summaryrefslogtreecommitdiffstats
path: root/kernel/time/posix-timers.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-03 19:14:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-03 19:14:51 -0400
commit1b044f1cfc65a7d90b209dfabd57e16d98b58c5b (patch)
treead657c911b563f9176b17578c0b88a1ea9916a02 /kernel/time/posix-timers.h
parente0f3e8f14da868047c524a0cf11e08b95fd1b008 (diff)
parent2287d8664fe7345ead891017eccd879fc605305e (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "A rather large update for timers/timekeeping: - compat syscall consolidation (Al Viro) - Posix timer consolidation (Christoph Helwig / Thomas Gleixner) - Cleanup of the device tree based initialization for clockevents and clocksources (Daniel Lezcano) - Consolidation of the FTTMR010 clocksource/event driver (Linus Walleij) - The usual set of small fixes and updates all over the place" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (93 commits) timers: Make the cpu base lock raw clocksource/drivers/mips-gic-timer: Fix an error code in 'gic_clocksource_of_init()' clocksource/drivers/fsl_ftm_timer: Unmap region obtained by of_iomap clocksource/drivers/tcb_clksrc: Make IO endian agnostic clocksource/drivers/sun4i: Switch to the timer-of common init clocksource/drivers/timer-of: Fix invalid iomap check Revert "ktime: Simplify ktime_compare implementation" clocksource/drivers: Fix uninitialized variable use in timer_of_init kselftests: timers: Add test for frequency step kselftests: timers: Fix inconsistency-check to not ignore first timestamp time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD time: Clean up CLOCK_MONOTONIC_RAW time handling posix-cpu-timers: Make timespec to nsec conversion safe itimer: Make timeval to nsec conversion range limited timers: Fix parameter description of try_to_del_timer_sync() ktime: Simplify ktime_compare implementation clocksource/drivers/fttmr010: Factor out clock read code clocksource/drivers/fttmr010: Implement delay timer clocksource/drivers: Add timer-of common init routine clocksource/drivers/tcb_clksrc: Save timer context on suspend/resume ...
Diffstat (limited to 'kernel/time/posix-timers.h')
-rw-r--r--kernel/time/posix-timers.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/kernel/time/posix-timers.h b/kernel/time/posix-timers.h
new file mode 100644
index 000000000000..fb303c3be4d3
--- /dev/null
+++ b/kernel/time/posix-timers.h
@@ -0,0 +1,40 @@
1#define TIMER_RETRY 1
2
3struct k_clock {
4 int (*clock_getres)(const clockid_t which_clock,
5 struct timespec64 *tp);
6 int (*clock_set)(const clockid_t which_clock,
7 const struct timespec64 *tp);
8 int (*clock_get)(const clockid_t which_clock,
9 struct timespec64 *tp);
10 int (*clock_adj)(const clockid_t which_clock, struct timex *tx);
11 int (*timer_create)(struct k_itimer *timer);
12 int (*nsleep)(const clockid_t which_clock, int flags,
13 const struct timespec64 *);
14 int (*timer_set)(struct k_itimer *timr, int flags,
15 struct itimerspec64 *new_setting,
16 struct itimerspec64 *old_setting);
17 int (*timer_del)(struct k_itimer *timr);
18 void (*timer_get)(struct k_itimer *timr,
19 struct itimerspec64 *cur_setting);
20 void (*timer_rearm)(struct k_itimer *timr);
21 int (*timer_forward)(struct k_itimer *timr, ktime_t now);
22 ktime_t (*timer_remaining)(struct k_itimer *timr, ktime_t now);
23 int (*timer_try_to_cancel)(struct k_itimer *timr);
24 void (*timer_arm)(struct k_itimer *timr, ktime_t expires,
25 bool absolute, bool sigev_none);
26};
27
28extern const struct k_clock clock_posix_cpu;
29extern const struct k_clock clock_posix_dynamic;
30extern const struct k_clock clock_process;
31extern const struct k_clock clock_thread;
32extern const struct k_clock alarm_clock;
33
34int posix_timer_event(struct k_itimer *timr, int si_private);
35
36void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting);
37int common_timer_set(struct k_itimer *timr, int flags,
38 struct itimerspec64 *new_setting,
39 struct itimerspec64 *old_setting);
40int common_timer_del(struct k_itimer *timer);