]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Framework/Protocol/SmmSxDispatch/SmmSxDispatch.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Protocol / SmmSxDispatch / SmmSxDispatch.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 SmmSxDispatch.h
16
17 Abstract:
18
19 EFI Smm Sx Smi Child Protocol
20
21 Revision History
22
23 --*/
24
25 #ifndef _EFI_SMM_SX_DISPATCH_H_
26 #define _EFI_SMM_SX_DISPATCH_H_
27
28 //
29 // Global ID for the Sx SMI Protocol
30 //
31 #define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \
32 { \
33 0x14fc52be, 0x1dc, 0x426c, 0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 \
34 }
35
36 EFI_FORWARD_DECLARATION (EFI_SMM_SX_DISPATCH_PROTOCOL);
37
38 //
39 // Related Definitions
40 //
41 typedef enum {
42 SxS0,
43 SxS1,
44 SxS2,
45 SxS3,
46 SxS4,
47 SxS5,
48 EfiMaximumSleepType
49 } EFI_SLEEP_TYPE;
50
51 typedef enum {
52 SxEntry,
53 SxExit,
54 EfiMaximumPhase
55 } EFI_SLEEP_PHASE;
56
57 typedef struct {
58 EFI_SLEEP_TYPE Type;
59 EFI_SLEEP_PHASE Phase;
60 } EFI_SMM_SX_DISPATCH_CONTEXT;
61
62 //
63 // Member functions
64 //
65 typedef
66 VOID
67 (EFIAPI *EFI_SMM_SX_DISPATCH) (
68 IN EFI_HANDLE DispatchHandle,
69 IN EFI_SMM_SX_DISPATCH_CONTEXT * DispatchContext
70 );
71
72 /*++
73
74 Routine Description:
75 Dispatch function for a Sx state SMI handler.
76
77 Arguments:
78 DispatchHandle - Handle of this dispatch function.
79 DispatchContext - Pointer to the dispatch function's context.
80 The Type and Phase fields are filled in
81 by the Sx dispatch driver prior to invoking
82 this dispatch function.
83 For this intertace, the Sx driver will call the
84 dispatch function for all Sx type and phases,
85 so the Sx state handler(s) must check the Type
86 and Phase field of the Dispatch context and act
87 accordingly.
88
89 Returns:
90 Nothing
91
92 --*/
93 typedef
94 EFI_STATUS
95 (EFIAPI *EFI_SMM_SX_REGISTER) (
96 IN EFI_SMM_SX_DISPATCH_PROTOCOL * This,
97 IN EFI_SMM_SX_DISPATCH DispatchFunction,
98 IN EFI_SMM_SX_DISPATCH_CONTEXT * DispatchContext,
99 OUT EFI_HANDLE * DispatchHandle
100 );
101
102 /*++
103
104 Routine Description:
105 Register a child SMI source dispatch function with a parent SMM driver
106
107 Arguments:
108 This - Protocol instance pointer.
109 DispatchFunction - Pointer to dispatch function to be invoked for
110 this SMI source
111 DispatchContext - Pointer to the dispatch function's context.
112 The caller fills this context in before calling
113 the register function to indicate to the register
114 function which Sx state type and phase the caller
115 wishes to be called back on. For this intertace,
116 the Sx driver will call the registered handlers for
117 all Sx type and phases, so the Sx state handler(s)
118 must check the Type and Phase field of the Dispatch
119 context and act accordingly.
120 DispatchHandle - Handle of dispatch function, for when interfacing
121 with the parent Sx state SMM driver.
122
123 Returns:
124 EFI_SUCCESS - The dispatch function has been successfully
125 registered and the SMI source has been enabled.
126 EFI_UNSUPPORTED - The Sx driver or hardware does not support that
127 Sx Type/Phase.
128 EFI_DEVICE_ERROR - The Sx driver was unable to enable the SMI source.
129 EFI_OUT_OF_RESOURCES - Not enough memory (system or SMM) to manage this
130 child.
131 EFI_INVALID_PARAMETER - DispatchContext is invalid. Type & Phase are not
132 within valid range.
133
134 --*/
135 typedef
136 EFI_STATUS
137 (EFIAPI *EFI_SMM_SX_UNREGISTER) (
138 IN EFI_SMM_SX_DISPATCH_PROTOCOL * This,
139 IN EFI_HANDLE DispatchHandle
140 );
141
142 /*++
143
144 Routine Description:
145 Unregister a child SMI source dispatch function with a parent SMM driver
146
147 Arguments:
148 This - Protocol instance pointer.
149 DispatchHandle - Handle of dispatch function to deregister.
150
151 Returns:
152 EFI_SUCCESS - The dispatch function has been successfully unregistered and the
153 SMI source has been disabled if there are no other registered child
154 dispatch functions for this SMI source.
155 EFI_INVALID_PARAMETER - Handle is invalid.
156 other - TBD
157
158 --*/
159
160 //
161 // Interface structure for the SMM Child Dispatch Protocol
162 //
163 typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL {
164 EFI_SMM_SX_REGISTER Register;
165 EFI_SMM_SX_UNREGISTER UnRegister;
166 } EFI_SMM_SX_DISPATCH_PROTOCOL;
167
168 extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;
169
170 #endif