]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SmmGpiDispatch2.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmGpiDispatch2.h
CommitLineData
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
9df063a0
HT
12 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
13 This program and the accompanying materials\r
b6e51fd5 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
31#define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID \\r
32 { \\r
33 0x25566b03, 0xb577, 0x4cbf, {0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80 } \\r
34 }\r
35\r
36///\r
37/// The dispatch function's context.\r
38///\r
39typedef struct {\r
40 ///\r
41 /// A bit mask of 64 possible GPIs that can generate an SMI. Bit 0 corresponds to logical \r
42 /// GPI[0], 1 corresponds to logical GPI[1], and so on.\r
43 ///\r
44 UINT64 GpiNum;\r
45} EFI_SMM_GPI_REGISTER_CONTEXT;\r
46\r
47typedef struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTOCOL;\r
48\r
49/**\r
50 Registers a child SMI source dispatch function with a parent SMM driver.\r
51\r
52 This service registers a function (DispatchFunction) which will be called when an SMI is \r
53 generated because of one or more of the GPIs specified by RegisterContext. On return, \r
54 DispatchHandle contains a unique handle which may be used later to unregister the function \r
55 using UnRegister().\r
56 The DispatchFunction will be called with Context set to the same value as was passed into \r
57 this function in RegisterContext and with CommBuffer pointing to another instance of \r
58 EFI_SMM_GPI_REGISTER_CONTEXT describing the GPIs which actually caused the SMI and \r
59 CommBufferSize pointing to the size of the structure.\r
60\r
61 @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROTOCOL instance.\r
62 @param[in] DispatchFunction Function to register for handler when the specified GPI causes an SMI.\r
63 @param[in] RegisterContext Pointer to the dispatch function's context.\r
64 The caller fills this context in before calling\r
65 the register function to indicate to the register\r
66 function the GPI(s) for which the dispatch function\r
67 should be invoked.\r
68 @param[out] DispatchHandle Handle generated by the dispatcher to track the\r
69 function instance.\r
70\r
71 @retval EFI_SUCCESS The dispatch function has been successfully\r
72 registered and the SMI source has been enabled.\r
73 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
74 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The GPI input value\r
75 is not within valid range.\r
76 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.\r
77**/\r
78typedef\r
79EFI_STATUS\r
a2bb197e 80(EFIAPI *EFI_SMM_GPI_REGISTER2)(\r
b6e51fd5 81 IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This,\r
82 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,\r
83 IN CONST EFI_SMM_GPI_REGISTER_CONTEXT *RegisterContext,\r
84 OUT EFI_HANDLE *DispatchHandle\r
85 );\r
86\r
87/**\r
88 Unregisters a General Purpose Input (GPI) service.\r
89\r
90 This service removes the handler associated with DispatchHandle so that it will no longer be \r
91 called when the GPI triggers an SMI. \r
92\r
93 @param[in] This Pointer to the EFI_SMM_GPI_DISPATCH2_PROTOCOL instance.\r
94 @param[in] DispatchHandle Handle of the service to remove.\r
95\r
96 @retval EFI_SUCCESS Handle of the service to remove.\r
97 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
98**/\r
99typedef\r
100EFI_STATUS\r
a2bb197e 101(EFIAPI *EFI_SMM_GPI_UNREGISTER2)(\r
b6e51fd5 102 IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This,\r
103 IN EFI_HANDLE DispatchHandle\r
104 );\r
105\r
106///\r
107/// Interface structure for the SMM GPI SMI Dispatch Protocol\r
108///\r
109/// The SMM GPI SMI Dispatch Protocol provides the parent dispatch service\r
110/// for the General Purpose Input (GPI) SMI source generator.\r
111///\r
112struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL {\r
a2bb197e 113 EFI_SMM_GPI_REGISTER2 Register;\r
114 EFI_SMM_GPI_UNREGISTER2 UnRegister;\r
b6e51fd5 115 ///\r
116 /// Denotes the maximum value of inputs that can have handlers attached.\r
117 ///\r
118 UINTN NumSupportedGpis;\r
119};\r
120\r
121extern EFI_GUID gEfiSmmGpiDispatch2ProtocolGuid;\r
122\r
123#endif\r
124\r