Commit 3bd142a4 authored by Thomas Gleixner's avatar Thomas Gleixner

clocksource: Cleanup struct clocksource and documentation

Reformat the struct definition, add missing member documentation.
No functional change.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lkml.kernel.org/r/20200207124402.825471920@linutronix.de
parent 25a2a656
...@@ -32,9 +32,19 @@ struct module; ...@@ -32,9 +32,19 @@ struct module;
* Provides mostly state-free accessors to the underlying hardware. * Provides mostly state-free accessors to the underlying hardware.
* This is the structure used for system time. * This is the structure used for system time.
* *
* @name: ptr to clocksource name * @read: Returns a cycle value, passes clocksource as argument
* @list: list head for registration * @mask: Bitmask for two's complement
* @rating: rating value for selection (higher is better) * subtraction of non 64 bit counters
* @mult: Cycle to nanosecond multiplier
* @shift: Cycle to nanosecond divisor (power of two)
* @max_idle_ns: Maximum idle time permitted by the clocksource (nsecs)
* @maxadj: Maximum adjustment value to mult (~11%)
* @archdata: Optional arch-specific data
* @max_cycles: Maximum safe cycle value which won't overflow on
* multiplication
* @name: Pointer to clocksource name
* @list: List head for registration (internal)
* @rating: Rating value for selection (higher is better)
* To avoid rating inflation the following * To avoid rating inflation the following
* list should give you a guide as to how * list should give you a guide as to how
* to assign your clocksource a rating * to assign your clocksource a rating
...@@ -49,27 +59,23 @@ struct module; ...@@ -49,27 +59,23 @@ struct module;
* 400-499: Perfect * 400-499: Perfect
* The ideal clocksource. A must-use where * The ideal clocksource. A must-use where
* available. * available.
* @read: returns a cycle value, passes clocksource as argument * @flags: Flags describing special properties
* @enable: optional function to enable the clocksource * @enable: Optional function to enable the clocksource
* @disable: optional function to disable the clocksource * @disable: Optional function to disable the clocksource
* @mask: bitmask for two's complement * @suspend: Optional suspend function for the clocksource
* subtraction of non 64 bit counters * @resume: Optional resume function for the clocksource
* @mult: cycle to nanosecond multiplier
* @shift: cycle to nanosecond divisor (power of two)
* @max_idle_ns: max idle time permitted by the clocksource (nsecs)
* @maxadj: maximum adjustment value to mult (~11%)
* @max_cycles: maximum safe cycle value which won't overflow on multiplication
* @flags: flags describing special properties
* @archdata: arch-specific data
* @suspend: suspend function for the clocksource, if necessary
* @resume: resume function for the clocksource, if necessary
* @mark_unstable: Optional function to inform the clocksource driver that * @mark_unstable: Optional function to inform the clocksource driver that
* the watchdog marked the clocksource unstable * the watchdog marked the clocksource unstable
* @owner: module reference, must be set by clocksource in modules * @tick_stable: Optional function called periodically from the watchdog
* code to provide stable syncrhonization points
* @wd_list: List head to enqueue into the watchdog list (internal)
* @cs_last: Last clocksource value for clocksource watchdog
* @wd_last: Last watchdog value corresponding to @cs_last
* @owner: Module reference, must be set by clocksource in modules
* *
* Note: This struct is not used in hotpathes of the timekeeping code * Note: This struct is not used in hotpathes of the timekeeping code
* because the timekeeper caches the hot path fields in its own data * because the timekeeper caches the hot path fields in its own data
* structure, so no line cache alignment is required, * structure, so no cache line alignment is required,
* *
* The pointer to the clocksource itself is handed to the read * The pointer to the clocksource itself is handed to the read
* callback. If you need extra information there you can wrap struct * callback. If you need extra information there you can wrap struct
...@@ -78,35 +84,36 @@ struct module; ...@@ -78,35 +84,36 @@ struct module;
* structure. * structure.
*/ */
struct clocksource { struct clocksource {
u64 (*read)(struct clocksource *cs); u64 (*read)(struct clocksource *cs);
u64 mask; u64 mask;
u32 mult; u32 mult;
u32 shift; u32 shift;
u64 max_idle_ns; u64 max_idle_ns;
u32 maxadj; u32 maxadj;
#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
struct arch_clocksource_data archdata; struct arch_clocksource_data archdata;
#endif #endif
u64 max_cycles; u64 max_cycles;
const char *name; const char *name;
struct list_head list; struct list_head list;
int rating; int rating;
int (*enable)(struct clocksource *cs); unsigned long flags;
void (*disable)(struct clocksource *cs);
unsigned long flags; int (*enable)(struct clocksource *cs);
void (*suspend)(struct clocksource *cs); void (*disable)(struct clocksource *cs);
void (*resume)(struct clocksource *cs); void (*suspend)(struct clocksource *cs);
void (*mark_unstable)(struct clocksource *cs); void (*resume)(struct clocksource *cs);
void (*tick_stable)(struct clocksource *cs); void (*mark_unstable)(struct clocksource *cs);
void (*tick_stable)(struct clocksource *cs);
/* private: */ /* private: */
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG #ifdef CONFIG_CLOCKSOURCE_WATCHDOG
/* Watchdog related data, used by the framework */ /* Watchdog related data, used by the framework */
struct list_head wd_list; struct list_head wd_list;
u64 cs_last; u64 cs_last;
u64 wd_last; u64 wd_last;
#endif #endif
struct module *owner; struct module *owner;
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment