4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are
7 licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _LEGACY_INTERRUPT_H_
17 #define _LEGACY_INTERRUPT_H_
21 #include <Protocol/LegacyInterrupt.h>
23 #include <Library/PcdLib.h>
24 #include <Library/PciLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/UefiBootServicesTableLib.h>
27 #include <OvmfPlatforms.h>
30 #define LEGACY_INT_BUS 0
31 #define LEGACY_INT_DEV_PIIX4 0x01
32 #define LEGACY_INT_DEV_Q35 0x1f
33 #define LEGACY_INT_FUNC 0
35 #define PIRQN 0x00 // PIRQ Null
45 #define MAX_PIRQ_NUMBER 8
48 Return the number of PIRQs supported by this chipset.
50 @param[in] This Pointer to LegacyInterrupt Protocol
51 @param[out] NumberPirqs The pointer to return the max IRQ number supported
53 @retval EFI_SUCCESS Max PIRQs successfully returned
59 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
60 OUT UINT8
*NumberPirqs
64 Return PCI location of this device.
65 $PIR table requires this info.
67 @param[in] This - Protocol instance pointer.
68 @param[out] Bus - PCI Bus
69 @param[out] Device - PCI Device
70 @param[out] Function - PCI Function
72 @retval EFI_SUCCESS Bus/Device/Function returned
78 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
85 Read the given PIRQ register
87 @param[in] This Protocol instance pointer
88 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc
89 @param[out] PirqData Value read
91 @retval EFI_SUCCESS Decoding change affected.
92 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
98 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,
104 Write the given PIRQ register
106 @param[in] This Protocol instance pointer
107 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc
108 @param[out] PirqData Value to write
110 @retval EFI_SUCCESS Decoding change affected.
111 @retval EFI_INVALID_PARAMETER Invalid PIRQ number
117 IN EFI_LEGACY_INTERRUPT_PROTOCOL
*This
,