diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2012-02-15 22:10:33 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2012-02-15 22:10:33 +0000 |
commit | b1dd90550d737c1dba96d6fd56765950a5e82a76 (patch) | |
tree | 3f42aa0e5e677233156fe577f447baa6f7798098 /sys/amd64 | |
parent | ceb9fa549ffa52d456ce2e85a72261a322b5d5f0 (diff) | |
download | src-b1dd90550d737c1dba96d6fd56765950a5e82a76.tar.gz src-b1dd90550d737c1dba96d6fd56765950a5e82a76.zip |
Make ACPI resume beeper less cryptic. Set PIC timer2 mode properly.
Notes
Notes:
svn path=/head/; revision=231787
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/acpica/acpi_wakecode.S | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/sys/amd64/acpica/acpi_wakecode.S b/sys/amd64/acpica/acpi_wakecode.S index 0f34d396e18a..82d0ab21e5a6 100644 --- a/sys/amd64/acpica/acpi_wakecode.S +++ b/sys/amd64/acpica/acpi_wakecode.S @@ -30,7 +30,9 @@ */ #include <machine/asmacros.h> +#include <machine/ppireg.h> #include <machine/specialreg.h> +#include <machine/timerreg.h> #include "assym.s" @@ -71,13 +73,21 @@ wakeup_start: testb $~0, resume_beep - wakeup_start jz 1f movb $0, resume_beep - wakeup_start - movb $0xc0, %al - outb %al, $0x42 - movb $0x04, %al - outb %al, $0x42 - inb $0x61, %al - orb $0x3, %al - outb %al, $0x61 + + /* Set PIC timer2 to beep. */ + movb $(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT), %al + outb %al, $TIMER_MODE + + /* Turn on speaker. */ + inb $IO_PPI, %al + orb $PIT_SPKR, %al + outb %al, $IO_PPI + + /* Set frequency. */ + movw $0x4c0, %ax + outb %al, $TIMER_CNTR2 + shrw $8, %ax + outb %al, $TIMER_CNTR2 1: /* Re-initialize video BIOS if the reset_video tunable is set. */ |