Comment update.
[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#include <PiDxe.h>\r
24\r
79964ac8 25//\r
26// Global ID for the GPI SMI Protocol\r
27//\r
28#define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \\r
29 { \\r
30 0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \\r
31 }\r
32\r
33typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL;\r
34\r
35//\r
36// Related Definitions\r
37//\r
b530f741 38\r
79964ac8 39//\r
40// GpiMask is a bit mask of 32 possible general purpose inputs that can generate a\r
41// a SMI. Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.\r
42//\r
43// The logical GPI index to physical pin on device is described by the GPI device name\r
44// found on the same handle as the GpiSmi child dispatch protocol. The GPI device name\r
45// is defined as protocol with a GUID name and NULL protocol pointer.\r
46//\r
47typedef struct {\r
48 UINTN GpiNum;\r
49} EFI_SMM_GPI_DISPATCH_CONTEXT;\r
50\r
51//\r
52// Member functions\r
53//\r
b530f741 54\r
79964ac8 55/**\r
56 Dispatch function for a GPI SMI handler.\r
57\r
58 @param DispatchHandle Handle of this dispatch function.\r
59 @param DispatchContext Pointer to the dispatch function's context.\r
60 The DispatchContext fields are filled in by the dispatching driver prior to\r
61 invoking this dispatch function.\r
79964ac8 62**/\r
63typedef\r
64VOID\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
700a7869 73 @param This Pointer to the EFI_SMM_GPI_DISPATCH_PROTOCOL instance.\r
74 @param DispatchFunction Function to install.\r
79964ac8 75 @param DispatchContext Pointer to the dispatch function's context.\r
76 The caller fills this context in before calling\r
77 the register function to indicate to the register\r
78 function the GPI(s) for which the dispatch function\r
79 should be invoked.\r
700a7869 80 @param DispatchHandle Handle generated by the dispatcher to track the \r
81 function instance.\r
79964ac8 82\r
83 @retval EFI_SUCCESS The dispatch function has been successfully\r
84 registered and the SMI source has been enabled.\r
85 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
86 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
87 child.\r
88 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value\r
89 is not within valid range.\r
90\r
91**/\r
92typedef\r
93EFI_STATUS\r
69686d56 94(EFIAPI *EFI_SMM_GPI_REGISTER)(\r
700a7869 95 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,\r
96 IN EFI_SMM_GPI_DISPATCH DispatchFunction,\r
97 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext,\r
98 OUT EFI_HANDLE *DispatchHandle\r
79964ac8 99 );\r
100\r
101/**\r
700a7869 102 Unregisters a General Purpose Input (GPI) service.\r
79964ac8 103\r
700a7869 104 @param This Pointer to the EFI_SMM_GPI_DISPATCH_PROTOCOL instance.\r
105 @param DispatchHandle Handle of the service to remove.\r
79964ac8 106\r
107 @retval EFI_SUCCESS The dispatch function has been successfully\r
108 unregistered and the SMI source has been disabled\r
109 if there are no other registered child dispatch\r
110 functions for this SMI source.\r
ec87b52a 111 @retval EFI_INVALID_PARAMETER DispatchHandle is invalid.\r
79964ac8 112\r
113**/\r
114typedef\r
115EFI_STATUS\r
69686d56 116(EFIAPI *EFI_SMM_GPI_UNREGISTER)(\r
700a7869 117 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,\r
118 IN EFI_HANDLE DispatchHandle\r
79964ac8 119 );\r
120\r
121//\r
122// Interface structure for the SMM GPI SMI Dispatch Protocol\r
123//\r
79964ac8 124struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {\r
125 EFI_SMM_GPI_REGISTER Register;\r
126 EFI_SMM_GPI_UNREGISTER UnRegister;\r
b530f741 127\r
128 //\r
129 // Denotes the maximum value of inputs that can have handlers attached.\r
130 //\r
79964ac8 131 UINTN NumSupportedGpis;\r
132};\r
133\r
134extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;\r
135\r
136#endif\r
b530f741 137\r