diff options
Diffstat (limited to 'arch/i386/kernel/acpi/sleep.c')
-rw-r--r-- | arch/i386/kernel/acpi/sleep.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c index c1af93032ff3..1cb2b186a3af 100644 --- a/arch/i386/kernel/acpi/sleep.c +++ b/arch/i386/kernel/acpi/sleep.c | |||
@@ -20,12 +20,13 @@ extern void zap_low_mappings(void); | |||
20 | 20 | ||
21 | extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); | 21 | extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); |
22 | 22 | ||
23 | static void init_low_mapping(pgd_t *pgd, int pgd_limit) | 23 | static void init_low_mapping(pgd_t * pgd, int pgd_limit) |
24 | { | 24 | { |
25 | int pgd_ofs = 0; | 25 | int pgd_ofs = 0; |
26 | 26 | ||
27 | while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) { | 27 | while ((pgd_ofs < pgd_limit) |
28 | set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD)); | 28 | && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) { |
29 | set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD)); | ||
29 | pgd_ofs++, pgd++; | 30 | pgd_ofs++, pgd++; |
30 | } | 31 | } |
31 | flush_tlb_all(); | 32 | flush_tlb_all(); |
@@ -37,12 +38,13 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit) | |||
37 | * Create an identity mapped page table and copy the wakeup routine to | 38 | * Create an identity mapped page table and copy the wakeup routine to |
38 | * low memory. | 39 | * low memory. |
39 | */ | 40 | */ |
40 | int acpi_save_state_mem (void) | 41 | int acpi_save_state_mem(void) |
41 | { | 42 | { |
42 | if (!acpi_wakeup_address) | 43 | if (!acpi_wakeup_address) |
43 | return 1; | 44 | return 1; |
44 | init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD); | 45 | init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD); |
45 | memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start); | 46 | memcpy((void *)acpi_wakeup_address, &wakeup_start, |
47 | &wakeup_end - &wakeup_start); | ||
46 | acpi_copy_wakeup_routine(acpi_wakeup_address); | 48 | acpi_copy_wakeup_routine(acpi_wakeup_address); |
47 | 49 | ||
48 | return 0; | 50 | return 0; |
@@ -51,7 +53,7 @@ int acpi_save_state_mem (void) | |||
51 | /* | 53 | /* |
52 | * acpi_restore_state - undo effects of acpi_save_state_mem | 54 | * acpi_restore_state - undo effects of acpi_save_state_mem |
53 | */ | 55 | */ |
54 | void acpi_restore_state_mem (void) | 56 | void acpi_restore_state_mem(void) |
55 | { | 57 | { |
56 | zap_low_mappings(); | 58 | zap_low_mappings(); |
57 | } | 59 | } |
@@ -67,7 +69,8 @@ void acpi_restore_state_mem (void) | |||
67 | void __init acpi_reserve_bootmem(void) | 69 | void __init acpi_reserve_bootmem(void) |
68 | { | 70 | { |
69 | if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) { | 71 | if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) { |
70 | printk(KERN_ERR "ACPI: Wakeup code way too big, S3 disabled.\n"); | 72 | printk(KERN_ERR |
73 | "ACPI: Wakeup code way too big, S3 disabled.\n"); | ||
71 | return; | 74 | return; |
72 | } | 75 | } |
73 | 76 | ||
@@ -90,10 +93,8 @@ static int __init acpi_sleep_setup(char *str) | |||
90 | return 1; | 93 | return 1; |
91 | } | 94 | } |
92 | 95 | ||
93 | |||
94 | __setup("acpi_sleep=", acpi_sleep_setup); | 96 | __setup("acpi_sleep=", acpi_sleep_setup); |
95 | 97 | ||
96 | |||
97 | static __init int reset_videomode_after_s3(struct dmi_system_id *d) | 98 | static __init int reset_videomode_after_s3(struct dmi_system_id *d) |
98 | { | 99 | { |
99 | acpi_video_flags |= 2; | 100 | acpi_video_flags |= 2; |
@@ -101,14 +102,14 @@ static __init int reset_videomode_after_s3(struct dmi_system_id *d) | |||
101 | } | 102 | } |
102 | 103 | ||
103 | static __initdata struct dmi_system_id acpisleep_dmi_table[] = { | 104 | static __initdata struct dmi_system_id acpisleep_dmi_table[] = { |
104 | { /* Reset video mode after returning from ACPI S3 sleep */ | 105 | { /* Reset video mode after returning from ACPI S3 sleep */ |
105 | .callback = reset_videomode_after_s3, | 106 | .callback = reset_videomode_after_s3, |
106 | .ident = "Toshiba Satellite 4030cdt", | 107 | .ident = "Toshiba Satellite 4030cdt", |
107 | .matches = { | 108 | .matches = { |
108 | DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), | 109 | DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), |
109 | }, | 110 | }, |
110 | }, | 111 | }, |
111 | { } | 112 | {} |
112 | }; | 113 | }; |
113 | 114 | ||
114 | static int __init acpisleep_dmi_init(void) | 115 | static int __init acpisleep_dmi_init(void) |