]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - EmbeddedPkg/Include/Protocol/HardwareInterrupt.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / EmbeddedPkg / Include / Protocol / HardwareInterrupt.h
... / ...
CommitLineData
1/** @file\r
2 Abstraction for hardware based interrupt routine\r
3\r
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
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
9 for clearing interrupt sources from individual devices.\r
10\r
11\r
12 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
13\r
14 SPDX-License-Identifier: BSD-2-Clause-Patent\r
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// Protocol GUID\r
25//\r
26// EAB39028-3D05-4316-AD0C-D64808DA3FF1\r
27\r
28#define EFI_HARDWARE_INTERRUPT_PROTOCOL_GGUID \\r
29 { 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } }\r
30\r
31typedef struct _EFI_HARDWARE_INTERRUPT_PROTOCOL EFI_HARDWARE_INTERRUPT_PROTOCOL;\r
32\r
33typedef UINTN HARDWARE_INTERRUPT_SOURCE;\r
34\r
35/**\r
36 C Interrupt Handler calledin the interrupt context when Source interrupt is active.\r
37\r
38 @param Source Source of the interrupt. Hardware routing off a specific platform defines\r
39 what source means.\r
40 @param SystemContext Pointer to system register context. Mostly used by debuggers and will\r
41 update the system context after the return from the interrupt if\r
42 modified. Don't change these values unless you know what you are doing\r
43\r
44**/\r
45typedef\r
46VOID\r
47(EFIAPI *HARDWARE_INTERRUPT_HANDLER)(\r
48 IN HARDWARE_INTERRUPT_SOURCE Source,\r
49 IN EFI_SYSTEM_CONTEXT SystemContext\r
50 );\r
51\r
52/**\r
53 Register Handler for the specified interrupt source.\r
54\r
55 @param This Instance pointer for this protocol\r
56 @param Source Hardware source of the interrupt\r
57 @param Handler Callback for interrupt. NULL to unregister\r
58\r
59 @retval EFI_SUCCESS Source was updated to support Handler.\r
60 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
61\r
62**/\r
63typedef\r
64EFI_STATUS\r
65(EFIAPI *HARDWARE_INTERRUPT_REGISTER)(\r
66 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
67 IN HARDWARE_INTERRUPT_SOURCE Source,\r
68 IN HARDWARE_INTERRUPT_HANDLER Handler\r
69 );\r
70\r
71/**\r
72 Enable interrupt source Source.\r
73\r
74 @param This Instance pointer for this protocol\r
75 @param Source Hardware source of the interrupt\r
76\r
77 @retval EFI_SUCCESS Source interrupt enabled.\r
78 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
79\r
80**/\r
81typedef\r
82EFI_STATUS\r
83(EFIAPI *HARDWARE_INTERRUPT_ENABLE)(\r
84 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
85 IN HARDWARE_INTERRUPT_SOURCE Source\r
86 );\r
87\r
88/**\r
89 Disable interrupt source Source.\r
90\r
91 @param This Instance pointer for this protocol\r
92 @param Source Hardware source of the interrupt\r
93\r
94 @retval EFI_SUCCESS Source interrupt disabled.\r
95 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
96\r
97**/\r
98typedef\r
99EFI_STATUS\r
100(EFIAPI *HARDWARE_INTERRUPT_DISABLE)(\r
101 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
102 IN HARDWARE_INTERRUPT_SOURCE Source\r
103 );\r
104\r
105/**\r
106 Return current state of interrupt source Source.\r
107\r
108 @param This Instance pointer for this protocol\r
109 @param Source Hardware source of the interrupt\r
110 @param InterruptState TRUE: source enabled, FALSE: source disabled.\r
111\r
112 @retval EFI_SUCCESS InterruptState is valid\r
113 @retval EFI_DEVICE_ERROR InterruptState is not valid\r
114\r
115**/\r
116typedef\r
117EFI_STATUS\r
118(EFIAPI *HARDWARE_INTERRUPT_INTERRUPT_STATE)(\r
119 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
120 IN HARDWARE_INTERRUPT_SOURCE Source,\r
121 IN BOOLEAN *InterruptState\r
122 );\r
123\r
124/**\r
125 Signal to the hardware that the End Of Interrupt state\r
126 has been reached.\r
127\r
128 @param This Instance pointer for this protocol\r
129 @param Source Hardware source of the interrupt\r
130\r
131 @retval EFI_SUCCESS Source interrupt EOI'ed.\r
132 @retval EFI_DEVICE_ERROR Hardware could not be programmed.\r
133\r
134**/\r
135typedef\r
136EFI_STATUS\r
137(EFIAPI *HARDWARE_INTERRUPT_END_OF_INTERRUPT)(\r
138 IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
139 IN HARDWARE_INTERRUPT_SOURCE Source\r
140 );\r
141\r
142struct _EFI_HARDWARE_INTERRUPT_PROTOCOL {\r
143 HARDWARE_INTERRUPT_REGISTER RegisterInterruptSource;\r
144 HARDWARE_INTERRUPT_ENABLE EnableInterruptSource;\r
145 HARDWARE_INTERRUPT_DISABLE DisableInterruptSource;\r
146 HARDWARE_INTERRUPT_INTERRUPT_STATE GetInterruptSourceState;\r
147 HARDWARE_INTERRUPT_END_OF_INTERRUPT EndOfInterrupt;\r
148};\r
149\r
150extern EFI_GUID gHardwareInterruptProtocolGuid;\r
151\r
152#endif\r