Guest User

Untitled

a guest
Jun 10th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.18 KB | None | 0 0
  1. /*
  2.  *  xapic.h
  3.  *  Advanced Programmable Interrupt Controller
  4.  */
  5.  
  6. #ifndef __XAPIC_H
  7. #define __XAPIC_H
  8.  
  9. #include <os/system.h>
  10. #include <types.h>
  11.  
  12. #define LAPIC_MM_REG_ID                     0x0020
  13. #define LAPIC_MM_REG_VERSION                0x0030
  14. #define LAPIC_MM_REG_TASK_PRIORITY          0x0080
  15. #define LAPIC_MM_REG_PROCESSOR_PRIORITY     0x00A0
  16. #define LAPIC_MM_REG_EOI                    0x00B0
  17. #define LAPIC_MM_REG_LOGICAL_DESTINATION    0x00D0
  18. #define LAPIC_MM_REG_DESTINATION_FORMAT     0x00E0
  19. #define LAPIC_MM_REG_SPURIOUS_INTERRUPT     0x00F0
  20. #define LAPIC_MM_REG_LVT_TIMER              0x0320
  21.  
  22. #define IOAPIC_MM_REG_IOSEL                 0x00
  23. #define IOAPIC_MM_REG_IOWIN                 0x10
  24.  
  25. enum {
  26.     IOAPIC_REG_IDENTIFY,
  27.     IOAPIC_REG_VERSION,
  28.     IOAPIC_REG_ARBITRATION
  29. };
  30.  
  31. #define IOAPIC_DMODE_FIXED          0x00
  32. #define IOAPIC_DMODE_LOW_PRIORITY   0x01
  33. #define IOAPIC_DMODE_SMI            0x02
  34. #define IOAPIC_DMODE_NMI            0x04
  35. #define IOAPIC_DMODE_INIT           0x05
  36. #define IOAPIC_DMODE_EXTINT         0x07
  37.  
  38. typedef struct _IOAPICRegIdentify {
  39.     uint8       apicVersion;
  40.     uint8       reserved1;
  41.     uint8       maximumRedirectionEntry;
  42.     uint8       reserved2;
  43. } PACKED IOAPICRegIdentify;
  44.  
  45. int XAPICInitialize(uint16* coreCount);
  46. void XAPICInstallRedirectionEntry(uint16 index, uint64 value);
  47.  
  48. #endif
Advertisement
Add Comment
Please, Sign In to add comment