aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/acpica/acpi_wakecode.S
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2009-03-23 22:35:30 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2009-03-23 22:35:30 +0000
commitd2b227cd4911d60018a01c8e8def38e4b8738ba4 (patch)
treef284ffd9edfdd71caca0193ffb187a3cc0ece60d /sys/amd64/acpica/acpi_wakecode.S
parent0755473ba23b34fedcd2d5a3ee6657319fc4e2e4 (diff)
downloadsrc-d2b227cd4911d60018a01c8e8def38e4b8738ba4.tar.gz
src-d2b227cd4911d60018a01c8e8def38e4b8738ba4.zip
- Clean up suspend/resume code for amd64.
- Call acpi_resync_clock() to reset system time before hardclock is ready to tick. Note we assume the current timecounter hardware and RTC are already available for read operation. Tested by: mav
Notes
Notes: svn path=/head/; revision=190341
Diffstat (limited to 'sys/amd64/acpica/acpi_wakecode.S')
-rw-r--r--sys/amd64/acpica/acpi_wakecode.S38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/amd64/acpica/acpi_wakecode.S b/sys/amd64/acpica/acpi_wakecode.S
index 111486e8d1a4..4165ec68867d 100644
--- a/sys/amd64/acpica/acpi_wakecode.S
+++ b/sys/amd64/acpica/acpi_wakecode.S
@@ -2,7 +2,7 @@
* Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
* Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
* Copyright (c) 2003 Peter Wemm
- * Copyright (c) 2008 Jung-uk Kim <jkim@FreeBSD.org>
+ * Copyright (c) 2008-2009 Jung-uk Kim <jkim@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -66,12 +66,14 @@ wakeup_start:
mov %ax, %ds /* are offsets rather than selectors */
mov %ax, %ss
movw $PAGE_SIZE - 8, %sp
- pushw $0
+ xorw %ax, %ax
+ pushw %ax
popfw
/* To debug resume hangs, beep the speaker if the user requested. */
- cmpw $0, resume_beep - wakeup_start
- je 1f
+ testb $~0, resume_beep - wakeup_start
+ jz 1f
+ movb $0, resume_beep - wakeup_start
movb $0xc0, %al
outb %al, $0x42
movb $0x04, %al
@@ -79,22 +81,16 @@ wakeup_start:
inb $0x61, %al
orb $0x3, %al
outb %al, $0x61
- movw $0, resume_beep - wakeup_start
1:
/* Re-initialize video BIOS if the reset_video tunable is set. */
- cmpw $0, reset_video - wakeup_start
- je 1f
+ testb $~0, reset_video - wakeup_start
+ jz 1f
+ movb $0, reset_video - wakeup_start
lcall $0xc000, $3
- movw $0, reset_video - wakeup_start
- /*
- * Set up segment registers for real mode again in case the
- * previous BIOS call clobbers them.
- */
- mov %cs, %ax
- mov %ax, %ds
- mov %ax, %ss
+ /* Re-start in case the previous BIOS call clobbers them. */
+ jmp wakeup_start
1:
/*
@@ -204,6 +200,7 @@ wakeup_sw64:
* space. Remember that jmp is relative and that we've been relocated,
* so use an indirect jump.
*/
+ ALIGN_TEXT
.code64
wakeup_64:
mov $bootdata64 - bootgdt, %eax
@@ -215,6 +212,13 @@ wakeup_64:
movq wakeup_retaddr - wakeup_start(%rbx), %rax
jmp *%rax
+ .data
+
+resume_beep:
+ .byte 0
+reset_video:
+ .byte 0
+
ALIGN_DATA
bootgdt:
.long 0x00000000
@@ -245,10 +249,6 @@ bootgdtdesc:
.long bootgdt - wakeup_start /* Offset plus %ds << 4 */
ALIGN_DATA
-resume_beep:
- .long 0
-reset_video:
- .long 0
wakeup_retaddr:
.quad 0
wakeup_kpml4: