mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
hrtimers: extend hrtimer base code to handle more then 2 clockids
The hrtimer code is written mainly with CLOCK_REALTIME and CLOCK_MONOTONIC in mind. These are clockids 0 and 1 resepctively. However, if we are to introduce any new hrtimer bases, using new clockids, we have to skip the cputimers (clockids 2,3) as well as other clockids that may not impelement timers. This patch adds a little bit of indirection between the clockid and the base, so that we can extend the base by one when we add a new clockid at number 7 or so. CC: Jamie Lokier <[email protected]> CC: Thomas Gleixner <[email protected]> CC: Alexander Shishkin <[email protected]> CC: Arve Hjønnevåg <[email protected]> Signed-off-by: John Stultz <[email protected]>
This commit is contained in:
1 parent
db1c1cce4a
commit
e06383db9e
2 files changed
+32
-14
No files matched your search
@@ -148,7 +148,11 @@ struct hrtimer_clock_base {
|
||||
#endif
|
||||
};
|
||||
|
||||
#define HRTIMER_MAX_CLOCK_BASES 2
|
||||
enum hrtimer_base_type {
|
||||
HRTIMER_BASE_REALTIME,
|
||||
HRTIMER_BASE_MONOTONIC,
|
||||
HRTIMER_MAX_CLOCK_BASES,
|
||||
};
|
||||
|
||||
/*
|
||||
* struct hrtimer_cpu_base - the per cpu clock bases
|
||||
|
||||
Reference in new issue
Block a user