aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/acpi
diff options
context:
space:
mode:
authorNigel Cunningham <nigel@nigel.suspend2.net>2007-07-19 04:47:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:43 -0400
commit5a60d6235c8352ade8f2699e72fcdfe853730456 (patch)
treecafab638df562b912e9e2a653e5c7238816d9706 /arch/i386/kernel/acpi
parentbd804eba1c8597cbb7cd5a5f9fe886aae16a079a (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/i386/kernel/acpi')
-rw-r--r--arch/i386/kernel/acpi/wakeup.S27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index a2295a34b2c7..b4e2ec3c3928 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -13,6 +13,21 @@
13# cs = 0x1234, eip = 0x05 13# cs = 0x1234, eip = 0x05
14# 14#
15 15
16#define BEEP \
17 inb $97, %al; \
18 outb %al, $0x80; \
19 movb $3, %al; \
20 outb %al, $97; \
21 outb %al, $0x80; \
22 movb $-74, %al; \
23 outb %al, $67; \
24 outb %al, $0x80; \
25 movb $-119, %al; \
26 outb %al, $66; \
27 outb %al, $0x80; \
28 movb $15, %al; \
29 outb %al, $66;
30
16ALIGN 31ALIGN
17 .align 4096 32 .align 4096
18ENTRY(wakeup_start) 33ENTRY(wakeup_start)
@@ -31,6 +46,11 @@ wakeup_code:
31 movw %cs, %ax 46 movw %cs, %ax
32 movw %ax, %ds # Make ds:0 point to wakeup_start 47 movw %ax, %ds # Make ds:0 point to wakeup_start
33 movw %ax, %ss 48 movw %ax, %ss
49
50 testl $1, beep_flags - wakeup_code
51 jz 1f
52 BEEP
531:
34 mov $(wakeup_stack - wakeup_code), %sp # Private stack is needed for ASUS board 54 mov $(wakeup_stack - wakeup_code), %sp # Private stack is needed for ASUS board
35 movw $0x0e00 + 'S', %fs:(0x12) 55 movw $0x0e00 + 'S', %fs:(0x12)
36 56
@@ -88,6 +108,10 @@ wakeup_code:
88 cmpl $0x12345678, %eax 108 cmpl $0x12345678, %eax
89 jne bogus_real_magic 109 jne bogus_real_magic
90 110
111 testl $2, beep_flags - wakeup_code
112 jz 1f
113 BEEP
1141:
91 ljmpl $__KERNEL_CS,$wakeup_pmode_return 115 ljmpl $__KERNEL_CS,$wakeup_pmode_return
92 116
93real_save_gdt: .word 0 117real_save_gdt: .word 0
@@ -98,6 +122,7 @@ real_save_cr4: .long 0
98real_magic: .long 0 122real_magic: .long 0
99video_mode: .long 0 123video_mode: .long 0
100video_flags: .long 0 124video_flags: .long 0
125beep_flags: .long 0
101real_efer_save_restore: .long 0 126real_efer_save_restore: .long 0
102real_save_efer_edx: .long 0 127real_save_efer_edx: .long 0
103real_save_efer_eax: .long 0 128real_save_efer_eax: .long 0
@@ -262,6 +287,8 @@ ENTRY(acpi_copy_wakeup_routine)
262 movl %edx, video_mode - wakeup_start (%eax) 287 movl %edx, video_mode - wakeup_start (%eax)
263 movl acpi_video_flags, %edx 288 movl acpi_video_flags, %edx
264 movl %edx, video_flags - wakeup_start (%eax) 289 movl %edx, video_flags - wakeup_start (%eax)
290 movl s2ram_beep, %edx
291 movl %edx, beep_flags - wakeup_start (%eax)
265 movl $0x12345678, real_magic - wakeup_start (%eax) 292 movl $0x12345678, real_magic - wakeup_start (%eax)
266 movl $0x12345678, saved_magic 293 movl $0x12345678, saved_magic
267 popl %ebx 294 popl %ebx