--- src/arch/linux/async/sigsegv.c Sat Jun 7 12:10:16 2003 +++ src/arch/linux/async/sigsegv.c Thu Jul 17 20:52:08 2003 @@ -324,16 +324,21 @@ { /* * FIRST thing to do - to avoid being trapped into int0x11 - * forever, we must clear AC before doing anything else! - * Clear also ID for some reasons? + * forever, we must restore the eflags. + * Also restore the %fs and %gs for compatibility with NPTL. */ - __asm__ __volatile__ (" \ - pushfl\n \ - popl %%eax\n \ - andl %0,%%eax\n \ - pushl %%eax\n \ - popfl" \ - : : "i"(~(AC|ID)) : "%eax"); + if (in_dpmi && !in_vm86 && context.cs != UCODESEL) { + __asm__ __volatile__ (" \ + pushl %0\n \ + popfl\n \ + movw %1, %%fs\n \ + movw %2, %%gs\n \ + " \ + : : + "m"(emu_stack_frame->eflags), + "m"(emu_stack_frame->fs), + "m"(emu_stack_frame->gs)); + } fault_cnt++; --- src/dosext/dpmi/dpmi.c Wed Jul 16 21:54:22 2003 +++ src/dosext/dpmi/dpmi.c Thu Jul 17 20:15:45 2003 @@ -142,8 +142,8 @@ unsigned short DPMI_SEL = 0; struct sigcontext_struct dpmi_stack_frame[DPMI_MAX_CLIENTS]; /* used to store the dpmi client registers */ -static struct sigcontext_struct _emu_stack_frame; /* used to store emulator registers */ -static struct sigcontext_struct *emu_stack_frame = &_emu_stack_frame; +struct sigcontext_struct _emu_stack_frame; /* used to store emulator registers */ +struct sigcontext_struct *emu_stack_frame = &_emu_stack_frame; #define CHECK_SELECTOR(x) \ { if (!ValidAndUsedSelector(x) || SystemSelector(x)) { \ --- src/dosext/dpmi/dpmi.h Wed Jul 16 21:54:20 2003 +++ src/dosext/dpmi/dpmi.h Thu Jul 17 20:16:34 2003 @@ -142,6 +142,7 @@ extern INTDESC Interrupt_Table[0x100]; extern SEGDESC Segments[]; extern struct sigcontext_struct dpmi_stack_frame[DPMI_MAX_CLIENTS]; +extern struct sigcontext_struct *emu_stack_frame; /* used to store the dpmi client registers */ extern RealModeCallBack mouseCallBack; /* user\'s mouse routine */ extern char *ldt_buffer;