2 Driver implementing the Tiano Legacy 8259 Protocol
4 Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <FrameworkDxe.h>
20 #include <Protocol/Legacy8259.h>
21 #include <Protocol/PciIo.h>
23 #include <Library/UefiBootServicesTableLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/IoLib.h>
26 #include <Library/BaseLib.h>
27 #include <Library/PcdLib.h>
29 #include <IndustryStandard/Pci.h>
31 // 8259 Hardware definitions
33 #define LEGACY_MODE_BASE_VECTOR_MASTER 0x08
34 #define LEGACY_MODE_BASE_VECTOR_SLAVE 0x70
36 #define PROTECTED_MODE_BASE_VECTOR_MASTER 0x68
37 #define PROTECTED_MODE_BASE_VECTOR_SLAVE 0x70
39 #define LEGACY_8259_CONTROL_REGISTER_MASTER 0x20
40 #define LEGACY_8259_MASK_REGISTER_MASTER 0x21
41 #define LEGACY_8259_CONTROL_REGISTER_SLAVE 0xA0
42 #define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1
43 #define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_MASTER 0x4D0
44 #define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_SLAVE 0x4D1
46 #define LEGACY_8259_EOI 0x20
48 // Protocol Function Prototypes
53 Interrupt8259SetVectorBase (
54 IN EFI_LEGACY_8259_PROTOCOL
*This
,
61 Interrupt8259GetMask (
62 IN EFI_LEGACY_8259_PROTOCOL
*This
,
63 OUT UINT16
*LegacyMask
, OPTIONAL
64 OUT UINT16
*LegacyEdgeLevel
, OPTIONAL
65 OUT UINT16
*ProtectedMask
, OPTIONAL
66 OUT UINT16
*ProtectedEdgeLevel OPTIONAL
71 Interrupt8259SetMask (
72 IN EFI_LEGACY_8259_PROTOCOL
*This
,
73 IN UINT16
*LegacyMask
, OPTIONAL
74 IN UINT16
*LegacyEdgeLevel
, OPTIONAL
75 IN UINT16
*ProtectedMask
, OPTIONAL
76 IN UINT16
*ProtectedEdgeLevel OPTIONAL
81 Interrupt8259SetMode (
82 IN EFI_LEGACY_8259_PROTOCOL
*This
,
83 IN EFI_8259_MODE Mode
,
84 IN UINT16
*Mask
, OPTIONAL
85 IN UINT16
*EdgeLevel OPTIONAL
90 Interrupt8259GetVector (
91 IN EFI_LEGACY_8259_PROTOCOL
*This
,
98 Interrupt8259EnableIrq (
99 IN EFI_LEGACY_8259_PROTOCOL
*This
,
101 IN BOOLEAN LevelTriggered
106 Interrupt8259DisableIrq (
107 IN EFI_LEGACY_8259_PROTOCOL
*This
,
113 Interrupt8259GetInterruptLine (
114 IN EFI_LEGACY_8259_PROTOCOL
*This
,
115 IN EFI_HANDLE PciHandle
,
121 Interrupt8259EndOfInterrupt (
122 IN EFI_LEGACY_8259_PROTOCOL
*This
,