ReactOS 0.4.15-dev-8428-g6910fa6
pic.h
Go to the documentation of this file.
1/*
2 * PROJECT: NEC PC-98 series onboard hardware
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Intel 8259A PIC header file
5 * COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
6 */
7
8#pragma once
9
10#define PIC1_CONTROL_PORT 0x00
11#define PIC1_DATA_PORT 0x02
12#define PIC2_CONTROL_PORT 0x08
13#define PIC2_DATA_PORT 0x0A
14
15#define PIC_TIMER_IRQ 0
16#define PIC_CASCADE_IRQ 7
17#define PIC_RTC_IRQ 15
18
19/*
20 * Definitions for ICW/OCW Bits
21 */
23{
25 Single
27
29{
33
35{
39
41{
45
47{
51
53{
59
61{
67
68typedef enum _I8259_EOI_MODE
69{
79
80/*
81 * Definitions for ICW Registers
82 */
83typedef union _I8259_ICW1
84{
85 struct
86 {
91 UCHAR Init:1;
93 };
94 UCHAR Bits;
96
97typedef union _I8259_ICW2
98{
99 struct
100 {
101 UCHAR Sbz:3;
103 };
104 UCHAR Bits;
106
107typedef union _I8259_ICW3
108{
109 union
110 {
111 struct
112 {
121 };
122 struct
123 {
124 UCHAR SlaveId:3;
125 UCHAR Reserved:5;
126 };
127 };
128 UCHAR Bits;
130
131typedef union _I8259_ICW4
132{
133 struct
134 {
136 UCHAR EoiMode:1;
139 UCHAR Reserved:3;
140 };
141 UCHAR Bits;
143
144typedef union _I8259_OCW2
145{
146 struct
147 {
149 UCHAR Sbz:2;
150 UCHAR EoiMode:3;
151 };
152 UCHAR Bits;
154
155typedef union _I8259_OCW3
156{
157 struct
158 {
161 UCHAR Sbo:1;
162 UCHAR Sbz:1;
164 UCHAR Reserved:1;
165 };
166 UCHAR Bits;
168
169typedef union _I8259_ISR
170{
171 struct
172 {
173 UCHAR Irq0:1;
174 UCHAR Irq1:1;
175 UCHAR Irq2:1;
176 UCHAR Irq3:1;
177 UCHAR Irq4:1;
178 UCHAR Irq5:1;
179 UCHAR Irq6:1;
180 UCHAR Irq7:1;
181 };
182 UCHAR Bits;
184
186
187/*
188 * NESA Edge/Level Triggered Register
189 */
190#define EISA_ELCR_MASTER 0x98D2
191#define EISA_ELCR_SLAVE 0x98D4
192
193typedef union _EISA_ELCR
194{
195 struct
196 {
197 struct
198 {
208 struct
209 {
219 };
220 USHORT Bits;
222
223typedef union _PIC_MASK
224{
225 struct
226 {
228 UCHAR Slave;
229 };
230 USHORT Both;
_I8259_ICW4_BUFFERED_MODE
Definition: halhw.h:193
_I8259_ICW4_EOI_MODE
Definition: halhw.h:187
_I8259_ICW1_OPERATING_MODE
Definition: halhw.h:163
_I8259_ICW4_SYSTEM_MODE
Definition: halhw.h:181
_I8259_ICW1_INTERRUPT_MODE
Definition: halhw.h:169
_I8259_EOI_MODE
Definition: halhw.h:209
_I8259_ICW1_INTERVAL
Definition: halhw.h:175
_I8259_READ_REQUEST
Definition: halhw.h:201
unsigned short USHORT
Definition: pedump.c:61
@ BufferedSlave
Definition: pic.h:56
@ NonBuffered2
Definition: pic.h:55
@ NonBuffered
Definition: pic.h:54
@ BufferedMaster
Definition: pic.h:57
@ NormalEoi
Definition: pic.h:48
@ AutomaticEoi
Definition: pic.h:49
union _I8259_OCW2 I8259_OCW2
union _I8259_OCW3 * PI8259_OCW3
union _I8259_ISR * PI8259_ISR
union _EISA_ELCR * PEISA_ELCR
union _I8259_ICW2 I8259_ICW2
enum _I8259_ICW4_EOI_MODE I8259_ICW4_EOI_MODE
@ Single
Definition: pic.h:25
@ Cascade
Definition: pic.h:24
@ Mcs8085Mode
Definition: pic.h:42
@ New8086Mode
Definition: pic.h:43
union _I8259_ICW3 I8259_ICW3
union _I8259_OCW2 * PI8259_OCW2
enum _I8259_READ_REQUEST I8259_READ_REQUEST
enum _I8259_EOI_MODE I8259_EOI_MODE
@ EdgeTriggered
Definition: pic.h:30
@ LevelTriggered
Definition: pic.h:31
union _I8259_ICW1 I8259_ICW1
union _EISA_ELCR EISA_ELCR
I8259_ISR I8259_IDR
Definition: pic.h:185
union _I8259_ICW2 * PI8259_ICW2
enum _I8259_ICW4_SYSTEM_MODE I8259_ICW4_SYSTEM_MODE
I8259_ISR * PI8259_IDR
Definition: pic.h:185
union _PIC_MASK * PPIC_MASK
@ NonSpecificEoi
Definition: pic.h:71
@ RotateSpecific
Definition: pic.h:77
@ RotateAutoEoiSet
Definition: pic.h:74
@ RotateNonSpecific
Definition: pic.h:75
@ InvalidEoiMode
Definition: pic.h:72
@ SetPriority
Definition: pic.h:76
@ SpecificEoi
Definition: pic.h:73
@ RotateAutoEoiClear
Definition: pic.h:70
union _I8259_ISR I8259_ISR
union _I8259_ICW3 * PI8259_ICW3
enum _I8259_ICW1_INTERRUPT_MODE I8259_ICW1_INTERRUPT_MODE
enum _I8259_ICW1_OPERATING_MODE I8259_ICW1_OPERATING_MODE
union _I8259_ICW1 * PI8259_ICW1
union _I8259_ICW4 * PI8259_ICW4
union _I8259_ICW4 I8259_ICW4
@ Interval4
Definition: pic.h:37
@ Interval8
Definition: pic.h:36
enum _I8259_ICW1_INTERVAL I8259_ICW1_INTERVAL
union _I8259_OCW3 I8259_OCW3
union _PIC_MASK PIC_MASK
@ ReadIsr
Definition: pic.h:65
@ InvalidRequest
Definition: pic.h:62
@ InvalidRequest2
Definition: pic.h:63
@ ReadIdr
Definition: pic.h:64
enum _I8259_ICW4_BUFFERED_MODE I8259_ICW4_BUFFERED_MODE
UCHAR Irq4Level
Definition: halhw.h:346
UCHAR Irq11Level
Definition: halhw.h:356
UCHAR Irq3Level
Definition: halhw.h:345
struct _EISA_ELCR::@1520::@1523 Slave
UCHAR Irq14Level
Definition: halhw.h:359
UCHAR Irq1Level
Definition: halhw.h:343
UCHAR Irq15Level
Definition: halhw.h:360
UCHAR Irq10Level
Definition: halhw.h:355
UCHAR Irq9Level
Definition: halhw.h:354
UCHAR Irq2Level
Definition: halhw.h:344
UCHAR Irq12Level
Definition: halhw.h:357
struct _EISA_ELCR::@1520::@1522 Master
USHORT Bits
Definition: halhw.h:363
UCHAR Irq13Level
Definition: halhw.h:358
UCHAR Irq8Level
Definition: halhw.h:353
UCHAR Irq7Level
Definition: halhw.h:349
UCHAR Irq0Level
Definition: halhw.h:342
UCHAR Irq6Level
Definition: halhw.h:348
UCHAR Irq5Level
Definition: halhw.h:347
UCHAR Init
Definition: halhw.h:231
UCHAR OperatingMode
Definition: halhw.h:228
UCHAR Bits
Definition: halhw.h:234
UCHAR NeedIcw4
Definition: halhw.h:227
UCHAR Interval
Definition: halhw.h:229
UCHAR InterruptVectorAddress
Definition: halhw.h:232
UCHAR InterruptMode
Definition: halhw.h:230
UCHAR Bits
Definition: halhw.h:244
UCHAR Sbz
Definition: halhw.h:241
UCHAR InterruptVector
Definition: halhw.h:242
UCHAR SlaveIrq5
Definition: halhw.h:258
UCHAR SlaveId
Definition: halhw.h:264
UCHAR SlaveIrq4
Definition: halhw.h:257
UCHAR SlaveIrq0
Definition: halhw.h:253
UCHAR SlaveIrq1
Definition: halhw.h:254
UCHAR SlaveIrq2
Definition: halhw.h:255
UCHAR Bits
Definition: halhw.h:268
UCHAR Reserved
Definition: halhw.h:265
UCHAR SlaveIrq6
Definition: halhw.h:259
UCHAR SlaveIrq7
Definition: halhw.h:260
UCHAR SlaveIrq3
Definition: halhw.h:256
UCHAR SystemMode
Definition: halhw.h:275
UCHAR BufferedMode
Definition: halhw.h:277
UCHAR SpecialFullyNestedMode
Definition: halhw.h:278
UCHAR Reserved
Definition: halhw.h:279
UCHAR Bits
Definition: halhw.h:281
UCHAR EoiMode
Definition: halhw.h:276
UCHAR Irq0
Definition: halhw.h:313
UCHAR Irq4
Definition: halhw.h:317
UCHAR Irq3
Definition: halhw.h:316
UCHAR Irq2
Definition: halhw.h:315
UCHAR Irq6
Definition: halhw.h:319
UCHAR Irq5
Definition: halhw.h:318
UCHAR Bits
Definition: halhw.h:322
UCHAR Irq1
Definition: halhw.h:314
UCHAR Irq7
Definition: halhw.h:320
UCHAR EoiMode
Definition: halhw.h:290
UCHAR Sbz
Definition: halhw.h:289
UCHAR Bits
Definition: halhw.h:292
UCHAR IrqNumber
Definition: halhw.h:288
UCHAR Sbo
Definition: halhw.h:301
UCHAR Sbz
Definition: halhw.h:302
UCHAR ReadRequest
Definition: halhw.h:299
UCHAR Bits
Definition: halhw.h:306
UCHAR PollCommand
Definition: halhw.h:300
UCHAR Reserved
Definition: halhw.h:304
UCHAR SpecialMaskMode
Definition: halhw.h:303
UCHAR Slave
Definition: halhw.h:371
USHORT Both
Definition: halhw.h:373
UCHAR Master
Definition: halhw.h:370
unsigned char UCHAR
Definition: xmlstorage.h:181