2 SMM General Purpose Input (GPI) Dispatch2 Protocol as defined in PI 1.1 Specification
3 Volume 4 System Management Mode Core Interface.
5 This protocol provides the parent dispatch service for the General Purpose Input
6 (GPI) SMI source generator.
8 The EFI_SMM_GPI_DISPATCH2_PROTOCOL provides the ability to install child handlers for the
9 given event types. Several inputs can be enabled. This purpose of this interface is to generate an
10 SMI in response to any of these inputs having a true value provided.
12 Copyright (c) 2009, Intel Corporation
13 All rights reserved. This program and the accompanying materials
14 are licensed and made available under the terms and conditions of the BSD License
15 which accompanies this distribution. The full text of the license may be found at
16 http://opensource.org/licenses/bsd-license.php
18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 @par Revision Reference:
22 This protocol is from PI Version 1.1.
26 #ifndef _SMM_GPI_DISPATCH2_H_
27 #define _SMM_GPI_DISPATCH2_H_
29 #include <Pi/PiSmmCis.h>
31 #define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID \
33 0x25566b03, 0xb577, 0x4cbf, {0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80 } \
37 /// The dispatch function's context.
41 /// A bit mask of 64 possible GPIs that can generate an SMI. Bit 0 corresponds to logical
42 /// GPI[0], 1 corresponds to logical GPI[1], and so on.
45 } EFI_SMM_GPI_REGISTER_CONTEXT
;
47 typedef struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTOCOL
;
50 Registers a child SMI source dispatch function with a parent SMM driver.
52 This service registers a function (DispatchFunction) which will be called when an SMI is
53 generated because of one or more of the GPIs specified by RegisterContext. On return,
54 DispatchHandle contains a unique handle which may be used later to unregister the function
56 The DispatchFunction will be called with Context set to the same value as was passed into
57 this function in RegisterContext and with CommBuffer pointing to another instance of
58 EFI_SMM_GPI_REGISTER_CONTEXT describing the GPIs which actually caused the SMI and
59 CommBufferSize pointing to the size of the structure.
61 @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROTOCOL instance.
62 @param[in] DispatchFunction Function to register for handler when the specified GPI causes an SMI.
63 @param[in] RegisterContext Pointer to the dispatch function's context.
64 The caller fills this context in before calling
65 the register function to indicate to the register
66 function the GPI(s) for which the dispatch function
68 @param[out] DispatchHandle Handle generated by the dispatcher to track the
71 @retval EFI_SUCCESS The dispatch function has been successfully
72 registered and the SMI source has been enabled.
73 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
74 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The GPI input value
75 is not within valid range.
76 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.
80 (EFIAPI
*EFI_SMM_GPI_REGISTER
)(
81 IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL
*This
,
82 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction
,
83 IN CONST EFI_SMM_GPI_REGISTER_CONTEXT
*RegisterContext
,
84 OUT EFI_HANDLE
*DispatchHandle
88 Unregisters a General Purpose Input (GPI) service.
90 This service removes the handler associated with DispatchHandle so that it will no longer be
91 called when the GPI triggers an SMI.
93 @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROTOCOL instance.
94 @param[in] DispatchHandle Handle of the service to remove.
96 @retval EFI_SUCCESS Handle of the service to remove.
97 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
101 (EFIAPI
*EFI_SMM_GPI_UNREGISTER
)(
102 IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL
*This
,
103 IN EFI_HANDLE DispatchHandle
107 /// Interface structure for the SMM GPI SMI Dispatch Protocol
109 /// The SMM GPI SMI Dispatch Protocol provides the parent dispatch service
110 /// for the General Purpose Input (GPI) SMI source generator.
112 struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL
{
113 EFI_SMM_GPI_REGISTER Register
;
114 EFI_SMM_GPI_UNREGISTER UnRegister
;
116 /// Denotes the maximum value of inputs that can have handlers attached.
118 UINTN NumSupportedGpis
;
121 extern EFI_GUID gEfiSmmGpiDispatch2ProtocolGuid
;