aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/acpica
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2009-04-01 13:09:26 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2009-04-01 13:09:26 +0000
commit2c66cccab7ceceb3eed086da3b2dedfc77ce72de (patch)
treeb58cda2045e48f43c2d8ff644f3d5c3a859f6e99 /sys/amd64/acpica
parentc11d6143cac353dc4d057d915cb63bf318c0f9e5 (diff)
downloadsrc-2c66cccab7ceceb3eed086da3b2dedfc77ce72de.tar.gz
src-2c66cccab7ceceb3eed086da3b2dedfc77ce72de.zip
Save and restore segment registers on amd64 when entering and leaving
the kernel on amd64. Fill and read segment registers for mcontext and signals. Handle traps caused by restoration of the invalidated selectors. Implement user-mode creation and manipulation of the process-specific LDT descriptors for amd64, see sysarch(2). Implement support for TSS i/o port access permission bitmap for amd64. Context-switch LDT and TSS. Do not save and restore segment registers on the context switch, that is handled by kernel enter/leave trampolines now. Remove segment restore code from the signal trampolines for freebsd/amd64, freebsd/ia32 and linux/i386 for the same reason. Implement amd64-specific compat shims for sysarch. Linuxolator (temporary ?) switched to use gsbase for thread_area pointer. TODO: Currently, gdb is not adapted to show segment registers from struct reg. Also, no machine-depended ptrace command is added to set segment registers for debugged process. In collaboration with: pho Discussed with: peter Reviewed by: jhb Linuxolator tested by: dchagin
Notes
Notes: svn path=/head/; revision=190620
Diffstat (limited to 'sys/amd64/acpica')
-rw-r--r--sys/amd64/acpica/acpi_switch.S17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/amd64/acpica/acpi_switch.S b/sys/amd64/acpica/acpi_switch.S
index d4f732a6eb2b..0b262925d2f6 100644
--- a/sys/amd64/acpica/acpi_switch.S
+++ b/sys/amd64/acpica/acpi_switch.S
@@ -64,12 +64,17 @@ ENTRY(acpi_restorecpu)
/* Fetch PCB. */
movq WAKEUP_CTX(xpcb), %r11
- /* Restore segment registers. */
- mov WAKEUP_PCB(DS), %ds
- mov WAKEUP_PCB(ES), %es
- mov WAKEUP_XPCB(SS), %ss
- mov WAKEUP_PCB(FS), %fs
- mov WAKEUP_PCB(GS), %gs
+ /* Force kernel segment registers. */
+ movl $KDSEL, %eax
+ movw %ax, %ds
+ movl $KDSEL, %eax
+ movw %ax, %es
+ movl $KDSEL, %eax
+ movw %ax, %ss
+ movl $KUF32SEL, %eax
+ movw %ax, %fs
+ movl $KUG32SEL, %eax
+ movw %ax, %gs
movl $MSR_FSBASE, %ecx
movl WAKEUP_PCB(FSBASE), %eax