]>
Commit | Line | Data |
---|---|---|
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 | |
9344f092 | 8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
07c6a47e ED |
9 | \r |
10 | **/\r | |
11 | \r | |
ba94c38f MH |
12 | #ifndef _MM_SW_DISPATCH_H_\r |
13 | #define _MM_SW_DISPATCH_H_\r | |
07c6a47e ED |
14 | \r |
15 | #include <Pi/PiMmCis.h>\r | |
16 | \r | |
17 | #define EFI_MM_SW_DISPATCH_PROTOCOL_GUID \\r | |
18 | { \\r | |
19 | 0x18a3c6dc, 0x5eea, 0x48c8, {0xa1, 0xc1, 0xb5, 0x33, 0x89, 0xf9, 0x89, 0x99 } \\r | |
20 | }\r | |
21 | \r | |
22 | ///\r | |
23 | /// A particular chipset may not support all possible software MMI input values.\r | |
24 | /// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single\r | |
25 | /// child registration for each SwMmiInputValue.\r | |
26 | ///\r | |
27 | typedef struct {\r | |
2f88bd3a | 28 | UINTN SwMmiInputValue;\r |
07c6a47e ED |
29 | } EFI_MM_SW_REGISTER_CONTEXT;\r |
30 | \r | |
31 | ///\r | |
32 | /// The DispatchFunction will be called with Context set to the same value as was passed into\r | |
33 | /// this function in RegisterContext and with CommBuffer (and CommBufferSize) pointing\r | |
34 | /// to an instance of EFI_MM_SW_CONTEXT indicating the index of the CPU which generated the\r | |
35 | /// software MMI.\r | |
36 | ///\r | |
37 | typedef struct {\r | |
38 | ///\r | |
39 | /// The 0-based index of the CPU which generated the software MMI.\r | |
40 | ///\r | |
2f88bd3a | 41 | UINTN SwMmiCpuIndex;\r |
07c6a47e ED |
42 | ///\r |
43 | /// This value corresponds directly to the CommandPort parameter used in the call to Trigger().\r | |
44 | ///\r | |
2f88bd3a | 45 | UINT8 CommandPort;\r |
07c6a47e ED |
46 | ///\r |
47 | /// This value corresponds directly to the DataPort parameter used in the call to Trigger().\r | |
48 | ///\r | |
2f88bd3a | 49 | UINT8 DataPort;\r |
07c6a47e ED |
50 | } EFI_MM_SW_CONTEXT;\r |
51 | \r | |
2f88bd3a | 52 | typedef struct _EFI_MM_SW_DISPATCH_PROTOCOL EFI_MM_SW_DISPATCH_PROTOCOL;\r |
07c6a47e ED |
53 | \r |
54 | /**\r | |
55 | Register a child MMI source dispatch function for the specified software MMI.\r | |
56 | \r | |
57 | This service registers a function (DispatchFunction) which will be called when the software\r | |
58 | MMI source specified by RegisterContext->SwMmiCpuIndex is detected. On return,\r | |
59 | DispatchHandle contains a unique handle which may be used later to unregister the function\r | |
60 | using UnRegister().\r | |
61 | \r | |
62 | @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.\r | |
63 | @param[in] DispatchFunction Function to register for handler when the specified software\r | |
64 | MMI is generated.\r | |
65 | @param[in, out] RegisterContext Pointer to the dispatch function's context.\r | |
66 | The caller fills this context in before calling\r | |
67 | the register function to indicate to the register\r | |
68 | function which Software MMI input value the\r | |
69 | dispatch function should be invoked for.\r | |
70 | @param[out] DispatchHandle Handle generated by the dispatcher to track the\r | |
71 | function instance.\r | |
72 | \r | |
73 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
74 | registered and the MMI source has been enabled.\r | |
75 | @retval EFI_DEVICE_ERROR The SW driver was unable to enable the MMI source.\r | |
76 | @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The SW MMI input value\r | |
77 | is not within a valid range or is already in use.\r | |
78 | @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this\r | |
79 | child.\r | |
80 | @retval EFI_OUT_OF_RESOURCES A unique software MMI value could not be assigned\r | |
81 | for this dispatch.\r | |
82 | **/\r | |
83 | typedef\r | |
84 | EFI_STATUS\r | |
85 | (EFIAPI *EFI_MM_SW_REGISTER)(\r | |
86 | IN CONST EFI_MM_SW_DISPATCH_PROTOCOL *This,\r | |
87 | IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,\r | |
88 | IN OUT EFI_MM_SW_REGISTER_CONTEXT *RegisterContext,\r | |
89 | OUT EFI_HANDLE *DispatchHandle\r | |
90 | );\r | |
91 | \r | |
92 | /**\r | |
93 | Unregister a child MMI source dispatch function for the specified software MMI.\r | |
94 | \r | |
95 | This service removes the handler associated with DispatchHandle so that it will no longer be\r | |
96 | called in response to a software MMI.\r | |
97 | \r | |
98 | @param[in] This Pointer to the EFI_MM_SW_DISPATCH_PROTOCOL instance.\r | |
99 | @param[in] DispatchHandle Handle of dispatch function to deregister.\r | |
100 | \r | |
101 | @retval EFI_SUCCESS The dispatch function has been successfully unregistered.\r | |
102 | @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r | |
103 | **/\r | |
104 | typedef\r | |
105 | EFI_STATUS\r | |
106 | (EFIAPI *EFI_MM_SW_UNREGISTER)(\r | |
107 | IN CONST EFI_MM_SW_DISPATCH_PROTOCOL *This,\r | |
108 | IN EFI_HANDLE DispatchHandle\r | |
2f88bd3a | 109 | );\r |
07c6a47e ED |
110 | \r |
111 | ///\r | |
112 | /// Interface structure for the MM Software MMI Dispatch Protocol.\r | |
113 | ///\r | |
ba94c38f | 114 | /// The EFI_MM_SW_DISPATCH_PROTOCOL provides the ability to install child handlers for the\r |
07c6a47e ED |
115 | /// given software. These handlers will respond to software interrupts, and the maximum software\r |
116 | /// interrupt in the EFI_MM_SW_REGISTER_CONTEXT is denoted by MaximumSwiValue.\r | |
117 | ///\r | |
118 | struct _EFI_MM_SW_DISPATCH_PROTOCOL {\r | |
2f88bd3a MK |
119 | EFI_MM_SW_REGISTER Register;\r |
120 | EFI_MM_SW_UNREGISTER UnRegister;\r | |
07c6a47e ED |
121 | ///\r |
122 | /// A read-only field that describes the maximum value that can be used in the\r | |
123 | /// EFI_MM_SW_DISPATCH_PROTOCOL.Register() service.\r | |
124 | ///\r | |
2f88bd3a | 125 | UINTN MaximumSwiValue;\r |
07c6a47e ED |
126 | };\r |
127 | \r | |
2f88bd3a | 128 | extern EFI_GUID gEfiMmSwDispatchProtocolGuid;\r |
07c6a47e ED |
129 | \r |
130 | #endif\r |