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