2 This file declares Smm Gpi Smi Child Protocol.
4 The EFI_SMM_GPI_DISPATCH_PROTOCOL is defined in Framework of EFI SMM Core Interface Spec
5 Version 0.9. It provides the ability to install child handlers for the given event types.
6 Several inputs can be enabled. This purpose of this interface is to generate an
7 SMI in response to any of these inputs having a true value provided.
9 Copyright (c) 2007 - 2009, Intel Corporation
10 All rights reserved. This program and the accompanying materials
11 are licensed and made available under the terms and conditions of the BSD License
12 which accompanies this distribution. The full text of the license may be found at
13 http://opensource.org/licenses/bsd-license.php
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #ifndef _SMM_GPI_DISPATCH_H_
21 #define _SMM_GPI_DISPATCH_H_
25 // Global ID for the GPI SMI Protocol
27 #define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \
29 0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \
32 typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL
;
35 // Related Definitions
39 // GpiMask is a bit mask of 32 possible general purpose inputs that can generate a
40 // a SMI. Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.
42 // The logical GPI index to physical pin on device is described by the GPI device name
43 // found on the same handle as the GpiSmi child dispatch protocol. The GPI device name
44 // is defined as protocol with a GUID name and NULL protocol pointer.
48 } EFI_SMM_GPI_DISPATCH_CONTEXT
;
55 Dispatch function for a GPI SMI handler.
57 @param DispatchHandle Handle of this dispatch function.
58 @param DispatchContext Pointer to the dispatch function's context.
59 The DispatchContext fields are filled in by the dispatching driver prior to
60 invoking this dispatch function.
64 (EFIAPI
*EFI_SMM_GPI_DISPATCH
)(
65 IN EFI_HANDLE DispatchHandle
,
66 IN EFI_SMM_GPI_DISPATCH_CONTEXT
*DispatchContext
70 Register a child SMI source dispatch function with a parent SMM driver
72 @param This Pointer to the EFI_SMM_GPI_DISPATCH_PROTOCOL instance.
73 @param DispatchFunction Function to install.
74 @param DispatchContext Pointer to the dispatch function's context.
75 The caller fills this context in before calling
76 the register function to indicate to the register
77 function the GPI(s) for which the dispatch function
79 @param DispatchHandle Handle generated by the dispatcher to track the
82 @retval EFI_SUCCESS The dispatch function has been successfully
83 registered and the SMI source has been enabled.
84 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
85 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
87 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value
88 is not within valid range.
93 (EFIAPI
*EFI_SMM_GPI_REGISTER
)(
94 IN EFI_SMM_GPI_DISPATCH_PROTOCOL
*This
,
95 IN EFI_SMM_GPI_DISPATCH DispatchFunction
,
96 IN EFI_SMM_GPI_DISPATCH_CONTEXT
*DispatchContext
,
97 OUT EFI_HANDLE
*DispatchHandle
101 Unregisters a General Purpose Input (GPI) service.
103 @param This Pointer to the EFI_SMM_GPI_DISPATCH_PROTOCOL instance.
104 @param DispatchHandle Handle of the service to remove.
106 @retval EFI_SUCCESS The dispatch function has been successfully
107 unregistered and the SMI source has been disabled
108 if there are no other registered child dispatch
109 functions for this SMI source.
110 @retval EFI_INVALID_PARAMETER DispatchHandle is invalid.
115 (EFIAPI
*EFI_SMM_GPI_UNREGISTER
)(
116 IN EFI_SMM_GPI_DISPATCH_PROTOCOL
*This
,
117 IN EFI_HANDLE DispatchHandle
121 // Interface structure for the SMM GPI SMI Dispatch Protocol
123 struct _EFI_SMM_GPI_DISPATCH_PROTOCOL
{
124 EFI_SMM_GPI_REGISTER Register
;
125 EFI_SMM_GPI_UNREGISTER UnRegister
;
128 /// Denotes the maximum value of inputs that can have handlers attached.
130 UINTN NumSupportedGpis
;
133 extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid
;