]> git.proxmox.com Git - mirror_edk2.git/blob - PcAtChipsetPkg/8259InterruptControllerDxe/8259.h
modify the format of DynamicHii type pcd in DSC file. We directly use Unicode string...
[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
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/IoLib.h>
25
26 //
27 // 8259 Hardware definitions
28 //
29 #define LEGACY_MODE_BASE_VECTOR_MASTER 0x08
30 #define LEGACY_MODE_BASE_VECTOR_SLAVE 0x70
31
32 #define PROTECTED_MODE_BASE_VECTOR_MASTER 0x68
33 #define PROTECTED_MODE_BASE_VECTOR_SLAVE 0x70
34
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
41
42 #define LEGACY_8259_EOI 0x20
43
44 //
45 // Protocol Function Prototypes
46 //
47 EFI_STATUS
48 EFIAPI
49 Interrupt8259SetVectorBase (
50 IN EFI_LEGACY_8259_PROTOCOL *This,
51 IN UINT8 MasterBase,
52 IN UINT8 SlaveBase
53 );
54
55 EFI_STATUS
56 EFIAPI
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
63 );
64
65 EFI_STATUS
66 EFIAPI
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
73 );
74
75 EFI_STATUS
76 EFIAPI
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
82 );
83
84 EFI_STATUS
85 EFIAPI
86 Interrupt8259GetVector (
87 IN EFI_LEGACY_8259_PROTOCOL *This,
88 IN EFI_8259_IRQ Irq,
89 OUT UINT8 *Vector
90 );
91
92 EFI_STATUS
93 EFIAPI
94 Interrupt8259EnableIrq (
95 IN EFI_LEGACY_8259_PROTOCOL *This,
96 IN EFI_8259_IRQ Irq,
97 IN BOOLEAN LevelTriggered
98 );
99
100 EFI_STATUS
101 EFIAPI
102 Interrupt8259DisableIrq (
103 IN EFI_LEGACY_8259_PROTOCOL *This,
104 IN EFI_8259_IRQ Irq
105 );
106
107 EFI_STATUS
108 EFIAPI
109 Interrupt8259GetInterruptLine (
110 IN EFI_LEGACY_8259_PROTOCOL *This,
111 IN EFI_HANDLE PciHandle,
112 OUT UINT8 *Vector
113 );
114
115 EFI_STATUS
116 EFIAPI
117 Interrupt8259EndOfInterrupt (
118 IN EFI_LEGACY_8259_PROTOCOL *This,
119 IN EFI_8259_IRQ Irq
120 );
121
122 #endif