diff options
author | Pavel Machek <pavel@suse.cz> | 2007-07-19 04:47:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:43 -0400 |
commit | 77afcf78a2ded9a91838734234949c0ead5feb12 (patch) | |
tree | 76922017855c70d550b40241f8a144f6c098cd04 /arch/i386 | |
parent | 5a60d6235c8352ade8f2699e72fcdfe853730456 (diff) |
PM: Integrate beeping flag with existing acpi_sleep flags
Move "debug during resume from s2ram" into the variable we already use
for real-mode flags to simplify code. It also closes nasty trap for
the user in acpi_sleep_setup; order of parameters actually mattered there,
acpi_sleep=s3_bios,s3_mode doing something different from
acpi_sleep=s3_mode,s3_bios.
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/acpi/sleep.c | 12 | ||||
-rw-r--r-- | arch/i386/kernel/acpi/wakeup.S | 18 |
2 files changed, 16 insertions, 14 deletions
diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c index 4ee83577bf61..c42b5ab49deb 100644 --- a/arch/i386/kernel/acpi/sleep.c +++ b/arch/i386/kernel/acpi/sleep.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | /* address in low memory of the wakeup routine. */ | 15 | /* address in low memory of the wakeup routine. */ |
16 | unsigned long acpi_wakeup_address = 0; | 16 | unsigned long acpi_wakeup_address = 0; |
17 | unsigned long acpi_video_flags; | 17 | unsigned long acpi_realmode_flags; |
18 | extern char wakeup_start, wakeup_end; | 18 | extern char wakeup_start, wakeup_end; |
19 | 19 | ||
20 | extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); | 20 | extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); |
@@ -68,9 +68,11 @@ static int __init acpi_sleep_setup(char *str) | |||
68 | { | 68 | { |
69 | while ((str != NULL) && (*str != '\0')) { | 69 | while ((str != NULL) && (*str != '\0')) { |
70 | if (strncmp(str, "s3_bios", 7) == 0) | 70 | if (strncmp(str, "s3_bios", 7) == 0) |
71 | acpi_video_flags = 1; | 71 | acpi_realmode_flags |= 1; |
72 | if (strncmp(str, "s3_mode", 7) == 0) | 72 | if (strncmp(str, "s3_mode", 7) == 0) |
73 | acpi_video_flags |= 2; | 73 | acpi_realmode_flags |= 2; |
74 | if (strncmp(str, "s3_beep", 7) == 0) | ||
75 | acpi_realmode_flags |= 4; | ||
74 | str = strchr(str, ','); | 76 | str = strchr(str, ','); |
75 | if (str != NULL) | 77 | if (str != NULL) |
76 | str += strspn(str, ", \t"); | 78 | str += strspn(str, ", \t"); |
@@ -80,9 +82,11 @@ static int __init acpi_sleep_setup(char *str) | |||
80 | 82 | ||
81 | __setup("acpi_sleep=", acpi_sleep_setup); | 83 | __setup("acpi_sleep=", acpi_sleep_setup); |
82 | 84 | ||
85 | /* Ouch, we want to delete this. We already have better version in userspace, in | ||
86 | s2ram from suspend.sf.net project */ | ||
83 | static __init int reset_videomode_after_s3(struct dmi_system_id *d) | 87 | static __init int reset_videomode_after_s3(struct dmi_system_id *d) |
84 | { | 88 | { |
85 | acpi_video_flags |= 2; | 89 | acpi_realmode_flags |= 2; |
86 | return 0; | 90 | return 0; |
87 | } | 91 | } |
88 | 92 | ||
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S index b4e2ec3c3928..ed0a0f2c1597 100644 --- a/arch/i386/kernel/acpi/wakeup.S +++ b/arch/i386/kernel/acpi/wakeup.S | |||
@@ -47,7 +47,7 @@ wakeup_code: | |||
47 | movw %ax, %ds # Make ds:0 point to wakeup_start | 47 | movw %ax, %ds # Make ds:0 point to wakeup_start |
48 | movw %ax, %ss | 48 | movw %ax, %ss |
49 | 49 | ||
50 | testl $1, beep_flags - wakeup_code | 50 | testl $4, realmode_flags - wakeup_code |
51 | jz 1f | 51 | jz 1f |
52 | BEEP | 52 | BEEP |
53 | 1: | 53 | 1: |
@@ -61,7 +61,7 @@ wakeup_code: | |||
61 | cmpl $0x12345678, %eax | 61 | cmpl $0x12345678, %eax |
62 | jne bogus_real_magic | 62 | jne bogus_real_magic |
63 | 63 | ||
64 | testl $1, video_flags - wakeup_code | 64 | testl $1, realmode_flags - wakeup_code |
65 | jz 1f | 65 | jz 1f |
66 | lcall $0xc000,$3 | 66 | lcall $0xc000,$3 |
67 | movw %cs, %ax | 67 | movw %cs, %ax |
@@ -69,7 +69,7 @@ wakeup_code: | |||
69 | movw %ax, %ss | 69 | movw %ax, %ss |
70 | 1: | 70 | 1: |
71 | 71 | ||
72 | testl $2, video_flags - wakeup_code | 72 | testl $2, realmode_flags - wakeup_code |
73 | jz 1f | 73 | jz 1f |
74 | mov video_mode - wakeup_code, %ax | 74 | mov video_mode - wakeup_code, %ax |
75 | call mode_set | 75 | call mode_set |
@@ -108,11 +108,11 @@ wakeup_code: | |||
108 | cmpl $0x12345678, %eax | 108 | cmpl $0x12345678, %eax |
109 | jne bogus_real_magic | 109 | jne bogus_real_magic |
110 | 110 | ||
111 | testl $2, beep_flags - wakeup_code | 111 | testl $8, realmode_flags - wakeup_code |
112 | jz 1f | 112 | jz 1f |
113 | BEEP | 113 | BEEP |
114 | 1: | 114 | 1: |
115 | ljmpl $__KERNEL_CS,$wakeup_pmode_return | 115 | ljmpl $__KERNEL_CS, $wakeup_pmode_return |
116 | 116 | ||
117 | real_save_gdt: .word 0 | 117 | real_save_gdt: .word 0 |
118 | .long 0 | 118 | .long 0 |
@@ -121,7 +121,7 @@ real_save_cr3: .long 0 | |||
121 | real_save_cr4: .long 0 | 121 | real_save_cr4: .long 0 |
122 | real_magic: .long 0 | 122 | real_magic: .long 0 |
123 | video_mode: .long 0 | 123 | video_mode: .long 0 |
124 | video_flags: .long 0 | 124 | realmode_flags: .long 0 |
125 | beep_flags: .long 0 | 125 | beep_flags: .long 0 |
126 | real_efer_save_restore: .long 0 | 126 | real_efer_save_restore: .long 0 |
127 | real_save_efer_edx: .long 0 | 127 | real_save_efer_edx: .long 0 |
@@ -285,10 +285,8 @@ ENTRY(acpi_copy_wakeup_routine) | |||
285 | 285 | ||
286 | movl saved_videomode, %edx | 286 | movl saved_videomode, %edx |
287 | movl %edx, video_mode - wakeup_start (%eax) | 287 | movl %edx, video_mode - wakeup_start (%eax) |
288 | movl acpi_video_flags, %edx | 288 | movl acpi_realmode_flags, %edx |
289 | movl %edx, video_flags - wakeup_start (%eax) | 289 | movl %edx, realmode_flags - wakeup_start (%eax) |
290 | movl s2ram_beep, %edx | ||
291 | movl %edx, beep_flags - wakeup_start (%eax) | ||
292 | movl $0x12345678, real_magic - wakeup_start (%eax) | 290 | movl $0x12345678, real_magic - wakeup_start (%eax) |
293 | movl $0x12345678, saved_magic | 291 | movl $0x12345678, saved_magic |
294 | popl %ebx | 292 | popl %ebx |