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