]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmGpiDispatch.h
updated parameters name to match spec.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmGpiDispatch.h
CommitLineData
79964ac8 1/** @file\r
b530f741 2 This file declares Smm Gpi Smi Child Protocol.\r
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
b530f741 9 Copyright (c) 2007 - 2009, Intel Corporation\r
79964ac8 10 All rights reserved. This program and the accompanying materials\r
11 are licensed and made available under the terms and conditions of the BSD License\r
12 which accompanies this distribution. 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
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
32typedef 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
39// GpiMask is a bit mask of 32 possible general purpose inputs that can generate a\r
40// a SMI. Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.\r
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
46typedef 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
57 @param DispatchHandle Handle of this dispatch function.\r
58 @param DispatchContext Pointer to the dispatch function's context.\r
59 The DispatchContext fields are filled in by the dispatching driver prior to\r
60 invoking this dispatch function.\r
79964ac8 61**/\r
62typedef\r
63VOID\r
69686d56 64(EFIAPI *EFI_SMM_GPI_DISPATCH)(\r
79964ac8 65 IN EFI_HANDLE DispatchHandle,\r
66 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext\r
67 );\r
68\r
69/**\r
70 Register a child SMI source dispatch function with a parent SMM driver\r
71\r
700a7869 72 @param This Pointer to the EFI_SMM_GPI_DISPATCH_PROTOCOL instance.\r
73 @param DispatchFunction Function to install.\r
79964ac8 74 @param DispatchContext Pointer to the dispatch function's context.\r
75 The caller fills this context in before calling\r
76 the register function to indicate to the register\r
77 function the GPI(s) for which the dispatch function\r
78 should be invoked.\r
700a7869 79 @param DispatchHandle Handle generated by the dispatcher to track the \r
80 function instance.\r
79964ac8 81\r
82 @retval EFI_SUCCESS The dispatch function has been successfully\r
83 registered and the SMI source has been enabled.\r
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
91typedef\r
92EFI_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
700a7869 103 @param This Pointer to the EFI_SMM_GPI_DISPATCH_PROTOCOL instance.\r
104 @param DispatchHandle Handle of the service to remove.\r
79964ac8 105\r
106 @retval EFI_SUCCESS The dispatch function has been successfully\r
107 unregistered and the SMI source has been disabled\r
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
113typedef\r
114EFI_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 123struct _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
133extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;\r
134\r
135#endif\r
b530f741 136\r