]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: CpuDxe: don't track interrupt state in a global variable
authorCohen, Eugene <eugene@hp.com>
Mon, 22 Feb 2016 23:08:27 +0000 (23:08 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 23 Feb 2016 11:07:11 +0000 (12:07 +0100)
Update the CpuDxe driver to remove an assumption that it is the only
component modifying interrupt state since this can be done through BaseLib
as well. Instead of using a global variable for last interrupt state we
now check the current PSTATE value directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmPkg/Drivers/CpuDxe/CpuDxe.c

index 0c49acb510831eb5a4e9bc43f767e091c612ed12..b1cac31d671b50e8dbb6c4b3cb037522d34de896 100644 (file)
@@ -17,8 +17,6 @@
 \r
 #include <Guid/IdleLoopEvent.h>\r
 \r
-BOOLEAN mInterruptState   = FALSE;\r
-\r
 \r
 /**\r
   This function flushes the range of addresses from Start to Start+Length\r
@@ -92,7 +90,6 @@ CpuEnableInterrupt (
 {\r
   ArmEnableInterrupts ();\r
 \r
-  mInterruptState  = TRUE;\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -114,7 +111,6 @@ CpuDisableInterrupt (
 {\r
   ArmDisableInterrupts ();\r
 \r
-  mInterruptState = FALSE;\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -143,7 +139,7 @@ CpuGetInterruptState (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  *State = mInterruptState;\r
+  *State = ArmGetInterruptState();\r
   return EFI_SUCCESS;\r
 }\r
 \r