From af7e9be5cce9a2ceb819f00b3f58014d23ab57cd Mon Sep 17 00:00:00 2001 From: luoqi Date: Wed, 28 Apr 1999 01:04:33 +0000 Subject: 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 John Dyson Julian Elischer Bruce Evans David Greenman --- sys/i386/linux/linux_sysvec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/i386/linux/linux_sysvec.c') 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; -- cgit v1.1