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