diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-25 11:30:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-25 11:30:35 -0400 |
commit | 4b7eba49c5912cbd7c70bbebec38d8cd54c2ef85 (patch) | |
tree | 99cc41c06ade46f9925268728417c9529ce5041e /arch/cris/kernel | |
parent | 92bf3d09410531a06e06504957271e3978f937e2 (diff) | |
parent | 7b91747d42a1012e3781dd09fa638d113809e3fd (diff) |
Merge tag 'cris-for-linus' of git://jni.nu/cris
Pull CRIS changes from Jesper Nilsson:
"No major changes here, but fixes some compile errors for CRIS, some
small style issues, some documentation and as a bonus nukes a couple
of obsolete rtc-files and related code."
* tag 'cris-for-linus' of git://jni.nu/cris:
cris: Remove old legacy "-traditional" flag from arch-v10/lib/Makefile
CRIS: Remove legacy RTC drivers
cris/mm/fault.c: Port OOM changes to do_page_fault
cris:fix the wrong function declear
CRIS: Add _sdata to vmlinux.lds.S
cris: posix_types.h, include asm-generic/posix_types.h
CRIS: Update documentation
cris/arch-v32: cryptocop: Use kzalloc
net:removed the unused variable
cris:removed the unused variable
CRISv32: Correct name of read_mostly section.
Diffstat (limited to 'arch/cris/kernel')
-rw-r--r-- | arch/cris/kernel/time.c | 76 | ||||
-rw-r--r-- | arch/cris/kernel/vmlinux.lds.S | 1 |
2 files changed, 8 insertions, 69 deletions
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c index 4e73092e85c0..277ffc459e4b 100644 --- a/arch/cris/kernel/time.c +++ b/arch/cris/kernel/time.c | |||
@@ -21,7 +21,6 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <asm/rtc.h> | ||
25 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
26 | #include <linux/module.h> | 25 | #include <linux/module.h> |
27 | #include <linux/param.h> | 26 | #include <linux/param.h> |
@@ -32,7 +31,8 @@ | |||
32 | #include <linux/profile.h> | 31 | #include <linux/profile.h> |
33 | #include <linux/sched.h> /* just for sched_clock() - funny that */ | 32 | #include <linux/sched.h> /* just for sched_clock() - funny that */ |
34 | 33 | ||
35 | int have_rtc; /* used to remember if we have an RTC or not */; | 34 | |
35 | #define D(x) | ||
36 | 36 | ||
37 | #define TICK_SIZE tick | 37 | #define TICK_SIZE tick |
38 | 38 | ||
@@ -50,78 +50,16 @@ u32 arch_gettimeoffset(void) | |||
50 | } | 50 | } |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | /* | ||
54 | * BUG: This routine does not handle hour overflow properly; it just | ||
55 | * sets the minutes. Usually you'll only notice that after reboot! | ||
56 | */ | ||
57 | |||
58 | int set_rtc_mmss(unsigned long nowtime) | 53 | int set_rtc_mmss(unsigned long nowtime) |
59 | { | 54 | { |
60 | int retval = 0; | 55 | D(printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime)); |
61 | int real_seconds, real_minutes, cmos_minutes; | 56 | return 0; |
62 | |||
63 | printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime); | ||
64 | |||
65 | if(!have_rtc) | ||
66 | return 0; | ||
67 | |||
68 | cmos_minutes = CMOS_READ(RTC_MINUTES); | ||
69 | cmos_minutes = bcd2bin(cmos_minutes); | ||
70 | |||
71 | /* | ||
72 | * since we're only adjusting minutes and seconds, | ||
73 | * don't interfere with hour overflow. This avoids | ||
74 | * messing with unknown time zones but requires your | ||
75 | * RTC not to be off by more than 15 minutes | ||
76 | */ | ||
77 | real_seconds = nowtime % 60; | ||
78 | real_minutes = nowtime / 60; | ||
79 | if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) | ||
80 | real_minutes += 30; /* correct for half hour time zone */ | ||
81 | real_minutes %= 60; | ||
82 | |||
83 | if (abs(real_minutes - cmos_minutes) < 30) { | ||
84 | real_seconds = bin2bcd(real_seconds); | ||
85 | real_minutes = bin2bcd(real_minutes); | ||
86 | CMOS_WRITE(real_seconds,RTC_SECONDS); | ||
87 | CMOS_WRITE(real_minutes,RTC_MINUTES); | ||
88 | } else { | ||
89 | printk_once(KERN_NOTICE | ||
90 | "set_rtc_mmss: can't update from %d to %d\n", | ||
91 | cmos_minutes, real_minutes); | ||
92 | retval = -1; | ||
93 | } | ||
94 | |||
95 | return retval; | ||
96 | } | 57 | } |
97 | 58 | ||
98 | /* grab the time from the RTC chip */ | 59 | /* grab the time from the RTC chip */ |
99 | 60 | unsigned long get_cmos_time(void) | |
100 | unsigned long | ||
101 | get_cmos_time(void) | ||
102 | { | 61 | { |
103 | unsigned int year, mon, day, hour, min, sec; | 62 | return 0; |
104 | if(!have_rtc) | ||
105 | return 0; | ||
106 | |||
107 | sec = CMOS_READ(RTC_SECONDS); | ||
108 | min = CMOS_READ(RTC_MINUTES); | ||
109 | hour = CMOS_READ(RTC_HOURS); | ||
110 | day = CMOS_READ(RTC_DAY_OF_MONTH); | ||
111 | mon = CMOS_READ(RTC_MONTH); | ||
112 | year = CMOS_READ(RTC_YEAR); | ||
113 | |||
114 | sec = bcd2bin(sec); | ||
115 | min = bcd2bin(min); | ||
116 | hour = bcd2bin(hour); | ||
117 | day = bcd2bin(day); | ||
118 | mon = bcd2bin(mon); | ||
119 | year = bcd2bin(year); | ||
120 | |||
121 | if ((year += 1900) < 1970) | ||
122 | year += 100; | ||
123 | |||
124 | return mktime(year, mon, day, hour, min, sec); | ||
125 | } | 63 | } |
126 | 64 | ||
127 | 65 | ||
@@ -132,7 +70,7 @@ int update_persistent_clock(struct timespec now) | |||
132 | 70 | ||
133 | void read_persistent_clock(struct timespec *ts) | 71 | void read_persistent_clock(struct timespec *ts) |
134 | { | 72 | { |
135 | ts->tv_sec = get_cmos_time(); | 73 | ts->tv_sec = 0; |
136 | ts->tv_nsec = 0; | 74 | ts->tv_nsec = 0; |
137 | } | 75 | } |
138 | 76 | ||
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S index a6990cb0f098..a68b983dcea1 100644 --- a/arch/cris/kernel/vmlinux.lds.S +++ b/arch/cris/kernel/vmlinux.lds.S | |||
@@ -52,6 +52,7 @@ SECTIONS | |||
52 | 52 | ||
53 | EXCEPTION_TABLE(4) | 53 | EXCEPTION_TABLE(4) |
54 | 54 | ||
55 | _sdata = .; | ||
55 | RODATA | 56 | RODATA |
56 | 57 | ||
57 | . = ALIGN (4); | 58 | . = ALIGN (4); |