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