Merge branch 'timers-clockevents-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-clockevents-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: hpet: Cleanup the clockevents init and register code x86: Convert PIT to clockevents_config_and_register() clockevents: Provide interface to reconfigure an active clock event device clockevents: Provide combined configure and register function clockevents: Restructure clock_event_device members clocksource: Get rid of the hardcoded 5 seconds sleep time limit clocksource: Restructure clocksource struct members
This commit is contained in:
@@ -56,46 +56,52 @@ enum clock_event_nofitiers {
|
||||
|
||||
/**
|
||||
* struct clock_event_device - clock event device descriptor
|
||||
* @name: ptr to clock event name
|
||||
* @features: features
|
||||
* @event_handler: Assigned by the framework to be called by the low
|
||||
* level handler of the event source
|
||||
* @set_next_event: set next event function
|
||||
* @next_event: local storage for the next event in oneshot mode
|
||||
* @max_delta_ns: maximum delta value in ns
|
||||
* @min_delta_ns: minimum delta value in ns
|
||||
* @mult: nanosecond to cycles multiplier
|
||||
* @shift: nanoseconds to cycles divisor (power of two)
|
||||
* @mode: operating mode assigned by the management code
|
||||
* @features: features
|
||||
* @retries: number of forced programming retries
|
||||
* @set_mode: set mode function
|
||||
* @broadcast: function to broadcast events
|
||||
* @min_delta_ticks: minimum delta value in ticks stored for reconfiguration
|
||||
* @max_delta_ticks: maximum delta value in ticks stored for reconfiguration
|
||||
* @name: ptr to clock event name
|
||||
* @rating: variable to rate clock event devices
|
||||
* @irq: IRQ number (only for non CPU local devices)
|
||||
* @cpumask: cpumask to indicate for which CPUs this device works
|
||||
* @set_next_event: set next event function
|
||||
* @set_mode: set mode function
|
||||
* @event_handler: Assigned by the framework to be called by the low
|
||||
* level handler of the event source
|
||||
* @broadcast: function to broadcast events
|
||||
* @list: list head for the management code
|
||||
* @mode: operating mode assigned by the management code
|
||||
* @next_event: local storage for the next event in oneshot mode
|
||||
* @retries: number of forced programming retries
|
||||
*/
|
||||
struct clock_event_device {
|
||||
const char *name;
|
||||
unsigned int features;
|
||||
void (*event_handler)(struct clock_event_device *);
|
||||
int (*set_next_event)(unsigned long evt,
|
||||
struct clock_event_device *);
|
||||
ktime_t next_event;
|
||||
u64 max_delta_ns;
|
||||
u64 min_delta_ns;
|
||||
u32 mult;
|
||||
u32 shift;
|
||||
enum clock_event_mode mode;
|
||||
unsigned int features;
|
||||
unsigned long retries;
|
||||
|
||||
void (*broadcast)(const struct cpumask *mask);
|
||||
void (*set_mode)(enum clock_event_mode mode,
|
||||
struct clock_event_device *);
|
||||
unsigned long min_delta_ticks;
|
||||
unsigned long max_delta_ticks;
|
||||
|
||||
const char *name;
|
||||
int rating;
|
||||
int irq;
|
||||
const struct cpumask *cpumask;
|
||||
int (*set_next_event)(unsigned long evt,
|
||||
struct clock_event_device *);
|
||||
void (*set_mode)(enum clock_event_mode mode,
|
||||
struct clock_event_device *);
|
||||
void (*event_handler)(struct clock_event_device *);
|
||||
void (*broadcast)(const struct cpumask *mask);
|
||||
struct list_head list;
|
||||
enum clock_event_mode mode;
|
||||
ktime_t next_event;
|
||||
unsigned long retries;
|
||||
};
|
||||
} ____cacheline_aligned;
|
||||
|
||||
/*
|
||||
* Calculate a multiplication factor for scaled math, which is used to convert
|
||||
@@ -122,6 +128,12 @@ extern u64 clockevent_delta2ns(unsigned long latch,
|
||||
struct clock_event_device *evt);
|
||||
extern void clockevents_register_device(struct clock_event_device *dev);
|
||||
|
||||
extern void clockevents_config_and_register(struct clock_event_device *dev,
|
||||
u32 freq, unsigned long min_delta,
|
||||
unsigned long max_delta);
|
||||
|
||||
extern int clockevents_update_freq(struct clock_event_device *ce, u32 freq);
|
||||
|
||||
extern void clockevents_exchange_device(struct clock_event_device *old,
|
||||
struct clock_event_device *new);
|
||||
extern void clockevents_set_mode(struct clock_event_device *dev,
|
||||
|
@@ -159,42 +159,38 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
|
||||
*/
|
||||
struct clocksource {
|
||||
/*
|
||||
* First part of structure is read mostly
|
||||
* Hotpath data, fits in a single cache line when the
|
||||
* clocksource itself is cacheline aligned.
|
||||
*/
|
||||
const char *name;
|
||||
struct list_head list;
|
||||
int rating;
|
||||
cycle_t (*read)(struct clocksource *cs);
|
||||
int (*enable)(struct clocksource *cs);
|
||||
void (*disable)(struct clocksource *cs);
|
||||
cycle_t cycle_last;
|
||||
cycle_t mask;
|
||||
u32 mult;
|
||||
u32 shift;
|
||||
u64 max_idle_ns;
|
||||
unsigned long flags;
|
||||
cycle_t (*vread)(void);
|
||||
void (*suspend)(struct clocksource *cs);
|
||||
void (*resume)(struct clocksource *cs);
|
||||
|
||||
#ifdef CONFIG_IA64
|
||||
void *fsys_mmio; /* used by fsyscall asm code */
|
||||
#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
|
||||
#else
|
||||
#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Second part is written at each timer interrupt
|
||||
* Keep it in a different cache line to dirty no
|
||||
* more than one cache line.
|
||||
*/
|
||||
cycle_t cycle_last ____cacheline_aligned_in_smp;
|
||||
const char *name;
|
||||
struct list_head list;
|
||||
int rating;
|
||||
cycle_t (*vread)(void);
|
||||
int (*enable)(struct clocksource *cs);
|
||||
void (*disable)(struct clocksource *cs);
|
||||
unsigned long flags;
|
||||
void (*suspend)(struct clocksource *cs);
|
||||
void (*resume)(struct clocksource *cs);
|
||||
|
||||
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
|
||||
/* Watchdog related data, used by the framework */
|
||||
struct list_head wd_list;
|
||||
cycle_t wd_last;
|
||||
#endif
|
||||
};
|
||||
} ____cacheline_aligned;
|
||||
|
||||
/*
|
||||
* Clock source flags bits::
|
||||
|
Reference in New Issue
Block a user