ArmPkg: only attempt buildin MmCommunicationDxe for AArch64
[mirror_edk2.git] / EmbeddedPkg / Include / Protocol / HardwareInterrupt2.h
CommitLineData
e40c7289
AB
1/** @file\r
2\r
3 Copyright (c) 2016-2017, Linaro Ltd. All rights reserved.<BR>\r
4\r
878b807a 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
e40c7289
AB
6\r
7**/\r
8\r
9#ifndef __HARDWARE_INTERRUPT2_H__\r
10#define __HARDWARE_INTERRUPT2_H__\r
11\r
12#include <Protocol/HardwareInterrupt.h>\r
13\r
14// 22838932-1a2d-4a47-aaba-f3f7cf569470\r
15\r
16#define EFI_HARDWARE_INTERRUPT2_PROTOCOL_GUID \\r
17 { 0x32898322, 0x2d1a, 0x474a, \\r
18 { 0xba, 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } }\r
19\r
20typedef enum {\r
21 EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_LOW,\r
22 EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_HIGH,\r
23 EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_FALLING,\r
24 EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING,\r
25} EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE;\r
26\r
27typedef struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL \\r
28 EFI_HARDWARE_INTERRUPT2_PROTOCOL;\r
29\r
30/**\r
31 Register Handler for the specified interrupt source.\r
32\r
33 @param This Instance pointer for this protocol\r
34 @param Source Hardware source of the interrupt\r
35 @param Handler Callback for interrupt. NULL to unregister\r
36\r
37 @retval EFI_SUCCESS Source was updated to support Handler.\r
38 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
39\r
40**/\r
41typedef\r
42EFI_STATUS\r
43(EFIAPI *HARDWARE_INTERRUPT2_REGISTER) (\r
44 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,\r
45 IN HARDWARE_INTERRUPT_SOURCE Source,\r
46 IN HARDWARE_INTERRUPT_HANDLER Handler\r
47 );\r
48\r
49\r
50/**\r
51 Enable interrupt source Source.\r
52\r
53 @param This Instance pointer for this protocol\r
54 @param Source Hardware source of the interrupt\r
55\r
56 @retval EFI_SUCCESS Source interrupt enabled.\r
57 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
58\r
59**/\r
60typedef\r
61EFI_STATUS\r
62(EFIAPI *HARDWARE_INTERRUPT2_ENABLE) (\r
63 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,\r
64 IN HARDWARE_INTERRUPT_SOURCE Source\r
65 );\r
66\r
67\r
68/**\r
69 Disable interrupt source Source.\r
70\r
71 @param This Instance pointer for this protocol\r
72 @param Source Hardware source of the interrupt\r
73\r
74 @retval EFI_SUCCESS Source interrupt disabled.\r
75 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
76\r
77**/\r
78typedef\r
79EFI_STATUS\r
80(EFIAPI *HARDWARE_INTERRUPT2_DISABLE) (\r
81 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,\r
82 IN HARDWARE_INTERRUPT_SOURCE Source\r
83 );\r
84\r
85\r
86/**\r
87 Return current state of interrupt source Source.\r
88\r
89 @param This Instance pointer for this protocol\r
90 @param Source Hardware source of the interrupt\r
91 @param InterruptState TRUE: source enabled, FALSE: source disabled.\r
92\r
93 @retval EFI_SUCCESS InterruptState is valid\r
94 @retval EFI_DEVICE_ERROR InterruptState is not valid\r
95\r
96**/\r
97typedef\r
98EFI_STATUS\r
99(EFIAPI *HARDWARE_INTERRUPT2_INTERRUPT_STATE) (\r
100 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,\r
101 IN HARDWARE_INTERRUPT_SOURCE Source,\r
102 IN BOOLEAN *InterruptState\r
103 );\r
104\r
105/**\r
106 Signal to the hardware that the End Of Interrupt state\r
107 has been reached.\r
108\r
109 @param This Instance pointer for this protocol\r
110 @param Source Hardware source of the interrupt\r
111\r
112 @retval EFI_SUCCESS Source interrupt EOI'ed.\r
113 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
114\r
115**/\r
116typedef\r
117EFI_STATUS\r
118(EFIAPI *HARDWARE_INTERRUPT2_END_OF_INTERRUPT) (\r
119 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,\r
120 IN HARDWARE_INTERRUPT_SOURCE Source\r
121 );\r
122\r
123/**\r
124 Return the configured trigger type for an interrupt source\r
125\r
126 @param This Instance pointer for this protocol\r
127 @param Source Hardware source of the interrupt\r
128 @param TriggerType The configured trigger type\r
129\r
130 @retval EFI_SUCCESS Operation successful\r
131 @retval EFI_DEVICE_ERROR Information could not be returned\r
132\r
133**/\r
134typedef\r
135EFI_STATUS\r
136(EFIAPI *HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE) (\r
137 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,\r
138 IN HARDWARE_INTERRUPT_SOURCE Source,\r
139 OUT EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE *TriggerType\r
140 );\r
141\r
142\r
143/**\r
144 Configure the trigger type for an interrupt source\r
145\r
146 @param This Instance pointer for this protocol\r
147 @param Source Hardware source of the interrupt\r
148 @param TriggerType The trigger type to configure\r
149\r
150 @retval EFI_SUCCESS Operation successful\r
151 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
152\r
153**/\r
154typedef\r
155EFI_STATUS\r
156(EFIAPI *HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE) (\r
157 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,\r
158 IN HARDWARE_INTERRUPT_SOURCE Source,\r
159 IN EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE TriggerType\r
160 );\r
161\r
162struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL {\r
163 HARDWARE_INTERRUPT2_REGISTER RegisterInterruptSource;\r
164 HARDWARE_INTERRUPT2_ENABLE EnableInterruptSource;\r
165 HARDWARE_INTERRUPT2_DISABLE DisableInterruptSource;\r
166 HARDWARE_INTERRUPT2_INTERRUPT_STATE GetInterruptSourceState;\r
167 HARDWARE_INTERRUPT2_END_OF_INTERRUPT EndOfInterrupt;\r
168\r
169 // v2 members\r
170 HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE GetTriggerType;\r
171 HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE SetTriggerType;\r
172};\r
173\r
174extern EFI_GUID gHardwareInterrupt2ProtocolGuid;\r
175\r
176#endif\r