pm_call: only enable interrupts in PM if interrupts on in RM
authorH. Peter Anvin <hpa@zytor.com>
Wed, 13 May 2009 22:29:13 +0000 (15:29 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 13 May 2009 22:29:13 +0000 (15:29 -0700)
When executing pm_call, only enable interrupts in PM if we were called
with interrupts enabled in RM.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/pm.inc

index 46acded..bcc95ce 100644 (file)
@@ -47,7 +47,11 @@ pm_call:
 
                bits 32
 .pm:
+               ; EAX points to the top of the RM stack, which is EFLAGS
+               test byte [eax+1],02h           ; RM EFLAGS.IF
+               jz .no_sti
                sti
+.no_sti:
                call edx
                mov bx,.rm
                jmp enter_rm