Imported Upstream version 1.30
[platform/upstream/x86info.git] / apic.h
1 #ifndef _APIC_H
2 #define _APIC_H
3
4 #define IA32_APIC_BASE_MSR              0x1B
5
6 #define APIC_REGISTER_SPACE             4096
7 #define APIC_REGISTER_ALIGNED_SIZE      4
8
9 #define PAGE_OFFSET(addr)               ((unsigned long)(addr) & (getpagesize() - 1))
10
11 enum apic_register_offset
12 {
13         APIC_ID         = 0x2,
14         APIC_VER        = 0x3,
15         APIC_TPR        = 0x8,
16         APIC_APR        = 0x9,
17         APIC_PPR        = 0xA,
18         APIC_EOI        = 0xB,
19         APIC_RRD        = 0xC,
20         APIC_LDR        = 0xD,
21         APIC_DFR        = 0xE,
22         APIC_SIVR       = 0xF,
23         APIC_ISR        = 0x10,
24         APIC_TMR        = 0x18,
25         APIC_IRR        = 0x20,
26         APIC_ESR        = 0x28,
27         APIC_LVT        = 0x2F,
28         APIC_ICR0       = 0x30,
29         APIC_ICR1       = 0x31,
30         APIC_LVTT       = 0x32,
31         APIC_LVTTS      = 0x33,
32         APIC_LVTPC      = 0x34,
33         APIC_LVT0       = 0x35,
34         APIC_LVT1       = 0x36,
35         APIC_LVTER      = 0x37,
36         APIC_TICR       = 0x38,
37         APIC_TCCR       = 0x39,
38         APIC_TDCR       = 0x3E,
39 };
40
41 #include <fcntl.h>
42 #include <sys/mman.h>
43
44 #endif /* _APIC_H */