]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmSxDispatch.h
6f2bb7fedaebd64ed7f5dada995a97c515525fe5
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmSxDispatch.h
1 /** @file
2 Provides the parent dispatch service for a given Sx-state source generator.
3
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 @par Revision Reference:
8 This Protocol is defined in Framework of EFI SMM Core Interface Spec
9 Version 0.9.
10
11 **/
12
13 #ifndef _EFI_SMM_SX_DISPATCH_H_
14 #define _EFI_SMM_SX_DISPATCH_H_
15
16 //
17 // Share some common definitions with PI SMM
18 //
19 #include <Protocol/SmmSxDispatch2.h>
20
21 //
22 // Global ID for the Sx SMI Protocol
23 //
24 #define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \
25 { \
26 0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \
27 }
28
29 typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;
30
31 typedef struct {
32 EFI_SLEEP_TYPE Type;
33 EFI_SLEEP_PHASE Phase;
34 } EFI_SMM_SX_DISPATCH_CONTEXT;
35
36 //
37 // Member functions
38 //
39 /**
40 Dispatch function for a Sx state SMI handler.
41
42 @param DispatchHandle The handle of this dispatch function.
43 @param DispatchContext The pointer to the dispatch function's context.
44 The Type and Phase fields are filled in by the Sx dispatch driver
45 prior to invoking this dispatch function. For this interface,
46 the Sx driver will call the dispatch function for all Sx type
47 and phases, so the Sx state handler(s) must check the Type and
48 Phase field of EFI_SMM_SX_DISPATCH_CONTEXT, and act accordingly.
49
50 @return None
51
52 **/
53 typedef
54 VOID
55 (EFIAPI *EFI_SMM_SX_DISPATCH)(
56 IN EFI_HANDLE DispatchHandle,
57 IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext
58 );
59
60 /**
61 Register a child SMI source dispatch function with a parent SMM driver.
62
63 @param This The pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.
64 @param DispatchFunction The function to install.
65 @param DispatchContext The pointer to the dispatch function's context.
66 The caller fills in this context before calling
67 the register function to indicates to the register
68 function which Sx state type and phase the caller
69 wishes to be called back on. For this interface,
70 the Sx driver will call the registered handlers for
71 all Sx type and phases, so the Sx state handler(s)
72 must check the Type and Phase field of the Dispatch
73 context, and act accordingly.
74 @param DispatchHandle The handle of dispatch function, for interfacing
75 with the parent Sx state SMM driver.
76
77 @retval EFI_SUCCESS The dispatch function has been successfully
78 registered and the SMI source has been enabled.
79 @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that
80 Sx Type/Phase.
81 @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.
82 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
83 child.
84 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not
85 within a valid range.
86
87 **/
88 typedef
89 EFI_STATUS
90 (EFIAPI *EFI_SMM_SX_REGISTER)(
91 IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,
92 IN EFI_SMM_SX_DISPATCH DispatchFunction,
93 IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,
94 OUT EFI_HANDLE *DispatchHandle
95 );
96
97 /**
98 Unregisters an Sx-state service
99
100 @param This The pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.
101 @param DispatchHandle The handle of the service to remove.
102
103 @retval EFI_SUCCESS The dispatch function has been successfully unregistered, and the
104 SMI source has been disabled, if there are no other registered child
105 dispatch functions for this SMI source.
106 @retval EFI_INVALID_PARAMETER Handle is invalid.
107
108 **/
109 typedef
110 EFI_STATUS
111 (EFIAPI *EFI_SMM_SX_UNREGISTER)(
112 IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,
113 IN EFI_HANDLE DispatchHandle
114 );
115
116 //
117 // Interface structure for the SMM Child Dispatch Protocol
118 //
119 /**
120 Provides the parent dispatch service for a given Sx-state source generator.
121 **/
122 struct _EFI_SMM_SX_DISPATCH_PROTOCOL {
123 EFI_SMM_SX_REGISTER Register; ///< Installs a child service to be dispatched by this protocol.
124 EFI_SMM_SX_UNREGISTER UnRegister; ///< Removes a child service dispatched by this protocol.
125 };
126
127 extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;
128
129 #endif