diff options
author | Jonathan Zhang <jonzhang@fb.com> | 2020-06-09 17:56:53 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-25 11:57:06 +0000 |
commit | 6d27778973edf6bdebfa812eac8893d52961a891 (patch) | |
tree | 8023f5c4d98247b5ef3ceb18b8820e1131753f7e /src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/MmGpiDispatch.h | |
parent | c9222f956763d20397152a44985bdb4abdb19e2d (diff) | |
download | coreboot-6d27778973edf6bdebfa812eac8893d52961a891.tar.xz |
vendorcode/intel: Add edk2-stable202005 support
This patch includes (edk2/edk2-stable202005) all required headers
for edk2-stable202005 quarterly EDK2 tag from EDK2 github project
using below command:
>> git clone https://github.com/tianocore/edk2.git vedk2-stable202005
Only include necessary header files.
MdePkg/Include/Base.h was updated to avoid compilation errors through
safeguarding definitions for MIN, MAX, NULL, ABS, ARRAY_SIZE.
Signed-off-by: Jonathan Zhang <jonzhang@fb.com>
Change-Id: I3172505d9b829647ee1208c87623172f10b39310
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42239
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/MmGpiDispatch.h')
-rw-r--r-- | src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/MmGpiDispatch.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/MmGpiDispatch.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/MmGpiDispatch.h new file mode 100644 index 0000000000..877c0e2a24 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Protocol/MmGpiDispatch.h @@ -0,0 +1,119 @@ +/** @file + MM General Purpose Input (GPI) Dispatch Protocol as defined in PI 1.5 Specification + Volume 4 Management Mode Core Interface. + + This protocol provides the parent dispatch service for the General Purpose Input + (GPI) MMI source generator. + + The EFI_MM_GPI_DISPATCH_PROTOCOL provides the ability to install child handlers for the + given event types. Several inputs can be enabled. This purpose of this interface is to generate an + MMI in response to any of these inputs having a true value provided. + + Copyright (c) 2017, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + This protocol is from PI Version 1.5. + +**/ + +#ifndef _MM_GPI_DISPATCH_H_ +#define _MM_GPI_DISPATCH_H_ + +#include <Pi/PiMmCis.h> + +#define EFI_MM_GPI_DISPATCH_PROTOCOL_GUID \ + { \ + 0x25566b03, 0xb577, 0x4cbf, {0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80 } \ + } + +/// +/// The dispatch function's context. +/// +typedef struct { + /// + /// A number from one of 2^64 possible GPIs that can generate an MMI. 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_MM_GPI_REGISTER_CONTEXT; + +typedef struct _EFI_MM_GPI_DISPATCH_PROTOCOL EFI_MM_GPI_DISPATCH_PROTOCOL; + +/** + Registers a child MMI source dispatch function with a parent MM driver. + + This service registers a function (DispatchFunction) which will be called when an MMI is + generated because of one or more of the GPIs specified by RegisterContext. On return, + DispatchHandle contains a unique handle which may be used later to unregister the function + using UnRegister(). + The DispatchFunction will be called with Context set to the same value as was passed into + this function in RegisterContext and with CommBuffer pointing to another instance of + EFI_MM_GPI_REGISTER_CONTEXT describing the GPIs which actually caused the MMI and + CommBufferSize pointing to the size of the structure. + + @param[in] This Pointer to the EFI_MM_GPI_DISPATCH_PROTOCOL instance. + @param[in] DispatchFunction Function to register for handler when the specified GPI causes an MMI. + @param[in] RegisterContext Pointer to the dispatch function's context. + The caller fills this context in before calling + the register function to indicate to the register + function the GPI(s) for which the dispatch function + should be invoked. + @param[out] DispatchHandle Handle generated by the dispatcher to track the + function instance. + + @retval EFI_SUCCESS The dispatch function has been successfully + registered and the MMI source has been enabled. + @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source. + @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 MM) to manage this child. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_GPI_REGISTER)( + IN CONST EFI_MM_GPI_DISPATCH_PROTOCOL *This, + IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction, + IN CONST EFI_MM_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 + called when the GPI triggers an MMI. + + @param[in] This Pointer to the EFI_MM_GPI_DISPATCH_PROTOCOL 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_MM_GPI_UNREGISTER)( + IN CONST EFI_MM_GPI_DISPATCH_PROTOCOL *This, + IN EFI_HANDLE DispatchHandle + ); + +/// +/// Interface structure for the MM GPI MMI Dispatch Protocol +/// +/// The MM GPI MMI Dispatch Protocol provides the parent dispatch service +/// for the General Purpose Input (GPI) MMI source generator. +/// +struct _EFI_MM_GPI_DISPATCH_PROTOCOL { + EFI_MM_GPI_REGISTER Register; + EFI_MM_GPI_UNREGISTER UnRegister; + /// + /// Denotes the maximum value of inputs that can have handlers attached. + /// + UINTN NumSupportedGpis; +}; + +extern EFI_GUID gEfiMmGpiDispatchProtocolGuid; + +#endif + |