VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h@ 99404

Last change on this file since 99404 was 99404, checked in by vboxsync, 2 years ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette