From: Sean Brogan <sean.bro...@microsoft.com> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400
Implement EnableInterruptsAndSleep. Cc: Michael D Kinney <michael.d.kin...@intel.com> Cc: Liming Gao <liming....@intel.com> Cc: Sean Brogan <sean.bro...@microsoft.com> Cc: Michael Turner <michael.tur...@microsoft.com> Cc: Bret Barkelew <bret.barke...@microsoft.com> Signed-off-by: Zhichao Gao <zhichao....@intel.com> --- MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c | 18 +++++++++++++++++- .../Library/BaseLib/Ia32/EnableInterrupts.nasm | 15 ++++++++++++++- .../Library/BaseLib/X64/EnableInterrupts.nasm | 15 ++++++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c index bc03144c42..c2a84342b1 100644 --- a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c +++ b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c @@ -1,7 +1,7 @@ /** @file EnableInterrupts function - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -24,3 +24,19 @@ EnableInterrupts ( } } +/** + Enables CPU interrupts and then waits for an interrupt to arrive. + +**/ +VOID +EFIAPI +EnableInterruptsAndSleep ( + VOID + ) +{ + _asm { + sti + hlt + } +} + diff --git a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.nasm b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.nasm index 979e708207..86902f61b6 100644 --- a/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.nasm +++ b/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.nasm @@ -1,6 +1,6 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> +; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: @@ -29,3 +29,16 @@ ASM_PFX(EnableInterrupts): sti ret +;------------------------------------------------------------------------------ +; VOID +; EFIAPI +; EnableInterruptsAndSleep ( +; VOID +; ); +;------------------------------------------------------------------------------ +global ASM_PFX(EnableInterruptsAndSleep) +ASM_PFX(EnableInterruptsAndSleep): + sti + hlt + ret + diff --git a/MdePkg/Library/BaseLib/X64/EnableInterrupts.nasm b/MdePkg/Library/BaseLib/X64/EnableInterrupts.nasm index 6057afd626..de8f2ad434 100644 --- a/MdePkg/Library/BaseLib/X64/EnableInterrupts.nasm +++ b/MdePkg/Library/BaseLib/X64/EnableInterrupts.nasm @@ -1,6 +1,6 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> +; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: @@ -30,3 +30,16 @@ ASM_PFX(EnableInterrupts): sti ret +;------------------------------------------------------------------------------ +; VOID +; EFIAPI +; EnableInterruptsAndSleep ( +; VOID +; ); +;------------------------------------------------------------------------------ +global ASM_PFX(EnableInterruptsAndSleep) +ASM_PFX(EnableInterruptsAndSleep): + sti + hlt + ret + -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#41305): https://edk2.groups.io/g/devel/message/41305 Mute This Topic: https://groups.io/mt/31741730/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-