3 Copyright (c) 2016-2017, Linaro Ltd. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __HARDWARE_INTERRUPT2_H__
16 #define __HARDWARE_INTERRUPT2_H__
18 #include <Protocol/HardwareInterrupt.h>
20 // 22838932-1a2d-4a47-aaba-f3f7cf569470
22 #define EFI_HARDWARE_INTERRUPT2_PROTOCOL_GUID \
23 { 0x32898322, 0x2d1a, 0x474a, \
24 { 0xba, 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } }
27 EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_LOW
,
28 EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_HIGH
,
29 EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_FALLING
,
30 EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING
,
31 } EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE
;
33 typedef struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL \
34 EFI_HARDWARE_INTERRUPT2_PROTOCOL
;
37 Register Handler for the specified interrupt source.
39 @param This Instance pointer for this protocol
40 @param Source Hardware source of the interrupt
41 @param Handler Callback for interrupt. NULL to unregister
43 @retval EFI_SUCCESS Source was updated to support Handler.
44 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
49 (EFIAPI
*HARDWARE_INTERRUPT2_REGISTER
) (
50 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL
*This
,
51 IN HARDWARE_INTERRUPT_SOURCE Source
,
52 IN HARDWARE_INTERRUPT_HANDLER Handler
57 Enable interrupt source Source.
59 @param This Instance pointer for this protocol
60 @param Source Hardware source of the interrupt
62 @retval EFI_SUCCESS Source interrupt enabled.
63 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
68 (EFIAPI
*HARDWARE_INTERRUPT2_ENABLE
) (
69 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL
*This
,
70 IN HARDWARE_INTERRUPT_SOURCE Source
75 Disable interrupt source Source.
77 @param This Instance pointer for this protocol
78 @param Source Hardware source of the interrupt
80 @retval EFI_SUCCESS Source interrupt disabled.
81 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
86 (EFIAPI
*HARDWARE_INTERRUPT2_DISABLE
) (
87 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL
*This
,
88 IN HARDWARE_INTERRUPT_SOURCE Source
93 Return current state of interrupt source Source.
95 @param This Instance pointer for this protocol
96 @param Source Hardware source of the interrupt
97 @param InterruptState TRUE: source enabled, FALSE: source disabled.
99 @retval EFI_SUCCESS InterruptState is valid
100 @retval EFI_DEVICE_ERROR InterruptState is not valid
105 (EFIAPI
*HARDWARE_INTERRUPT2_INTERRUPT_STATE
) (
106 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL
*This
,
107 IN HARDWARE_INTERRUPT_SOURCE Source
,
108 IN BOOLEAN
*InterruptState
112 Signal to the hardware that the End Of Interrupt state
115 @param This Instance pointer for this protocol
116 @param Source Hardware source of the interrupt
118 @retval EFI_SUCCESS Source interrupt EOI'ed.
119 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
124 (EFIAPI
*HARDWARE_INTERRUPT2_END_OF_INTERRUPT
) (
125 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL
*This
,
126 IN HARDWARE_INTERRUPT_SOURCE Source
130 Return the configured trigger type for an interrupt source
132 @param This Instance pointer for this protocol
133 @param Source Hardware source of the interrupt
134 @param TriggerType The configured trigger type
136 @retval EFI_SUCCESS Operation successful
137 @retval EFI_DEVICE_ERROR Information could not be returned
142 (EFIAPI
*HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE
) (
143 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL
*This
,
144 IN HARDWARE_INTERRUPT_SOURCE Source
,
145 OUT EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE
*TriggerType
150 Configure the trigger type for an interrupt source
152 @param This Instance pointer for this protocol
153 @param Source Hardware source of the interrupt
154 @param TriggerType The trigger type to configure
156 @retval EFI_SUCCESS Operation successful
157 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
162 (EFIAPI
*HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE
) (
163 IN EFI_HARDWARE_INTERRUPT2_PROTOCOL
*This
,
164 IN HARDWARE_INTERRUPT_SOURCE Source
,
165 IN EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE TriggerType
168 struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL
{
169 HARDWARE_INTERRUPT2_REGISTER RegisterInterruptSource
;
170 HARDWARE_INTERRUPT2_ENABLE EnableInterruptSource
;
171 HARDWARE_INTERRUPT2_DISABLE DisableInterruptSource
;
172 HARDWARE_INTERRUPT2_INTERRUPT_STATE GetInterruptSourceState
;
173 HARDWARE_INTERRUPT2_END_OF_INTERRUPT EndOfInterrupt
;
176 HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE GetTriggerType
;
177 HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE SetTriggerType
;
180 extern EFI_GUID gHardwareInterrupt2ProtocolGuid
;