diff options
author | john stultz <johnstul@us.ibm.com> | 2006-09-26 02:32:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:57 -0400 |
commit | c7f40ff15aba95bc09a759024d62b2c344ef0856 (patch) | |
tree | cccf693193af5253127726172461f5910f349e74 /arch/i386/kernel/apm.c | |
parent | 0f0f1b400ce3c4780b9d974bc69e8b558d99aba4 (diff) |
[PATCH] i386: Kill references to xtime
Remove all references to xtime in i386 and replace them w/
get/set_timeofday(). Requires some ugly and uncertain changes to APM, but
has been lightly tested to work.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/apm.c')
-rw-r--r-- | arch/i386/kernel/apm.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 24fd577861f1..ff9ce4b5eaa8 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -1154,9 +1154,11 @@ out: | |||
1154 | 1154 | ||
1155 | static void set_time(void) | 1155 | static void set_time(void) |
1156 | { | 1156 | { |
1157 | struct timespec ts; | ||
1157 | if (got_clock_diff) { /* Must know time zone in order to set clock */ | 1158 | if (got_clock_diff) { /* Must know time zone in order to set clock */ |
1158 | xtime.tv_sec = get_cmos_time() + clock_cmos_diff; | 1159 | ts.tv_sec = get_cmos_time() + clock_cmos_diff; |
1159 | xtime.tv_nsec = 0; | 1160 | ts.tv_nsec = 0; |
1161 | do_settimeofday(&ts); | ||
1160 | } | 1162 | } |
1161 | } | 1163 | } |
1162 | 1164 | ||
@@ -1232,13 +1234,8 @@ static int suspend(int vetoable) | |||
1232 | restore_processor_state(); | 1234 | restore_processor_state(); |
1233 | 1235 | ||
1234 | local_irq_disable(); | 1236 | local_irq_disable(); |
1235 | write_seqlock(&xtime_lock); | ||
1236 | spin_lock(&i8253_lock); | ||
1237 | reinit_timer(); | ||
1238 | set_time(); | 1237 | set_time(); |
1239 | 1238 | reinit_timer(); | |
1240 | spin_unlock(&i8253_lock); | ||
1241 | write_sequnlock(&xtime_lock); | ||
1242 | 1239 | ||
1243 | if (err == APM_NO_ERROR) | 1240 | if (err == APM_NO_ERROR) |
1244 | err = APM_SUCCESS; | 1241 | err = APM_SUCCESS; |
@@ -1365,9 +1362,7 @@ static void check_events(void) | |||
1365 | ignore_bounce = 1; | 1362 | ignore_bounce = 1; |
1366 | if ((event != APM_NORMAL_RESUME) | 1363 | if ((event != APM_NORMAL_RESUME) |
1367 | || (ignore_normal_resume == 0)) { | 1364 | || (ignore_normal_resume == 0)) { |
1368 | write_seqlock_irq(&xtime_lock); | ||
1369 | set_time(); | 1365 | set_time(); |
1370 | write_sequnlock_irq(&xtime_lock); | ||
1371 | device_resume(); | 1366 | device_resume(); |
1372 | pm_send_all(PM_RESUME, (void *)0); | 1367 | pm_send_all(PM_RESUME, (void *)0); |
1373 | queue_event(event, NULL); | 1368 | queue_event(event, NULL); |
@@ -1383,9 +1378,7 @@ static void check_events(void) | |||
1383 | break; | 1378 | break; |
1384 | 1379 | ||
1385 | case APM_UPDATE_TIME: | 1380 | case APM_UPDATE_TIME: |
1386 | write_seqlock_irq(&xtime_lock); | ||
1387 | set_time(); | 1381 | set_time(); |
1388 | write_sequnlock_irq(&xtime_lock); | ||
1389 | break; | 1382 | break; |
1390 | 1383 | ||
1391 | case APM_CRITICAL_SUSPEND: | 1384 | case APM_CRITICAL_SUSPEND: |