Fix format of Copyright notice to conform to legal requirements.
[mirror_edk2.git] / PcAtChipsetPkg / 8259InterruptControllerDxe / 8259.h
CommitLineData
90b8b0ec 1/** @file\r
2 Driver implementing the Tiano Legacy 8259 Protocol\r
1166d068 3\r
47ca9c95 4Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php.\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
1166d068 12\r
1166d068 13**/\r
14\r
15#ifndef _8259_H__\r
16#define _8259_H__\r
17\r
18#include <FrameworkDxe.h>\r
19\r
1166d068 20#include <Protocol/Legacy8259.h>\r
ae6a37f0 21#include <Protocol/PciIo.h>\r
1166d068 22\r
23#include <Library/UefiBootServicesTableLib.h>\r
24#include <Library/DebugLib.h>\r
8be701c3 25#include <Library/IoLib.h>\r
ae6a37f0 26#include <Library/BaseLib.h>\r
0547cf4b 27#include <Library/PcdLib.h>\r
1166d068 28\r
6844f188 29#include <IndustryStandard/Pci.h>\r
47ca9c95 30\r
1166d068 31// 8259 Hardware definitions\r
47ca9c95 32\r
1166d068 33#define LEGACY_MODE_BASE_VECTOR_MASTER 0x08\r
34#define LEGACY_MODE_BASE_VECTOR_SLAVE 0x70\r
35\r
36#define PROTECTED_MODE_BASE_VECTOR_MASTER 0x68\r
37#define PROTECTED_MODE_BASE_VECTOR_SLAVE 0x70\r
38\r
39#define LEGACY_8259_CONTROL_REGISTER_MASTER 0x20\r
40#define LEGACY_8259_MASK_REGISTER_MASTER 0x21\r
41#define LEGACY_8259_CONTROL_REGISTER_SLAVE 0xA0\r
42#define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1\r
43#define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_MASTER 0x4D0\r
44#define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_SLAVE 0x4D1\r
45\r
46#define LEGACY_8259_EOI 0x20\r
47\r
1166d068 48// Protocol Function Prototypes\r
47ca9c95 49\r
50\r
1166d068 51EFI_STATUS\r
52EFIAPI\r
53Interrupt8259SetVectorBase (\r
90b8b0ec 54 IN EFI_LEGACY_8259_PROTOCOL *This,\r
55 IN UINT8 MasterBase,\r
56 IN UINT8 SlaveBase\r
57 );\r
1166d068 58\r
59EFI_STATUS\r
60EFIAPI\r
61Interrupt8259GetMask (\r
90b8b0ec 62 IN EFI_LEGACY_8259_PROTOCOL *This,\r
1166d068 63 OUT UINT16 *LegacyMask, OPTIONAL\r
64 OUT UINT16 *LegacyEdgeLevel, OPTIONAL\r
65 OUT UINT16 *ProtectedMask, OPTIONAL\r
66 OUT UINT16 *ProtectedEdgeLevel OPTIONAL\r
90b8b0ec 67 );\r
1166d068 68\r
69EFI_STATUS\r
70EFIAPI\r
71Interrupt8259SetMask (\r
90b8b0ec 72 IN EFI_LEGACY_8259_PROTOCOL *This,\r
73 IN UINT16 *LegacyMask, OPTIONAL\r
74 IN UINT16 *LegacyEdgeLevel, OPTIONAL\r
75 IN UINT16 *ProtectedMask, OPTIONAL\r
76 IN UINT16 *ProtectedEdgeLevel OPTIONAL\r
77 );\r
1166d068 78\r
79EFI_STATUS\r
80EFIAPI\r
81Interrupt8259SetMode (\r
90b8b0ec 82 IN EFI_LEGACY_8259_PROTOCOL *This,\r
83 IN EFI_8259_MODE Mode,\r
84 IN UINT16 *Mask, OPTIONAL\r
85 IN UINT16 *EdgeLevel OPTIONAL\r
86 );\r
1166d068 87\r
88EFI_STATUS\r
89EFIAPI\r
90Interrupt8259GetVector (\r
91 IN EFI_LEGACY_8259_PROTOCOL *This,\r
92 IN EFI_8259_IRQ Irq,\r
93 OUT UINT8 *Vector\r
90b8b0ec 94 );\r
1166d068 95\r
96EFI_STATUS\r
97EFIAPI\r
98Interrupt8259EnableIrq (\r
90b8b0ec 99 IN EFI_LEGACY_8259_PROTOCOL *This,\r
100 IN EFI_8259_IRQ Irq,\r
101 IN BOOLEAN LevelTriggered\r
102 );\r
1166d068 103\r
104EFI_STATUS\r
105EFIAPI\r
106Interrupt8259DisableIrq (\r
90b8b0ec 107 IN EFI_LEGACY_8259_PROTOCOL *This,\r
108 IN EFI_8259_IRQ Irq\r
109 );\r
1166d068 110\r
111EFI_STATUS\r
112EFIAPI\r
113Interrupt8259GetInterruptLine (\r
114 IN EFI_LEGACY_8259_PROTOCOL *This,\r
115 IN EFI_HANDLE PciHandle,\r
116 OUT UINT8 *Vector\r
90b8b0ec 117 );\r
1166d068 118\r
119EFI_STATUS\r
120EFIAPI\r
121Interrupt8259EndOfInterrupt (\r
122 IN EFI_LEGACY_8259_PROTOCOL *This,\r
123 IN EFI_8259_IRQ Irq\r
90b8b0ec 124 );\r
1166d068 125\r
126#endif\r