]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmSwDispatch.h
fbffe71946c3c5578daf9d3f6b94b65aaf45bf91
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmSwDispatch.h
1 /** @file
2 Provides the parent dispatch service for a given SMI source generator.
3
4 Copyright (c) 2007 - 2009, 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 @par Revision Reference:
14 This Protocol is defined in Framework for EFI SMM Core Interface Spec
15 Version 0.9.
16
17 **/
18
19 #ifndef _EFI_SMM_SW_DISPATCH_H_
20 #define _EFI_SMM_SW_DISPATCH_H_
21
22
23 //
24 // Global ID for the SW SMI Protocol
25 //
26 #define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \
27 { \
28 0xe541b773, 0xdd11, 0x420c, {0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf } \
29 }
30
31 typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL EFI_SMM_SW_DISPATCH_PROTOCOL;
32
33 //
34 // Related Definitions
35 //
36 //
37 // A particular chipset may not support all possible software SMI input values.
38 // For example, the ICH supports only values 00h to 0FFh. The parent only allows a single
39 // child registration for each SwSmiInputValue.
40 //
41 typedef struct {
42 UINTN SwSmiInputValue;
43 } EFI_SMM_SW_DISPATCH_CONTEXT;
44
45 //
46 // Member functions
47 //
48 /**
49 Dispatch function for a Software SMI handler.
50
51 @param DispatchHandle Handle of this dispatch function.
52 @param DispatchContext Pointer to the dispatch function's context.
53 The SwSmiInputValue field is filled in
54 by the software dispatch driver prior to
55 invoking this dispatch function.
56 The dispatch function will only be called
57 for input values for which it is registered.
58
59 @return None
60
61 **/
62 typedef
63 VOID
64 (EFIAPI *EFI_SMM_SW_DISPATCH)(
65 IN EFI_HANDLE DispatchHandle,
66 IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext
67 );
68
69 /**
70 Register a child SMI source dispatch function with a parent SMM driver
71
72 @param This Pointer to the EFI_SMM_SW_DISPATCH_PROTOCOL instance.
73 @param DispatchFunction Function to install.
74 @param DispatchContext Pointer to the dispatch function's context.
75 The caller fills this context in before calling
76 the register function to indicate to the register
77 function which Software SMI input value the
78 dispatch function should be invoked for.
79 @param DispatchHandle Handle generated by the dispatcher to track the function instance.
80
81 @retval EFI_SUCCESS The dispatch function has been successfully
82 registered and the SMI source has been enabled.
83 @retval EFI_DEVICE_ERROR The SW driver was unable to enable the SMI source.
84 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
85 child.
86 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The SW SMI input value
87 is not within valid range.
88
89 **/
90 typedef
91 EFI_STATUS
92 (EFIAPI *EFI_SMM_SW_REGISTER)(
93 IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,
94 IN EFI_SMM_SW_DISPATCH DispatchFunction,
95 IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext,
96 OUT EFI_HANDLE *DispatchHandle
97 );
98
99 /**
100 Unregister a child SMI source dispatch function with a parent SMM driver
101
102 @param This Pointer to the EFI_SMM_SW_DISPATCH_PROTOCOL instance.
103 @param DispatchHandle Handle of the service to remove.
104
105 @retval EFI_SUCCESS The dispatch function has been successfully
106 unregistered and the SMI source has been disabled
107 if there are no other registered child dispatch
108 functions for this SMI source.
109 @retval EFI_INVALID_PARAMETER Handle is invalid.
110
111 **/
112 typedef
113 EFI_STATUS
114 (EFIAPI *EFI_SMM_SW_UNREGISTER)(
115 IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,
116 IN EFI_HANDLE DispatchHandle
117 );
118
119
120 //
121 // Interface structure for the SMM Software SMI Dispatch Protocol
122 //
123 /**
124 Provides the parent dispatch service for a given SMI source generator.
125 **/
126 ///
127 /// Inconsistent with specification here:
128 /// In framework spec SmmCis, this definition is named as _EFI_SMM_ICHN_DISPATCH_PROTOCOL by mistake.
129 ///
130 struct _EFI_SMM_SW_DISPATCH_PROTOCOL {
131 ///
132 /// Installs a child service to be dispatched by this protocol.
133 ///
134 EFI_SMM_SW_REGISTER Register;
135
136 ///
137 /// Removes a child service dispatched by this protocol.
138 ///
139 EFI_SMM_SW_UNREGISTER UnRegister;
140
141 ///
142 /// A read-only field that describes the maximum value that can be used
143 /// in the EFI_SMM_SW_DISPATCH_PROTOCOL.Register() service.
144 ///
145 UINTN MaximumSwiValue;
146 };
147
148 extern EFI_GUID gEfiSmmSwDispatchProtocolGuid;
149
150 #endif