Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenioapic.h
Go to the documentation of this file.
00001 /* 00002 * 00003 */ 00004 00005 #pragma once 00006 00007 /* I/O APIC Register Address Map */ 00008 #define IOAPIC_IOREGSEL 0x0000 /* I/O Register Select (index) (R/W) */ 00009 #define IOAPIC_IOWIN 0x0010 /* I/O window (data) (R/W) */ 00010 00011 #define IOAPIC_ID 0x0000 /* IO APIC ID (R/W) */ 00012 #define IOAPIC_VER 0x0001 /* IO APIC Version (R) */ 00013 #define IOAPIC_ARB 0x0002 /* IO APIC Arbitration ID (R) */ 00014 #define IOAPIC_REDTBL 0x0010 /* Redirection Table (0-23 64-bit registers) (R/W) */ 00015 00016 #define IOAPIC_ID_MASK (0xF << 24) 00017 #define GET_IOAPIC_ID(x) ((UCHAR)(((x) & IOAPIC_ID_MASK) >> 24)) 00018 #define SET_IOAPIC_ID(x) ((x) << 24) 00019 00020 #define IOAPIC_VER_MASK (0xFF) 00021 #define GET_IOAPIC_VERSION(x) (((x) & IOAPIC_VER_MASK)) 00022 #define IOAPIC_MRE_MASK (0xFF << 16) /* Maximum Redirection Entry */ 00023 #define GET_IOAPIC_MRE(x) (((x) & IOAPIC_MRE_MASK) >> 16) 00024 00025 #define IOAPIC_ARB_MASK (0xF << 24) 00026 #define GET_IOAPIC_ARB(x) (((x) & IOAPIC_ARB_MASK) >> 24) 00027 00028 #define IOAPIC_TBL_DELMOD (0x7 << 10) /* Delivery Mode (see APIC_DM_*) */ 00029 #define IOAPIC_TBL_DM (0x1 << 11) /* Destination Mode */ 00030 #define IOAPIC_TBL_DS (0x1 << 12) /* Delivery Status */ 00031 #define IOAPIC_TBL_INTPOL (0x1 << 13) /* Interrupt Input Pin Polarity */ 00032 #define IOAPIC_TBL_RIRR (0x1 << 14) /* Remote IRR */ 00033 #define IOAPIC_TBL_TM (0x1 << 15) /* Trigger Mode */ 00034 #define IOAPIC_TBL_IM (0x1 << 16) /* Interrupt Mask */ 00035 #define IOAPIC_TBL_DF0 (0xF << 56) /* Destination Field (physical mode) */ 00036 #define IOAPIC_TBL_DF1 (0xFF<< 56) /* Destination Field (logical mode) */ 00037 #define IOAPIC_TBL_VECTOR (0xFF << 0) /* Vector (10h - FEh) */ 00038 00039 #include <pshpack1.h> 00040 typedef struct _IOAPIC_ROUTE_ENTRY { 00041 ULONG vector : 8, 00042 delivery_mode : 3, /* 000: FIXED 00043 * 001: lowest priority 00044 * 111: ExtINT 00045 */ 00046 dest_mode : 1, /* 0: physical, 1: logical */ 00047 delivery_status : 1, 00048 polarity : 1, 00049 irr : 1, 00050 trigger : 1, /* 0: edge, 1: level */ 00051 mask : 1, /* 0: enabled, 1: disabled */ 00052 __reserved_2 : 15; 00053 00054 union { 00055 struct { 00056 ULONG __reserved_1 : 24, 00057 physical_dest : 4, 00058 __reserved_2 : 4; 00059 } physical; 00060 struct { 00061 ULONG __reserved_1 : 24, 00062 logical_dest : 8; 00063 } logical; 00064 } dest; 00065 } IOAPIC_ROUTE_ENTRY, *PIOAPIC_ROUTE_ENTRY; 00066 #include <poppack.h> 00067 00068 typedef struct _IOAPIC_INFO 00069 { 00070 UCHAR ApicId; /* APIC ID */ 00071 UCHAR ApicVersion; /* APIC version */ 00072 ULONG ApicAddress; /* APIC address */ 00073 ULONG EntryCount; /* Number of redirection entries */ 00074 } IOAPIC_INFO, *PIOAPIC_INFO; 00075 00076 #define IOAPIC_DEFAULT_BASE 0xFEC00000 /* Default I/O APIC Base Register Address */ 00077 00078 extern ULONG IRQCount; /* Number of IRQs */ 00079 extern UCHAR BUSMap[MAX_BUS]; /* Map of all buses in the system */ 00080 extern UCHAR PCIBUSMap[MAX_BUS]; /* Map of all PCI buses in the system */ 00081 extern IOAPIC_INFO IOAPICMap[MAX_IOAPIC]; /* Map of all I/O APICs in the system */ 00082 extern ULONG IOAPICCount; /* Number of I/O APICs in the system */ 00083 extern ULONG APICMode; /* APIC mode at startup */ 00084 extern MP_CONFIGURATION_INTSRC IRQMap[MAX_IRQ_SOURCE]; /* Map of all IRQs */ 00085 00086 VOID IOAPICSetupIrqs(VOID); 00087 VOID IOAPICEnable(VOID); 00088 VOID IOAPICSetupIds(VOID); 00089 VOID IOAPICMaskIrq(ULONG Irq); 00090 VOID IOAPICUnmaskIrq(ULONG Irq); 00091 00092 VOID HaliReconfigurePciInterrupts(VOID); 00093 00094 /* For debugging */ 00095 VOID IOAPICDump(VOID); 00096 00097 /* EOF */ Generated on Sat May 26 2012 04:27:21 for ReactOS by
1.7.6.1
|