2 Abstraction for hardware based interrupt routine
4 On non IA-32 systems it is common to have a single hardware interrupt vector
5 and a 2nd layer of software that routes the interrupt handlers based on the
6 interrupt source. This protocol enables this routing. The driver implementing
7 this protocol is responsible for clearing the pending interrupt in the
8 interrupt routing hardware. The HARDWARE_INTERRUPT_HANDLER is responsible
9 for clearing interrupt sources from individual devices.
12 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
14 This program and the accompanying materials
15 are licensed and made available under the terms and conditions of the BSD License
16 which accompanies this distribution. The full text of the license may be found at
17 http://opensource.org/licenses/bsd-license.php
19 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
20 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
24 #ifndef __HARDWARE_INTERRUPT_H__
25 #define __HARDWARE_INTERRUPT_H__
27 #include <Protocol/DebugSupport.h>
33 // EAB39028-3D05-4316-AD0C-D64808DA3FF1
35 #define EFI_HARDWARE_INTERRUPT_PROTOCOL_GGUID \
36 { 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } }
39 typedef struct _EFI_HARDWARE_INTERRUPT_PROTOCOL EFI_HARDWARE_INTERRUPT_PROTOCOL
;
42 typedef UINTN HARDWARE_INTERRUPT_SOURCE
;
46 C Interrupt Handler calledin the interrupt context when Source interrupt is active.
48 @param Source Source of the interrupt. Hardware routing off a specific platform defines
50 @param SystemContext Pointer to system register context. Mostly used by debuggers and will
51 update the system context after the return from the interrupt if
52 modified. Don't change these values unless you know what you are doing
57 (EFIAPI
*HARDWARE_INTERRUPT_HANDLER
) (
58 IN HARDWARE_INTERRUPT_SOURCE Source
,
59 IN EFI_SYSTEM_CONTEXT SystemContext
64 Register Handler for the specified interrupt source.
66 @param This Instance pointer for this protocol
67 @param Source Hardware source of the interrupt
68 @param Handler Callback for interrupt. NULL to unregister
70 @retval EFI_SUCCESS Source was updated to support Handler.
71 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
76 (EFIAPI
*HARDWARE_INTERRUPT_REGISTER
) (
77 IN EFI_HARDWARE_INTERRUPT_PROTOCOL
*This
,
78 IN HARDWARE_INTERRUPT_SOURCE Source
,
79 IN HARDWARE_INTERRUPT_HANDLER Handler
84 Enable interrupt source Source.
86 @param This Instance pointer for this protocol
87 @param Source Hardware source of the interrupt
89 @retval EFI_SUCCESS Source interrupt enabled.
90 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
95 (EFIAPI
*HARDWARE_INTERRUPT_ENABLE
) (
96 IN EFI_HARDWARE_INTERRUPT_PROTOCOL
*This
,
97 IN HARDWARE_INTERRUPT_SOURCE Source
103 Disable interrupt source Source.
105 @param This Instance pointer for this protocol
106 @param Source Hardware source of the interrupt
108 @retval EFI_SUCCESS Source interrupt disabled.
109 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
114 (EFIAPI
*HARDWARE_INTERRUPT_DISABLE
) (
115 IN EFI_HARDWARE_INTERRUPT_PROTOCOL
*This
,
116 IN HARDWARE_INTERRUPT_SOURCE Source
121 Return current state of interrupt source Source.
123 @param This Instance pointer for this protocol
124 @param Source Hardware source of the interrupt
125 @param InterruptState TRUE: source enabled, FALSE: source disabled.
127 @retval EFI_SUCCESS InterruptState is valid
128 @retval EFI_DEVICE_ERROR InterruptState is not valid
133 (EFIAPI
*HARDWARE_INTERRUPT_INTERRUPT_STATE
) (
134 IN EFI_HARDWARE_INTERRUPT_PROTOCOL
*This
,
135 IN HARDWARE_INTERRUPT_SOURCE Source
,
136 IN BOOLEAN
*InterruptState
140 Signal to the hardware that the End Of Intrrupt state
143 @param This Instance pointer for this protocol
144 @param Source Hardware source of the interrupt
146 @retval EFI_SUCCESS Source interrupt EOI'ed.
147 @retval EFI_DEVICE_ERROR Hardware could not be programmed.
152 (EFIAPI
*HARDWARE_INTERRUPT_END_OF_INTERRUPT
) (
153 IN EFI_HARDWARE_INTERRUPT_PROTOCOL
*This
,
154 IN HARDWARE_INTERRUPT_SOURCE Source
158 struct _EFI_HARDWARE_INTERRUPT_PROTOCOL
{
159 HARDWARE_INTERRUPT_REGISTER RegisterInterruptSource
;
160 HARDWARE_INTERRUPT_ENABLE EnableInterruptSource
;
161 HARDWARE_INTERRUPT_DISABLE DisableInterruptSource
;
162 HARDWARE_INTERRUPT_INTERRUPT_STATE GetInterruptSourceState
;
163 HARDWARE_INTERRUPT_END_OF_INTERRUPT EndOfInterrupt
;
166 extern EFI_GUID gHardwareInterruptProtocolGuid
;