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
_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
_types.h Provide a fake varargs implementation for lint's benefit. This way 2003-05-10 00:55:15 +00:00
acpica_machdep.h
apicreg.h
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
floatingpoint.h
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
in_cksum.h
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
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
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
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
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
vmparam.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00