]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c
1. Simplified PalCallStatic.s's by removing unnecessary condition testings.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ipf / CpuBreakpoint.c
index 987fc9c846bb402100fd11e345e8d23f554c1323..0097d991ebf2ae2bb75b10282672621dc92b79eb 100644 (file)
 #pragma intrinsic (__break)\r
 #pragma intrinsic (__mfa)\r
 \r
+typedef struct {\r
+  UINT64                            Status;\r
+  UINT64                            r9;\r
+  UINT64                            r10;\r
+  UINT64                            r11;\r
+} PAL_PROC_RETURN;\r
+\r
+PAL_PROC_RETURN\r
+PalCallStatic (\r
+  IN      CONST VOID                *PalEntryPoint,\r
+  IN      UINT64                    Arg1,\r
+  IN      UINT64                    Arg2,\r
+  IN      UINT64                    Arg3,\r
+  IN      UINT64                    Arg4\r
+  );\r
+\r
 /**\r
   Generates a breakpoint on the CPU.\r
 \r
@@ -82,20 +98,36 @@ EnableInterrupts (
 }\r
 \r
 /**\r
-  Retrieves the current CPU interrupt state.\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnableDisableInterrupts (\r
+  VOID\r
+  )\r
+{\r
+  EnableInterrupts ();\r
+  DisableInterrupts ();\r
+}\r
 \r
-  Retrieves the current CPU interrupt state. Returns TRUE is interrupts are\r
-  currently enabled. Otherwise returns FALSE.\r
+/**\r
+  Places the CPU in a sleep state until an interrupt is received.\r
 \r
-  @retval TRUE  CPU interrupts are enabled.\r
-  @retval FALSE CPU interrupts are disabled.\r
+  Places the CPU in a sleep state until an interrupt is received. If interrupts\r
+  are disabled prior to calling this function, then the CPU will be placed in a\r
+  sleep state indefinitely.\r
 \r
 **/\r
-BOOLEAN\r
+VOID\r
 EFIAPI\r
-GetInterruptState (\r
+CpuSleep (\r
   VOID\r
   )\r
 {\r
-  return FALSE;\r
+  PalCallStatic (NULL, 29, 0, 0, 0);\r
 }\r