]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Csm/CsmSupportLib/LegacyInterrupt.h
OvmfPkg/Acpi: Fix few typos
[mirror_edk2.git] / OvmfPkg / Csm / CsmSupportLib / LegacyInterrupt.h
CommitLineData
8016da21 1/** @file\r
2 Legacy Region Support\r
3\r
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
5\r
b26f0cf9 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
8016da21 7\r
8**/\r
9\r
10#ifndef _LEGACY_INTERRUPT_H_\r
11#define _LEGACY_INTERRUPT_H_\r
12\r
13#include <PiDxe.h>\r
14\r
15#include <Protocol/LegacyInterrupt.h>\r
16\r
72a11001 17#include <Library/PcdLib.h>\r
8016da21 18#include <Library/PciLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/UefiBootServicesTableLib.h>\r
72a11001
GS
21#include <OvmfPlatforms.h>\r
22\r
8016da21 23\r
24#define LEGACY_INT_BUS 0\r
72a11001
GS
25#define LEGACY_INT_DEV_PIIX4 0x01\r
26#define LEGACY_INT_DEV_Q35 0x1f\r
8016da21 27#define LEGACY_INT_FUNC 0\r
28\r
29#define PIRQN 0x00 // PIRQ Null\r
30#define PIRQA 0x60\r
31#define PIRQB 0x61\r
32#define PIRQC 0x62\r
33#define PIRQD 0x63\r
34#define PIRQE 0x68\r
35#define PIRQF 0x69\r
36#define PIRQG 0x6A\r
37#define PIRQH 0x6B\r
38\r
39#define MAX_PIRQ_NUMBER 8\r
40\r
41/**\r
42 Return the number of PIRQs supported by this chipset.\r
43\r
44 @param[in] This Pointer to LegacyInterrupt Protocol\r
45 @param[out] NumberPirqs The pointer to return the max IRQ number supported\r
46\r
47 @retval EFI_SUCCESS Max PIRQs successfully returned\r
48\r
49**/\r
50EFI_STATUS\r
51EFIAPI\r
52GetNumberPirqs (\r
53 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
54 OUT UINT8 *NumberPirqs\r
55 );\r
56\r
57/**\r
58 Return PCI location of this device.\r
59 $PIR table requires this info.\r
60\r
61 @param[in] This - Protocol instance pointer.\r
62 @param[out] Bus - PCI Bus\r
63 @param[out] Device - PCI Device\r
64 @param[out] Function - PCI Function\r
65\r
66 @retval EFI_SUCCESS Bus/Device/Function returned\r
67\r
68**/\r
69EFI_STATUS\r
70EFIAPI\r
71GetLocation (\r
72 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
73 OUT UINT8 *Bus,\r
74 OUT UINT8 *Device,\r
75 OUT UINT8 *Function\r
76 );\r
77\r
78/**\r
79 Read the given PIRQ register\r
80\r
81 @param[in] This Protocol instance pointer\r
82 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc\r
83 @param[out] PirqData Value read\r
84\r
85 @retval EFI_SUCCESS Decoding change affected.\r
86 @retval EFI_INVALID_PARAMETER Invalid PIRQ number\r
87\r
88**/\r
89EFI_STATUS\r
90EFIAPI\r
91ReadPirq (\r
92 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
93 IN UINT8 PirqNumber,\r
94 OUT UINT8 *PirqData\r
95 );\r
96\r
97/**\r
98 Write the given PIRQ register\r
99\r
100 @param[in] This Protocol instance pointer\r
101 @param[in] PirqNumber The Pirq register 0 = A, 1 = B etc\r
102 @param[out] PirqData Value to write\r
103\r
104 @retval EFI_SUCCESS Decoding change affected.\r
105 @retval EFI_INVALID_PARAMETER Invalid PIRQ number\r
106\r
107**/\r
108EFI_STATUS\r
109EFIAPI\r
110WritePirq (\r
111 IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,\r
112 IN UINT8 PirqNumber,\r
113 IN UINT8 PirqData\r
114 );\r
115\r
116#endif\r
117\r