freebsd-dev/sys/amd64/include
Peter Wemm bf1e897425 Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base
value on entry and exit.  This isn't as easy as it sounds because when
we recursively trap or interrupt, we have to avoid duplicating the
swapgs instruction or we end up back with the userland %gs.  I implemented
this by testing TF_CS to see if we're coming from supervisor mode
already, and check for returning to supervisor. To avoid a race with
interrupts in the brief period after beginning executing the handler and
before the swapgs, convert all trap gates to interrupt gates, and reenable
interrupts immediately after the swapgs.  I am not happy with this.
There are other possible ways to do this that should be investigated.
(eg: storing the GS.base MSR value in the trapframe)

Add some sysarch functions to let the userland code get to this.

Approved by:	re (blanket amd64/*)
2003-05-12 02:37:29 +00:00
..
pc use __packed. 2002-09-23 18:54:32 +00:00
_inttypes.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
_limits.h Style fixes. 2003-05-04 22:13:04 +00:00
_stdint.h Create a new header <machine/_stdint.h> for storing MD parts of 2002-07-29 17:41:23 +00:00
_types.h Provide a fake varargs implementation for lint's benefit. This way 2003-05-10 00:55:15 +00:00
acpica_machdep.h Resolve conflicts arising from the ACPI CA 20020725 import. 2002-07-30 19:35:32 +00:00
apicreg.h Expand the APIC ID mask field of the ICR register to 8 bits intead of just 2003-03-17 19:14:13 +00:00
asm.h Remove _ARCH_INDIRECT ifdefs. They existed for lib/msun/* on i386, which 2003-05-10 00:53:34 +00:00
asmacros.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
atomic.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
bus_amd64.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
bus_at386.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
bus_dma.h Change the operation parameter of bus_dmamap_sync() from an 2003-04-10 23:03:33 +00:00
bus_memio.h
bus_pio.h
bus.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
clock.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
cpu.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
cpufunc.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
cputypes.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
critical.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
db_machdep.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
elf.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
endian.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
exec.h
float.h Implement fpclassify(): 2003-02-08 20:37:55 +00:00
floatingpoint.h o Move the contents of <machine/floatingpoint.h> over to 2003-01-19 06:01:33 +00:00
fpu.h Include the MXCSR initial values, based on the AMD docs. This file 2003-05-09 18:28:05 +00:00
frame.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
ieeefp.h o Move the contents of <machine/floatingpoint.h> over to 2003-01-19 06:01:33 +00:00
in_cksum.h This is the first snapshot of the FreeBSD/ia64 kernel. This kernel will 2000-09-29 13:46:07 +00:00
kse.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
legacyvar.h Add a new legacy(4) device driver for use on machines that do not have 2002-09-23 15:50:06 +00:00
limits.h Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
md_var.h Make atdevbase long for the KERNBASE > 4GB case 2003-05-11 22:53:43 +00:00
metadata.h Slight reorg and added AMD64 support. A couple of the MODINFOMD_* values 2003-05-01 03:31:18 +00:00
mptable.h Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
mutex.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
npx.h Include the MXCSR initial values, based on the AMD docs. This file 2003-05-09 18:28:05 +00:00
param.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
pcb_ext.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
pcb.h Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base 2003-05-12 02:37:29 +00:00
pci_cfgreg.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
pcpu.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
pmap.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
proc.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
profile.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
psl.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
ptrace.h Move the definition of PT_[GS]ET{,DB,FP}REGS from the MD ptrace.h to the 2002-03-16 00:25:53 +00:00
reg.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
reloc.h
resource.h
runq.h Move the "- 1" into the RQB_FFS(mask) macro itself so that 2002-06-20 06:21:20 +00:00
segments.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
setjmp.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
sigframe.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
signal.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
smp.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
specialreg.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
stdarg.h Provide a fake varargs implementation for lint's benefit. This way 2003-05-10 00:55:15 +00:00
sysarch.h Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base 2003-05-12 02:37:29 +00:00
trap.h Activate SSE/SIMD. This is the extra context switching support that 2001-07-12 06:32:51 +00:00
tss.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
ucontext.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
varargs.h Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
vmparam.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00