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