]>
Commit | Line | Data |
---|---|---|
07c6a47e ED |
1 | /** @file\r |
2 | MM General Purpose Input (GPI) Dispatch Protocol as defined in PI 1.5 Specification\r | |
3 | Volume 4 Management Mode Core Interface.\r | |
4 | \r | |
5 | This protocol provides the parent dispatch service for the General Purpose Input\r | |
6 | (GPI) MMI source generator.\r | |
7 | \r | |
8 | The EFI_MM_GPI_DISPATCH_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 | MMI in response to any of these inputs having a true value provided.\r | |
11 | \r | |
12 | Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r | |
9344f092 | 13 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
07c6a47e ED |
14 | \r |
15 | @par Revision Reference:\r | |
16 | This protocol is from PI Version 1.5.\r | |
17 | \r | |
18 | **/\r | |
19 | \r | |
20 | #ifndef _MM_GPI_DISPATCH_H_\r | |
21 | #define _MM_GPI_DISPATCH_H_\r | |
22 | \r | |
23 | #include <Pi/PiMmCis.h>\r | |
24 | \r | |
25 | #define EFI_MM_GPI_DISPATCH_PROTOCOL_GUID \\r | |
26 | { \\r | |
27 | 0x25566b03, 0xb577, 0x4cbf, {0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80 } \\r | |
28 | }\r | |
29 | \r | |
30 | ///\r | |
31 | /// The dispatch function's context.\r | |
32 | ///\r | |
33 | typedef struct {\r | |
34 | ///\r | |
35 | /// A number from one of 2^64 possible GPIs that can generate an MMI. A\r | |
36 | /// 0 corresponds to logical GPI[0]; 1 corresponds to logical GPI[1]; and\r | |
37 | /// GpiNum of N corresponds to GPI[N], where N can span from 0 to 2^64-1.\r | |
38 | ///\r | |
39 | UINT64 GpiNum;\r | |
40 | } EFI_MM_GPI_REGISTER_CONTEXT;\r | |
41 | \r | |
42 | typedef struct _EFI_MM_GPI_DISPATCH_PROTOCOL EFI_MM_GPI_DISPATCH_PROTOCOL;\r | |
43 | \r | |
44 | /**\r | |
45 | Registers a child MMI source dispatch function with a parent MM driver.\r | |
46 | \r | |
47 | This service registers a function (DispatchFunction) which will be called when an MMI is\r | |
48 | generated because of one or more of the GPIs specified by RegisterContext. On return,\r | |
49 | DispatchHandle contains a unique handle which may be used later to unregister the function\r | |
50 | using UnRegister().\r | |
51 | The DispatchFunction will be called with Context set to the same value as was passed into\r | |
52 | this function in RegisterContext and with CommBuffer pointing to another instance of\r | |
53 | EFI_MM_GPI_REGISTER_CONTEXT describing the GPIs which actually caused the MMI and\r | |
54 | CommBufferSize pointing to the size of the structure.\r | |
55 | \r | |
56 | @param[in] This Pointer to the EFI_MM_GPI_DISPATCH_PROTOCOL instance.\r | |
57 | @param[in] DispatchFunction Function to register for handler when the specified GPI causes an MMI.\r | |
58 | @param[in] RegisterContext Pointer to the dispatch function's context.\r | |
59 | The caller fills this context in before calling\r | |
60 | the register function to indicate to the register\r | |
61 | function the GPI(s) for which the dispatch function\r | |
62 | should be invoked.\r | |
63 | @param[out] DispatchHandle Handle generated by the dispatcher to track the\r | |
64 | function instance.\r | |
65 | \r | |
66 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
67 | registered and the MMI source has been enabled.\r | |
68 | @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.\r | |
69 | @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The GPI input value\r | |
70 | is not within valid range.\r | |
71 | @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.\r | |
72 | **/\r | |
73 | typedef\r | |
74 | EFI_STATUS\r | |
75 | (EFIAPI *EFI_MM_GPI_REGISTER)(\r | |
76 | IN CONST EFI_MM_GPI_DISPATCH_PROTOCOL *This,\r | |
77 | IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,\r | |
78 | IN CONST EFI_MM_GPI_REGISTER_CONTEXT *RegisterContext,\r | |
79 | OUT EFI_HANDLE *DispatchHandle\r | |
80 | );\r | |
81 | \r | |
82 | /**\r | |
83 | Unregisters a General Purpose Input (GPI) service.\r | |
84 | \r | |
85 | This service removes the handler associated with DispatchHandle so that it will no longer be\r | |
86 | called when the GPI triggers an MMI.\r | |
87 | \r | |
88 | @param[in] This Pointer to the EFI_MM_GPI_DISPATCH_PROTOCOL instance.\r | |
89 | @param[in] DispatchHandle Handle of the service to remove.\r | |
90 | \r | |
91 | @retval EFI_SUCCESS Handle of the service to remove.\r | |
92 | @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r | |
93 | **/\r | |
94 | typedef\r | |
95 | EFI_STATUS\r | |
96 | (EFIAPI *EFI_MM_GPI_UNREGISTER)(\r | |
97 | IN CONST EFI_MM_GPI_DISPATCH_PROTOCOL *This,\r | |
98 | IN EFI_HANDLE DispatchHandle\r | |
99 | );\r | |
100 | \r | |
101 | ///\r | |
102 | /// Interface structure for the MM GPI MMI Dispatch Protocol\r | |
103 | ///\r | |
104 | /// The MM GPI MMI Dispatch Protocol provides the parent dispatch service\r | |
105 | /// for the General Purpose Input (GPI) MMI source generator.\r | |
106 | ///\r | |
107 | struct _EFI_MM_GPI_DISPATCH_PROTOCOL {\r | |
108 | EFI_MM_GPI_REGISTER Register;\r | |
109 | EFI_MM_GPI_UNREGISTER UnRegister;\r | |
110 | ///\r | |
111 | /// Denotes the maximum value of inputs that can have handlers attached.\r | |
112 | ///\r | |
113 | UINTN NumSupportedGpis;\r | |
114 | };\r | |
115 | \r | |
116 | extern EFI_GUID gEfiMmGpiDispatchProtocolGuid;\r | |
117 | \r | |
118 | #endif\r | |
119 | \r |