]> git.proxmox.com Git - mirror_edk2.git/blob - PcAtChipsetPkg/8259InterruptControllerDxe/8259.h
1. removed an extra call to SetVectorBase() in the SetMode() function.
[mirror_edk2.git] / PcAtChipsetPkg / 8259InterruptControllerDxe / 8259.h
1 /** @file
2 Driver implementing the Tiano Legacy 8259 Protocol
3
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
9
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.
12
13 **/
14
15 #ifndef _8259_H__
16 #define _8259_H__
17
18 #include <FrameworkDxe.h>
19
20 #include <Protocol/Legacy8259.h>
21 #include <Protocol/PciIo.h>
22
23 #include <Library/UefiBootServicesTableLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/IoLib.h>
26 #include <Library/BaseLib.h>
27
28 #include <IndustryStandard/Pci22.h>
29 //
30 // 8259 Hardware definitions
31 //
32 #define LEGACY_MODE_BASE_VECTOR_MASTER 0x08
33 #define LEGACY_MODE_BASE_VECTOR_SLAVE 0x70
34
35 #define PROTECTED_MODE_BASE_VECTOR_MASTER 0x68
36 #define PROTECTED_MODE_BASE_VECTOR_SLAVE 0x70
37
38 #define LEGACY_8259_CONTROL_REGISTER_MASTER 0x20
39 #define LEGACY_8259_MASK_REGISTER_MASTER 0x21
40 #define LEGACY_8259_CONTROL_REGISTER_SLAVE 0xA0
41 #define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1
42 #define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_MASTER 0x4D0
43 #define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_SLAVE 0x4D1
44
45 #define LEGACY_8259_EOI 0x20
46
47 //
48 // Protocol Function Prototypes
49 //
50 EFI_STATUS
51 EFIAPI
52 Interrupt8259SetVectorBase (
53 IN EFI_LEGACY_8259_PROTOCOL *This,
54 IN UINT8 MasterBase,
55 IN UINT8 SlaveBase
56 );
57
58 EFI_STATUS
59 EFIAPI
60 Interrupt8259GetMask (
61 IN EFI_LEGACY_8259_PROTOCOL *This,
62 OUT UINT16 *LegacyMask, OPTIONAL
63 OUT UINT16 *LegacyEdgeLevel, OPTIONAL
64 OUT UINT16 *ProtectedMask, OPTIONAL
65 OUT UINT16 *ProtectedEdgeLevel OPTIONAL
66 );
67
68 EFI_STATUS
69 EFIAPI
70 Interrupt8259SetMask (
71 IN EFI_LEGACY_8259_PROTOCOL *This,
72 IN UINT16 *LegacyMask, OPTIONAL
73 IN UINT16 *LegacyEdgeLevel, OPTIONAL
74 IN UINT16 *ProtectedMask, OPTIONAL
75 IN UINT16 *ProtectedEdgeLevel OPTIONAL
76 );
77
78 EFI_STATUS
79 EFIAPI
80 Interrupt8259SetMode (
81 IN EFI_LEGACY_8259_PROTOCOL *This,
82 IN EFI_8259_MODE Mode,
83 IN UINT16 *Mask, OPTIONAL
84 IN UINT16 *EdgeLevel OPTIONAL
85 );
86
87 EFI_STATUS
88 EFIAPI
89 Interrupt8259GetVector (
90 IN EFI_LEGACY_8259_PROTOCOL *This,
91 IN EFI_8259_IRQ Irq,
92 OUT UINT8 *Vector
93 );
94
95 EFI_STATUS
96 EFIAPI
97 Interrupt8259EnableIrq (
98 IN EFI_LEGACY_8259_PROTOCOL *This,
99 IN EFI_8259_IRQ Irq,
100 IN BOOLEAN LevelTriggered
101 );
102
103 EFI_STATUS
104 EFIAPI
105 Interrupt8259DisableIrq (
106 IN EFI_LEGACY_8259_PROTOCOL *This,
107 IN EFI_8259_IRQ Irq
108 );
109
110 EFI_STATUS
111 EFIAPI
112 Interrupt8259GetInterruptLine (
113 IN EFI_LEGACY_8259_PROTOCOL *This,
114 IN EFI_HANDLE PciHandle,
115 OUT UINT8 *Vector
116 );
117
118 EFI_STATUS
119 EFIAPI
120 Interrupt8259EndOfInterrupt (
121 IN EFI_LEGACY_8259_PROTOCOL *This,
122 IN EFI_8259_IRQ Irq
123 );
124
125 #endif