diff options
author | Nigel Cunningham <nigel@nigel.suspend2.net> | 2007-07-19 04:47:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:43 -0400 |
commit | 5a60d6235c8352ade8f2699e72fcdfe853730456 (patch) | |
tree | cafab638df562b912e9e2a653e5c7238816d9706 /arch/x86_64 | |
parent | bd804eba1c8597cbb7cd5a5f9fe886aae16a079a (diff) |
PM: Optional beeping during resume from suspend to RAM
Add a feature allowing the user to make the system beep during a resume from
suspend to RAM, on x86_64 and i386.
This is useful for the users with broken resume from RAM, so that they can
verify if the control reaches the kernel after a wake-up event.
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/x86_64')
-rw-r--r-- | arch/x86_64/kernel/acpi/wakeup.S | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S index 8550a6ffa275..ed63d1845792 100644 --- a/arch/x86_64/kernel/acpi/wakeup.S +++ b/arch/x86_64/kernel/acpi/wakeup.S | |||
@@ -16,6 +16,21 @@ | |||
16 | # cs = 0x1234, eip = 0x05 | 16 | # cs = 0x1234, eip = 0x05 |
17 | # | 17 | # |
18 | 18 | ||
19 | #define BEEP \ | ||
20 | inb $97, %al; \ | ||
21 | outb %al, $0x80; \ | ||
22 | movb $3, %al; \ | ||
23 | outb %al, $97; \ | ||
24 | outb %al, $0x80; \ | ||
25 | movb $-74, %al; \ | ||
26 | outb %al, $67; \ | ||
27 | outb %al, $0x80; \ | ||
28 | movb $-119, %al; \ | ||
29 | outb %al, $66; \ | ||
30 | outb %al, $0x80; \ | ||
31 | movb $15, %al; \ | ||
32 | outb %al, $66; | ||
33 | |||
19 | 34 | ||
20 | ALIGN | 35 | ALIGN |
21 | .align 16 | 36 | .align 16 |
@@ -33,6 +48,13 @@ wakeup_code: | |||
33 | movw %cs, %ax | 48 | movw %cs, %ax |
34 | movw %ax, %ds # Make ds:0 point to wakeup_start | 49 | movw %ax, %ds # Make ds:0 point to wakeup_start |
35 | movw %ax, %ss | 50 | movw %ax, %ss |
51 | |||
52 | # Data segment must be set up before we can see whether to beep. | ||
53 | testl $1, beep_flags - wakeup_code | ||
54 | jz 1f | ||
55 | BEEP | ||
56 | 1: | ||
57 | |||
36 | # Private stack is needed for ASUS board | 58 | # Private stack is needed for ASUS board |
37 | mov $(wakeup_stack - wakeup_code), %sp | 59 | mov $(wakeup_stack - wakeup_code), %sp |
38 | 60 | ||
@@ -229,6 +251,7 @@ gdt_48a: | |||
229 | .long gdta - wakeup_code # gdt base (relocated in later) | 251 | .long gdta - wakeup_code # gdt base (relocated in later) |
230 | 252 | ||
231 | real_magic: .quad 0 | 253 | real_magic: .quad 0 |
254 | beep_flags: .quad 0 | ||
232 | video_mode: .quad 0 | 255 | video_mode: .quad 0 |
233 | video_flags: .quad 0 | 256 | video_flags: .quad 0 |
234 | 257 | ||
@@ -344,6 +367,8 @@ ENTRY(acpi_copy_wakeup_routine) | |||
344 | pushq %rax | 367 | pushq %rax |
345 | pushq %rdx | 368 | pushq %rdx |
346 | 369 | ||
370 | movl s2ram_beep, %edx | ||
371 | movl %edx, beep_flags - wakeup_start (,%rdi) | ||
347 | movl saved_video_mode, %edx | 372 | movl saved_video_mode, %edx |
348 | movl %edx, video_mode - wakeup_start (,%rdi) | 373 | movl %edx, video_mode - wakeup_start (,%rdi) |
349 | movl acpi_video_flags, %edx | 374 | movl acpi_video_flags, %edx |