summaryrefslogtreecommitdiffstats
path: root/sys/i386/svr4
diff options
context:
space:
mode:
authorluoqi <luoqi@FreeBSD.org>1999-04-28 01:04:33 +0000
committerluoqi <luoqi@FreeBSD.org>1999-04-28 01:04:33 +0000
commitaf7e9be5cce9a2ceb819f00b3f58014d23ab57cd (patch)
tree0e70c0e764f072d43041acca8ac52e30616dced3 /sys/i386/svr4
parent0f4a245030e7f1acb03f8de0822a58b188fc0d28 (diff)
downloadFreeBSD-src-af7e9be5cce9a2ceb819f00b3f58014d23ab57cd.zip
FreeBSD-src-af7e9be5cce9a2ceb819f00b3f58014d23ab57cd.tar.gz
Enable vmspace sharing on SMP. Major changes are,
- %fs register is added to trapframe and saved/restored upon kernel entry/exit. - Per-cpu pages are no longer mapped at the same virtual address. - Each cpu now has a separate gdt selector table. A new segment selector is added to point to per-cpu pages, per-cpu global variables are now accessed through this new selector (%fs). The selectors in gdt table are rearranged for cache line optimization. - fask_vfork is now on as default for both UP and SMP. - Some aio code cleanup. Reviewed by: Alan Cox <alc@cs.rice.edu> John Dyson <dyson@iquest.net> Julian Elischer <julian@whistel.com> Bruce Evans <bde@zeta.org.au> David Greenman <dg@root.com>
Diffstat (limited to 'sys/i386/svr4')
-rw-r--r--sys/i386/svr4/svr4_locore.s4
-rw-r--r--sys/i386/svr4/svr4_machdep.c11
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/i386/svr4/svr4_locore.s b/sys/i386/svr4/svr4_locore.s
index 7903e73..2f9c683 100644
--- a/sys/i386/svr4/svr4_locore.s
+++ b/sys/i386/svr4/svr4_locore.s
@@ -13,11 +13,11 @@ NON_GPROF_ENTRY(svr4_sigcode)
jnz 1f
#endif
#endif
- movl SVR4_UC_FS(%eax),%ecx
movl SVR4_UC_GS(%eax),%edx
- movl %cx,%fs
movl %dx,%gs
#if defined(__NetBSD__)
+ movl SVR4_UC_FS(%eax),%ecx
+ movl %cx,%fs
1: pushl %eax
pushl $1 # setcontext(p) == syscontext(1, p)
pushl %eax # junk to fake return address
diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c
index a94f45e..5e77fd1 100644
--- a/sys/i386/svr4/svr4_machdep.c
+++ b/sys/i386/svr4/svr4_machdep.c
@@ -127,8 +127,13 @@ svr4_getcontext(p, uc, mask, oonstack)
} else
#endif
{
+#if defined(__NetBSD__)
__asm("movl %%gs,%w0" : "=r" (r[SVR4_X86_GS]));
__asm("movl %%fs,%w0" : "=r" (r[SVR4_X86_FS]));
+#else
+ r[SVR4_X86_GS] = rgs();
+ r[SVR4_X86_FS] = tf->tf_fs;
+#endif
r[SVR4_X86_ES] = tf->tf_es;
r[SVR4_X86_DS] = tf->tf_ds;
r[SVR4_X86_EFL] = tf->tf_eflags;
@@ -230,7 +235,12 @@ svr4_setcontext(p, uc)
!USERMODE(r[SVR4_X86_CS], r[SVR4_X86_EFL]))
return (EINVAL);
+#if defined(__NetBSD__)
/* %fs and %gs were restored by the trampoline. */
+#else
+ /* %gs was restored by the trampoline. */
+ tf->tf_fs = r[SVR4_X86_FS];
+#endif
tf->tf_es = r[SVR4_X86_ES];
tf->tf_ds = r[SVR4_X86_DS];
tf->tf_eflags = r[SVR4_X86_EFL];
@@ -449,6 +459,7 @@ svr4_sendsig(catcher, sig, mask, code)
tf->tf_cs = _ucodesel;
tf->tf_ds = _udatasel;
tf->tf_es = _udatasel;
+ tf->tf_fs = _udatasel;
tf->tf_ss = _udatasel;
#endif
}
OpenPOWER on IntegriCloud