]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/MmSwDispatch.h
MdePkg: Update MmSwDispatch.h's references to SmmSw2Dispatch.
[mirror_edk2.git] / MdePkg / Include / Protocol / MmSwDispatch.h
CommitLineData
07c6a47e
ED
1/** @file\r
2 MM Software Dispatch Protocol introduced from PI 1.5 Specification\r
3 Volume 4 Management Mode Core Interface.\r
4\r
5 This protocol provides the parent dispatch service for a given MMI source generator.\r
6\r
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
8 This program and the accompanying materials\r
9 are licensed and made available under the terms and conditions of the BSD License\r
10 which accompanies this distribution. The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
ba94c38f
MH
18#ifndef _MM_SW_DISPATCH_H_\r
19#define _MM_SW_DISPATCH_H_\r
07c6a47e
ED
20\r
21#include <Pi/PiMmCis.h>\r
22\r
23#define EFI_MM_SW_DISPATCH_PROTOCOL_GUID \\r
24 { \\r
25 0x18a3c6dc, 0x5eea, 0x48c8, {0xa1, 0xc1, 0xb5, 0x33, 0x89, 0xf9, 0x89, 0x99 } \\r
26 }\r
27\r
28///\r
29/// A particular chipset may not support all possible software MMI input values.\r
30/// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single\r
31/// child registration for each SwMmiInputValue.\r
32///\r
33typedef struct {\r
34 UINTN SwMmiInputValue;\r
35} EFI_MM_SW_REGISTER_CONTEXT;\r
36\r
37///\r
38/// The DispatchFunction will be called with Context set to the same value as was passed into\r
39/// this function in RegisterContext and with CommBuffer (and CommBufferSize) pointing\r
40/// to an instance of EFI_MM_SW_CONTEXT indicating the index of the CPU which generated the\r
41/// software MMI.\r
42///\r
43typedef struct {\r
44 ///\r
45 /// The 0-based index of the CPU which generated the software MMI.\r
46 ///\r
47 UINTN SwMmiCpuIndex;\r
48 ///\r
49 /// This value corresponds directly to the CommandPort parameter used in the call to Trigger().\r
50 ///\r
51 UINT8 CommandPort;\r
52 ///\r
53 /// This value corresponds directly to the DataPort parameter used in the call to Trigger().\r
54 ///\r
55 UINT8 DataPort;\r
56} EFI_MM_SW_CONTEXT;\r
57\r
58typedef struct _EFI_MM_SW_DISPATCH_PROTOCOL EFI_MM_SW_DISPATCH_PROTOCOL;\r
59\r
60/**\r
61 Register a child MMI source dispatch function for the specified software MMI.\r
62\r
63 This service registers a function (DispatchFunction) which will be called when the software\r
64 MMI source specified by RegisterContext->SwMmiCpuIndex is detected. On return,\r
65 DispatchHandle contains a unique handle which may be used later to unregister the function\r
66 using UnRegister().\r
67\r
68 @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.\r
69 @param[in] DispatchFunction Function to register for handler when the specified software\r
70 MMI is generated.\r
71 @param[in, out] RegisterContext Pointer to the dispatch function's context.\r
72 The caller fills this context in before calling\r
73 the register function to indicate to the register\r
74 function which Software MMI input value the\r
75 dispatch function should be invoked for.\r
76 @param[out] DispatchHandle Handle generated by the dispatcher to track the\r
77 function instance.\r
78\r
79 @retval EFI_SUCCESS The dispatch function has been successfully\r
80 registered and the MMI source has been enabled.\r
81 @retval EFI_DEVICE_ERROR The SW driver was unable to enable the MMI source.\r
82 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The SW MMI input value\r
83 is not within a valid range or is already in use.\r
84 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this\r
85 child.\r
86 @retval EFI_OUT_OF_RESOURCES A unique software MMI value could not be assigned\r
87 for this dispatch.\r
88**/\r
89typedef\r
90EFI_STATUS\r
91(EFIAPI *EFI_MM_SW_REGISTER)(\r
92 IN CONST EFI_MM_SW_DISPATCH_PROTOCOL *This,\r
93 IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,\r
94 IN OUT EFI_MM_SW_REGISTER_CONTEXT *RegisterContext,\r
95 OUT EFI_HANDLE *DispatchHandle\r
96 );\r
97\r
98/**\r
99 Unregister a child MMI source dispatch function for the specified software MMI.\r
100\r
101 This service removes the handler associated with DispatchHandle so that it will no longer be\r
102 called in response to a software MMI.\r
103\r
104 @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.\r
105 @param[in] DispatchHandle Handle of dispatch function to deregister.\r
106\r
107 @retval EFI_SUCCESS The dispatch function has been successfully unregistered.\r
108 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
109**/\r
110typedef\r
111EFI_STATUS\r
112(EFIAPI *EFI_MM_SW_UNREGISTER)(\r
113 IN CONST EFI_MM_SW_DISPATCH_PROTOCOL *This,\r
114 IN EFI_HANDLE DispatchHandle\r
115);\r
116\r
117///\r
118/// Interface structure for the MM Software MMI Dispatch Protocol.\r
119///\r
ba94c38f 120/// The EFI_MM_SW_DISPATCH_PROTOCOL provides the ability to install child handlers for the\r
07c6a47e
ED
121/// given software. These handlers will respond to software interrupts, and the maximum software\r
122/// interrupt in the EFI_MM_SW_REGISTER_CONTEXT is denoted by MaximumSwiValue.\r
123///\r
124struct _EFI_MM_SW_DISPATCH_PROTOCOL {\r
125 EFI_MM_SW_REGISTER Register;\r
126 EFI_MM_SW_UNREGISTER UnRegister;\r
127 ///\r
128 /// A read-only field that describes the maximum value that can be used in the\r
129 /// EFI_MM_SW_DISPATCH_PROTOCOL.Register() service.\r
130 ///\r
131 UINTN MaximumSwiValue;\r
132};\r
133\r
134extern EFI_GUID gEfiMmSwDispatchProtocolGuid;\r
135\r
136#endif\r