Date: Wed, 15 Feb 2012 22:10:33 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r231787 - head/sys/amd64/acpica Message-ID: <201202152210.q1FMAXq2084276@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Wed Feb 15 22:10:33 2012 New Revision: 231787 URL: http://svn.freebsd.org/changeset/base/231787 Log: Make ACPI resume beeper less cryptic. Set PIC timer2 mode properly. Modified: head/sys/amd64/acpica/acpi_wakecode.S Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Wed Feb 15 22:07:09 2012 (r231786) +++ head/sys/amd64/acpica/acpi_wakecode.S Wed Feb 15 22:10:33 2012 (r231787) @@ -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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202152210.q1FMAXq2084276>