]> Zhao Yanbai Git Server - minix.git/commitdiff
restore PSW like 9393439a20 for AMD syscall 99/2899/1
authorBen Gras <ben@minix3.org>
Thu, 20 Nov 2014 16:42:32 +0000 (16:42 +0000)
committerBen Gras <ben@minix3.org>
Mon, 24 Nov 2014 11:05:45 +0000 (12:05 +0100)
Change-Id: Ide0a8727af8d0d81361382dbd2460c7a6c5743fc

minix/kernel/arch/i386/mpx.S

index 81fb696a3c73a384a542d689abe7f6888d7bfe7d..fa38697e53246afaa097a79481746b385bcfd8ad 100644 (file)
@@ -418,11 +418,17 @@ ENTRY(restore_user_context_syscall)
         * enabling interrupts, and of course sysret instead of sysexit.
         */
        mov     4(%esp), %ebp           /* retrieve proc ptr arg */
+
+        /* restore PSW (before we switch to user stack!) */
+        movl    PSWREG(%ebp), %edi      /* load desired PSW to EDI */
+        push    %edi
+        popf
+
        mov     PCREG(%ebp), %ecx       /* sysret restores EIP using ECX */
        mov     SPREG(%ebp), %esp       /* restore ESP directly */
        mov     AXREG(%ebp), %eax       /* trap return value */
        mov     BXREG(%ebp), %ebx       /* secondary return value */
-       movl    PSWREG(%ebp), %edi      /* load desired PSW to EDI */
+
        sysret                          /* jump to EIP in user */
 
 ENTRY(restore_user_context_int)