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:49 -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:49 -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:46 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Sean Brogan , Michael D Kinney , Liming Gao , Michael Turner , Bret Barkelew Subject: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file Date: Fri, 24 May 2019 13:04:35 +0800 Message-Id: <20190524050437.38616-5-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 Add gEfiCpu2ProtocolGuid to MdePkg.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: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdePkg/Include/Protocol/Cpu2.h | 43 ++++++++++++++++++++++++++++++++++ MdePkg/MdePkg.dec | 3 +++ 2 files changed, 46 insertions(+) create mode 100644 MdePkg/Include/Protocol/Cpu2.h diff --git a/MdePkg/Include/Protocol/Cpu2.h b/MdePkg/Include/Protocol/Cpu2.h new file mode 100644 index 0000000000..cacd948140 --- /dev/null +++ b/MdePkg/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.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __PROTOCOL_CPU2_H__ +#define __PROTOCOL_CPU2_H__ + +#include + +typedef struct _EFI_CPU2_PROTOCOL EFI_CPU2_PROTOCOL; + + +/** + This function enables CPU interrupts and then waits for an interrupt to arrive. + + @param This The EFI_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 *EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)( + IN EFI_CPU2_PROTOCOL *This + ); + +// +// The EFI_CPU2_PROTOCOL is used to abstract processor-specific functions from the DXE +// Foundation. +// +struct _EFI_CPU2_PROTOCOL { + EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT EnableAndWaitForInterrupt; +}; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 6c563375ee..e8c6939849 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1803,6 +1803,9 @@ ## Include/Protocol/ShellDynamicCommand.h gEfiShellDynamicCommandProtocolGuid = { 0x3c7200e9, 0x005f, 0x4ea4, {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }} + ## Include/Protocol/Cpu2.h + gEfiCpu2ProtocolGuid = { 0x55198405, 0x26C0, 0x4765, {0x8B, 0x7D, 0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }} + # # [Error.gEfiMdePkgTokenSpaceGuid] # 0x80000001 | Invalid value provided. -- 2.21.0.windows.1