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