4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef _LEGACY_INTERRUPT_H_
11 #define _LEGACY_INTERRUPT_H_
15 #include <Protocol/LegacyInterrupt.h>
17 #include <Library/PcdLib.h>
18 #include <Library/PciLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
21 #include <OvmfPlatforms.h>
24 #define LEGACY_INT_BUS 0
25 #define LEGACY_INT_DEV_PIIX4 0x01
26 #define LEGACY_INT_DEV_Q35 0x1f
27 #define LEGACY_INT_FUNC 0
29 #define PIRQN 0x00 // PIRQ Null
39 #define MAX_PIRQ_NUMBER 8
42 Return the number of PIRQs supported by this chipset.
44 @param[in] This Pointer to LegacyInterrupt Protocol
45 @param[out] NumberPirqs The pointer to return the max IRQ number supported
47 @retval EFI_SUCCESS Max PIRQs successfully returned
53 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
54 OUT UINT8
*NumberPirqs
58 Return PCI location of this device.
59 $PIR table requires this info.
61 @param[in] This - Protocol instance pointer.
62 @param[out] Bus - PCI Bus
63 @param[out] Device - PCI Device
64 @param[out] Function - PCI Function
66 @retval EFI_SUCCESS Bus/Device/Function returned
72 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
79 Read the given PIRQ register
81 @param[in] This Protocol instance pointer
82 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc
83 @param[out] PirqData Value read
85 @retval EFI_SUCCESS Decoding change affected.
86 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
92 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
98 Write the given PIRQ register
100 @param[in] This Protocol instance pointer
101 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc
102 @param[out] PirqData Value to write
104 @retval EFI_SUCCESS Decoding change affected.
105 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
111 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,