Advertisement
tyler569

Local APIC registers

Feb 21st, 2018
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.34 KB | None | 0 0
  1.  
  2. #include <basic.h>
  3.  
  4. // Confirm this through ACPI, remap as needed:
  5. #define X86_LAPIC_DEFAULT_BASE 0xFEE00000
  6.  
  7. #define X86_MSR_IA32_APIC_BASE 0x1B
  8. #define X86_MSR_IA32_APIC_BASE_APIC_ENABLE (1 << 11)
  9. #define X86_MSR_IA32_APIC_BASE_CPU_IS_BSP  (1 << 8)
  10.  
  11.  
  12. #define X86_LAPIC_REG_ID                    0x20
  13. #define X86_LAPIC_REG_VERSION               0x30
  14. #define X86_LAPIC_REG_TASK_PRIORITY         0x80
  15. #define X86_LAPIC_REG_ARB_PRIORITY          0x90
  16. #define X86_LAPIC_REG_PROCESSOR_PRIORITY    0xA0
  17. #define X86_LAPIC_REG_EOI                   0xB0
  18. #define X86_LAPIC_REG_REMOTE_READ           0xC0
  19. #define X86_LAPIC_REG_LOGICAL_DESTINATION   0xD0
  20. #define X86_LAPIC_REG_DESTINATION_FORMAT    0xE0
  21. #define X86_LAPIC_REG_SPURIOUS_INTERRUPT    0xF0
  22. // TMR - 8 dwords
  23. // IRR - 8 dwords
  24. #define X86_LAPIC_REG_ERROR_STATUS         0x280
  25. #define X86_LAPIC_REG_LVT_CMCI             0x2F0
  26. // ICR - 2 dwords
  27. #define X86_LAPIC_REG_LVT_TIMER            0x320
  28. #define X86_LAPIC_REG_LVT_THERMAL          0x330
  29. #define X86_LAPIC_REG_LVT_PERFMON          0x340
  30. #define X86_LAPIC_REG_LVT_LINT0            0x350
  31. #define X86_LAPIC_REG_LVT_LINT1            0x360
  32. #define X86_LAPIC_REG_LVT_ERROR            0x370
  33. #define X86_LAPIC_REG_TIMER_INITIAL        0x380
  34. #define X86_LAPIC_REG_TIMER_CURRENT        0x390
  35. #define X86_LAPIC_REG_TIMER_DIVIDE         0x3E0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement