aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include/pcpu.h
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/include/pcpu.h
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/include/pcpu.h')
-rw-r--r--sys/amd64/include/pcpu.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h
index 23818ca81328..139281a6b478 100644
--- a/sys/amd64/include/pcpu.h
+++ b/sys/amd64/include/pcpu.h
@@ -62,12 +62,20 @@
char pc_monitorbuf[128] __aligned(128); /* cache line */ \
struct pcpu *pc_prvspace; /* Self-reference */ \
struct pmap *pc_curpmap; \
- struct amd64tss *pc_tssp; \
+ struct amd64tss *pc_tssp; /* TSS segment active on CPU */ \
+ struct amd64tss *pc_commontssp;/* Common TSS for the CPU */ \
register_t pc_rsp0; \
register_t pc_scratch_rsp; /* User %rsp in syscall */ \
u_int pc_apic_id; \
u_int pc_acpi_id; /* ACPI CPU id */ \
- struct user_segment_descriptor *pc_gs32p \
+ /* Pointer to the CPU %fs descriptor */ \
+ struct user_segment_descriptor *pc_fs32p; \
+ /* Pointer to the CPU %gs descriptor */ \
+ struct user_segment_descriptor *pc_gs32p; \
+ /* Pointer to the CPU LDT descriptor */ \
+ struct system_segment_descriptor *pc_ldt; \
+ /* Pointer to the CPU TSS descriptor */ \
+ struct system_segment_descriptor *pc_tss
PCPU_XEN_FIELDS
#ifdef _KERNEL