]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmGpiDispatch.h
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2893 6f19259b...
[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 #include <PiDxe.h>
25
26 //
27 // Global ID for the GPI SMI Protocol
28 //
29 #define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \
30 { \
31 0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \
32 }
33
34 typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL;
35
36 //
37 // Related Definitions
38 //
39 //
40 // GpiMask is a bit mask of 32 possible general purpose inputs that can generate a
41 // a SMI. Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.
42 //
43 // The logical GPI index to physical pin on device is described by the GPI device name
44 // found on the same handle as the GpiSmi child dispatch protocol. The GPI device name
45 // is defined as protocol with a GUID name and NULL protocol pointer.
46 //
47 typedef struct {
48 UINTN GpiNum;
49 } EFI_SMM_GPI_DISPATCH_CONTEXT;
50
51 //
52 // Member functions
53 //
54 /**
55 Dispatch function for a GPI SMI handler.
56
57 @param DispatchHandle Handle of this dispatch function.
58 @param DispatchContext Pointer to the dispatch function's context.
59 The DispatchContext fields are filled in by the dispatching driver prior to
60 invoking this dispatch function.
61
62 @return None
63
64 **/
65 typedef
66 VOID
67 (EFIAPI *EFI_SMM_GPI_DISPATCH) (
68 IN EFI_HANDLE DispatchHandle,
69 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext
70 );
71
72 /**
73 Register a child SMI source dispatch function with a parent SMM driver
74
75 @param This Protocol instance pointer.
76 @param DispatchFunction Pointer to dispatch function to be invoked for
77 this SMI source
78 @param DispatchContext Pointer to the dispatch function's context.
79 The caller fills this context in before calling
80 the register function to indicate to the register
81 function the GPI(s) for which the dispatch function
82 should be invoked.
83 @param DispatchHandle Handle of dispatch function, for when interfacing
84 with the parent Sx state SMM driver.
85
86 @retval EFI_SUCCESS The dispatch function has been successfully
87 registered and the SMI source has been enabled.
88 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
89 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
90 child.
91 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value
92 is not within valid range.
93
94 **/
95 typedef
96 EFI_STATUS
97 (EFIAPI *EFI_SMM_GPI_REGISTER) (
98 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
99 IN EFI_SMM_GPI_DISPATCH DispatchFunction,
100 IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext,
101 OUT EFI_HANDLE *DispatchHandle
102 );
103
104 /**
105 Unregister a child SMI source dispatch function with a parent SMM driver
106
107 @param This Protocol instance pointer.
108 @param DispatchHandle Handle of dispatch function to deregister.
109
110 @retval EFI_SUCCESS The dispatch function has been successfully
111 unregistered and the SMI source has been disabled
112 if there are no other registered child dispatch
113 functions for this SMI source.
114 @retval EFI_INVALID_PARAMETER Handle is invalid.
115 @retval other TBD
116
117 **/
118 typedef
119 EFI_STATUS
120 (EFIAPI *EFI_SMM_GPI_UNREGISTER) (
121 IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
122 IN EFI_HANDLE DispatchHandle
123 );
124
125 //
126 // Interface structure for the SMM GPI SMI Dispatch Protocol
127 //
128 /**
129 @par Protocol Description:
130 Provides the parent dispatch service for the General Purpose Input
131 (GPI) SMI source generator.
132
133 @param Register
134 Installs a child service to be dispatched by this protocol.
135
136 @param UnRegister
137 Removes a child service dispatched by this protocol.
138
139 @param NumSupportedGpis
140 Denotes the maximum value of inputs that can have handlers attached.
141
142 **/
143 struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {
144 EFI_SMM_GPI_REGISTER Register;
145 EFI_SMM_GPI_UNREGISTER UnRegister;
146 UINTN NumSupportedGpis;
147 };
148
149 extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;
150
151 #endif