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