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