From nobody Fri Dec 27 03:50:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1503902460104870.6000642473878; Sun, 27 Aug 2017 23:41:00 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 863AF21DF8096; Sun, 27 Aug 2017 23:38:18 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DE55421DF8082 for ; Sun, 27 Aug 2017 23:38:15 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 27 Aug 2017 23:40:54 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.51]) by orsmga002.jf.intel.com with ESMTP; 27 Aug 2017 23:40:53 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,440,1498546800"; d="scan'208";a="128872826" From: Eric Dong To: edk2-devel@lists.01.org Date: Mon, 28 Aug 2017 14:40:48 +0800 Message-Id: <1503902448-7984-3-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1503902448-7984-1-git-send-email-eric.dong@intel.com> References: <1503902448-7984-1-git-send-email-eric.dong@intel.com> Subject: [edk2] [Patch 2/2] MdePkg: Reference new definitions for Management Mode. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In PI 1.5 version, system management mode name(SMM) has been changed to Management Mode(MM). It impacts the current code which still use SMM/Smram/SMI keywords. This patch update the original files which related to old SMM modules, also keep the compatible with old SMM related drivers. Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- MdePkg/Include/Pi/PiMultiPhase.h | 32 ++- MdePkg/Include/Pi/PiSmmCis.h | 183 ++---------- MdePkg/Include/Protocol/DxeSmmReadyToLock.h | 9 +- MdePkg/Include/Protocol/SmmAccess2.h | 103 +------ MdePkg/Include/Protocol/SmmBase2.h | 8 +- MdePkg/Include/Protocol/SmmCommunication.h | 58 +--- MdePkg/Include/Protocol/SmmConfiguration.h | 8 +- MdePkg/Include/Protocol/SmmControl2.h | 79 +----- MdePkg/Include/Protocol/SmmCpu.h | 309 +++++++----------= ---- MdePkg/Include/Protocol/SmmCpuIo2.h | 79 +----- MdePkg/Include/Protocol/SmmEndOfDxe.h | 9 +- MdePkg/Include/Protocol/SmmGpiDispatch2.h | 98 +------ MdePkg/Include/Protocol/SmmIoTrapDispatch2.h | 105 +------ MdePkg/Include/Protocol/SmmPciRootBridgeIo.h | 11 +- .../Include/Protocol/SmmPeriodicTimerDispatch2.h | 16 +- MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h | 89 +----- MdePkg/Include/Protocol/SmmReadyToLock.h | 7 +- .../Include/Protocol/SmmReportStatusCodeHandler.h | 63 +---- .../Include/Protocol/SmmStandbyButtonDispatch2.h | 89 +----- MdePkg/Include/Protocol/SmmStatusCode.h | 42 +-- MdePkg/Include/Protocol/SmmSwDispatch2.h | 8 +- MdePkg/Include/Protocol/SmmSxDispatch2.h | 111 +------- MdePkg/Include/Protocol/SmmUsbDispatch2.h | 101 +------ 23 files changed, 257 insertions(+), 1360 deletions(-) diff --git a/MdePkg/Include/Pi/PiMultiPhase.h b/MdePkg/Include/Pi/PiMultiPh= ase.h index 169258c..6839038 100644 --- a/MdePkg/Include/Pi/PiMultiPhase.h +++ b/MdePkg/Include/Pi/PiMultiPhase.h @@ -95,43 +95,49 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. ///@} =20 /// -/// SMRAM states and capabilities +/// MMRAM states and capabilities /// -#define EFI_SMRAM_OPEN 0x00000001 -#define EFI_SMRAM_CLOSED 0x00000002 -#define EFI_SMRAM_LOCKED 0x00000004 +#define EFI_MMRAM_OPEN 0x00000001 +#define EFI_MMRAM_CLOSED 0x00000002 +#define EFI_MMRAM_LOCKED 0x00000004 #define EFI_CACHEABLE 0x00000008 #define EFI_ALLOCATED 0x00000010 #define EFI_NEEDS_TESTING 0x00000020 #define EFI_NEEDS_ECC_INITIALIZATION 0x00000040 =20 +#define EFI_SMRAM_OPEN EFI_MMRAM_OPEN +#define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED +#define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED + /// -/// Structure describing a SMRAM region and its accessibility attributes. +/// Structure describing a MMRAM region and its accessibility attributes. /// typedef struct { /// - /// Designates the physical address of the SMRAM in memory. This view of= memory is=20 - /// the same as seen by I/O-based agents, for example, but it may not be= the address seen=20 + /// Designates the physical address of the MMRAM in memory. This view of= memory is + /// the same as seen by I/O-based agents, for example, but it may not be= the address seen /// by the processors. /// EFI_PHYSICAL_ADDRESS PhysicalStart; /// - /// Designates the address of the SMRAM, as seen by software executing o= n the=20 + /// Designates the address of the MMRAM, as seen by software executing o= n the /// processors. This address may or may not match PhysicalStart. /// EFI_PHYSICAL_ADDRESS CpuStart; =20 /// - /// Describes the number of bytes in the SMRAM region. + /// Describes the number of bytes in the MMRAM region. /// UINT64 PhysicalSize; /// - /// Describes the accessibility attributes of the SMRAM. These attribut= es include the=20 - /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheab= le), logical=20 - /// allocation (e.g., allocated), and pre-use initialization (e.g., need= s testing/ECC=20 + /// Describes the accessibility attributes of the MMRAM. These attribut= es include the + /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheab= le), logical + /// allocation (e.g., allocated), and pre-use initialization (e.g., need= s testing/ECC /// initialization). /// UINT64 RegionState; -} EFI_SMRAM_DESCRIPTOR; +} EFI_MMRAM_DESCRIPTOR; + +typedef EFI_MMRAM_DESCRIPTOR EFI_SMRAM_DESCRIPTOR; =20 typedef enum { EFI_PCD_TYPE_8, diff --git a/MdePkg/Include/Pi/PiSmmCis.h b/MdePkg/Include/Pi/PiSmmCis.h index 6cb28b7..4f8d5d0 100644 --- a/MdePkg/Include/Pi/PiSmmCis.h +++ b/MdePkg/Include/Pi/PiSmmCis.h @@ -16,21 +16,17 @@ #ifndef _PI_SMMCIS_H_ #define _PI_SMMCIS_H_ =20 -#include +#include #include =20 typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2; - -/// -/// The System Management System Table (SMST) signature -/// -#define SMM_SMST_SIGNATURE SIGNATURE_32 ('S', 'M', 'S', 'T') -/// -/// The System Management System Table (SMST) revision is 1.4 -/// -#define SMM_SPECIFICATION_MAJOR_REVISION 1 -#define SMM_SPECIFICATION_MINOR_REVISION 40 -#define EFI_SMM_SYSTEM_TABLE2_REVISION ((SMM_SPECIFICATION_MAJOR_REVISI= ON<<16) | (SMM_SPECIFICATION_MINOR_REVISION)) +// +// Define new MM related definition introduced by PI 1.5. +// +#define SMM_SMST_SIGNATURE MM_MMST_SIGNATURE +#define SMM_SPECIFICATION_MAJOR_REVISION MM_SPECIFICATION_MAJOR_REVISION +#define SMM_SPECIFICATION_MINOR_REVISION MM_SPECIFICATION_MINOR_REVISION +#define EFI_SMM_SYSTEM_TABLE2_REVISION EFI_MM_SYSTEM_TABLE_REVISION =20 /** Adds, updates, or removes a configuration table entry from the System Ma= nagement System Table. @@ -53,160 +49,19 @@ typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_= TABLE2; typedef EFI_STATUS (EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE2)( - IN CONST EFI_SMM_SYSTEM_TABLE2 *SystemTable, - IN CONST EFI_GUID *Guid, - IN VOID *Table, - IN UINTN TableSize - ); - -/** - This service lets the caller to get one distinct application processor (= AP) to execute - a caller-provided code stream while in SMM. - - @param[in] Procedure A pointer to the code stream to be run on= the designated - AP of the system. - @param[in] CpuNumber The zero-based index of the processor num= ber of the AP - on which the code stream is supposed to r= un. - @param[in,out] ProcArguments Allows the caller to pass a list of param= eters to the code - that is run by the AP. - - @retval EFI_SUCCESS The call was successful and the return pa= rameters are valid. - @retval EFI_INVALID_PARAMETER The input arguments are out of range. - @retval EFI_INVALID_PARAMETER The CPU requested is not available on thi= s SMI invocation. - @retval EFI_INVALID_PARAMETER The CPU cannot support an additional serv= ice invocation. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_STARTUP_THIS_AP)( - IN EFI_AP_PROCEDURE Procedure, - IN UINTN CpuNumber, - IN OUT VOID *ProcArguments OPTIONAL + IN CONST EFI_SMM_SYSTEM_TABLE2 *SystemTable, + IN CONST EFI_GUID *Guid, + IN VOID *Table, + IN UINTN TableSize ); =20 -/** - Function prototype for protocol install notification. - - @param[in] Protocol Points to the protocol's unique identifier. - @param[in] Interface Points to the interface instance. - @param[in] Handle The handle on which the interface was installed. - - @return Status Code -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_NOTIFY_FN)( - IN CONST EFI_GUID *Protocol, - IN VOID *Interface, - IN EFI_HANDLE Handle - ); - -/** - Register a callback function be called when a particular protocol interf= ace is installed. - - The SmmRegisterProtocolNotify() function creates a registration Function= that is to be=20 - called whenever a protocol interface is installed for Protocol by=20 - SmmInstallProtocolInterface(). - If Function =3D=3D NULL and Registration is an existing registration, th= en the callback is unhooked. - - @param[in] Protocol The unique ID of the protocol for which th= e event is to be registered. - @param[in] Function Points to the notification function. - @param[out] Registration A pointer to a memory location to receive = the registration value. - - @retval EFI_SUCCESS Successfully returned the registration rec= ord - that has been added or unhooked. - @retval EFI_INVALID_PARAMETER Protocol is NULL or Registration is NULL. - @retval EFI_OUT_OF_RESOURCES Not enough memory resource to finish the r= equest. - @retval EFI_NOT_FOUND If the registration is not found when Func= tion =3D=3D NULL. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_REGISTER_PROTOCOL_NOTIFY)( - IN CONST EFI_GUID *Protocol, - IN EFI_SMM_NOTIFY_FN Function, - OUT VOID **Registration - ); - -/** - Manage SMI of a particular type. - - @param[in] HandlerType Points to the handler type or NULL for ro= ot SMI handlers. - @param[in] Context Points to an optional context buffer. - @param[in,out] CommBuffer Points to the optional communication buff= er. - @param[in,out] CommBufferSize Points to the size of the optional commun= ication buffer. - - @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was processe= d successfully but not quiesced. - @retval EFI_INTERRUPT_PENDING One or more SMI sources could= not be quiesced. - @retval EFI_NOT_FOUND Interrupt source was not hand= led or quiesced. - @retval EFI_SUCCESS Interrupt source was handled = and quiesced. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_INTERRUPT_MANAGE)( - IN CONST EFI_GUID *HandlerType, - IN CONST VOID *Context OPTIONAL, - IN OUT VOID *CommBuffer OPTIONAL, - IN OUT UINTN *CommBufferSize OPTIONAL - ); - -/** - Main entry point for an SMM handler dispatch or communicate-based callba= ck. - - @param[in] DispatchHandle The unique handle assigned to this handle= r by SmiHandlerRegister(). - @param[in] Context Points to an optional handler context whi= ch was specified when the - handler was registered. - @param[in,out] CommBuffer A pointer to a collection of data in memo= ry that will - be conveyed from a non-SMM environment in= to an SMM environment. - @param[in,out] CommBufferSize The size of the CommBuffer. - - @retval EFI_SUCCESS The interrupt was handled an= d quiesced. No other handlers=20 - should still be called. - @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quies= ced but other handlers should=20 - still be called. - @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pendi= ng and other handlers should still=20 - be called. - @retval EFI_INTERRUPT_PENDING The interrupt could not be q= uiesced. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT2)( - IN EFI_HANDLE DispatchHandle, - IN CONST VOID *Context OPTIONAL, - IN OUT VOID *CommBuffer OPTIONAL, - IN OUT UINTN *CommBufferSize OPTIONAL - ); - -/** - Registers a handler to execute within SMM. - - @param[in] Handler Handler service function pointer. - @param[in] HandlerType Points to the handler type or NULL for ro= ot SMI handlers. - @param[out] DispatchHandle On return, contains a unique handle which= can be used to later - unregister the handler function. - - @retval EFI_SUCCESS SMI handler added successfully. - @retval EFI_INVALID_PARAMETER Handler is NULL or DispatchHandle is NULL. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_INTERRUPT_REGISTER)( - IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler, - IN CONST EFI_GUID *HandlerType OPTIONAL, - OUT EFI_HANDLE *DispatchHandle - ); - -/** - Unregister a handler in SMM. - - @param[in] DispatchHandle The handle that was specified when the ha= ndler was registered. - - @retval EFI_SUCCESS Handler function was successfully unregis= tered. - @retval EFI_INVALID_PARAMETER DispatchHandle does not refer to a valid = handle. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_INTERRUPT_UNREGISTER)( - IN EFI_HANDLE DispatchHandle - ); +typedef EFI_MM_STARTUP_THIS_AP EFI_SMM_STARTUP_THIS_AP; +typedef EFI_MM_NOTIFY_FN EFI_SMM_NOTIFY_FN; +typedef EFI_MM_REGISTER_PROTOCOL_NOTIFY EFI_SMM_REGISTER_PROTOCOL_N= OTIFY; +typedef EFI_MM_INTERRUPT_MANAGE EFI_SMM_INTERRUPT_MANAGE; +typedef EFI_MM_HANDLER_ENTRY_POINT EFI_SMM_HANDLER_ENTRY_POINT= 2; +typedef EFI_MM_INTERRUPT_REGISTER EFI_SMM_INTERRUPT_REGISTER; +typedef EFI_MM_INTERRUPT_UNREGISTER EFI_SMM_INTERRUPT_UNREGISTE= R; =20 /// /// Processor information and functionality needed by SMM Foundation. diff --git a/MdePkg/Include/Protocol/DxeSmmReadyToLock.h b/MdePkg/Include/P= rotocol/DxeSmmReadyToLock.h index a52a8a2..1bb2535 100644 --- a/MdePkg/Include/Protocol/DxeSmmReadyToLock.h +++ b/MdePkg/Include/Protocol/DxeSmmReadyToLock.h @@ -17,7 +17,7 @@ platform code may choose to use notification handler to lock SMM by invo= king EFI_SMM_ACCESS2_PROTOCOL.Lock() function. =20 - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -31,10 +31,9 @@ #ifndef _DXE_SMM_READY_TO_LOCK_H_ #define _DXE_SMM_READY_TO_LOCK_H_ =20 -#define EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL_GUID \ - { \ - 0x60ff8964, 0xe906, 0x41d0, { 0xaf, 0xed, 0xf2, 0x41, 0xe9, 0x74, 0xe0= , 0x8e } \ - } +#include + +#define EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL_GUID EFI_DXE_MM_READY_TO_LOCK_P= ROTOCOL_GUID =20 extern EFI_GUID gEfiDxeSmmReadyToLockProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmAccess2.h b/MdePkg/Include/Protocol= /SmmAccess2.h index 5904266..3dc15fe 100644 --- a/MdePkg/Include/Protocol/SmmAccess2.h +++ b/MdePkg/Include/Protocol/SmmAccess2.h @@ -25,108 +25,19 @@ #ifndef _SMM_ACCESS2_H_ #define _SMM_ACCESS2_H_ =20 -#define EFI_SMM_ACCESS2_PROTOCOL_GUID \ - { \ - 0xc2702b74, 0x800c, 0x4131, {0x87, 0x46, 0x8f, 0xb5, 0xb8, 0x9c, 0xe4= , 0xac } \ - } +#include =20 +#define EFI_SMM_ACCESS2_PROTOCOL_GUID EFI_MM_ACCESS_PROTOCOL_GUID =20 -typedef struct _EFI_SMM_ACCESS2_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL; +typedef EFI_MM_ACCESS_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL; =20 -/** - Opens the SMRAM area to be accessible by a boot-service driver. +typedef EFI_MM_OPEN EFI_SMM_OPEN2; =20 - This function "opens" SMRAM so that it is visible while not inside of SM= M. The function should=20 - return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM.= The function=20 - should return EFI_DEVICE_ERROR if the SMRAM configuration is locked. +typedef EFI_MM_CLOSE EFI_SMM_CLOSE2; =20 - @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance. - - @retval EFI_SUCCESS The operation was successful. - @retval EFI_UNSUPPORTED The system does not support opening and closin= g of SMRAM. - @retval EFI_DEVICE_ERROR SMRAM cannot be opened, perhaps because it is = locked. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_OPEN2)( - IN EFI_SMM_ACCESS2_PROTOCOL *This - ); - -/** - Inhibits access to the SMRAM. - - This function "closes" SMRAM so that it is not visible while outside of = SMM. The function should=20 - return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM. - - @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance. - - @retval EFI_SUCCESS The operation was successful. - @retval EFI_UNSUPPORTED The system does not support opening and closin= g of SMRAM. - @retval EFI_DEVICE_ERROR SMRAM cannot be closed. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_CLOSE2)( - IN EFI_SMM_ACCESS2_PROTOCOL *This - ); - -/** - Inhibits access to the SMRAM. - - This function prohibits access to the SMRAM region. This function is us= ually implemented such=20 - that it is a write-once operation.=20 - - @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance. - - @retval EFI_SUCCESS The device was successfully locked. - @retval EFI_UNSUPPORTED The system does not support locking of SMRAM. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_LOCK2)( - IN EFI_SMM_ACCESS2_PROTOCOL *This - ); - -/** - Queries the memory controller for the possible regions that will support= SMRAM. - - @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance. - @param[in,out] SmramMapSize A pointer to the size, in bytes, of the Sm= ramMemoryMap buffer. - @param[in,out] SmramMap A pointer to the buffer in which firmware = places the current memory map. - - @retval EFI_SUCCESS The chipset supported the given resource. - @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small. The= current buffer size=20 - needed to hold the memory map is returned = in SmramMapSize. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_CAPABILITIES2)( - IN CONST EFI_SMM_ACCESS2_PROTOCOL *This, - IN OUT UINTN *SmramMapSize, - IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap - ); - -/// -/// EFI SMM Access2 Protocol is used to control the visibility of the SMR= AM on the platform. -/// It abstracts the location and characteristics of SMRAM. The platform = should report all=20 -/// MMRAM via EFI_MM_ACCESS_PROTOCOL. The expectation is that the north b= ridge or memory=20 -/// controller would publish this protocol. -///=20 -struct _EFI_SMM_ACCESS2_PROTOCOL { - EFI_SMM_OPEN2 Open; - EFI_SMM_CLOSE2 Close; - EFI_SMM_LOCK2 Lock; - EFI_SMM_CAPABILITIES2 GetCapabilities; - /// - /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is lo= cked. - /// - BOOLEAN LockState; - /// - /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is op= en. - /// - BOOLEAN OpenState; -}; +typedef EFI_MM_LOCK EFI_SMM_LOCK2; =20 +typedef EFI_MM_CAPABILITIES EFI_SMM_CAPABILITIES2; extern EFI_GUID gEfiSmmAccess2ProtocolGuid; =20 #endif diff --git a/MdePkg/Include/Protocol/SmmBase2.h b/MdePkg/Include/Protocol/S= mmBase2.h index d60428c..0033e4e 100644 --- a/MdePkg/Include/Protocol/SmmBase2.h +++ b/MdePkg/Include/Protocol/SmmBase2.h @@ -4,7 +4,7 @@ This protocol is utilized by all SMM drivers to locate the SMM infrastru= cture services and determine whether the driver is being invoked inside SMRAM or outside of SMRAM. =20 - Copyright (c) 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BS= D License =20 which accompanies this distribution. The full text of the license may b= e found at =20 @@ -19,11 +19,9 @@ #define _SMM_BASE2_H_ =20 #include +#include =20 -#define EFI_SMM_BASE2_PROTOCOL_GUID \ - { \ - 0xf4ccbfb7, 0xf6e0, 0x47fd, {0x9d, 0xd4, 0x10, 0xa8, 0xf1, 0x50, 0xc1,= 0x91 } \ - } +#define EFI_SMM_BASE2_PROTOCOL_GUID EFI_MM_BASE_PROTOCOL_GUID =20 typedef struct _EFI_SMM_BASE2_PROTOCOL EFI_SMM_BASE2_PROTOCOL; =20 diff --git a/MdePkg/Include/Protocol/SmmCommunication.h b/MdePkg/Include/Pr= otocol/SmmCommunication.h index 5587d49..95b8d0d 100644 --- a/MdePkg/Include/Protocol/SmmCommunication.h +++ b/MdePkg/Include/Protocol/SmmCommunication.h @@ -18,64 +18,14 @@ #ifndef _SMM_COMMUNICATION_H_ #define _SMM_COMMUNICATION_H_ =20 -#pragma pack(1) +#include =20 -/// -/// To avoid confusion in interpreting frames, the communication buffer sh= ould always=20 -/// begin with EFI_SMM_COMMUNICATE_HEADER -/// -typedef struct { - /// - /// Allows for disambiguation of the message format. - /// - EFI_GUID HeaderGuid; - /// - /// Describes the size of Data (in bytes) and does not include the size = of the header. - /// - UINTN MessageLength; - /// - /// Designates an array of bytes that is MessageLength in size. - /// - UINT8 Data[1]; -} EFI_SMM_COMMUNICATE_HEADER; =20 -#pragma pack() +typedef EFI_MM_COMMUNICATE_HEADER EFI_SMM_COMMUNICATE_HEADER; =20 -#define EFI_SMM_COMMUNICATION_PROTOCOL_GUID \ - { \ - 0xc68ed8e2, 0x9dc6, 0x4cbd, { 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3= , 0x32 } \ - } +#define EFI_SMM_COMMUNICATION_PROTOCOL_GUID EFI_MM_COMMUNICATION_PROTOCOL_= GUID =20 -typedef struct _EFI_SMM_COMMUNICATION_PROTOCOL EFI_SMM_COMMUNICATION_PROT= OCOL; - -/** - Communicates with a registered handler. - =20 - This function provides a service to send and receive messages from a reg= istered UEFI service. - - @param[in] This The EFI_SMM_COMMUNICATION_PROTOCOL instan= ce. - @param[in] CommBuffer A pointer to the buffer to convey into SM= RAM. - @param[in] CommSize The size of the data buffer being passed = in.On exit, the size of data - being returned. Zero if the handler does = not wish to reply with any data. - - @retval EFI_SUCCESS The message was successfully posted. - @retval EFI_INVALID_PARAMETER The CommBuffer was NULL. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_COMMUNICATE2)( - IN CONST EFI_SMM_COMMUNICATION_PROTOCOL *This, - IN OUT VOID *CommBuffer, - IN OUT UINTN *CommSize - ); - -/// -/// EFI SMM Communication Protocol provides runtime services for communica= ting -/// between DXE drivers and a registered SMI handler. -/// -struct _EFI_SMM_COMMUNICATION_PROTOCOL { - EFI_SMM_COMMUNICATE2 Communicate; -}; +typedef EFI_MM_COMMUNICATION_PROTOCOL EFI_SMM_COMMUNICATION_PROTOCOL; =20 extern EFI_GUID gEfiSmmCommunicationProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmConfiguration.h b/MdePkg/Include/Pr= otocol/SmmConfiguration.h index 3674831..af47edb 100644 --- a/MdePkg/Include/Protocol/SmmConfiguration.h +++ b/MdePkg/Include/Protocol/SmmConfiguration.h @@ -6,7 +6,7 @@ 2) register the SMM Foundation entry point with the processor code. The = entry point will be invoked by the SMM processor entry code. =20 - Copyright (c) 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BS= D License =20 which accompanies this distribution. The full text of the license may b= e found at =20 @@ -20,12 +20,10 @@ #ifndef _SMM_CONFIGURATION_H_ #define _SMM_CONFIGURATION_H_ =20 +#include #include =20 -#define EFI_SMM_CONFIGURATION_PROTOCOL_GUID \ - { \ - 0x26eeb3de, 0xb689, 0x492e, {0x80, 0xf0, 0xbe, 0x8b, 0xd7, 0xda, 0x4b,= 0xa7 } \ - } +#define EFI_SMM_CONFIGURATION_PROTOCOL_GUID EFI_MM_CONFIGURATION_PROTOCOL_= GUID =20 /// /// Structure describing a SMRAM region which cannot be used for the SMRAM= heap. diff --git a/MdePkg/Include/Protocol/SmmControl2.h b/MdePkg/Include/Protoco= l/SmmControl2.h index 58df62a..7177f8e 100644 --- a/MdePkg/Include/Protocol/SmmControl2.h +++ b/MdePkg/Include/Protocol/SmmControl2.h @@ -11,7 +11,7 @@ accessed, will generate the SMI. Also, the hardware optionally supports= the periodic generation of=20 these signals. =20 - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BS= D License =20 which accompanies this distribution. The full text of the license may b= e found at =20 @@ -25,81 +25,16 @@ #ifndef _SMM_CONTROL2_H_ #define _SMM_CONTROL2_H_ =20 -#include +#include =20 -#define EFI_SMM_CONTROL2_PROTOCOL_GUID \ - { \ - 0x843dc720, 0xab1e, 0x42cb, {0x93, 0x57, 0x8a, 0x0, 0x78, 0xf3, 0x56, = 0x1b} \ - } +#define EFI_SMM_CONTROL2_PROTOCOL_GUID EFI_MM_CONTROL_PROTOCOL_GUID =20 -typedef struct _EFI_SMM_CONTROL2_PROTOCOL EFI_SMM_CONTROL2_PROTOCOL; -typedef UINTN EFI_SMM_PERIOD; +typedef EFI_MM_CONTROL_PROTOCOL EFI_SMM_CONTROL2_PROTOCOL; +typedef EFI_MM_PERIOD EFI_SMM_PERIOD; =20 -/** - Invokes SMI activation from either the preboot or runtime environment. - - This function generates an SMI. - - @param[in] This The EFI_SMM_CONTROL2_PROTOCOL instanc= e. - @param[in,out] CommandPort The value written to the command port. - @param[in,out] DataPort The value written to the data port. - @param[in] Periodic Optional mechanism to engender a peri= odic stream. - @param[in] ActivationInterval Optional parameter to repeat at this = period one - time or, if the Periodic Boolean is s= et, periodically. - - @retval EFI_SUCCESS The SMI/PMI has been engendered. - @retval EFI_DEVICE_ERROR The timing is unsupported. - @retval EFI_INVALID_PARAMETER The activation period is unsupported. - @retval EFI_INVALID_PARAMETER The last periodic activation has not been= cleared.=20 - @retval EFI_NOT_STARTED The SMM base service has not been initial= ized. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_ACTIVATE2)( - IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, - IN OUT UINT8 *CommandPort OPTIONAL, - IN OUT UINT8 *DataPort OPTIONAL, - IN BOOLEAN Periodic OPTIONAL, - IN UINTN ActivationInterval OPTIONAL - ); - -/** - Clears any system state that was created in response to the Trigger() ca= ll. - - This function acknowledges and causes the deassertion of the SMI activat= ion source. - - @param[in] This The EFI_SMM_CONTROL2_PROTOCOL instance. - @param[in] Periodic Optional parameter to repeat at this peri= od one time - - @retval EFI_SUCCESS The SMI/PMI has been engendered. - @retval EFI_DEVICE_ERROR The source could not be cleared. - @retval EFI_INVALID_PARAMETER The service did not support the Periodic = input argument. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_DEACTIVATE2)( - IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, - IN BOOLEAN Periodic OPTIONAL - ); - -/// -/// The EFI_SMM_CONTROL2_PROTOCOL is produced by a runtime driver. It prov= ides an=20 -/// abstraction of the platform hardware that generates an SMI. There are= often I/O ports that, when=20 -/// accessed, will generate the SMI. Also, the hardware optionally suppor= ts the periodic generation of=20 -/// these signals. -/// -struct _EFI_SMM_CONTROL2_PROTOCOL { - EFI_SMM_ACTIVATE2 Trigger; - EFI_SMM_DEACTIVATE2 Clear; - /// - /// Minimum interval at which the platform can set the period. A maximu= m is not=20 - /// specified in that the SMM infrastructure code can emulate a maximum = interval that is=20 - /// greater than the hardware capabilities by using software emulation i= n the SMM=20 - /// infrastructure code. - /// - EFI_SMM_PERIOD MinimumTriggerPeriod; -}; +typedef EFI_MM_ACTIVATE EFI_SMM_ACTIVATE2; =20 +typedef EFI_MM_DEACTIVATE EFI_SMM_DEACTIVATE2; extern EFI_GUID gEfiSmmControl2ProtocolGuid; =20 #endif diff --git a/MdePkg/Include/Protocol/SmmCpu.h b/MdePkg/Include/Protocol/Smm= Cpu.h index 2e7f7c3..117b9a3 100644 --- a/MdePkg/Include/Protocol/SmmCpu.h +++ b/MdePkg/Include/Protocol/SmmCpu.h @@ -6,7 +6,7 @@ but not in the same format. These so-called pseudo-registers provide thi= s information in a standard=20 format. =20 =20 - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BS= D License =20 which accompanies this distribution. The full text of the license may b= e found at =20 @@ -20,227 +20,116 @@ #ifndef _SMM_CPU_H_ #define _SMM_CPU_H_ =20 -#define EFI_SMM_CPU_PROTOCOL_GUID \ - { \ - 0xeb346b97, 0x975f, 0x4a9f, { 0x8b, 0x22, 0xf8, 0xe9, 0x2b, 0xb3, 0xd5= , 0x69 } \ - } +#include + +#define EFI_SMM_CPU_PROTOCOL_GUID EFI_MM_CPU_PROTOCOL_GUID + +#define EFI_SMM_SAVE_STATE_REGISTER_GDTBASE EFI_MM_SAVE_STATE_REGIST= ER_GDTBASE +#define EFI_SMM_SAVE_STATE_REGISTER_IDTBASE EFI_MM_SAVE_STATE_REGIST= ER_IDTBASE +#define EFI_SMM_SAVE_STATE_REGISTER_LDTBASE EFI_MM_SAVE_STATE_REGIST= ER_LDTBASE +#define EFI_SMM_SAVE_STATE_REGISTER_GDTLIMIT EFI_MM_SAVE_STATE_REGIST= ER_GDTLIMIT +#define EFI_SMM_SAVE_STATE_REGISTER_IDTLIMIT EFI_MM_SAVE_STATE_REGIST= ER_IDTLIMIT +#define EFI_SMM_SAVE_STATE_REGISTER_LDTLIMIT EFI_MM_SAVE_STATE_REGIST= ER_LDTLIMIT +#define EFI_SMM_SAVE_STATE_REGISTER_LDTINFO EFI_MM_SAVE_STATE_REGIST= ER_LDTINFO +#define EFI_SMM_SAVE_STATE_REGISTER_ES EFI_MM_SAVE_STATE_REGIST= ER_ES +#define EFI_SMM_SAVE_STATE_REGISTER_CS EFI_MM_SAVE_STATE_REGIST= ER_CS +#define EFI_SMM_SAVE_STATE_REGISTER_SS EFI_MM_SAVE_STATE_REGIST= ER_SS +#define EFI_SMM_SAVE_STATE_REGISTER_DS EFI_MM_SAVE_STATE_REGIST= ER_DS +#define EFI_SMM_SAVE_STATE_REGISTER_FS EFI_MM_SAVE_STATE_REGIST= ER_FS +#define EFI_SMM_SAVE_STATE_REGISTER_GS EFI_MM_SAVE_STATE_REGIST= ER_GS +#define EFI_SMM_SAVE_STATE_REGISTER_LDTR_SEL EFI_MM_SAVE_STATE_REGIST= ER_LDTR_SEL +#define EFI_SMM_SAVE_STATE_REGISTER_TR_SEL EFI_MM_SAVE_STATE_REGIST= ER_TR_SEL +#define EFI_SMM_SAVE_STATE_REGISTER_DR7 EFI_MM_SAVE_STATE_REGIST= ER_DR7 +#define EFI_SMM_SAVE_STATE_REGISTER_DR6 EFI_MM_SAVE_STATE_REGIST= ER_DR6 +#define EFI_SMM_SAVE_STATE_REGISTER_R8 EFI_MM_SAVE_STATE_REGIST= ER_R8 +#define EFI_SMM_SAVE_STATE_REGISTER_R9 EFI_MM_SAVE_STATE_REGIST= ER_R9 +#define EFI_SMM_SAVE_STATE_REGISTER_R10 EFI_MM_SAVE_STATE_REGIST= ER_R10 +#define EFI_SMM_SAVE_STATE_REGISTER_R11 EFI_MM_SAVE_STATE_REGIST= ER_R11 +#define EFI_SMM_SAVE_STATE_REGISTER_R12 EFI_MM_SAVE_STATE_REGIST= ER_R12 +#define EFI_SMM_SAVE_STATE_REGISTER_R13 EFI_MM_SAVE_STATE_REGIST= ER_R13 +#define EFI_SMM_SAVE_STATE_REGISTER_R14 EFI_MM_SAVE_STATE_REGIST= ER_R14 +#define EFI_SMM_SAVE_STATE_REGISTER_R15 EFI_MM_SAVE_STATE_REGIST= ER_R15 +#define EFI_SMM_SAVE_STATE_REGISTER_RAX EFI_MM_SAVE_STATE_REGIST= ER_RAX +#define EFI_SMM_SAVE_STATE_REGISTER_RBX EFI_MM_SAVE_STATE_REGIST= ER_RBX +#define EFI_SMM_SAVE_STATE_REGISTER_RCX EFI_MM_SAVE_STATE_REGIST= ER_RCX +#define EFI_SMM_SAVE_STATE_REGISTER_RDX EFI_MM_SAVE_STATE_REGIST= ER_RDX +#define EFI_SMM_SAVE_STATE_REGISTER_RSP EFI_MM_SAVE_STATE_REGIST= ER_RSP +#define EFI_SMM_SAVE_STATE_REGISTER_RBP EFI_MM_SAVE_STATE_REGIST= ER_RBP +#define EFI_SMM_SAVE_STATE_REGISTER_RSI EFI_MM_SAVE_STATE_REGIST= ER_RSI +#define EFI_SMM_SAVE_STATE_REGISTER_RDI EFI_MM_SAVE_STATE_REGIST= ER_RDI +#define EFI_SMM_SAVE_STATE_REGISTER_RIP EFI_MM_SAVE_STATE_REGIST= ER_RIP +#define EFI_SMM_SAVE_STATE_REGISTER_RFLAGS EFI_MM_SAVE_STATE_REGIST= ER_RFLAGS +#define EFI_SMM_SAVE_STATE_REGISTER_CR0 EFI_MM_SAVE_STATE_REGIST= ER_CR0 +#define EFI_SMM_SAVE_STATE_REGISTER_CR3 EFI_MM_SAVE_STATE_REGIST= ER_CR3 +#define EFI_SMM_SAVE_STATE_REGISTER_CR4 EFI_MM_SAVE_STATE_REGIST= ER_CR4 +#define EFI_SMM_SAVE_STATE_REGISTER_FCW EFI_MM_SAVE_STATE_REGIST= ER_FCW +#define EFI_SMM_SAVE_STATE_REGISTER_FSW EFI_MM_SAVE_STATE_REGIST= ER_FSW +#define EFI_SMM_SAVE_STATE_REGISTER_FTW EFI_MM_SAVE_STATE_REGIST= ER_FTW +#define EFI_SMM_SAVE_STATE_REGISTER_OPCODE EFI_MM_SAVE_STATE_REGIST= ER_OPCODE +#define EFI_SMM_SAVE_STATE_REGISTER_FP_EIP EFI_MM_SAVE_STATE_REGIST= ER_FP_EIP +#define EFI_SMM_SAVE_STATE_REGISTER_FP_CS EFI_MM_SAVE_STATE_REGIST= ER_FP_CS +#define EFI_SMM_SAVE_STATE_REGISTER_DATAOFFSET EFI_MM_SAVE_STATE_REGIST= ER_DATAOFFSET +#define EFI_SMM_SAVE_STATE_REGISTER_FP_DS EFI_MM_SAVE_STATE_REGIST= ER_FP_DS +#define EFI_SMM_SAVE_STATE_REGISTER_MM0 EFI_MM_SAVE_STATE_REGIST= ER_MM0 +#define EFI_SMM_SAVE_STATE_REGISTER_MM1 EFI_MM_SAVE_STATE_REGIST= ER_MM1 +#define EFI_SMM_SAVE_STATE_REGISTER_MM2 EFI_MM_SAVE_STATE_REGIST= ER_MM2 +#define EFI_SMM_SAVE_STATE_REGISTER_MM3 EFI_MM_SAVE_STATE_REGIST= ER_MM3 +#define EFI_SMM_SAVE_STATE_REGISTER_MM4 EFI_MM_SAVE_STATE_REGIST= ER_MM4 +#define EFI_SMM_SAVE_STATE_REGISTER_MM5 EFI_MM_SAVE_STATE_REGIST= ER_MM5 +#define EFI_SMM_SAVE_STATE_REGISTER_MM6 EFI_MM_SAVE_STATE_REGIST= ER_MM6 +#define EFI_SMM_SAVE_STATE_REGISTER_MM7 EFI_MM_SAVE_STATE_REGIST= ER_MM7 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM0 EFI_MM_SAVE_STATE_REGIST= ER_XMM0 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM1 EFI_MM_SAVE_STATE_REGIST= ER_XMM1 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM2 EFI_MM_SAVE_STATE_REGIST= ER_XMM2 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM3 EFI_MM_SAVE_STATE_REGIST= ER_XMM3 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM4 EFI_MM_SAVE_STATE_REGIST= ER_XMM4 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM5 EFI_MM_SAVE_STATE_REGIST= ER_XMM5 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM6 EFI_MM_SAVE_STATE_REGIST= ER_XMM6 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM7 EFI_MM_SAVE_STATE_REGIST= ER_XMM7 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM8 EFI_MM_SAVE_STATE_REGIST= ER_XMM8 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM9 EFI_MM_SAVE_STATE_REGIST= ER_XMM9 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM10 EFI_MM_SAVE_STATE_REGIST= ER_XMM10 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM11 EFI_MM_SAVE_STATE_REGIST= ER_XMM11 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM12 EFI_MM_SAVE_STATE_REGIST= ER_XMM12 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM13 EFI_MM_SAVE_STATE_REGIST= ER_XMM13 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM14 EFI_MM_SAVE_STATE_REGIST= ER_XMM14 +#define EFI_SMM_SAVE_STATE_REGISTER_XMM15 EFI_MM_SAVE_STATE_REGIST= ER_XMM15 +#define EFI_SMM_SAVE_STATE_REGISTER_IO EFI_MM_SAVE_STATE_REGIST= ER_IO +#define EFI_SMM_SAVE_STATE_REGISTER_LMA EFI_MM_SAVE_STATE_REGIST= ER_LMA +#define EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID EFI_MM_SAVE_STATE_REGIST= ER_PROCESSOR_ID + +typedef EFI_MM_SAVE_STATE_REGISTER EFI_SMM_SAVE_STATE_REGISTER; + + +#define EFI_SMM_SAVE_STATE_REGISTER_LMA_32BIT EFI_MM_SAVE_STATE_REGISTER_L= MA_32BIT +#define EFI_SMM_SAVE_STATE_REGISTER_LMA_64BIT EFI_MM_SAVE_STATE_REGISTER_L= MA_64BIT =20 -/// -/// Save State register index -/// -typedef enum { - /// - /// x86/X64 standard registers - /// - EFI_SMM_SAVE_STATE_REGISTER_GDTBASE =3D 4, - EFI_SMM_SAVE_STATE_REGISTER_IDTBASE =3D 5, - EFI_SMM_SAVE_STATE_REGISTER_LDTBASE =3D 6, - EFI_SMM_SAVE_STATE_REGISTER_GDTLIMIT =3D 7, - EFI_SMM_SAVE_STATE_REGISTER_IDTLIMIT =3D 8, - EFI_SMM_SAVE_STATE_REGISTER_LDTLIMIT =3D 9, - EFI_SMM_SAVE_STATE_REGISTER_LDTINFO =3D 10, - EFI_SMM_SAVE_STATE_REGISTER_ES =3D 20, - EFI_SMM_SAVE_STATE_REGISTER_CS =3D 21, - EFI_SMM_SAVE_STATE_REGISTER_SS =3D 22, - EFI_SMM_SAVE_STATE_REGISTER_DS =3D 23, - EFI_SMM_SAVE_STATE_REGISTER_FS =3D 24, - EFI_SMM_SAVE_STATE_REGISTER_GS =3D 25, - EFI_SMM_SAVE_STATE_REGISTER_LDTR_SEL =3D 26, - EFI_SMM_SAVE_STATE_REGISTER_TR_SEL =3D 27, - EFI_SMM_SAVE_STATE_REGISTER_DR7 =3D 28, - EFI_SMM_SAVE_STATE_REGISTER_DR6 =3D 29, - EFI_SMM_SAVE_STATE_REGISTER_R8 =3D 30, - EFI_SMM_SAVE_STATE_REGISTER_R9 =3D 31, - EFI_SMM_SAVE_STATE_REGISTER_R10 =3D 32, - EFI_SMM_SAVE_STATE_REGISTER_R11 =3D 33, - EFI_SMM_SAVE_STATE_REGISTER_R12 =3D 34, - EFI_SMM_SAVE_STATE_REGISTER_R13 =3D 35, - EFI_SMM_SAVE_STATE_REGISTER_R14 =3D 36, - EFI_SMM_SAVE_STATE_REGISTER_R15 =3D 37, =20 - EFI_SMM_SAVE_STATE_REGISTER_RAX =3D 38, - EFI_SMM_SAVE_STATE_REGISTER_RBX =3D 39, - EFI_SMM_SAVE_STATE_REGISTER_RCX =3D 40, - EFI_SMM_SAVE_STATE_REGISTER_RDX =3D 41, - EFI_SMM_SAVE_STATE_REGISTER_RSP =3D 42, - EFI_SMM_SAVE_STATE_REGISTER_RBP =3D 43, - EFI_SMM_SAVE_STATE_REGISTER_RSI =3D 44, - EFI_SMM_SAVE_STATE_REGISTER_RDI =3D 45, - EFI_SMM_SAVE_STATE_REGISTER_RIP =3D 46, - EFI_SMM_SAVE_STATE_REGISTER_RFLAGS =3D 51, - EFI_SMM_SAVE_STATE_REGISTER_CR0 =3D 52, - EFI_SMM_SAVE_STATE_REGISTER_CR3 =3D 53, - EFI_SMM_SAVE_STATE_REGISTER_CR4 =3D 54, - EFI_SMM_SAVE_STATE_REGISTER_FCW =3D 256, - EFI_SMM_SAVE_STATE_REGISTER_FSW =3D 257, - EFI_SMM_SAVE_STATE_REGISTER_FTW =3D 258, =20 - EFI_SMM_SAVE_STATE_REGISTER_OPCODE =3D 259, - EFI_SMM_SAVE_STATE_REGISTER_FP_EIP =3D 260, - EFI_SMM_SAVE_STATE_REGISTER_FP_CS =3D 261, - EFI_SMM_SAVE_STATE_REGISTER_DATAOFFSET =3D 262, - EFI_SMM_SAVE_STATE_REGISTER_FP_DS =3D 263, - EFI_SMM_SAVE_STATE_REGISTER_MM0 =3D 264, - EFI_SMM_SAVE_STATE_REGISTER_MM1 =3D 265, - EFI_SMM_SAVE_STATE_REGISTER_MM2 =3D 266, - EFI_SMM_SAVE_STATE_REGISTER_MM3 =3D 267, - EFI_SMM_SAVE_STATE_REGISTER_MM4 =3D 268, - EFI_SMM_SAVE_STATE_REGISTER_MM5 =3D 269, - EFI_SMM_SAVE_STATE_REGISTER_MM6 =3D 270, - EFI_SMM_SAVE_STATE_REGISTER_MM7 =3D 271, - EFI_SMM_SAVE_STATE_REGISTER_XMM0 =3D 272, - EFI_SMM_SAVE_STATE_REGISTER_XMM1 =3D 273, - EFI_SMM_SAVE_STATE_REGISTER_XMM2 =3D 274, - EFI_SMM_SAVE_STATE_REGISTER_XMM3 =3D 275, - EFI_SMM_SAVE_STATE_REGISTER_XMM4 =3D 276, - EFI_SMM_SAVE_STATE_REGISTER_XMM5 =3D 277, - EFI_SMM_SAVE_STATE_REGISTER_XMM6 =3D 278, - EFI_SMM_SAVE_STATE_REGISTER_XMM7 =3D 279, - EFI_SMM_SAVE_STATE_REGISTER_XMM8 =3D 280, - EFI_SMM_SAVE_STATE_REGISTER_XMM9 =3D 281, - EFI_SMM_SAVE_STATE_REGISTER_XMM10 =3D 282, - EFI_SMM_SAVE_STATE_REGISTER_XMM11 =3D 283, - EFI_SMM_SAVE_STATE_REGISTER_XMM12 =3D 284, - EFI_SMM_SAVE_STATE_REGISTER_XMM13 =3D 285, - EFI_SMM_SAVE_STATE_REGISTER_XMM14 =3D 286, - EFI_SMM_SAVE_STATE_REGISTER_XMM15 =3D 287, =20 - /// - /// Pseudo-Registers - /// - EFI_SMM_SAVE_STATE_REGISTER_IO =3D 512, - EFI_SMM_SAVE_STATE_REGISTER_LMA =3D 513, - EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID =3D 514 -} EFI_SMM_SAVE_STATE_REGISTER; =20 - -/// -/// The EFI_SMM_SAVE_STATE_REGISTER_LMA pseudo-register values -/// If the processor acts in 32-bit mode at the time the SMI occurred, the= pseudo register value=20 -/// EFI_SMM_SAVE_STATE_REGISTER_LMA_32BIT is returned in Buffer. Otherwise= ,=20 -/// EFI_SMM_SAVE_STATE_REGISTER_LMA_64BIT is returned in Buffer. -/// -#define EFI_SMM_SAVE_STATE_REGISTER_LMA_32BIT 32 -#define EFI_SMM_SAVE_STATE_REGISTER_LMA_64BIT 64 =20 /// /// Size width of I/O instruction /// -typedef enum { - EFI_SMM_SAVE_STATE_IO_WIDTH_UINT8 =3D 0, - EFI_SMM_SAVE_STATE_IO_WIDTH_UINT16 =3D 1, - EFI_SMM_SAVE_STATE_IO_WIDTH_UINT32 =3D 2, - EFI_SMM_SAVE_STATE_IO_WIDTH_UINT64 =3D 3 -} EFI_SMM_SAVE_STATE_IO_WIDTH; +#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT8 EFI_MM_SAVE_STATE_IO_WIDTH_UINT8 +#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT16 EFI_MM_SAVE_STATE_IO_WIDTH_UINT= 16 +#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT32 EFI_MM_SAVE_STATE_IO_WIDTH_UINT= 32 +#define EFI_SMM_SAVE_STATE_IO_WIDTH_UINT64 EFI_MM_SAVE_STATE_IO_WIDTH_UINT= 64 +typedef EFI_MM_SAVE_STATE_IO_WIDTH EFI_SMM_SAVE_STATE_IO_WIDTH; =20 /// /// Types of I/O instruction /// -typedef enum { - EFI_SMM_SAVE_STATE_IO_TYPE_INPUT =3D 1, - EFI_SMM_SAVE_STATE_IO_TYPE_OUTPUT =3D 2, - EFI_SMM_SAVE_STATE_IO_TYPE_STRING =3D 4, - EFI_SMM_SAVE_STATE_IO_TYPE_REP_PREFIX =3D 8 -} EFI_SMM_SAVE_STATE_IO_TYPE; +#define EFI_SMM_SAVE_STATE_IO_TYPE_INPUT EFI_MM_SAVE_STATE_IO_TYPE_INPUT +#define EFI_SMM_SAVE_STATE_IO_TYPE_OUTPUT EFI_MM_SAVE_STATE_IO_TYPE_OUTPUT +#define EFI_SMM_SAVE_STATE_IO_TYPE_STRING EFI_MM_SAVE_STATE_IO_TYPE_STRING +#define EFI_SMM_SAVE_STATE_IO_TYPE_REP_PREFIX EFI_MM_SAVE_STATE_IO_TYPE_RE= P_PREFIX +typedef EFI_MM_SAVE_STATE_IO_TYPE EFI_SMM_SAVE_STATE_IO_TYPE; =20 -/// -/// Structure of the data which is returned when ReadSaveState() is called= with=20 -/// EFI_SMM_SAVE_STATE_REGISTER_IO. If there was no I/O then ReadSaveState= () will=20 -/// return EFI_NOT_FOUND. -/// -/// This structure describes the I/O operation which was in process when t= he SMI was generated. -/// -typedef struct _EFI_SMM_SAVE_STATE_IO_INFO { - /// - /// For input instruction (IN, INS), this is data read before the SMI oc= curred. For output=20 - /// instructions (OUT, OUTS) this is data that was written before the SM= I occurred. The=20 - /// width of the data is specified by IoWidth. - /// - UINT64 IoData; - /// - /// The I/O port that was being accessed when the SMI was triggered. - /// - UINT16 IoPort; - /// - /// Defines the size width (UINT8, UINT16, UINT32, UINT64) for IoData. - /// - EFI_SMM_SAVE_STATE_IO_WIDTH IoWidth; - /// - /// Defines type of I/O instruction. - /// - EFI_SMM_SAVE_STATE_IO_TYPE IoType; -} EFI_SMM_SAVE_STATE_IO_INFO; - =20 -typedef struct _EFI_SMM_CPU_PROTOCOL EFI_SMM_CPU_PROTOCOL; - -/** - Read data from the CPU save state. - - This function is used to read the specified number of bytes of the speci= fied register from the CPU=20 - save state of the specified CPU and place the value into the buffer. If = the CPU does not support the - specified register Register, then EFI_NOT_FOUND should be returned. If = the CPU does not=20 - support the specified register width Width, then EFI_INVALID_PARAMETER i= s returned. - - @param[in] This The EFI_SMM_CPU_PROTOCOL instance. - @param[in] Width The number of bytes to read from the CPU = save state. - @param[in] Register Specifies the CPU register to read form t= he save state. - @param[in] CpuIndex Specifies the zero-based index of the CPU= save state. - @param[out] Buffer Upon return, this holds the CPU register = value read from the save state. - =20 - @retval EFI_SUCCESS The register was read from Save State. - @retval EFI_NOT_FOUND The register is not defined for the Save = State of Processor. - @retval EFI_INVALID_PARAMETER Input parameters are not valid, for examp= le, Processor No or register width=20 - is not correct.This or Buffer is NULL. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_READ_SAVE_STATE)( - IN CONST EFI_SMM_CPU_PROTOCOL *This, - IN UINTN Width, - IN EFI_SMM_SAVE_STATE_REGISTER Register, - IN UINTN CpuIndex, - OUT VOID *Buffer - ); - - -/** - Write data to the CPU save state. - - This function is used to write the specified number of bytes of the spec= ified register to the CPU save=20 - state of the specified CPU and place the value into the buffer. If the C= PU does not support the=20 - specified register Register, then EFI_UNSUPPORTED should be returned. If= the CPU does not=20 - support the specified register width Width, then EFI_INVALID_PARAMETER i= s returned. - - @param[in] This The EFI_SMM_CPU_PROTOCOL instance. - @param[in] Width The number of bytes to write to the CPU s= ave state. - @param[in] Register Specifies the CPU register to write to th= e save state. - @param[in] CpuIndex Specifies the zero-based index of the CPU= save state. - @param[in] Buffer Upon entry, this holds the new CPU regist= er value. - =20 - @retval EFI_SUCCESS The register was written to Save State. - @retval EFI_NOT_FOUND The register is not defined for the Save = State of Processor. - @retval EFI_INVALID_PARAMETER Input parameters are not valid. For examp= le:=20 - ProcessorIndex or Width is not correct. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_WRITE_SAVE_STATE)( - IN CONST EFI_SMM_CPU_PROTOCOL *This, - IN UINTN Width,=20 - IN EFI_SMM_SAVE_STATE_REGISTER Register, - IN UINTN CpuIndex, - IN CONST VOID *Buffer - ); +typedef EFI_MM_SAVE_STATE_IO_INFO EFI_SMM_SAVE_STATE_IO_INFO; =20 -/// -/// EFI SMM CPU Protocol provides access to CPU-related information while = in SMM. -/// -/// This protocol allows SMM drivers to access architecture-standard regis= ters from any of the CPU=20 -/// save state areas. In some cases, difference processors provide the sam= e information in the save state,=20 -/// but not in the same format. These so-called pseudo-registers provide t= his information in a standard=20 -/// format. =20 -/// -struct _EFI_SMM_CPU_PROTOCOL { - EFI_SMM_READ_SAVE_STATE ReadSaveState; - EFI_SMM_WRITE_SAVE_STATE WriteSaveState; -}; +typedef EFI_MM_CPU_PROTOCOL EFI_SMM_CPU_PROTOCOL; + +typedef EFI_MM_READ_SAVE_STATE EFI_SMM_READ_SAVE_STATE; =20 +typedef EFI_MM_WRITE_SAVE_STATE EFI_SMM_WRITE_SAVE_STATE; extern EFI_GUID gEfiSmmCpuProtocolGuid; =20 #endif diff --git a/MdePkg/Include/Protocol/SmmCpuIo2.h b/MdePkg/Include/Protocol/= SmmCpuIo2.h index 9c00c80..704568d 100644 --- a/MdePkg/Include/Protocol/SmmCpuIo2.h +++ b/MdePkg/Include/Protocol/SmmCpuIo2.h @@ -3,7 +3,7 @@ =20 This protocol provides CPU I/O and memory access within SMM. =20 - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -17,79 +17,24 @@ #ifndef _SMM_CPU_IO2_H_ #define _SMM_CPU_IO2_H_ =20 -#define EFI_SMM_CPU_IO2_PROTOCOL_GUID \ - { \ - 0x3242A9D8, 0xCE70, 0x4AA0, { 0x95, 0x5D, 0x5E, 0x7B, 0x14, 0x0D, 0xE4= , 0xD2 } \ - } +#include =20 -typedef struct _EFI_SMM_CPU_IO2_PROTOCOL EFI_SMM_CPU_IO2_PROTOCOL; +#define EFI_SMM_CPU_IO2_PROTOCOL_GUID EFI_MM_CPU_IO_PROTOCOL_GUID + +typedef EFI_MM_CPU_IO_PROTOCOL EFI_SMM_CPU_IO2_PROTOCOL; =20 /// /// Width of the SMM CPU I/O operations /// -typedef enum { - SMM_IO_UINT8 =3D 0, - SMM_IO_UINT16 =3D 1, - SMM_IO_UINT32 =3D 2, - SMM_IO_UINT64 =3D 3 -} EFI_SMM_IO_WIDTH; - -/** - Provides the basic memory and I/O interfaces used toabstract accesses to= devices. - - The I/O operations are carried out exactly as requested. The caller is=20 - responsible for any alignment and I/O width issues that the bus, device,=20 - platform, or type of I/O might require. - - @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. - @param[in] Width Signifies the width of the I/O operations. - @param[in] Address The base address of the I/O operations. The ca= ller is=20 - responsible for aligning the Address if require= d.=20 - @param[in] Count The number of I/O operations to perform. - @param[in,out] Buffer For read operations, the destination buffer to = store=20 - the results. For write operations, the source = buffer=20 - from which to write data. +#define SMM_IO_UINT8 MM_IO_UINT8 +#define SMM_IO_UINT16 MM_IO_UINT16 +#define SMM_IO_UINT32 MM_IO_UINT32 +#define SMM_IO_UINT64 MM_IO_UINT64 =20 - @retval EFI_SUCCESS The data was read from or written to the = device. - @retval EFI_UNSUPPORTED The Address is not valid for this system. - @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to= a lack - of resources. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_CPU_IO2)( - IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, - IN EFI_SMM_IO_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - IN OUT VOID *Buffer - ); - -typedef struct { - /// - /// This service provides the various modalities of memory and I/O read. - /// - EFI_SMM_CPU_IO2 Read; - /// - /// This service provides the various modalities of memory and I/O write. - /// - EFI_SMM_CPU_IO2 Write; -} EFI_SMM_IO_ACCESS2; +typedef EFI_MM_IO_WIDTH EFI_SMM_IO_WIDTH; +typedef EFI_MM_CPU_IO EFI_SMM_CPU_IO2; =20 -/// -/// SMM CPU I/O Protocol provides CPU I/O and memory access within SMM. -/// -struct _EFI_SMM_CPU_IO2_PROTOCOL { - /// - /// Allows reads and writes to memory-mapped I/O space. - /// - EFI_SMM_IO_ACCESS2 Mem; - /// - /// Allows reads and writes to I/O space. - /// - EFI_SMM_IO_ACCESS2 Io; -}; +typedef EFI_MM_IO_ACCESS EFI_SMM_IO_ACCESS2; =20 extern EFI_GUID gEfiSmmCpuIo2ProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmEndOfDxe.h b/MdePkg/Include/Protoco= l/SmmEndOfDxe.h index e92ce4a..ae34804 100644 --- a/MdePkg/Include/Protocol/SmmEndOfDxe.h +++ b/MdePkg/Include/Protocol/SmmEndOfDxe.h @@ -9,7 +9,7 @@ This protocol prorogates End of DXE notification into SMM environment. This protocol is installed prior to installation of the SMM Ready to Loc= k Protocol. =20 - Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -23,10 +23,9 @@ #ifndef _SMM_END_OF_DXE_H_ #define _SMM_END_OF_DXE_H_ =20 -#define EFI_SMM_END_OF_DXE_PROTOCOL_GUID \ - { \ - 0x24e70042, 0xd5c5, 0x4260, { 0x8c, 0x39, 0xa, 0xd3, 0xaa, 0x32, 0xe9,= 0x3d } \ - } +#include + +#define EFI_SMM_END_OF_DXE_PROTOCOL_GUID EFI_MM_END_OF_DXE_PROTOCOL_GUID =20 extern EFI_GUID gEfiSmmEndOfDxeProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmGpiDispatch2.h b/MdePkg/Include/Pro= tocol/SmmGpiDispatch2.h index 65be0ce..bda3f98 100644 --- a/MdePkg/Include/Protocol/SmmGpiDispatch2.h +++ b/MdePkg/Include/Protocol/SmmGpiDispatch2.h @@ -9,7 +9,7 @@ given event types. Several inputs can be enabled. This purpose of this= interface is to generate an=20 SMI in response to any of these inputs having a true value provided. =20 - Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -26,98 +26,22 @@ #ifndef _SMM_GPI_DISPATCH2_H_ #define _SMM_GPI_DISPATCH2_H_ =20 +#include #include =20 -#define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID \ - { \ - 0x25566b03, 0xb577, 0x4cbf, {0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43,= 0x80 } \ - } - +#define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID EFI_MM_GPI_DISPATCH_PROTOCO= L_GUID /// /// The dispatch function's context. /// -typedef struct { - /// - /// A number from one of 2^64 possible GPIs that can generate an SMI. A - /// 0 corresponds to logical GPI[0]; 1 corresponds to logical GPI[1]; and - /// GpiNum of N corresponds to GPI[N], where N can span from 0 to 2^64-1. - /// - UINT64 GpiNum; -} EFI_SMM_GPI_REGISTER_CONTEXT; - -typedef struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTO= COL; - -/** - Registers a child SMI source dispatch function with a parent SMM driver. - - This service registers a function (DispatchFunction) which will be calle= d when an SMI is=20 - generated because of one or more of the GPIs specified by RegisterContex= t. On return,=20 - DispatchHandle contains a unique handle which may be used later to unreg= ister the function=20 - using UnRegister(). - The DispatchFunction will be called with Context set to the same value a= s was passed into=20 - this function in RegisterContext and with CommBuffer pointing to another= instance of=20 - EFI_SMM_GPI_REGISTER_CONTEXT describing the GPIs which actually caused t= he SMI and=20 - CommBufferSize pointing to the size of the structure. - - @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROT= OCOL instance. - @param[in] DispatchFunction Function to register for handler when the= specified GPI causes an SMI. - @param[in] RegisterContext Pointer to the dispatch function's contex= t. - The caller fills this context in before c= alling - the register function to indicate to the = register - function the GPI(s) for which the dispatc= h function - should be invoked. - @param[out] DispatchHandle Handle generated by the dispatcher to tra= ck the - function instance. - - @retval EFI_SUCCESS The dispatch function has been successful= ly - registered and the SMI source has been en= abled. - @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI s= ource. - @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The GPI input= value - is not within valid range. - @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM= ) to manage this child. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_GPI_REGISTER2)( - IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This, - IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, - IN CONST EFI_SMM_GPI_REGISTER_CONTEXT *RegisterContext, - OUT EFI_HANDLE *DispatchHandle - ); - -/** - Unregisters a General Purpose Input (GPI) service. - - This service removes the handler associated with DispatchHandle so that = it will no longer be=20 - called when the GPI triggers an SMI.=20 - - @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROT= OCOL instance. - @param[in] DispatchHandle Handle of the service to remove. - - @retval EFI_SUCCESS Handle of the service to remove. - @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_GPI_UNREGISTER2)( - IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This, - IN EFI_HANDLE DispatchHandle - ); +typedef EFI_MM_GPI_REGISTER_CONTEXT EFI_SMM_GPI_REGISTER_CONTEXT; + +typedef EFI_MM_GPI_REGISTER EFI_SMM_GPI_REGISTER2; + +typedef EFI_MM_GPI_UNREGISTER EFI_SMM_GPI_UNREGISTER2; + +typedef EFI_MM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTOCOL; + =20 -/// -/// Interface structure for the SMM GPI SMI Dispatch Protocol -/// -/// The SMM GPI SMI Dispatch Protocol provides the parent dispatch service -/// for the General Purpose Input (GPI) SMI source generator. -/// -struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL { - EFI_SMM_GPI_REGISTER2 Register; - EFI_SMM_GPI_UNREGISTER2 UnRegister; - /// - /// Denotes the maximum value of inputs that can have handlers attached. - /// - UINTN NumSupportedGpis; -}; =20 extern EFI_GUID gEfiSmmGpiDispatch2ProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmIoTrapDispatch2.h b/MdePkg/Include/= Protocol/SmmIoTrapDispatch2.h index 187d48b..b37c9e1 100644 --- a/MdePkg/Include/Protocol/SmmIoTrapDispatch2.h +++ b/MdePkg/Include/Protocol/SmmIoTrapDispatch2.h @@ -4,7 +4,7 @@ =20 This protocol provides a parent dispatch service for IO trap SMI sources. =20 - Copyright (c) 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -21,114 +21,31 @@ #ifndef _SMM_IO_TRAP_DISPATCH2_H_ #define _SMM_IO_TRAP_DISPATCH2_H_ =20 -#include +#include =20 -#define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID \ - { \ - 0x58dc368d, 0x7bfa, 0x4e77, {0xab, 0xbc, 0xe, 0x29, 0x41, 0x8d, 0xf9, = 0x30 } \ - } +#define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID EFI_MM_IO_TRAP_DISPATCH_P= ROTOCOL_GUID =20 /// /// IO Trap valid types /// -typedef enum { - WriteTrap, - ReadTrap, - ReadWriteTrap, - IoTrapTypeMaximum -} EFI_SMM_IO_TRAP_DISPATCH_TYPE; +typedef EFI_MM_IO_TRAP_DISPATCH_TYPE EFI_SMM_IO_TRAP_DISPATCH_TYPE; =20 /// /// IO Trap context structure containing information about the /// IO trap event that should invoke the handler /// -typedef struct { - UINT16 Address; - UINT16 Length; - EFI_SMM_IO_TRAP_DISPATCH_TYPE Type; -} EFI_SMM_IO_TRAP_REGISTER_CONTEXT; +typedef EFI_MM_IO_TRAP_REGISTER_CONTEXT EFI_SMM_IO_TRAP_REGISTER_CONTEXT; =20 /// /// IO Trap context structure containing information about the IO trap tha= t occurred /// -typedef struct { - UINT32 WriteData; -} EFI_SMM_IO_TRAP_CONTEXT; - -typedef struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL EFI_SMM_IO_TRAP_DISPATC= H2_PROTOCOL; - -/** - Register an IO trap SMI child handler for a specified SMI. - - This service registers a function (DispatchFunction) which will be calle= d when an SMI is=20 - generated because of an access to an I/O port specified by RegisterConte= xt. On return,=20 - DispatchHandle contains a unique handle which may be used later to unreg= ister the function=20 - using UnRegister(). If the base of the I/O range specified is zero, then= an I/O range with the=20 - specified length and characteristics will be allocated and the Address f= ield in RegisterContext=20 - updated. If no range could be allocated, then EFI_OUT_OF_RESOURCES will = be returned.=20 - - The service will not perform GCD allocation if the base address is non-z= ero or=20 - EFI_SMM_READY_TO_LOCK has been installed. In this case, the caller is r= esponsible for the=20 - existence and allocation of the specific IO range. - An error may be returned if some or all of the requested resources confl= ict with an existing IO trap=20 - child handler. - - It is not required that implementations will allow multiple children for= a single IO trap SMI source. =20 - Some implementations may support multiple children. - The DispatchFunction will be called with Context updated to contain info= rmation=20 - concerning the I/O action that actually happened and is passed in Regist= erContext, with=20 - CommBuffer pointing to the data actually written and CommBufferSize poin= ting to the size of=20 - the data in CommBuffer. - - @param[in] This Pointer to the EFI_SMM_IO_TRAP_DISPATCH2_= PROTOCOL instance. - @param[in] DispatchFunction Function to register for handler when I/O= trap location is accessed. - @param[in] RegisterContext Pointer to the dispatch function's contex= t. The caller fills this - context in before calling the register fu= nction to indicate to the register - function the IO trap SMI source for which= the dispatch function should be invoked. - @param[out] DispatchHandle Handle of the dispatch function, for when= interfacing with the parent SMM driver. - - @retval EFI_SUCCESS The dispatch function has been successful= ly registered. - @retval EFI_DEVICE_ERROR The driver was unable to complete due to = hardware error. - @retval EFI_OUT_OF_RESOURCES Insufficient resources are available to f= ulfill the IO trap range request. - @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The input va= lue is not within a valid range. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_REGISTER)( - IN CONST EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This, - IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, - IN OUT EFI_SMM_IO_TRAP_REGISTER_CONTEXT *RegisterContext, - OUT EFI_HANDLE *DispatchHandle - ); - -/** - Unregister a child SMI source dispatch function with a parent SMM driver. - - This service removes a previously installed child dispatch handler. This= does not guarantee that the=20 - system resources will be freed from the GCD. - - @param[in] This Pointer to the EFI_SMM_IO_TRAP_DISPATCH2_= PROTOCOL instance.=20 - @param[in] DispatchHandle Handle of the child service to remove. - - @retval EFI_SUCCESS The dispatch function has been successful= ly unregistered. - @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER)( - IN CONST EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This, - IN EFI_HANDLE DispatchHandle - ); +typedef EFI_MM_IO_TRAP_CONTEXT EFI_SMM_IO_TRAP_CONTEXT; =20 -/// -/// Interface structure for the SMM IO Trap Dispatch2 Protocol. -/// -/// This protocol provides a parent dispatch service for IO trap SMI sourc= es. -/// -struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL { - EFI_SMM_IO_TRAP_DISPATCH2_REGISTER Register; - EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER UnRegister; -}; +typedef EFI_MM_IO_TRAP_DISPATCH_PROTOCOL EFI_SMM_IO_TRAP_DISPATCH2_PROTOCO= L; + +typedef EFI_MM_IO_TRAP_DISPATCH_REGISTER EFI_SMM_IO_TRAP_DISPATCH2_REGIS= TER; + +typedef EFI_MM_IO_TRAP_DISPATCH_UNREGISTER EFI_SMM_IO_TRAP_DISPATCH2_UNREG= ISTER; =20 extern EFI_GUID gEfiSmmIoTrapDispatch2ProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmPciRootBridgeIo.h b/MdePkg/Include/= Protocol/SmmPciRootBridgeIo.h index 2c538f4..0f23875 100644 --- a/MdePkg/Include/Protocol/SmmPciRootBridgeIo.h +++ b/MdePkg/Include/Protocol/SmmPciRootBridgeIo.h @@ -3,7 +3,7 @@ =20 This protocol provides PCI I/O and memory access within SMM. =20 - Copyright (c) 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -17,19 +17,16 @@ #ifndef _SMM_PCI_ROOT_BRIDGE_IO_H_ #define _SMM_PCI_ROOT_BRIDGE_IO_H_ =20 -#include +#include =20 -#define EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \ - { \ - 0x8bc1714d, 0xffcb, 0x41c3, { 0x89, 0xdc, 0x6c, 0x74, 0xd0, 0x6d, 0x98= , 0xea } \ - } +#define EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID EFI_MM_PCI_ROOT_BRIDGE_IO= _PROTOCOL_GUID =20 /// /// This protocol provides the same functionality as the PCI Root Bridge I= /O Protocol defined in the=20 /// UEFI 2.1 Specifcation, section 13.2, except that the functions for Map= () and Unmap() may return=20 /// EFI_UNSUPPORTED. /// -typedef EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOC= OL; +typedef EFI_MM_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_SMM_PCI_ROOT_BRIDGE_IO_PRO= TOCOL; =20 extern EFI_GUID gEfiSmmPciRootBridgeIoProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmPeriodicTimerDispatch2.h b/MdePkg/I= nclude/Protocol/SmmPeriodicTimerDispatch2.h index 0682540..078a91b 100644 --- a/MdePkg/Include/Protocol/SmmPeriodicTimerDispatch2.h +++ b/MdePkg/Include/Protocol/SmmPeriodicTimerDispatch2.h @@ -4,7 +4,7 @@ =20 This protocol provides the parent dispatch service for the periodical ti= mer SMI source generator. =20 - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -22,11 +22,9 @@ #define _SMM_PERIODIC_TIMER_DISPATCH2_H_ =20 #include +#include =20 -#define EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID \ - { \ - 0x4cec368e, 0x8e8e, 0x4d71, {0x8b, 0xe1, 0x95, 0x8c, 0x45, 0xfc, 0x8a,= 0x53 } \ - } +#define EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID EFI_MM_PERIODIC_TIM= ER_DISPATCH_PROTOCOL_GUID =20 /// /// Example: A chipset supports periodic SMIs on every 64ms or 2 seconds. @@ -66,13 +64,7 @@ typedef struct { /// Register() in RegisterContext and with CommBuffer pointing to an insta= nce of=20 /// EFI_SMM_PERIODIC_TIMER_CONTEXT and CommBufferSize pointing to its size. /// -typedef struct { - /// - /// ElapsedTime is the actual time in 100 nanosecond units elapsed since= last called, a - /// value of 0 indicates an unknown amount of time. - /// - UINT64 ElapsedTime; -} EFI_SMM_PERIODIC_TIMER_CONTEXT; +typedef EFI_MM_PERIODIC_TIMER_CONTEXT EFI_SMM_PERIODIC_TIMER_CONTEXT; =20 typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL EFI_SMM_PERIODI= C_TIMER_DISPATCH2_PROTOCOL; =20 diff --git a/MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h b/MdePkg/Inc= lude/Protocol/SmmPowerButtonDispatch2.h index ef4626a..fa844cb 100644 --- a/MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h +++ b/MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h @@ -4,7 +4,7 @@ =20 This protocol provides the parent dispatch service for the power button = SMI source generator. =20 - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -21,95 +21,20 @@ #ifndef _SMM_POWER_BUTTON_DISPATCH2_H_ #define _SMM_POWER_BUTTON_DISPATCH2_H_ =20 -#include +#include =20 -#define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID \ - { \ - 0x1b1183fa, 0x1823, 0x46a7, {0x88, 0x72, 0x9c, 0x57, 0x87, 0x55, 0x40,= 0x9d } \ - } - -/// -/// Power Button phases. -/// -typedef enum { - EfiPowerButtonEntry, - EfiPowerButtonExit, - EfiPowerButtonMax -} EFI_POWER_BUTTON_PHASE; +#define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID EFI_MM_POWER_BUTTON_D= ISPATCH_PROTOCOL_GUID =20 /// /// The dispatch function's context. /// -typedef struct { - /// - /// Designates whether this handler should be invoked upon entry or exit. - /// - EFI_POWER_BUTTON_PHASE Phase; -} EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT; - -typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_POWER_BUTT= ON_DISPATCH2_PROTOCOL; +typedef EFI_MM_POWER_BUTTON_REGISTER_CONTEXT EFI_SMM_POWER_BUTTON_REGISTER= _CONTEXT; =20 -/** - Provides the parent dispatch service for a power button event. - - This service registers a function (DispatchFunction) which will be calle= d when an SMI is=20 - generated because the power button was pressed or released, as specified= by RegisterContext.=20 - On return, DispatchHandle contains a unique handle which may be used lat= er to unregister the=20 - function using UnRegister(). - The DispatchFunction will be called with Context set to the same value a= s was passed into=20 - this function in RegisterContext and with CommBuffer and CommBufferSize = set to NULL. - - @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPA= TCH2_PROTOCOL instance. - @param[in] DispatchFunction Function to register for handler when pow= er button is pressed or released. - @param[in] RegisterContext Pointer to the dispatch function's contex= t. The caller fills in this context - before calling the Register() function to= indicate to the Register() function - the power button SMI phase for which the = dispatch function should be invoked. - @param[out] DispatchHandle Handle generated by the dispatcher to tra= ck the function instance.=20 - - @retval EFI_SUCCESS The dispatch function has been successful= ly - registered and the SMI source has been en= abled. - @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI s= ource. - @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The power but= ton input value - is not within valid range. - @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM= ) to manage this child. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER2)( - IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This, - IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, - IN EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT *RegisterContext, - OUT EFI_HANDLE *DispatchHandle - ); +typedef EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATC= H2_PROTOCOL; =20 -/** - Unregisters a power-button service. +typedef EFI_MM_POWER_BUTTON_REGISTER EFI_SMM_POWER_BUTTON_REGISTER2; =20 - This service removes the handler associated with DispatchHandle so that = it will no longer be=20 - called when the standby button is pressed or released.=20 - - @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPA= TCH2_PROTOCOL instance. - @param[in] DispatchHandle Handle of the service to remove. - - @retval EFI_SUCCESS The service has been successfully removed. - @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER2)( - IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This, - IN EFI_HANDLE DispatchHandle - ); - -/// -/// Interface structure for the SMM Power Button Dispatch2 Protocol. -/// -/// This protocol provides the parent dispatch service for the power butto= n SMI source generator. -/// -struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL { - EFI_SMM_POWER_BUTTON_REGISTER2 Register; - EFI_SMM_POWER_BUTTON_UNREGISTER2 UnRegister; -}; +typedef EFI_MM_POWER_BUTTON_UNREGISTER EFI_SMM_POWER_BUTTON_UNREGISTER2; =20 extern EFI_GUID gEfiSmmPowerButtonDispatch2ProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmReadyToLock.h b/MdePkg/Include/Prot= ocol/SmmReadyToLock.h index edf1719..eb8b7a4 100644 --- a/MdePkg/Include/Protocol/SmmReadyToLock.h +++ b/MdePkg/Include/Protocol/SmmReadyToLock.h @@ -25,10 +25,9 @@ #ifndef _SMM_READY_TO_LOCK_H_ #define _SMM_READY_TO_LOCK_H_ =20 -#define EFI_SMM_READY_TO_LOCK_PROTOCOL_GUID \ - { \ - 0x47b7fa8c, 0xf4bd, 0x4af6, { 0x82, 0x00, 0x33, 0x30, 0x86, 0xf0, 0xd2= , 0xc8 } \ - } +#include + +#define EFI_SMM_READY_TO_LOCK_PROTOCOL_GUID EFI_MM_READY_TO_LOCK_PROTOCOL_= GUID =20 extern EFI_GUID gEfiSmmReadyToLockProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h b/MdePkg/= Include/Protocol/SmmReportStatusCodeHandler.h index 862142d..8cddfac 100644 --- a/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h +++ b/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h @@ -1,7 +1,7 @@ /** @file This protocol provides registering and unregistering services to status = code consumers while in DXE SMM. =20 - Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -15,66 +15,17 @@ #ifndef __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__ #define __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__ =20 -#define EFI_SMM_RSC_HANDLER_PROTOCOL_GUID \ - { \ - 0x2ff29fa7, 0x5e80, 0x4ed9, {0xb3, 0x80, 0x1, 0x7d, 0x3c, 0x55, 0x4f, = 0xf4} \ - } +#include =20 -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_RSC_HANDLER_CALLBACK)( - IN EFI_STATUS_CODE_TYPE CodeType, - IN EFI_STATUS_CODE_VALUE Value, - IN UINT32 Instance, - IN EFI_GUID *CallerId, - IN EFI_STATUS_CODE_DATA *Data -); +#define EFI_SMM_RSC_HANDLER_PROTOCOL_GUID EFI_MM_RSC_HANDLER_PROTOCOL_GUID =20 -/** - Register the callback function for ReportStatusCode() notification. - =20 - When this function is called the function pointer is added to an interna= l list and any future calls to - ReportStatusCode() will be forwarded to the Callback function. - =20 - @param[in] Callback A pointer to a function of type EFI_RS= C_HANDLER_CALLBACK that is called when - a call to ReportStatusCode() occurs. - - @retval EFI_SUCCESS Function was successfully registered. - @retval EFI_INVALID_PARAMETER The callback function was NULL. - @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. = No more functions can be - registered. - @retval EFI_ALREADY_STARTED The function was already registered. I= t can't be registered again. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_RSC_HANDLER_REGISTER)( - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback -); +typedef EFI_MM_RSC_HANDLER_CALLBACK EFI_SMM_RSC_HANDLER_CALLBACK; =20 -/** - Remove a previously registered callback function from the notification l= ist. - =20 - A callback function must be unregistered before it is deallocated. It is= important that any registered - callbacks that are not runtime complaint be unregistered when ExitBootSe= rvices() is called. +typedef EFI_MM_RSC_HANDLER_REGISTER EFI_SMM_RSC_HANDLER_REGISTER; =20 - @param[in] Callback A pointer to a function of type EFI_SMM_RS= C_HANDLER_CALLBACK that is to be - unregistered. - =20 - @retval EFI_SUCCESS The function was successfully unregistered. - @retval EFI_INVALID_PARAMETER The callback function was NULL. - @retval EFI_NOT_FOUND The callback function was not found to be = unregistered. - =20 -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_RSC_HANDLER_UNREGISTER)( - IN EFI_SMM_RSC_HANDLER_CALLBACK Callback -); +typedef EFI_MM_RSC_HANDLER_UNREGISTER EFI_SMM_RSC_HANDLER_UNREGISTER; =20 -typedef struct _EFI_SMM_RSC_HANDLER_PROTOCOL { - EFI_SMM_RSC_HANDLER_REGISTER Register; - EFI_SMM_RSC_HANDLER_UNREGISTER Unregister; -} EFI_SMM_RSC_HANDLER_PROTOCOL; +typedef EFI_MM_RSC_HANDLER_PROTOCOL EFI_SMM_RSC_HANDLER_PROTOCOL; =20 extern EFI_GUID gEfiSmmRscHandlerProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h b/MdePkg/I= nclude/Protocol/SmmStandbyButtonDispatch2.h index 104e2a2..f4385ef 100644 --- a/MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h +++ b/MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h @@ -21,97 +21,20 @@ #ifndef _SMM_STANDBY_BUTTON_DISPATCH2_H_ #define _SMM_STANDBY_BUTTON_DISPATCH2_H_ =20 -#include +#include =20 -#define EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID \ - { \ - 0x7300c4a1, 0x43f2, 0x4017, {0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58,= 0x5b } \ - } - -/// -/// Standby Button phases -/// -typedef enum { - EfiStandbyButtonEntry, - EfiStandbyButtonExit, - EfiStandbyButtonMax -} EFI_STANDBY_BUTTON_PHASE; +#define EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID EFI_MM_STANDBY_BUTT= ON_DISPATCH_PROTOCOL_GUID =20 /// /// The dispatch function's context. /// -typedef struct { - /// - /// Describes whether the child handler should be invoked upon the entry= to the button=20 - /// activation or upon exit. - /// - EFI_STANDBY_BUTTON_PHASE Phase; -} EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT; - -typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_STANDBY_= BUTTON_DISPATCH2_PROTOCOL; +typedef EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT EFI_SMM_STANDBY_BUTTON_REGI= STER_CONTEXT; =20 -/** - Provides the parent dispatch service for a standby button event. - - This service registers a function (DispatchFunction) which will be calle= d when an SMI is=20 - generated because the standby button was pressed or released, as specifi= ed by=20 - RegisterContext. On return, DispatchHandle contains a unique handle whic= h may be used=20 - later to unregister the function using UnRegister(). - The DispatchFunction will be called with Context set to the same value a= s was passed into=20 - this function in RegisterContext and with CommBuffer and CommBufferSize = set to NULL.=20 - - @param[in] This Pointer to the EFI_SMM_STANDBY_BUTTON_DIS= PATCH2_PROTOCOL instance. - @param[in] DispatchFunction Function to register for handler when the= standby button is pressed or released. - @param[in] RegisterContext Pointer to the dispatch function's contex= t. The caller fills in this context - before calling the register function to i= ndicate to the register function the=20 - standby button SMI source for which the d= ispatch function should be invoked. - @param[out] DispatchHandle Handle generated by the dispatcher to tra= ck the function instance.=20 - - @retval EFI_SUCCESS The dispatch function has been successful= ly - registered and the SMI source has been en= abled. - @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI s= ource. - @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The standby b= utton input value - is not within valid range. - @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM= ) to manage this child. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER2)( - IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This, - IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, - IN EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext, - OUT EFI_HANDLE *DispatchHandle - ); +typedef EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DIS= PATCH2_PROTOCOL; =20 -/** - Unregisters a child SMI source dispatch function with a parent SMM drive= r. +typedef EFI_MM_STANDBY_BUTTON_REGISTER EFI_SMM_STANDBY_BUTTON_REGISTER2; =20 - This service removes the handler associated with DispatchHandle so that = it will no longer be=20 - called when the standby button is pressed or released. - - @param[in] This Pointer to the EFI_SMM_STANDBY_BUTTON_DIS= PATCH2_PROTOCOL instance. - @param[in] DispatchHandle Handle of the service to remove. - - @retval EFI_SUCCESS The service has been successfully removed. - @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER2)( - IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This, - IN EFI_HANDLE DispatchHandle - ); - -/// -/// Interface structure for the SMM Standby Button Dispatch2 Protocol. -/// -/// This protocol provides the parent dispatch service for the standby -/// button SMI source generator. -/// -struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL { - EFI_SMM_STANDBY_BUTTON_REGISTER2 Register; - EFI_SMM_STANDBY_BUTTON_UNREGISTER2 UnRegister; -}; +typedef EFI_MM_STANDBY_BUTTON_UNREGISTER EFI_SMM_STANDBY_BUTTON_UNREGISTER= 2; =20 extern EFI_GUID gEfiSmmStandbyButtonDispatch2ProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmStatusCode.h b/MdePkg/Include/Proto= col/SmmStatusCode.h index a0e71ef..0c03e8d 100644 --- a/MdePkg/Include/Protocol/SmmStatusCode.h +++ b/MdePkg/Include/Protocol/SmmStatusCode.h @@ -17,47 +17,13 @@ #ifndef _SMM_STATUS_CODE_H__ #define _SMM_STATUS_CODE_H__ =20 +#include =20 -#define EFI_SMM_STATUS_CODE_PROTOCOL_GUID \ - { \ - 0x6afd2b77, 0x98c1, 0x4acd, {0xa6, 0xf9, 0x8a, 0x94, 0x39, 0xde, 0xf, = 0xb1} \ - } +#define EFI_SMM_STATUS_CODE_PROTOCOL_GUID EFI_MM_STATUS_CODE_PROTOCOL_GUID =20 -typedef struct _EFI_SMM_STATUS_CODE_PROTOCOL EFI_SMM_STATUS_CODE_PROTOCOL; +typedef EFI_MM_STATUS_CODE_PROTOCOL EFI_SMM_STATUS_CODE_PROTOCOL; =20 -/** - Service to emit the status code in SMM. =20 - - The EFI_SMM_STATUS_CODE_PROTOCOL.ReportStatusCode() function enables a d= river=20 - to emit a status code while in SMM. The reason that there is a separate= protocol definition from the=20 - DXE variant of this service is that the publisher of this protocol will = provide a service that is=20 - capability of coexisting with a foreground operational environment, such= as an operating system=20 - after the termination of boot services. =20 - - @param[in] This Points to this instance of the EFI_SMM_ST= ATUS_CODE_PROTOCOL. - @param[in] CodeType DIndicates the type of status code being = reported.=20 - @param[in] Value Describes the current status of a hardwar= e or software entity.=20 - @param[in] Instance The enumeration of a hardware or software= entity within the system. - @param[in] CallerId This optional parameter may be used to id= entify the caller. - @param[in] Data This optional parameter may be used to pa= ss additional data. - - @retval EFI_SUCCESS The function completed successfully. - @retval EFI_INVALID_PARAMETER The function should not be completed due = to a device error. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_REPORT_STATUS_CODE)( - IN CONST EFI_SMM_STATUS_CODE_PROTOCOL *This, - IN EFI_STATUS_CODE_TYPE CodeType, - IN EFI_STATUS_CODE_VALUE Value, - IN UINT32 Instance, - IN CONST EFI_GUID *CallerId, - IN EFI_STATUS_CODE_DATA *Data OPTIONAL - ); - -struct _EFI_SMM_STATUS_CODE_PROTOCOL { - EFI_SMM_REPORT_STATUS_CODE ReportStatusCode; -}; +typedef EFI_MM_REPORT_STATUS_CODE EFI_SMM_REPORT_STATUS_CODE; =20 extern EFI_GUID gEfiSmmStatusCodeProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmSwDispatch2.h b/MdePkg/Include/Prot= ocol/SmmSwDispatch2.h index 1614937..b49ef96 100644 --- a/MdePkg/Include/Protocol/SmmSwDispatch2.h +++ b/MdePkg/Include/Protocol/SmmSwDispatch2.h @@ -4,7 +4,7 @@ =20 This protocol provides the parent dispatch service for a given SMI sourc= e generator. =20 - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -18,12 +18,10 @@ #ifndef _SMM_SW_DISPATCH2_H_ #define _SMM_SW_DISPATCH2_H_ =20 +#include #include =20 -#define EFI_SMM_SW_DISPATCH2_PROTOCOL_GUID \ - { \ - 0x18a3c6dc, 0x5eea, 0x48c8, {0xa1, 0xc1, 0xb5, 0x33, 0x89, 0xf9, 0x89,= 0x99 } \ - } +#define EFI_SMM_SW_DISPATCH2_PROTOCOL_GUID EFI_MM_SW_DISPATCH_PROTOCOL_GUID =20 /// /// A particular chipset may not support all possible software SMI input v= alues. diff --git a/MdePkg/Include/Protocol/SmmSxDispatch2.h b/MdePkg/Include/Prot= ocol/SmmSxDispatch2.h index 37effda..1565eea 100644 --- a/MdePkg/Include/Protocol/SmmSxDispatch2.h +++ b/MdePkg/Include/Protocol/SmmSxDispatch2.h @@ -4,7 +4,7 @@ =20 Provides the parent dispatch service for a given Sx-state source generat= or. =20 - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -18,117 +18,20 @@ #ifndef _SMM_SX_DISPATCH2_H_ #define _SMM_SX_DISPATCH2_H_ =20 -#include +#include =20 -#define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID \ - { \ - 0x456d2859, 0xa84b, 0x4e47, {0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99,= 0x7d } \ - } - -/// -/// Sleep states S0-S5 -/// -typedef enum { - SxS0, - SxS1, - SxS2, - SxS3, - SxS4, - SxS5, - EfiMaximumSleepType -} EFI_SLEEP_TYPE; - -/// -/// Sleep state phase: entry or exit -/// -typedef enum { - SxEntry, - SxExit, - EfiMaximumPhase -} EFI_SLEEP_PHASE; +#define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID EFI_MM_SX_DISPATCH_PROTOCOL_GUID =20 /// /// The dispatch function's context /// -typedef struct { - EFI_SLEEP_TYPE Type; - EFI_SLEEP_PHASE Phase; -} EFI_SMM_SX_REGISTER_CONTEXT; - -typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOC= OL; - -/** - Provides the parent dispatch service for a given Sx source generator. - - This service registers a function (DispatchFunction) which will be calle= d when the sleep state=20 - event specified by RegisterContext is detected. On return, DispatchHandl= e contains a=20 - unique handle which may be used later to unregister the function using U= nRegister(). - The DispatchFunction will be called with Context set to the same value a= s was passed into=20 - this function in RegisterContext and with CommBuffer and CommBufferSize = set to=20 - NULL and 0 respectively. +typedef EFI_MM_SX_REGISTER_CONTEXT EFI_SMM_SX_REGISTER_CONTEXT; =20 - @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTO= COL instance. - @param[in] DispatchFunction Function to register for handler when the= specified sleep state event occurs. - @param[in] RegisterContext Pointer to the dispatch function's contex= t. - The caller fills this context in before c= alling - the register function to indicate to the = register - function which Sx state type and phase th= e caller - wishes to be called back on. For this int= ertace, - the Sx driver will call the registered ha= ndlers for - all Sx type and phases, so the Sx state h= andler(s) - must check the Type and Phase field of th= e Dispatch - context and act accordingly. - @param[out] DispatchHandle Handle of dispatch function, for when int= erfacing - with the parent Sx state SMM driver. +typedef EFI_MM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL; =20 - @retval EFI_SUCCESS The dispatch function has been successful= ly - registered and the SMI source has been en= abled. - @retval EFI_UNSUPPORTED The Sx driver or hardware does not suppor= t that - Sx Type/Phase. - @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SM= I source. - @retval EFI_INVALID_PARAMETER RegisterContext is invalid. Type & Phase = are not - within valid range. - @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM= ) to manage this - child. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_SX_REGISTER2)( - IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This, - IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, - IN CONST EFI_SMM_SX_REGISTER_CONTEXT *RegisterContext, - OUT EFI_HANDLE *DispatchHandle - ); - -/** - Unregisters an Sx-state service. - - This service removes the handler associated with DispatchHandle so that = it will no longer be=20 - called in response to sleep event. +typedef EFI_MM_SX_REGISTER EFI_SMM_SX_REGISTER2; =20 - @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTO= COL instance. - @param[in] DispatchHandle Handle of the service to remove.=20 - - @retval EFI_SUCCESS The service has been successfully removed. - @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_SX_UNREGISTER2)( - IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This, - IN EFI_HANDLE DispatchHandle - ); - -/// -/// Interface structure for the SMM Sx Dispatch Protocol -/// -/// The EFI_SMM_SX_DISPATCH2_PROTOCOL provides the ability to install chil= d handlers to=20 -/// respond to sleep state related events. -/// -struct _EFI_SMM_SX_DISPATCH2_PROTOCOL { - EFI_SMM_SX_REGISTER2 Register; - EFI_SMM_SX_UNREGISTER2 UnRegister; -}; +typedef EFI_MM_SX_UNREGISTER EFI_SMM_SX_UNREGISTER2; =20 extern EFI_GUID gEfiSmmSxDispatch2ProtocolGuid; =20 diff --git a/MdePkg/Include/Protocol/SmmUsbDispatch2.h b/MdePkg/Include/Pro= tocol/SmmUsbDispatch2.h index fc2ef51..69289c1 100644 --- a/MdePkg/Include/Protocol/SmmUsbDispatch2.h +++ b/MdePkg/Include/Protocol/SmmUsbDispatch2.h @@ -4,7 +4,7 @@ =20 Provides the parent dispatch service for the USB SMI source generator. =20 - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -21,108 +21,25 @@ #ifndef _SMM_USB_DISPATCH2_H_ #define _SMM_USB_DISPATCH2_H_ =20 -#include +#include =20 -#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID \ - { \ - 0xee9b8d90, 0xc5a6, 0x40a2, {0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc,= 0xa1 } \ - } +#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID EFI_MM_USB_DISPATCH_PROTOCOL_G= UID =20 /// /// USB SMI event types /// -typedef enum { - UsbLegacy, - UsbWake -} EFI_USB_SMI_TYPE; +typedef EFI_USB_MMI_TYPE EFI_USB_SMI_TYPE; =20 /// /// The dispatch function's context. /// -typedef struct { - /// - /// Describes whether this child handler will be invoked in response to = a USB legacy=20 - /// emulation event, such as port-trap on the PS/2* keyboard control reg= isters, or to a=20 - /// USB wake event, such as resumption from a sleep state. - /// - EFI_USB_SMI_TYPE Type; - /// - /// The device path is part of the context structure and describes the l= ocation of the=20 - /// particular USB host controller in the system for which this register= event will occur. - /// This location is important because of the possible integration of se= veral USB host=20 - /// controllers in a system. - /// - EFI_DEVICE_PATH_PROTOCOL *Device; -} EFI_SMM_USB_REGISTER_CONTEXT; - -typedef struct _EFI_SMM_USB_DISPATCH2_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTO= COL; - -/** - Provides the parent dispatch service for the USB SMI source generator. +typedef EFI_MM_USB_REGISTER_CONTEXT EFI_SMM_USB_REGISTER_CONTEXT; =20 - This service registers a function (DispatchFunction) which will be calle= d when the USB- - related SMI specified by RegisterContext has occurred. On return, Dispat= chHandle=20 - contains a unique handle which may be used later to unregister the funct= ion using UnRegister(). - The DispatchFunction will be called with Context set to the same value a= s was passed into=20 - this function in RegisterContext and with CommBuffer containing NULL and=20 - CommBufferSize containing zero. - - @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROT= OCOL instance. - @param[in] DispatchFunction Function to register for handler when a U= SB-related SMI occurs.=20 - @param[in] RegisterContext Pointer to the dispatch function's contex= t. - The caller fills this context in before c= alling - the register function to indicate to the = register - function the USB SMI types for which the = dispatch - function should be invoked. - @param[out] DispatchHandle Handle generated by the dispatcher to tra= ck the function instance. - - @retval EFI_SUCCESS The dispatch function has been successful= ly - registered and the SMI source has been en= abled. - @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI s= ource. - @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The USB SMI t= ype - is not within valid range. - @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM= ) to manage this child. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_USB_REGISTER2)( - IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This, - IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction, - IN CONST EFI_SMM_USB_REGISTER_CONTEXT *RegisterContext, - OUT EFI_HANDLE *DispatchHandle - ); - -/** - Unregisters a USB service. - - This service removes the handler associated with DispatchHandle so that = it will no longer be=20 - called when the USB event occurs. - - @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROT= OCOL instance. - @param[in] DispatchHandle Handle of the service to remove.=20 - - @retval EFI_SUCCESS The dispatch function has been successful= ly - unregistered and the SMI source has been = disabled - if there are no other registered child di= spatch - functions for this SMI source. - @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_USB_UNREGISTER2)( - IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This, - IN EFI_HANDLE DispatchHandle - ); +typedef EFI_MM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTOCOL; =20 -/// -/// Interface structure for the SMM USB SMI Dispatch2 Protocol -/// -/// This protocol provides the parent dispatch service for the USB SMI sou= rce generator. -/// -struct _EFI_SMM_USB_DISPATCH2_PROTOCOL { - EFI_SMM_USB_REGISTER2 Register; - EFI_SMM_USB_UNREGISTER2 UnRegister; -}; +typedef EFI_MM_USB_REGISTER EFI_SMM_USB_REGISTER2; + +typedef EFI_MM_USB_UNREGISTER EFI_SMM_USB_UNREGISTER2; =20 extern EFI_GUID gEfiSmmUsbDispatch2ProtocolGuid; =20 --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel