From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <liming.gao@intel.com>,
Michael Turner <Michael.Turner@microsoft.com>,
Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [PATCH 3/6] MdePkg/BaseLib: Implement EnableInterruptsAndSleep
Date: Fri, 24 May 2019 13:04:34 +0800 [thread overview]
Message-ID: <20190524050437.38616-4-zhichao.gao@intel.com> (raw)
In-Reply-To: <20190524050437.38616-1-zhichao.gao@intel.com>
From: Sean Brogan <sean.brogan@microsoft.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400
Implement EnableInterruptsAndSleep.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@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
next prev parent reply other threads:[~2019-05-24 5:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-24 5:04 [PATCH 0/6] Fix race condition and add event protocol Gao, Zhichao
2019-05-24 5:04 ` [PATCH 1/6] MdeModulePkg: Add gEdkiiCommonEventProtocolGuid for event Gao, Zhichao
2019-05-24 5:04 ` [PATCH 2/6] MdePkg/BaseLib.h: Add EnableInterruptsAndSleep function declare Gao, Zhichao
2019-05-24 5:04 ` Gao, Zhichao [this message]
2019-05-24 5:04 ` [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file Gao, Zhichao
2019-05-24 5:20 ` Liming Gao
2019-05-24 5:27 ` Gao, Zhichao
2019-05-24 5:34 ` [edk2-devel] " Yao, Jiewen
2019-05-24 5:38 ` Yao, Jiewen
2019-05-24 6:02 ` Liming Gao
2019-05-24 7:48 ` Gao, Zhichao
2019-05-24 5:04 ` [PATCH 5/6] UefiCpuPkg/CpuDxe: Implement Cpu2 protocol Gao, Zhichao
2019-05-24 5:04 ` [PATCH 6/6] MdeModulePkg/DxeMain: Implement common event protocol Gao, Zhichao
2019-05-24 5:17 ` [PATCH 0/6] Fix race condition and add " Ni, Ray
2019-05-24 7:47 ` Gao, Zhichao
2019-05-24 9:43 ` [edk2-devel] " Laszlo Ersek
2019-05-24 12:52 ` Felix Polyudov
2019-06-13 16:22 ` Liming Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190524050437.38616-4-zhichao.gao@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox