|
37 | 37 | * @lock: Lock for syncrhonized access to the base |
38 | 38 | * @timerqueue: Timerqueue head managing the list of events |
39 | 39 | * @get_ktime: Function to read the time correlating to the base |
| 40 | + * @get_timespec: Function to read the namespace time correlating to the base |
40 | 41 | * @base_clockid: clockid for the base |
41 | 42 | */ |
42 | 43 | static struct alarm_base { |
43 | 44 | spinlock_t lock; |
44 | 45 | struct timerqueue_head timerqueue; |
45 | 46 | ktime_t (*get_ktime)(void); |
| 47 | + void (*get_timespec)(struct timespec64 *tp); |
46 | 48 | clockid_t base_clockid; |
47 | 49 | } alarm_bases[ALARM_NUMTYPE]; |
48 | 50 |
|
@@ -670,7 +672,8 @@ static int alarm_clock_get_timespec(clockid_t which_clock, struct timespec64 *tp |
670 | 672 | if (!alarmtimer_get_rtcdev()) |
671 | 673 | return -EINVAL; |
672 | 674 |
|
673 | | - *tp = ktime_to_timespec64(base->get_ktime()); |
| 675 | + base->get_timespec(tp); |
| 676 | + |
674 | 677 | return 0; |
675 | 678 | } |
676 | 679 |
|
@@ -883,8 +886,10 @@ static int __init alarmtimer_init(void) |
883 | 886 | /* Initialize alarm bases */ |
884 | 887 | alarm_bases[ALARM_REALTIME].base_clockid = CLOCK_REALTIME; |
885 | 888 | alarm_bases[ALARM_REALTIME].get_ktime = &ktime_get_real; |
| 889 | + alarm_bases[ALARM_REALTIME].get_timespec = ktime_get_real_ts64, |
886 | 890 | alarm_bases[ALARM_BOOTTIME].base_clockid = CLOCK_BOOTTIME; |
887 | 891 | alarm_bases[ALARM_BOOTTIME].get_ktime = &ktime_get_boottime; |
| 892 | + alarm_bases[ALARM_BOOTTIME].get_timespec = ktime_get_boottime_ts64; |
888 | 893 | for (i = 0; i < ALARM_NUMTYPE; i++) { |
889 | 894 | timerqueue_init_head(&alarm_bases[i].timerqueue); |
890 | 895 | spin_lock_init(&alarm_bases[i].lock); |
|
0 commit comments