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