]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmGpiDispatch.h
Clean up to update the reference of the these macros:
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmGpiDispatch.h
1 /** @file
2 This file declares Smm Gpi Smi Child Protocol
3 The EFI_SMM_GPI_DISPATCH_PROTOCOL provides the ability to install child handlers for the
4 given event types. Several inputs can be enabled. This purpose of this interface is to generate an
5 SMI in response to any of these inputs having a true value provided.
6
7 Copyright (c) 2007, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 Module Name: SmmGpiDispatch.h
17
18 @par Revision Reference:
19 This Protocol is defined in Framework of EFI SMM Core Interface Spec
20 Version 0.9.
21
22 **/
23
24 #ifndef _EFI_SMM_GPI_DISPATCH_H_
25 #define _EFI_SMM_GPI_DISPATCH_H_
26
27 #include <PiDxe.h>
28
29 //
30 // Global ID for the GPI SMI Protocol
31 //
32 #define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \
33 { \
34 0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \
35 }
36
37 typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL;
38
39 //
40 // Related Definitions
41 //
42 //
43 // GpiMask is a bit mask of 32 possible general purpose inputs that can generate a
44 // a SMI. Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.
45 //
46 // The logical GPI index to physical pin on device is described by the GPI device name
47 // found on the same handle as the GpiSmi child dispatch protocol. The GPI device name
48 // is defined as protocol with a GUID name and NULL protocol pointer.
49 //
50 typedef struct {
51 UINTN GpiNum;
52 } EFI_SMM_GPI_DISPATCH_CONTEXT;
53
54 //
55 // Member functions
56 //
57 /**
58 Dispatch function for a GPI SMI handler.
59
60 @param DispatchHandle Handle of this dispatch function.
61 @param DispatchContext Pointer to the dispatch function's context.
62 The DispatchContext fields are filled in by the dispatching driver prior to
63 invoking this dispatch function.
64
65 @return None
66
67 **/
68 typedef
69 VOID
70 (EFIAPI *EFI_SMM_GPI_DISPATCH)(
71 IN EFI_HANDLE DispatchHandle,
72 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext
73 );
74
75 /**
76 Register a child SMI source dispatch function with a parent SMM driver
77
78 @param This Protocol instance pointer.
79 @param DispatchFunction Pointer to dispatch function to be invoked for
80 this SMI source
81 @param DispatchContext Pointer to the dispatch function's context.
82 The caller fills this context in before calling
83 the register function to indicate to the register
84 function the GPI(s) for which the dispatch function
85 should be invoked.
86 @param DispatchHandle Handle of dispatch function, for when interfacing
87 with the parent Sx state SMM driver.
88
89 @retval EFI_SUCCESS The dispatch function has been successfully
90 registered and the SMI source has been enabled.
91 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
92 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
93 child.
94 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value
95 is not within valid range.
96
97 **/
98 typedef
99 EFI_STATUS
100 (EFIAPI *EFI_SMM_GPI_REGISTER)(
101 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
102 IN EFI_SMM_GPI_DISPATCH DispatchFunction,
103 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext,
104 OUT EFI_HANDLE *DispatchHandle
105 );
106
107 /**
108 Unregister a child SMI source dispatch function with a parent SMM driver
109
110 @param This Protocol instance pointer.
111 @param DispatchHandle Handle of dispatch function to deregister.
112
113 @retval EFI_SUCCESS The dispatch function has been successfully
114 unregistered and the SMI source has been disabled
115 if there are no other registered child dispatch
116 functions for this SMI source.
117 @retval EFI_INVALID_PARAMETER Handle is invalid.
118 @retval other TBD
119
120 **/
121 typedef
122 EFI_STATUS
123 (EFIAPI *EFI_SMM_GPI_UNREGISTER)(
124 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
125 IN EFI_HANDLE DispatchHandle
126 );
127
128 //
129 // Interface structure for the SMM GPI SMI Dispatch Protocol
130 //
131 /**
132 @par Protocol Description:
133 Provides the parent dispatch service for the General Purpose Input
134 (GPI) SMI source generator.
135
136 @param Register
137 Installs a child service to be dispatched by this protocol.
138
139 @param UnRegister
140 Removes a child service dispatched by this protocol.
141
142 @param NumSupportedGpis
143 Denotes the maximum value of inputs that can have handlers attached.
144
145 **/
146 struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {
147 EFI_SMM_GPI_REGISTER Register;
148 EFI_SMM_GPI_UNREGISTER UnRegister;
149 UINTN NumSupportedGpis;
150 };
151
152 extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;
153
154 #endif