diff options
author | jkim <jkim@FreeBSD.org> | 2012-02-15 22:10:33 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-02-15 22:10:33 +0000 |
commit | 06d5b58227da4266ed0284669328d25d6340146d (patch) | |
tree | 3f42aa0e5e677233156fe577f447baa6f7798098 /sys/amd64/acpica | |
parent | e89cddf37f8fadb0946c20ddaa7a6d0828f36285 (diff) | |
download | FreeBSD-src-06d5b58227da4266ed0284669328d25d6340146d.zip FreeBSD-src-06d5b58227da4266ed0284669328d25d6340146d.tar.gz |
Make ACPI resume beeper less cryptic. Set PIC timer2 mode properly.
Diffstat (limited to 'sys/amd64/acpica')
-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 0f34d39..82d0ab2 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. */ |