diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:53:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:53:35 -0400 |
commit | 420c1c572d4ceaa2f37b6311b7017ac6cf049fe2 (patch) | |
tree | df04e6b4b756b7a46d9887462d54a3ad0e1f91d5 /drivers/char | |
parent | 9620639b7ea3843983f4ced8b4c81eb4d8974838 (diff) | |
parent | 6e6823d17b157f185be09f4c70181299f9273f0b (diff) |
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (62 commits)
posix-clocks: Check write permissions in posix syscalls
hrtimer: Remove empty hrtimer_init_hres_timer()
hrtimer: Update hrtimer->state documentation
hrtimer: Update base[CLOCK_BOOTTIME].offset correctly
timers: Export CLOCK_BOOTTIME via the posix timers interface
timers: Add CLOCK_BOOTTIME hrtimer base
time: Extend get_xtime_and_monotonic_offset() to also return sleep
time: Introduce get_monotonic_boottime and ktime_get_boottime
hrtimers: extend hrtimer base code to handle more then 2 clockids
ntp: Remove redundant and incorrect parameter check
mn10300: Switch do_timer() to xtimer_update()
posix clocks: Introduce dynamic clocks
posix-timers: Cleanup namespace
posix-timers: Add support for fd based clocks
x86: Add clock_adjtime for x86
posix-timers: Introduce a syscall for clock tuning.
time: Splitout compat timex accessors
ntp: Add ADJ_SETOFFSET mode bit
time: Introduce timekeeping_inject_offset
posix-timer: Update comment
...
Fix up new system-call-related conflicts in
arch/x86/ia32/ia32entry.S
arch/x86/include/asm/unistd_32.h
arch/x86/include/asm/unistd_64.h
arch/x86/kernel/syscall_table_32.S
(name_to_handle_at()/open_by_handle_at() vs clock_adjtime()), and some
due to movement of get_jiffies_64() in:
kernel/time.c
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mmtimer.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index e6d75627c6c8..33dc2298af73 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -53,6 +53,8 @@ MODULE_LICENSE("GPL"); | |||
53 | 53 | ||
54 | #define RTC_BITS 55 /* 55 bits for this implementation */ | 54 | #define RTC_BITS 55 /* 55 bits for this implementation */ |
55 | 55 | ||
56 | static struct k_clock sgi_clock; | ||
57 | |||
56 | extern unsigned long sn_rtc_cycles_per_second; | 58 | extern unsigned long sn_rtc_cycles_per_second; |
57 | 59 | ||
58 | #define RTC_COUNTER_ADDR ((long *)LOCAL_MMR_ADDR(SH_RTC)) | 60 | #define RTC_COUNTER_ADDR ((long *)LOCAL_MMR_ADDR(SH_RTC)) |
@@ -487,7 +489,7 @@ static int sgi_clock_get(clockid_t clockid, struct timespec *tp) | |||
487 | return 0; | 489 | return 0; |
488 | }; | 490 | }; |
489 | 491 | ||
490 | static int sgi_clock_set(clockid_t clockid, struct timespec *tp) | 492 | static int sgi_clock_set(const clockid_t clockid, const struct timespec *tp) |
491 | { | 493 | { |
492 | 494 | ||
493 | u64 nsec; | 495 | u64 nsec; |
@@ -763,15 +765,21 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, | |||
763 | return err; | 765 | return err; |
764 | } | 766 | } |
765 | 767 | ||
768 | static int sgi_clock_getres(const clockid_t which_clock, struct timespec *tp) | ||
769 | { | ||
770 | tp->tv_sec = 0; | ||
771 | tp->tv_nsec = sgi_clock_period; | ||
772 | return 0; | ||
773 | } | ||
774 | |||
766 | static struct k_clock sgi_clock = { | 775 | static struct k_clock sgi_clock = { |
767 | .res = 0, | 776 | .clock_set = sgi_clock_set, |
768 | .clock_set = sgi_clock_set, | 777 | .clock_get = sgi_clock_get, |
769 | .clock_get = sgi_clock_get, | 778 | .clock_getres = sgi_clock_getres, |
770 | .timer_create = sgi_timer_create, | 779 | .timer_create = sgi_timer_create, |
771 | .nsleep = do_posix_clock_nonanosleep, | 780 | .timer_set = sgi_timer_set, |
772 | .timer_set = sgi_timer_set, | 781 | .timer_del = sgi_timer_del, |
773 | .timer_del = sgi_timer_del, | 782 | .timer_get = sgi_timer_get |
774 | .timer_get = sgi_timer_get | ||
775 | }; | 783 | }; |
776 | 784 | ||
777 | /** | 785 | /** |
@@ -831,8 +839,8 @@ static int __init mmtimer_init(void) | |||
831 | (unsigned long) node); | 839 | (unsigned long) node); |
832 | } | 840 | } |
833 | 841 | ||
834 | sgi_clock_period = sgi_clock.res = NSEC_PER_SEC / sn_rtc_cycles_per_second; | 842 | sgi_clock_period = NSEC_PER_SEC / sn_rtc_cycles_per_second; |
835 | register_posix_clock(CLOCK_SGI_CYCLE, &sgi_clock); | 843 | posix_timers_register_clock(CLOCK_SGI_CYCLE, &sgi_clock); |
836 | 844 | ||
837 | printk(KERN_INFO "%s: v%s, %ld MHz\n", MMTIMER_DESC, MMTIMER_VERSION, | 845 | printk(KERN_INFO "%s: v%s, %ld MHz\n", MMTIMER_DESC, MMTIMER_VERSION, |
838 | sn_rtc_cycles_per_second/(unsigned long)1E6); | 846 | sn_rtc_cycles_per_second/(unsigned long)1E6); |