ArmPkg: only attempt buildin MmCommunicationDxe for AArch64
[mirror_edk2.git] / EmbeddedPkg / Include / Protocol / HardwareInterrupt.h
CommitLineData
2ef2b01e
A
1/** @file\r
2 Abstraction for hardware based interrupt routine\r
3402aac7 3\r
2ef2b01e
A
4 On non IA-32 systems it is common to have a single hardware interrupt vector\r
5 and a 2nd layer of software that routes the interrupt handlers based on the\r
3402aac7
RC
6 interrupt source. This protocol enables this routing. The driver implementing\r
7 this protocol is responsible for clearing the pending interrupt in the\r
8 interrupt routing hardware. The HARDWARE_INTERRUPT_HANDLER is responsible\r
2ef2b01e
A
9 for clearing interrupt sources from individual devices.\r
10\r
11\r
60274cca 12 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
2ef2b01e 13\r
878b807a 14 SPDX-License-Identifier: BSD-2-Clause-Patent\r
2ef2b01e
A
15\r
16**/\r
17\r
18#ifndef __HARDWARE_INTERRUPT_H__\r
19#define __HARDWARE_INTERRUPT_H__\r
20\r
21#include <Protocol/DebugSupport.h>\r
22\r
23\r
24//\r
25// Protocol GUID\r
26//\r
27// EAB39028-3D05-4316-AD0C-D64808DA3FF1\r
28\r
29#define EFI_HARDWARE_INTERRUPT_PROTOCOL_GGUID \\r
30 { 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } }\r
31\r
32\r
33typedef struct _EFI_HARDWARE_INTERRUPT_PROTOCOL EFI_HARDWARE_INTERRUPT_PROTOCOL;\r
34\r
35\r
36typedef UINTN HARDWARE_INTERRUPT_SOURCE;\r
37\r
38\r
39/**\r
40 C Interrupt Handler calledin the interrupt context when Source interrupt is active.\r
41\r
42 @param Source Source of the interrupt. Hardware routing off a specific platform defines\r
43 what source means.\r
44 @param SystemContext Pointer to system register context. Mostly used by debuggers and will\r
3402aac7 45 update the system context after the return from the interrupt if\r
2ef2b01e
A
46 modified. Don't change these values unless you know what you are doing\r
47\r
48**/\r
49typedef\r
50VOID\r
51(EFIAPI *HARDWARE_INTERRUPT_HANDLER) (\r
52 IN HARDWARE_INTERRUPT_SOURCE Source,\r
3402aac7 53 IN EFI_SYSTEM_CONTEXT SystemContext\r
2ef2b01e
A
54 );\r
55\r
56\r
57/**\r
58 Register Handler for the specified interrupt source.\r
59\r
60 @param This Instance pointer for this protocol\r
61 @param Source Hardware source of the interrupt\r
62 @param Handler Callback for interrupt. NULL to unregister\r
63\r
64 @retval EFI_SUCCESS Source was updated to support Handler.\r
65 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
66\r
67**/\r
68typedef\r
69EFI_STATUS\r
70(EFIAPI *HARDWARE_INTERRUPT_REGISTER) (\r
71 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
72 IN HARDWARE_INTERRUPT_SOURCE Source,\r
73 IN HARDWARE_INTERRUPT_HANDLER Handler\r
74 );\r
75\r
76\r
77/**\r
78 Enable interrupt source Source.\r
79\r
80 @param This Instance pointer for this protocol\r
81 @param Source Hardware source of the interrupt\r
82\r
83 @retval EFI_SUCCESS Source interrupt enabled.\r
84 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
85\r
86**/\r
87typedef\r
88EFI_STATUS\r
89(EFIAPI *HARDWARE_INTERRUPT_ENABLE) (\r
90 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
91 IN HARDWARE_INTERRUPT_SOURCE Source\r
92 );\r
93\r
94\r
95\r
96/**\r
97 Disable interrupt source Source.\r
98\r
99 @param This Instance pointer for this protocol\r
100 @param Source Hardware source of the interrupt\r
101\r
102 @retval EFI_SUCCESS Source interrupt disabled.\r
103 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
104\r
105**/\r
106typedef\r
107EFI_STATUS\r
108(EFIAPI *HARDWARE_INTERRUPT_DISABLE) (\r
109 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
110 IN HARDWARE_INTERRUPT_SOURCE Source\r
111 );\r
112\r
113\r
114/**\r
115 Return current state of interrupt source Source.\r
116\r
117 @param This Instance pointer for this protocol\r
118 @param Source Hardware source of the interrupt\r
119 @param InterruptState TRUE: source enabled, FALSE: source disabled.\r
120\r
121 @retval EFI_SUCCESS InterruptState is valid\r
122 @retval EFI_DEVICE_ERROR InterruptState is not valid\r
123\r
124**/\r
125typedef\r
126EFI_STATUS\r
127(EFIAPI *HARDWARE_INTERRUPT_INTERRUPT_STATE) (\r
128 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
129 IN HARDWARE_INTERRUPT_SOURCE Source,\r
3402aac7 130 IN BOOLEAN *InterruptState\r
753816a3 131 );\r
132\r
133/**\r
c6a72cd7 134 Signal to the hardware that the End Of Interrupt state\r
753816a3 135 has been reached.\r
136\r
137 @param This Instance pointer for this protocol\r
138 @param Source Hardware source of the interrupt\r
139\r
140 @retval EFI_SUCCESS Source interrupt EOI'ed.\r
141 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
142\r
143**/\r
144typedef\r
145EFI_STATUS\r
146(EFIAPI *HARDWARE_INTERRUPT_END_OF_INTERRUPT) (\r
147 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
148 IN HARDWARE_INTERRUPT_SOURCE Source\r
2ef2b01e
A
149 );\r
150\r
151\r
152struct _EFI_HARDWARE_INTERRUPT_PROTOCOL {\r
153 HARDWARE_INTERRUPT_REGISTER RegisterInterruptSource;\r
154 HARDWARE_INTERRUPT_ENABLE EnableInterruptSource;\r
155 HARDWARE_INTERRUPT_DISABLE DisableInterruptSource;\r
156 HARDWARE_INTERRUPT_INTERRUPT_STATE GetInterruptSourceState;\r
753816a3 157 HARDWARE_INTERRUPT_END_OF_INTERRUPT EndOfInterrupt;\r
2ef2b01e
A
158};\r
159\r
160extern EFI_GUID gHardwareInterruptProtocolGuid;\r
161\r
162#endif\r
163\r
164\r