From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) Received: from mga03.intel.com (mga03.intel.com []) by groups.io with SMTP; Thu, 23 May 2019 22:04:48 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 22:04:47 -0700 X-ExtLoop1: 1 Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 23 May 2019 22:04:44 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Sean Brogan , Michael D Kinney , Liming Gao , Michael Turner , Bret Barkelew Subject: [PATCH 3/6] MdePkg/BaseLib: Implement EnableInterruptsAndSleep Date: Fri, 24 May 2019 13:04:34 +0800 Message-Id: <20190524050437.38616-4-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190524050437.38616-1-zhichao.gao@intel.com> References: <20190524050437.38616-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sean Brogan REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400 Implement EnableInterruptsAndSleep. Cc: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- 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.
+ Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
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.
+; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
; 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.
+; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
; 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