aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/acpica/acpi_wakecode.S
diff options
context:
space:
mode:
authorMitsuru IWASAKI <iwasaki@FreeBSD.org>2012-06-09 00:37:26 +0000
committerMitsuru IWASAKI <iwasaki@FreeBSD.org>2012-06-09 00:37:26 +0000
commitfb864578afd9c1f073b39c9154b2d5642c536ed9 (patch)
treed545096ae7b18322fd63d055e098b158b8862a01 /sys/amd64/acpica/acpi_wakecode.S
parentb347830a7d6e01f2771dac675a57019beed726fc (diff)
downloadsrc-fb864578afd9c1f073b39c9154b2d5642c536ed9.tar.gz
src-fb864578afd9c1f073b39c9154b2d5642c536ed9.zip
Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference of
suspend/resume procedures are minimized among them. common: - Add global cpuset suspended_cpus to indicate APs are suspended/resumed. - Remove acpi_waketag and acpi_wakemap from acpivar.h (no longer used). - Add some variables in acpi_wakecode.S in order to minimize the difference among amd64 and i386. - Disable load_cr3() because now CR3 is restored in resumectx(). amd64: - Add suspend/resume related members (such as MSR) in PCB. - Modify savectx() for above new PCB members. - Merge acpi_switch.S into cpu_switch.S as resumectx(). i386: - Merge(and remove) suspendctx() into savectx() in order to match with amd64 code. Reviewed by: attilio@, acpi@
Notes
Notes: svn path=/head/; revision=236772
Diffstat (limited to 'sys/amd64/acpica/acpi_wakecode.S')
-rw-r--r--sys/amd64/acpica/acpi_wakecode.S38
1 files changed, 12 insertions, 26 deletions
diff --git a/sys/amd64/acpica/acpi_wakecode.S b/sys/amd64/acpica/acpi_wakecode.S
index 82d0ab21e5a6..a87732819226 100644
--- a/sys/amd64/acpica/acpi_wakecode.S
+++ b/sys/amd64/acpica/acpi_wakecode.S
@@ -219,10 +219,15 @@ wakeup_64:
mov $bootdata64 - bootgdt, %eax
mov %ax, %ds
- /* Restore arguments and return. */
- movq wakeup_kpml4 - wakeup_start(%rbx), %rdi
- movq wakeup_ctx - wakeup_start(%rbx), %rsi
- movq wakeup_retaddr - wakeup_start(%rbx), %rax
+ /* Restore arguments. */
+ movq wakeup_cr3 - wakeup_start(%rbx), %rsi
+ movq wakeup_pcb - wakeup_start(%rbx), %rdi
+ movq wakeup_ret - wakeup_start(%rbx), %rax
+
+ /* Restore GDT. */
+ lgdt wakeup_gdt - wakeup_start(%rbx)
+
+ /* Jump to return address. */
jmp *%rax
.data
@@ -268,34 +273,15 @@ bootgdtdesc:
.long bootgdt - wakeup_start /* Offset plus %ds << 4 */
ALIGN_DATA
-wakeup_retaddr:
+wakeup_cr4: /* not used */
.quad 0
-wakeup_kpml4:
- .quad 0
-
-wakeup_ctx:
+wakeup_cr3:
.quad 0
wakeup_pcb:
.quad 0
-wakeup_fpusave:
+wakeup_ret:
.quad 0
wakeup_gdt:
.word 0
.quad 0
-
- ALIGN_DATA
-wakeup_efer:
- .quad 0
-wakeup_star:
- .quad 0
-wakeup_lstar:
- .quad 0
-wakeup_cstar:
- .quad 0
-wakeup_sfmask:
- .quad 0
-wakeup_xsmask:
- .quad 0
-wakeup_cpu:
- .long 0
dummy: