]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmGpiDispatch.h
7454bcc6851857c20dcd55e9adf5211d3e75e10b
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmGpiDispatch.h
1 /** @file
2 This file declares Smm Gpi Smi Child Protocol
3
4 Copyright (c) 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: SmmGpiDispatch.h
14
15 @par Revision Reference:
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec
17 Version 0.9.
18
19 **/
20
21 #ifndef _EFI_SMM_GPI_DISPATCH_H_
22 #define _EFI_SMM_GPI_DISPATCH_H_
23
24 //
25 // Global ID for the GPI SMI Protocol
26 //
27 #define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \
28 { \
29 0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \
30 }
31
32 typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL;
33
34 //
35 // Related Definitions
36 //
37 //
38 // GpiMask is a bit mask of 32 possible general purpose inputs that can generate a
39 // a SMI. Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.
40 //
41 // The logical GPI index to physical pin on device is described by the GPI device name
42 // found on the same handle as the GpiSmi child dispatch protocol. The GPI device name
43 // is defined as protocol with a GUID name and NULL protocol pointer.
44 //
45 typedef struct {
46 UINTN GpiNum;
47 } EFI_SMM_GPI_DISPATCH_CONTEXT;
48
49 //
50 // Member functions
51 //
52 /**
53 Dispatch function for a GPI SMI handler.
54
55 @param DispatchHandle Handle of this dispatch function.
56 @param DispatchContext Pointer to the dispatch function's context.
57 The DispatchContext fields are filled in by the dispatching driver prior to
58 invoking this dispatch function.
59
60 @return None
61
62 **/
63 typedef
64 VOID
65 (EFIAPI *EFI_SMM_GPI_DISPATCH) (
66 IN EFI_HANDLE DispatchHandle,
67 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext
68 );
69
70 /**
71 Register a child SMI source dispatch function with a parent SMM driver
72
73 @param This Protocol instance pointer.
74 @param DispatchFunction Pointer to dispatch function to be invoked for
75 this SMI source
76 @param DispatchContext Pointer to the dispatch function's context.
77 The caller fills this context in before calling
78 the register function to indicate to the register
79 function the GPI(s) for which the dispatch function
80 should be invoked.
81 @param DispatchHandle Handle of dispatch function, for when interfacing
82 with the parent Sx state SMM driver.
83
84 @retval EFI_SUCCESS The dispatch function has been successfully
85 registered and the SMI source has been enabled.
86 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
87 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
88 child.
89 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value
90 is not within valid range.
91
92 **/
93 typedef
94 EFI_STATUS
95 (EFIAPI *EFI_SMM_GPI_REGISTER) (
96 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
97 IN EFI_SMM_GPI_DISPATCH DispatchFunction,
98 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext,
99 OUT EFI_HANDLE *DispatchHandle
100 );
101
102 /**
103 Unregister a child SMI source dispatch function with a parent SMM driver
104
105 @param This Protocol instance pointer.
106 @param DispatchHandle Handle of dispatch function to deregister.
107
108 @retval EFI_SUCCESS The dispatch function has been successfully
109 unregistered and the SMI source has been disabled
110 if there are no other registered child dispatch
111 functions for this SMI source.
112 @retval EFI_INVALID_PARAMETER Handle is invalid.
113 @retval other TBD
114
115 **/
116 typedef
117 EFI_STATUS
118 (EFIAPI *EFI_SMM_GPI_UNREGISTER) (
119 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
120 IN EFI_HANDLE DispatchHandle
121 );
122
123 //
124 // Interface structure for the SMM GPI SMI Dispatch Protocol
125 //
126 /**
127 @par Protocol Description:
128 Provides the parent dispatch service for the General Purpose Input
129 (GPI) SMI source generator.
130
131 @param Register
132 Installs a child service to be dispatched by this protocol.
133
134 @param UnRegister
135 Removes a child service dispatched by this protocol.
136
137 @param NumSupportedGpis
138 Denotes the maximum value of inputs that can have handlers attached.
139
140 **/
141 struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {
142 EFI_SMM_GPI_REGISTER Register;
143 EFI_SMM_GPI_UNREGISTER UnRegister;
144 UINTN NumSupportedGpis;
145 };
146
147 extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;
148
149 #endif