ReactOS 0.4.16-dev-117-g38f21f9
ioapic.h
Go to the documentation of this file.
1/*
2 *
3 */
4
5#pragma once
6
7/* I/O APIC Register Address Map */
8#define IOAPIC_IOREGSEL 0x0000 /* I/O Register Select (index) (R/W) */
9#define IOAPIC_IOWIN 0x0010 /* I/O window (data) (R/W) */
10
11#define IOAPIC_ID 0x0000 /* IO APIC ID (R/W) */
12#define IOAPIC_VER 0x0001 /* IO APIC Version (R) */
13#define IOAPIC_ARB 0x0002 /* IO APIC Arbitration ID (R) */
14#define IOAPIC_REDTBL 0x0010 /* Redirection Table (0-23 64-bit registers) (R/W) */
15
16#define IOAPIC_ID_MASK (0xF << 24)
17#define GET_IOAPIC_ID(x) ((UCHAR)(((x) & IOAPIC_ID_MASK) >> 24))
18#define SET_IOAPIC_ID(x) ((x) << 24)
19
20#define IOAPIC_VER_MASK (0xFF)
21#define GET_IOAPIC_VERSION(x) (((x) & IOAPIC_VER_MASK))
22#define IOAPIC_MRE_MASK (0xFF << 16) /* Maximum Redirection Entry */
23#define GET_IOAPIC_MRE(x) (((x) & IOAPIC_MRE_MASK) >> 16)
24
25#define IOAPIC_ARB_MASK (0xF << 24)
26#define GET_IOAPIC_ARB(x) (((x) & IOAPIC_ARB_MASK) >> 24)
27
28#define IOAPIC_TBL_DELMOD (0x7 << 10) /* Delivery Mode (see APIC_DM_*) */
29#define IOAPIC_TBL_DM (0x1 << 11) /* Destination Mode */
30#define IOAPIC_TBL_DS (0x1 << 12) /* Delivery Status */
31#define IOAPIC_TBL_INTPOL (0x1 << 13) /* Interrupt Input Pin Polarity */
32#define IOAPIC_TBL_RIRR (0x1 << 14) /* Remote IRR */
33#define IOAPIC_TBL_TM (0x1 << 15) /* Trigger Mode */
34#define IOAPIC_TBL_IM (0x1 << 16) /* Interrupt Mask */
35#define IOAPIC_TBL_DF0 (0xF << 56) /* Destination Field (physical mode) */
36#define IOAPIC_TBL_DF1 (0xFF<< 56) /* Destination Field (logical mode) */
37#define IOAPIC_TBL_VECTOR (0xFF << 0) /* Vector (10h - FEh) */
38
39#include <pshpack1.h>
40typedef struct _IOAPIC_ROUTE_ENTRY {
42 delivery_mode : 3, /* 000: FIXED
43 * 001: lowest priority
44 * 111: ExtINT
45 */
46 dest_mode : 1, /* 0: physical, 1: logical */
49 irr : 1,
50 trigger : 1, /* 0: edge, 1: level */
51 mask : 1, /* 0: enabled, 1: disabled */
53
54 union {
55 struct {
58 __reserved_2 : 4;
60 struct {
66#include <poppack.h>
67
68typedef struct _IOAPIC_INFO
69{
70 UCHAR ApicId; /* APIC ID */
71 UCHAR ApicVersion; /* APIC version */
72 ULONG ApicAddress; /* APIC address */
73 ULONG EntryCount; /* Number of redirection entries */
75
76#define IOAPIC_DEFAULT_BASE 0xFEC00000 /* Default I/O APIC Base Register Address */
77
78extern ULONG IRQCount; /* Number of IRQs */
79extern UCHAR BUSMap[MAX_BUS]; /* Map of all buses in the system */
80extern UCHAR PCIBUSMap[MAX_BUS]; /* Map of all PCI buses in the system */
81extern IOAPIC_INFO IOAPICMap[MAX_IOAPIC]; /* Map of all I/O APICs in the system */
82extern ULONG IOAPICCount; /* Number of I/O APICs in the system */
83extern ULONG APICMode; /* APIC mode at startup */
84extern MP_CONFIGURATION_INTSRC IRQMap[MAX_IRQ_SOURCE]; /* Map of all IRQs */
85
91
93
94/* For debugging */
96
97/* EOF */
struct _IOAPIC_ROUTE_ENTRY * PIOAPIC_ROUTE_ENTRY
struct _IOAPIC_ROUTE_ENTRY IOAPIC_ROUTE_ENTRY
ULONG IOAPICCount
Definition: ioapic.c:25
IOAPIC_INFO IOAPICMap[MAX_IOAPIC]
Definition: ioapic.c:24
UCHAR BUSMap[MAX_BUS]
Definition: ioapic.c:21
UCHAR PCIBUSMap[MAX_BUS]
Definition: ioapic.c:22
ULONG APICMode
Definition: apic.c:49
VOID HaliReconfigurePciInterrupts(VOID)
Definition: ioapic.c:634
VOID IOAPICSetupIrqs(VOID)
Definition: ioapic.c:296
struct _IOAPIC_INFO IOAPIC_INFO
VOID IOAPICEnable(VOID)
Definition: ioapic.c:409
VOID IOAPICMaskIrq(ULONG Irq)
Definition: ioapic.c:494
VOID IOAPICDump(VOID)
Definition: ioapic.c:524
MP_CONFIGURATION_INTSRC IRQMap[MAX_IRQ_SOURCE]
Definition: ioapic.c:17
VOID IOAPICSetupIds(VOID)
Definition: ioapic.c:432
struct _IOAPIC_INFO * PIOAPIC_INFO
VOID IOAPICUnmaskIrq(ULONG Irq)
Definition: ioapic.c:511
ULONG IRQCount
Definition: ioapic.c:18
#define MAX_IOAPIC
Definition: mps.h:145
#define MAX_IRQ_SOURCE
Definition: mps.h:161
#define MAX_BUS
Definition: mps.h:109
ULONG ApicAddress
Definition: ioapic.h:72
UCHAR ApicId
Definition: ioapic.h:70
UCHAR ApicVersion
Definition: ioapic.h:71
ULONG EntryCount
Definition: ioapic.h:73
Definition: ioapic.h:40
ULONG irr
Definition: ioapic.h:49
ULONG delivery_mode
Definition: ioapic.h:42
ULONG mask
Definition: ioapic.h:51
ULONG delivery_status
Definition: ioapic.h:47
ULONG __reserved_1
Definition: ioapic.h:56
ULONG polarity
Definition: ioapic.h:48
ULONG physical_dest
Definition: ioapic.h:57
ULONG vector
Definition: ioapic.h:41
struct _IOAPIC_ROUTE_ENTRY::@1535::@1537 logical
struct _IOAPIC_ROUTE_ENTRY::@1535::@1536 physical
ULONG trigger
Definition: ioapic.h:50
ULONG dest_mode
Definition: ioapic.h:46
ULONG logical_dest
Definition: ioapic.h:62
ULONG __reserved_2
Definition: ioapic.h:52
union _IOAPIC_ROUTE_ENTRY::@1535 dest
uint32_t ULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: xmlstorage.h:181