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