diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-24 17:27:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-24 17:44:01 -0400 |
commit | eb71c87a492b7090ff9e8ac46912c480a1687e38 (patch) | |
tree | 1136213dee0f942866b6c2c65de7e7c63ca94fda /include/asm-generic | |
parent | d384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff) |
Add some basic resume trace facilities
Considering that there isn't a lot of hw we can depend on during resume,
this is about as good as it gets.
This is x86-only for now, although the basic concept (and most of the
code) will certainly work on almost any platform.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/rtc.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h index cef08db34ada..4087037a4225 100644 --- a/include/asm-generic/rtc.h +++ b/include/asm-generic/rtc.h | |||
@@ -114,6 +114,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) | |||
114 | /* Set the current date and time in the real time clock. */ | 114 | /* Set the current date and time in the real time clock. */ |
115 | static inline int set_rtc_time(struct rtc_time *time) | 115 | static inline int set_rtc_time(struct rtc_time *time) |
116 | { | 116 | { |
117 | unsigned long flags; | ||
117 | unsigned char mon, day, hrs, min, sec; | 118 | unsigned char mon, day, hrs, min, sec; |
118 | unsigned char save_control, save_freq_select; | 119 | unsigned char save_control, save_freq_select; |
119 | unsigned int yrs; | 120 | unsigned int yrs; |
@@ -131,7 +132,7 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
131 | if (yrs > 255) /* They are unsigned */ | 132 | if (yrs > 255) /* They are unsigned */ |
132 | return -EINVAL; | 133 | return -EINVAL; |
133 | 134 | ||
134 | spin_lock_irq(&rtc_lock); | 135 | spin_lock_irqsave(&rtc_lock, flags); |
135 | #ifdef CONFIG_MACH_DECSTATION | 136 | #ifdef CONFIG_MACH_DECSTATION |
136 | real_yrs = yrs; | 137 | real_yrs = yrs; |
137 | leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) || | 138 | leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) || |
@@ -152,7 +153,7 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
152 | * whether the chip is in binary mode or not. | 153 | * whether the chip is in binary mode or not. |
153 | */ | 154 | */ |
154 | if (yrs > 169) { | 155 | if (yrs > 169) { |
155 | spin_unlock_irq(&rtc_lock); | 156 | spin_unlock_irqrestore(&rtc_lock, flags); |
156 | return -EINVAL; | 157 | return -EINVAL; |
157 | } | 158 | } |
158 | 159 | ||
@@ -187,7 +188,7 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
187 | CMOS_WRITE(save_control, RTC_CONTROL); | 188 | CMOS_WRITE(save_control, RTC_CONTROL); |
188 | CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); | 189 | CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); |
189 | 190 | ||
190 | spin_unlock_irq(&rtc_lock); | 191 | spin_unlock_irqrestore(&rtc_lock, flags); |
191 | 192 | ||
192 | return 0; | 193 | return 0; |
193 | } | 194 | } |