changeset 11434:5084f09ba20e

Fix pthread & lrmi segfault issue. ("Oleg I. Vdovikin" <vdovikin@jscc.ru>)
author ranma
date Tue, 11 Nov 2003 10:39:36 +0000
parents 6d27f80d6918
children e35ceb2bf375
files osdep/lrmi.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/osdep/lrmi.c	Tue Nov 11 00:20:09 2003 +0000
+++ b/osdep/lrmi.c	Tue Nov 11 10:39:36 2003 +0000
@@ -11,6 +11,7 @@
 Original location: http://cvs.debian.org/lrmi/
 */
 
+#include <signal.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/io.h>
@@ -789,10 +790,17 @@
 run_vm86(void)
 	{
 	unsigned int vret;
+	sigset_t allsigs, cursigs;
+	unsigned long oldgs;
 
 	while (1)
 		{
+		sigfillset(&allsigs);
+	        sigprocmask(SIG_SETMASK, &allsigs, &cursigs);
+		asm volatile ("movl %%gs, %0" : "=g" (oldgs));
 		vret = lrmi_vm86(&context.vm);
+		asm volatile ("movl %0, %%gs" :: "g" (oldgs));
+		sigprocmask(SIG_SETMASK, &cursigs, NULL);
 
 		if (VM86_TYPE(vret) == VM86_INTx)
 			{