]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmSwDispatch.h
Updated IntelFrameworkPkg.nspd to add GUID/PPI/Protocol definitions.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmSwDispatch.h
1 /** @file
2 This file declares EFI Smm Software Smi Child Protocol
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 of 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 // Global ID for the SW SMI Protocol
26 //
27 #define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \
28 { \
29 0xe541b773, 0xdd11, 0x420c, {0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf } \
30 }
31
32 typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL EFI_SMM_SW_DISPATCH_PROTOCOL;
33
34 //
35 // Related Definitions
36 //
37 //
38 // A particular chipset may not support all possible software SMI input values.
39 // For example, the ICH supports only values 00h to 0FFh. The parent only allows a single
40 // child registration for each SwSmiInputValue.
41 //
42 typedef struct {
43 UINTN SwSmiInputValue;
44 } EFI_SMM_SW_DISPATCH_CONTEXT;
45
46 //
47 // Member functions
48 //
49 /**
50 Dispatch function for a Software SMI handler.
51
52 @param DispatchHandle Handle of this dispatch function.
53 @param DispatchContext Pointer to the dispatch function's context.
54 The SwSmiInputValue field is filled in
55 by the software dispatch driver prior to
56 invoking this dispatch function.
57 The dispatch function will only be called
58 for input values for which it is registered.
59
60 Nothing
61
62 **/
63 typedef
64 VOID
65 (EFIAPI *EFI_SMM_SW_DISPATCH) (
66 IN EFI_HANDLE DispatchHandle,
67 IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext
68 );
69
70 /**
71 Register a child SMI source dispatch function with a parent SMM driver
72
73 @param This Protocol instance pointer.
74 @param DispatchFunction Pointer to dispatch function to be invoked for
75 this SMI source
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 of dispatch function, for when interfacing
82 with the parent Sx state SMM driver.
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 Protocol instance pointer.
106 @param DispatchHandle Handle of dispatch function to deregister.
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 @retval other TBD
114
115 **/
116 typedef
117 EFI_STATUS
118 (EFIAPI *EFI_SMM_SW_UNREGISTER) (
119 IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,
120 IN EFI_HANDLE DispatchHandle
121 );
122
123 //
124 // Interface structure for the SMM Software SMI Dispatch Protocol
125 //
126 /**
127 @par Protocol Description:
128 Provides the parent dispatch service for a given SMI source generator.
129
130 @param Register
131 Installs a child service to be dispatched by this protocol.
132
133 @param UnRegister
134 Removes a child service dispatched by this protocol.
135
136 @param MaximumSwiValue
137 A read-only field that describes the maximum value that can be used
138 in the EFI_SMM_SW_DISPATCH_PROTOCOL.Register() service.
139
140 **/
141 struct _EFI_SMM_SW_DISPATCH_PROTOCOL {
142 EFI_SMM_SW_REGISTER Register;
143 EFI_SMM_SW_UNREGISTER UnRegister;
144 UINTN MaximumSwiValue;
145 };
146
147 extern EFI_GUID gEfiSmmSwDispatchProtocolGuid;
148
149 #endif