Mercurial > mplayer.hg
comparison osdep/lrmi.c @ 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 | 608666e629b2 |
children | 22f8732b5d97 |
comparison
equal
deleted
inserted
replaced
11433:6d27f80d6918 | 11434:5084f09ba20e |
---|---|
9 | 9 |
10 This software has NO WARRANTY. Use it at your own risk. | 10 This software has NO WARRANTY. Use it at your own risk. |
11 Original location: http://cvs.debian.org/lrmi/ | 11 Original location: http://cvs.debian.org/lrmi/ |
12 */ | 12 */ |
13 | 13 |
14 #include <signal.h> | |
14 #include <stdio.h> | 15 #include <stdio.h> |
15 #include <string.h> | 16 #include <string.h> |
16 #include <sys/io.h> | 17 #include <sys/io.h> |
17 #include <asm/vm86.h> | 18 #include <asm/vm86.h> |
18 | 19 |
787 | 788 |
788 static int | 789 static int |
789 run_vm86(void) | 790 run_vm86(void) |
790 { | 791 { |
791 unsigned int vret; | 792 unsigned int vret; |
793 sigset_t allsigs, cursigs; | |
794 unsigned long oldgs; | |
792 | 795 |
793 while (1) | 796 while (1) |
794 { | 797 { |
798 sigfillset(&allsigs); | |
799 sigprocmask(SIG_SETMASK, &allsigs, &cursigs); | |
800 asm volatile ("movl %%gs, %0" : "=g" (oldgs)); | |
795 vret = lrmi_vm86(&context.vm); | 801 vret = lrmi_vm86(&context.vm); |
802 asm volatile ("movl %0, %%gs" :: "g" (oldgs)); | |
803 sigprocmask(SIG_SETMASK, &cursigs, NULL); | |
796 | 804 |
797 if (VM86_TYPE(vret) == VM86_INTx) | 805 if (VM86_TYPE(vret) == VM86_INTx) |
798 { | 806 { |
799 unsigned int v = VM86_ARG(vret); | 807 unsigned int v = VM86_ARG(vret); |
800 | 808 |