Refactor clock_event_device emulation
PATCH 2/2 Refactor clock_event_device emulation
I-pipe's current hooking into the GENERIC_CLOCKEVENTS infrastructure contains an ugly out-of-band argument passing via the device structure (delta...) and unneeded indirections of the intercepted services. This patches overcomes both by cleanly modifying relevant properties of the clock_event_device on takeover.
Jan
--- include/linux/clockchips.h | 1 include/linux/ipipe_tickdev.h | 11 +++++--- kernel/ipipe/core.c | 54 +++++++++++++++++------------------------- kernel/time/clockevents.c | 1 4 files changed, 30 insertions(+), 37 deletions(-)
include/linux/clockchips.h +0 -1
@@ -91,7 +91,6 @@ struct clock_event_device {struct list_head list;enum clock_event_mode mode;ktime_t next_event; -int64_t delta; };/*
include/linux/ipipe_tickdev.h +7 -4
@@ -31,21 +31,24 @@ struct tick_device;struct ipipe_tick_device {void (*emul_set_mode)(enum clock_event_mode , -struct ipipe_tick_device *tdev); +struct clock_event_device *cdev);int (*emul_set_tick)(unsigned long delta, -struct ipipe_tick_device *tdev); +struct clock_event_device *cdev);void (*real_set_mode)(enum clock_event_mode mode,struct clock_event_device *cdev);int (*real_set_tick)(unsigned long delta,struct clock_event_device *cdev);struct tick_device *slave; +unsigned long real_max_delta_ns; +unsigned long real_mult; +int real_shift; };int ipipe_request_tickdev (const char *devname,void (*emumode)(enum clock_event_mode mode, -struct ipipe_tick_device *tdev), +struct clock_event_device *cdev),int (*emutick)(unsigned long evt, -struct ipipe_tick_device *tdev), +struct clock_event_device *cdev),int cpu,unsigned long *tick_freq);void ipipe_release_tickdev (int cpu);
kernel/ipipe/core.c +23 -31
89 lines not on this page · raw message
kernel/time/clockevents.c +0 -1
@@ -84,7 +84,6 @@ int clockevents_program_event(struct cloreturn -ETIME ; dev->next_event = expires; - dev->delta = delta;if (dev->mode ==CLOCK_EVT_MODE_SHUTDOWN )return 0 ;