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