diff options
author | luoqi <luoqi@FreeBSD.org> | 1999-04-28 01:04:33 +0000 |
---|---|---|
committer | luoqi <luoqi@FreeBSD.org> | 1999-04-28 01:04:33 +0000 |
commit | af7e9be5cce9a2ceb819f00b3f58014d23ab57cd (patch) | |
tree | 0e70c0e764f072d43041acca8ac52e30616dced3 /sys/i386/linux | |
parent | 0f4a245030e7f1acb03f8de0822a58b188fc0d28 (diff) | |
download | FreeBSD-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/linux')
-rw-r--r-- | sys/i386/linux/linux_genassym.c | 3 | ||||
-rw-r--r-- | sys/i386/linux/linux_locore.s | 2 | ||||
-rw-r--r-- | sys/i386/linux/linux_misc.c | 14 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 10 |
4 files changed, 12 insertions, 17 deletions
diff --git a/sys/i386/linux/linux_genassym.c b/sys/i386/linux/linux_genassym.c index 76b8ced..99a88a5 100644 --- a/sys/i386/linux/linux_genassym.c +++ b/sys/i386/linux/linux_genassym.c @@ -1,4 +1,4 @@ -/* $Id: linux_genassym.c,v 1.7 1998/02/01 18:47:56 bde Exp $ */ +/* $Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp $ */ #include <sys/param.h> @@ -16,7 +16,6 @@ main() printf("#define\tLINUX_SIGF_HANDLER %u\n", OS(linux_sigframe, sf_handler)); printf("#define\tLINUX_SIGF_SC %u\n", OS(linux_sigframe, sf_sc)); - printf("#define\tLINUX_SC_FS %u\n", OS(linux_sigcontext, sc_fs)); printf("#define\tLINUX_SC_GS %u\n", OS(linux_sigcontext, sc_gs)); printf("#define\tLINUX_SC_EFLAGS %u\n", OS(linux_sigcontext, sc_eflags)); diff --git a/sys/i386/linux/linux_locore.s b/sys/i386/linux/linux_locore.s index 1440218..b458c94 100644 --- a/sys/i386/linux/linux_locore.s +++ b/sys/i386/linux/linux_locore.s @@ -6,9 +6,7 @@ NON_GPROF_ENTRY(linux_sigcode) call LINUX_SIGF_HANDLER(%esp) leal LINUX_SIGF_SC(%esp),%ebx /* linux scp */ - movl LINUX_SC_FS(%ebx),%ecx movl LINUX_SC_GS(%ebx),%edx - movl %cx,%fs movl %dx,%gs push %eax /* fake ret addr */ movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */ diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c index 68a2d43..e01693a 100644 --- a/sys/i386/linux/linux_misc.c +++ b/sys/i386/linux/linux_misc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_misc.c,v 1.55 1999/04/27 11:15:32 phk Exp $ + * $Id: linux_misc.c,v 1.56 1999/04/27 12:21:04 phk Exp $ */ #include <sys/param.h> @@ -531,18 +531,18 @@ select_out: int linux_getpgid(struct proc *p, struct linux_getpgid_args *args) { - struct proc *curproc; + struct proc *curp; #ifdef DEBUG printf("Linux-emul(%d): getpgid(%d)\n", p->p_pid, args->pid); #endif if (args->pid != p->p_pid) { - if (!(curproc = pfind(args->pid))) + if (!(curp = pfind(args->pid))) return ESRCH; } else - curproc = p; - p->p_retval[0] = curproc->p_pgid; + curp = p; + p->p_retval[0] = curp->p_pgid; return 0; } @@ -576,10 +576,6 @@ linux_clone(struct proc *p, struct linux_clone_args *args) vm_offset_t start; struct rfork_args rf_args; -#ifdef SMP - printf("linux_clone(%d): does not work with SMP yet\n", p->p_pid); - return (EOPNOTSUPP); -#endif #ifdef DEBUG if (args->flags & CLONE_PID) printf("linux_clone(%d): CLONE_PID not yet supported\n", p->p_pid); diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index d3a2f71..8584d96 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_sysvec.c,v 1.45 1999/02/04 21:20:13 newton Exp $ + * $Id: linux_sysvec.c,v 1.46 1999/04/19 14:14:14 peter Exp $ */ /* XXX we use functions that might not exist. */ @@ -249,8 +249,8 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code) * Build the signal context to be used by sigreturn. */ frame.sf_sc.sc_mask = mask; - __asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs)); - __asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs)); + frame.sf_sc.sc_gs = rgs(); + frame.sf_sc.sc_fs = regs->tf_fs; frame.sf_sc.sc_es = regs->tf_es; frame.sf_sc.sc_ds = regs->tf_ds; frame.sf_sc.sc_edi = regs->tf_edi; @@ -286,6 +286,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code) regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; regs->tf_es = _udatasel; + regs->tf_fs = _udatasel; regs->tf_ss = _udatasel; } @@ -359,7 +360,8 @@ linux_sigreturn(p, args) /* * Restore signal context. */ - /* %fs and %gs were restored by the trampoline. */ + /* %gs was restored by the trampoline. */ + regs->tf_fs = context.sc_fs; regs->tf_es = context.sc_es; regs->tf_ds = context.sc_ds; regs->tf_edi = context.sc_edi; |