freebsd-dev/sys/amd64
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
..
acpica Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
amd64 Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base 2003-05-12 02:37:29 +00:00
compile Make space for compilations. 2002-07-06 02:49:07 +00:00
conf Turn syscons on now that it works, so that anybody trying to run this 2003-05-09 18:26:06 +00:00
ia32 Regen. 2003-04-25 15:59:44 +00:00
include Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base 2003-05-12 02:37:29 +00:00
isa Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base 2003-05-12 02:37:29 +00:00
pci Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
Makefile This commit adds basic support for the UFS2 filesystem. The UFS2 2002-06-21 06:18:05 +00:00