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>
23 #define LEGACY_INT_BUS 0
24 #define LEGACY_INT_DEV_PIIX4 0x01
25 #define LEGACY_INT_DEV_Q35 0x1f
26 #define LEGACY_INT_FUNC 0
28 #define PIRQN 0x00 // PIRQ Null
38 #define MAX_PIRQ_NUMBER 8
41 Return the number of PIRQs supported by this chipset.
43 @param[in] This Pointer to LegacyInterrupt Protocol
44 @param[out] NumberPirqs The pointer to return the max IRQ number supported
46 @retval EFI_SUCCESS Max PIRQs successfully returned
52 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
53 OUT UINT8
*NumberPirqs
57 Return PCI location of this device.
58 $PIR table requires this info.
60 @param[in] This - Protocol instance pointer.
61 @param[out] Bus - PCI Bus
62 @param[out] Device - PCI Device
63 @param[out] Function - PCI Function
65 @retval EFI_SUCCESS Bus/Device/Function returned
71 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
78 Read the given PIRQ register
80 @param[in] This Protocol instance pointer
81 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc
82 @param[out] PirqData Value read
84 @retval EFI_SUCCESS Decoding change affected.
85 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
91 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
97 Write the given PIRQ register
99 @param[in] This Protocol instance pointer
100 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc
101 @param[out] PirqData Value to write
103 @retval EFI_SUCCESS Decoding change affected.
104 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
110 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,