2 Driver implementing the Tiano Legacy 8259 Protocol
4 Copyright (c) 2005, 2009, Intel Corporation
5 All rights reserved. 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>
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/IoLib.h>
27 // 8259 Hardware definitions
29 #define LEGACY_MODE_BASE_VECTOR_MASTER 0x08
30 #define LEGACY_MODE_BASE_VECTOR_SLAVE 0x70
32 #define PROTECTED_MODE_BASE_VECTOR_MASTER 0x68
33 #define PROTECTED_MODE_BASE_VECTOR_SLAVE 0x70
35 #define LEGACY_8259_CONTROL_REGISTER_MASTER 0x20
36 #define LEGACY_8259_MASK_REGISTER_MASTER 0x21
37 #define LEGACY_8259_CONTROL_REGISTER_SLAVE 0xA0
38 #define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1
39 #define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_MASTER 0x4D0
40 #define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_SLAVE 0x4D1
42 #define LEGACY_8259_EOI 0x20
45 // Protocol Function Prototypes
49 Interrupt8259SetVectorBase (
50 IN EFI_LEGACY_8259_PROTOCOL
*This
,
57 Interrupt8259GetMask (
58 IN EFI_LEGACY_8259_PROTOCOL
*This
,
59 OUT UINT16
*LegacyMask
, OPTIONAL
60 OUT UINT16
*LegacyEdgeLevel
, OPTIONAL
61 OUT UINT16
*ProtectedMask
, OPTIONAL
62 OUT UINT16
*ProtectedEdgeLevel OPTIONAL
67 Interrupt8259SetMask (
68 IN EFI_LEGACY_8259_PROTOCOL
*This
,
69 IN UINT16
*LegacyMask
, OPTIONAL
70 IN UINT16
*LegacyEdgeLevel
, OPTIONAL
71 IN UINT16
*ProtectedMask
, OPTIONAL
72 IN UINT16
*ProtectedEdgeLevel OPTIONAL
77 Interrupt8259SetMode (
78 IN EFI_LEGACY_8259_PROTOCOL
*This
,
79 IN EFI_8259_MODE Mode
,
80 IN UINT16
*Mask
, OPTIONAL
81 IN UINT16
*EdgeLevel OPTIONAL
86 Interrupt8259GetVector (
87 IN EFI_LEGACY_8259_PROTOCOL
*This
,
94 Interrupt8259EnableIrq (
95 IN EFI_LEGACY_8259_PROTOCOL
*This
,
97 IN BOOLEAN LevelTriggered
102 Interrupt8259DisableIrq (
103 IN EFI_LEGACY_8259_PROTOCOL
*This
,
109 Interrupt8259GetInterruptLine (
110 IN EFI_LEGACY_8259_PROTOCOL
*This
,
111 IN EFI_HANDLE PciHandle
,
117 Interrupt8259EndOfInterrupt (
118 IN EFI_LEGACY_8259_PROTOCOL
*This
,