From d74e9d43ab8169b6d98576bb6535730247ab722a Mon Sep 17 00:00:00 2001 From: mycroft Date: Mon, 8 Jan 1996 20:12:20 +0000 Subject: [PATCH] Also reset %fs and %gs when delivering a signal. --- sys/arch/i386/i386/machdep.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 9419f218d420..46a1e5bf5343 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.184 1996/01/08 13:51:34 mycroft Exp $ */ +/* $NetBSD: machdep.c,v 1.185 1996/01/08 20:12:20 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved. @@ -587,14 +587,16 @@ sendsig(catcher, sig, mask, code) /* * Build context to run handler in. */ - tf->tf_esp = (int)fp; + __asm("movl %w0,%%gs" : : "r" (GSEL(GUDATA_SEL, SEL_UPL))); + __asm("movl %w0,%%fs" : : "r" (GSEL(GUDATA_SEL, SEL_UPL))); + tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL); + tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL); tf->tf_eip = (int)(((char *)PS_STRINGS) - (esigcode - sigcode)); + tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL); #ifdef VM86 tf->tf_eflags &= ~PSL_VM; #endif - tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL); - tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL); - tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL); + tf->tf_esp = (int)fp; tf->tf_ss = GSEL(GUDATA_SEL, SEL_UPL); }