]>
Commit | Line | Data |
---|---|---|
b6e51fd5 | 1 | /** @file\r |
2 | SMM General Purpose Input (GPI) Dispatch2 Protocol as defined in PI 1.1 Specification\r | |
3 | Volume 4 System Management Mode Core Interface.\r | |
4 | \r | |
5 | This protocol provides the parent dispatch service for the General Purpose Input \r | |
6 | (GPI) SMI source generator.\r | |
7 | \r | |
8 | The EFI_SMM_GPI_DISPATCH2_PROTOCOL provides the ability to install child handlers for the \r | |
9 | given event types. Several inputs can be enabled. This purpose of this interface is to generate an \r | |
10 | SMI in response to any of these inputs having a true value provided.\r | |
11 | \r | |
12 | Copyright (c) 2009, Intel Corporation\r | |
13 | All rights reserved. This program and the accompanying materials\r | |
14 | are licensed and made available under the terms and conditions of the BSD License\r | |
15 | which accompanies this distribution. The full text of the license may be found at\r | |
16 | http://opensource.org/licenses/bsd-license.php\r | |
17 | \r | |
18 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
19 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
20 | \r | |
21 | @par Revision Reference:\r | |
22 | This protocol is from PI Version 1.1.\r | |
23 | \r | |
24 | **/\r | |
25 | \r | |
26 | #ifndef _SMM_GPI_DISPATCH2_H_\r | |
27 | #define _SMM_GPI_DISPATCH2_H_\r | |
28 | \r | |
29 | #include <Pi/PiSmmCis.h>\r | |
30 | \r | |
a2bb197e | 31 | ///\r |
32 | /// Note:\r | |
33 | /// To avoid name conflict between PI and Framework SMM spec, the following names defined\r | |
34 | /// in PI 1.2 SMM spec are renamed. These renamings are not yet in a public PI spec and errta.\r | |
35 | ///\r | |
36 | /// EFI_SMM_GPI_REGISTER -> EFI_SMM_GPI_REGISTER2\r | |
37 | /// EFI_SMM_GPI_UNREGISTER -> EFI_SMM_GPI_UNREGISTER2\r | |
38 | ///\r | |
39 | \r | |
b6e51fd5 | 40 | #define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID \\r |
41 | { \\r | |
42 | 0x25566b03, 0xb577, 0x4cbf, {0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80 } \\r | |
43 | }\r | |
44 | \r | |
45 | ///\r | |
46 | /// The dispatch function's context.\r | |
47 | ///\r | |
48 | typedef struct {\r | |
49 | ///\r | |
50 | /// A bit mask of 64 possible GPIs that can generate an SMI. Bit 0 corresponds to logical \r | |
51 | /// GPI[0], 1 corresponds to logical GPI[1], and so on.\r | |
52 | ///\r | |
53 | UINT64 GpiNum;\r | |
54 | } EFI_SMM_GPI_REGISTER_CONTEXT;\r | |
55 | \r | |
56 | typedef struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTOCOL;\r | |
57 | \r | |
58 | /**\r | |
59 | Registers a child SMI source dispatch function with a parent SMM driver.\r | |
60 | \r | |
61 | This service registers a function (DispatchFunction) which will be called when an SMI is \r | |
62 | generated because of one or more of the GPIs specified by RegisterContext. On return, \r | |
63 | DispatchHandle contains a unique handle which may be used later to unregister the function \r | |
64 | using UnRegister().\r | |
65 | The DispatchFunction will be called with Context set to the same value as was passed into \r | |
66 | this function in RegisterContext and with CommBuffer pointing to another instance of \r | |
67 | EFI_SMM_GPI_REGISTER_CONTEXT describing the GPIs which actually caused the SMI and \r | |
68 | CommBufferSize pointing to the size of the structure.\r | |
69 | \r | |
70 | @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROTOCOL instance.\r | |
71 | @param[in] DispatchFunction Function to register for handler when the specified GPI causes an SMI.\r | |
72 | @param[in] RegisterContext Pointer to the dispatch function's context.\r | |
73 | The caller fills this context in before calling\r | |
74 | the register function to indicate to the register\r | |
75 | function the GPI(s) for which the dispatch function\r | |
76 | should be invoked.\r | |
77 | @param[out] DispatchHandle Handle generated by the dispatcher to track the\r | |
78 | function instance.\r | |
79 | \r | |
80 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
81 | registered and the SMI source has been enabled.\r | |
82 | @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r | |
83 | @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The GPI input value\r | |
84 | is not within valid range.\r | |
85 | @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.\r | |
86 | **/\r | |
87 | typedef\r | |
88 | EFI_STATUS\r | |
a2bb197e | 89 | (EFIAPI *EFI_SMM_GPI_REGISTER2)(\r |
b6e51fd5 | 90 | IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This,\r |
91 | IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,\r | |
92 | IN CONST EFI_SMM_GPI_REGISTER_CONTEXT *RegisterContext,\r | |
93 | OUT EFI_HANDLE *DispatchHandle\r | |
94 | );\r | |
95 | \r | |
96 | /**\r | |
97 | Unregisters a General Purpose Input (GPI) service.\r | |
98 | \r | |
99 | This service removes the handler associated with DispatchHandle so that it will no longer be \r | |
100 | called when the GPI triggers an SMI. \r | |
101 | \r | |
102 | @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROTOCOL instance.\r | |
103 | @param[in] DispatchHandle Handle of the service to remove.\r | |
104 | \r | |
105 | @retval EFI_SUCCESS Handle of the service to remove.\r | |
106 | @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r | |
107 | **/\r | |
108 | typedef\r | |
109 | EFI_STATUS\r | |
a2bb197e | 110 | (EFIAPI *EFI_SMM_GPI_UNREGISTER2)(\r |
b6e51fd5 | 111 | IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This,\r |
112 | IN EFI_HANDLE DispatchHandle\r | |
113 | );\r | |
114 | \r | |
115 | ///\r | |
116 | /// Interface structure for the SMM GPI SMI Dispatch Protocol\r | |
117 | ///\r | |
118 | /// The SMM GPI SMI Dispatch Protocol provides the parent dispatch service\r | |
119 | /// for the General Purpose Input (GPI) SMI source generator.\r | |
120 | ///\r | |
121 | struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL {\r | |
a2bb197e | 122 | EFI_SMM_GPI_REGISTER2 Register;\r |
123 | EFI_SMM_GPI_UNREGISTER2 UnRegister;\r | |
b6e51fd5 | 124 | ///\r |
125 | /// Denotes the maximum value of inputs that can have handlers attached.\r | |
126 | ///\r | |
127 | UINTN NumSupportedGpis;\r | |
128 | };\r | |
129 | \r | |
130 | extern EFI_GUID gEfiSmmGpiDispatch2ProtocolGuid;\r | |
131 | \r | |
132 | #endif\r | |
133 | \r |