2 MM Software Dispatch Protocol introduced from PI 1.5 Specification
3 Volume 4 Management Mode Core Interface.
5 This protocol provides the parent dispatch service for a given MMI source generator.
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef _MM_SW_DISPATCH_H_
13 #define _MM_SW_DISPATCH_H_
15 #include <Pi/PiMmCis.h>
17 #define EFI_MM_SW_DISPATCH_PROTOCOL_GUID \
19 0x18a3c6dc, 0x5eea, 0x48c8, {0xa1, 0xc1, 0xb5, 0x33, 0x89, 0xf9, 0x89, 0x99 } \
23 /// A particular chipset may not support all possible software MMI input values.
24 /// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single
25 /// child registration for each SwMmiInputValue.
28 UINTN SwMmiInputValue
;
29 } EFI_MM_SW_REGISTER_CONTEXT
;
32 /// The DispatchFunction will be called with Context set to the same value as was passed into
33 /// this function in RegisterContext and with CommBuffer (and CommBufferSize) pointing
34 /// to an instance of EFI_MM_SW_CONTEXT indicating the index of the CPU which generated the
39 /// The 0-based index of the CPU which generated the software MMI.
43 /// This value corresponds directly to the CommandPort parameter used in the call to Trigger().
47 /// This value corresponds directly to the DataPort parameter used in the call to Trigger().
52 typedef struct _EFI_MM_SW_DISPATCH_PROTOCOL EFI_MM_SW_DISPATCH_PROTOCOL
;
55 Register a child MMI source dispatch function for the specified software MMI.
57 This service registers a function (DispatchFunction) which will be called when the software
58 MMI source specified by RegisterContext->SwMmiCpuIndex is detected. On return,
59 DispatchHandle contains a unique handle which may be used later to unregister the function
62 @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.
63 @param[in] DispatchFunction Function to register for handler when the specified software
65 @param[in, out] RegisterContext Pointer to the dispatch function's context.
66 The caller fills this context in before calling
67 the register function to indicate to the register
68 function which Software MMI input value the
69 dispatch function should be invoked for.
70 @param[out] DispatchHandle Handle generated by the dispatcher to track the
73 @retval EFI_SUCCESS The dispatch function has been successfully
74 registered and the MMI source has been enabled.
75 @retval EFI_DEVICE_ERROR The SW driver was unable to enable the MMI source.
76 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The SW MMI input value
77 is not within a valid range or is already in use.
78 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this
80 @retval EFI_OUT_OF_RESOURCES A unique software MMI value could not be assigned
85 (EFIAPI
*EFI_MM_SW_REGISTER
)(
86 IN CONST EFI_MM_SW_DISPATCH_PROTOCOL
*This
,
87 IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction
,
88 IN OUT EFI_MM_SW_REGISTER_CONTEXT
*RegisterContext
,
89 OUT EFI_HANDLE
*DispatchHandle
93 Unregister a child MMI source dispatch function for the specified software MMI.
95 This service removes the handler associated with DispatchHandle so that it will no longer be
96 called in response to a software MMI.
98 @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.
99 @param[in] DispatchHandle Handle of dispatch function to deregister.
101 @retval EFI_SUCCESS The dispatch function has been successfully unregistered.
102 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
106 (EFIAPI
*EFI_MM_SW_UNREGISTER
)(
107 IN CONST EFI_MM_SW_DISPATCH_PROTOCOL
*This
,
108 IN EFI_HANDLE DispatchHandle
112 /// Interface structure for the MM Software MMI Dispatch Protocol.
114 /// The EFI_MM_SW_DISPATCH_PROTOCOL provides the ability to install child handlers for the
115 /// given software. These handlers will respond to software interrupts, and the maximum software
116 /// interrupt in the EFI_MM_SW_REGISTER_CONTEXT is denoted by MaximumSwiValue.
118 struct _EFI_MM_SW_DISPATCH_PROTOCOL
{
119 EFI_MM_SW_REGISTER Register
;
120 EFI_MM_SW_UNREGISTER UnRegister
;
122 /// A read-only field that describes the maximum value that can be used in the
123 /// EFI_MM_SW_DISPATCH_PROTOCOL.Register() service.
125 UINTN MaximumSwiValue
;
128 extern EFI_GUID gEfiMmSwDispatchProtocolGuid
;