X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FIpf%2FCpuBreakpoint.c;h=0097d991ebf2ae2bb75b10282672621dc92b79eb;hp=7923e92fa96ef9831f8f5296b2c11bc8b805dc7b;hb=a69c49fc119ae22e62acd00da011fb9e2bfa433f;hpb=97d92bdaf05d9307d494444cead97c41272eca62 diff --git a/MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c b/MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c index 7923e92fa9..0097d991eb 100644 --- a/MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c +++ b/MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c @@ -19,6 +19,22 @@ #pragma intrinsic (__break) #pragma intrinsic (__mfa) +typedef struct { + UINT64 Status; + UINT64 r9; + UINT64 r10; + UINT64 r11; +} PAL_PROC_RETURN; + +PAL_PROC_RETURN +PalCallStatic ( + IN CONST VOID *PalEntryPoint, + IN UINT64 Arg1, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4 + ); + /** Generates a breakpoint on the CPU. @@ -82,38 +98,36 @@ EnableInterrupts ( } /** - Retrieves the current CPU interrupt state. - - Retrieves the current CPU interrupt state. Returns TRUE is interrupts are - currently enabled. Otherwise returns FALSE. + Enables CPU interrupts for the smallest window required to capture any + pending interrupts. - @retval TRUE CPU interrupts are enabled. - @retval FALSE CPU interrupts are disabled. + Enables CPU interrupts for the smallest window required to capture any + pending interrupts. **/ -BOOLEAN +VOID EFIAPI -GetInterruptState ( +EnableDisableInterrupts ( VOID ) { - return FALSE; + EnableInterrupts (); + DisableInterrupts (); } /** - Enables CPU interrupts for the smallest window required to capture any - pending interrupts. + Places the CPU in a sleep state until an interrupt is received. - Enables CPU interrupts for the smallest window required to capture any - pending interrupts. + Places the CPU in a sleep state until an interrupt is received. If interrupts + are disabled prior to calling this function, then the CPU will be placed in a + sleep state indefinitely. **/ VOID EFIAPI -EnableDisableInterrupts ( +CpuSleep ( VOID ) { - EnableInterrupts (); - DisableInterrupts (); + PalCallStatic (NULL, 29, 0, 0, 0); }