public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Hao A Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>,
	Star Zeng <star.zeng@intel.com>,
	Liming gao <liming.gao@intel.com>,
	Michael Turner <Michael.Turner@microsoft.com>,
	Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [PATCH V2 1/4] MdeModulePkg: Add gEdkiiCpu2ProtocolGuid and header file
Date: Tue,  9 Jul 2019 16:39:53 +0800	[thread overview]
Message-ID: <20190709083956.13024-2-zhichao.gao@intel.com> (raw)
In-Reply-To: <20190709083956.13024-1-zhichao.gao@intel.com>

From: Sean Brogan <sean.brogan@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400

Add gEdkiiCpu2ProtocolGuid to MdeMdeModulePkg.dec.
Add the header file of Cpu2 protocol: it has one interface
to enable interrupt and put cpu to sleep to wait for an
interrupt.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@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>
---
 MdeModulePkg/Include/Protocol/Cpu2.h | 43 ++++++++++++++++++++++++++++
 MdeModulePkg/MdeModulePkg.dec        |  3 ++
 2 files changed, 46 insertions(+)
 create mode 100644 MdeModulePkg/Include/Protocol/Cpu2.h

diff --git a/MdeModulePkg/Include/Protocol/Cpu2.h b/MdeModulePkg/Include/Protocol/Cpu2.h
new file mode 100644
index 0000000000..14464a38c8
--- /dev/null
+++ b/MdeModulePkg/Include/Protocol/Cpu2.h
@@ -0,0 +1,43 @@
+/** @file
+  CPU2 Protocol
+
+  This code abstracts the DXE core from processor implementation details.
+
+  Copyright (c) 2006 - 2018, Microsoft Corporation. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __PROTOCOL_CPU2_H__
+#define __PROTOCOL_CPU2_H__
+
+#include <Uefi.h>
+
+typedef struct _EDKII_CPU2_PROTOCOL   EDKII_CPU2_PROTOCOL;
+
+
+/**
+  This function enables CPU interrupts and then waits for an interrupt to arrive.
+
+  @param  This                  The EDKII_CPU2_PROTOCOL instance.
+
+  @retval EFI_SUCCESS           Interrupts are enabled on the processor.
+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the processor.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)(
+  IN EDKII_CPU2_PROTOCOL              *This
+  );
+
+///
+/// The EDKII_CPU2_PROTOCOL is used to abstract processor-specific functions from the DXE
+/// Foundation.
+///
+struct _EDKII_CPU2_PROTOCOL {
+  EDKII_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT            EnableAndForWaitInterrupt;
+};
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 12e0bbf579..354241c2ab 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -620,6 +620,9 @@
   ## Include/Protocol/PeCoffImageEmulator.h
   gEdkiiPeCoffImageEmulatorProtocolGuid = { 0x96f46153, 0x97a7, 0x4793, { 0xac, 0xc1, 0xfa, 0x19, 0xbf, 0x78, 0xea, 0x97 } }
 
+  ## Include/Protocol/Cpu2.h
+  gEdkiiCpu2ProtocolGuid = { 0x55198405, 0x26C0, 0x4765, {0x8B, 0x7D, 0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }}
+
 #
 # [Error.gEfiMdeModulePkgTokenSpaceGuid]
 #   0x80000001 | Invalid value provided.
-- 
2.21.0.windows.1


  reply	other threads:[~2019-07-09  8:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09  8:39 [PATCH V2 0/4] Fix race condition and add event protocol Gao, Zhichao
2019-07-09  8:39 ` Gao, Zhichao [this message]
2019-07-09  8:39 ` [PATCH V2 2/4] UefiCpuPkg/CpuDxe: Implement Cpu2 protocol Gao, Zhichao
2019-07-11  2:22   ` Dong, Eric
2019-07-11  2:36     ` Gao, Zhichao
2019-07-11 10:24       ` Laszlo Ersek
2019-07-11 10:48         ` Leif Lindholm
2019-07-09  8:39 ` [PATCH V2 3/4] MdeModulePkg: Add gEdkiiCommonEventProtocolGuid for creating event Gao, Zhichao
2019-07-09  8:39 ` [PATCH V2 4/4] MdeModulePkg/DxeMain: Implement common event protocol Gao, Zhichao
2019-07-09  9:23   ` Wang, Jian J
2019-07-10  0:24     ` Gao, Zhichao
2019-07-10  8:46       ` Wang, Jian J
2019-07-11  0:20         ` Gao, Zhichao
2019-07-11  1:26           ` Wang, Jian J
2019-07-10 12:20 ` [edk2-devel] [PATCH V2 0/4] Fix race condition and add " Laszlo Ersek

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=20190709083956.13024-2-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