386l.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #define Pe 0x00000001 /* Protected Mode Enable */
  10. #define Mp 0x00000002 /* Monitor Coprocessor */
  11. #define Em 0x00000004 /* Emulate Coprocessor */
  12. #define Ts 0x00000008 /* Task Switched */
  13. #define Et 0x00000010 /* Extension Type */
  14. #define Ne 0x00000020 /* Numeric Error */
  15. #define Wp 0x00010000 /* Write Protect */
  16. #define Am 0x00040000 /* Alignment Mask */
  17. #define Nw 0x20000000 /* Not Writethrough */
  18. #define Cd 0x40000000 /* Cache Disable */
  19. #define Pg 0x80000000 /* Paging Enable */
  20. #define Pwt 0x00000008 /* Page-Level Writethrough */
  21. #define Pcd 0x00000010 /* Page-Level Cache Disable */
  22. #define Vme 0x00000001 /* Virtual-8086 Mode Extensions */
  23. #define Pvi 0x00000002 /* Protected Mode Virtual Interrupts */
  24. #define Tsd 0x00000004 /* Time-Stamp Disable */
  25. #define De 0x00000008 /* Debugging Extensions */
  26. #define Pse 0x00000010 /* Page-Size Extensions */
  27. #define Pae 0x00000020 /* Physical Address Extension */
  28. #define Mce 0x00000040 /* Machine Check Enable */
  29. #define Pge 0x00000080 /* Page-Global Enable */
  30. #define Pce 0x00000100 /* Performance Monitoring Counter Enable */
  31. #define Osfxsr 0x00000200 /* FXSAVE/FXRSTOR Support */
  32. #define Osxmmexcpt 0x00000400 /* Unmasked Exception Support */
  33. #define Cf 0x00000001 /* Carry Flag */
  34. #define Pf 0x00000004 /* Parity Flag */
  35. #define Af 0x00000010 /* Auxiliary Flag */
  36. #define Zf 0x00000040 /* Zero Flag */
  37. #define Sf 0x00000080 /* Sign Flag */
  38. #define Tf 0x00000100 /* Trap Flag */
  39. #define If 0x00000200 /* Interrupt Flag */
  40. #define Df 0x00000400 /* Direction Flag */
  41. #define Of 0x00000800 /* Overflow Flag */
  42. #define Iopl0 0x00000000 /* I/O Privilege Level */
  43. #define Iopl1 0x00001000
  44. #define Iopl2 0x00002000
  45. #define Iopl3 0x00003000
  46. #define Nt 0x00004000 /* Nested Task */
  47. #define Rf 0x00010000 /* Resume Flag */
  48. #define Vm 0x00020000 /* Virtual-8086 Mode */
  49. #define Ac 0x00040000 /* Alignment Check */
  50. #define Vif 0x00080000 /* Virtual Interrupt Flag */
  51. #define Vip 0x00100000 /* Virtual Interrupt Pending */
  52. #define Id 0x00200000 /* ID Flag */
  53. #define PteP 0x00000001ul /* Present */
  54. #define PteRW 0x00000002ul /* Read/Write */
  55. #define PteU 0x00000004ul /* User/Supervisor */
  56. #define PtePWT 0x00000008ul /* Page-Level Write Through */
  57. #define PtePCD 0x00000010ul /* Page Level Cache Disable */
  58. #define PteA 0x00000020ul /* Accessed */
  59. #define PteD 0x00000040ul /* Dirty */
  60. #define PtePS 0x00000080ul /* Page Size */
  61. #define PtePAT0 PtePS /* Level 0 PAT */
  62. #define PteG 0x00000100ul /* Global */
  63. #define PtePAT1 0x00000800ul /* Level 1 PAT */
  64. #define IdtDE 0x00 /* Divide-by-Zero Error */
  65. #define IdtDB 0x01 /* Debug */
  66. #define IdtNMI 0x02 /* Non-Maskable-Interrupt */
  67. #define IdtBP 0x03 /* Breakpoint */
  68. #define IdtOF 0x04 /* Overflow */
  69. #define IdtBR 0x05 /* Bound-Range */
  70. #define IdtUD 0x06 /* Invalid-Opcode */
  71. #define IdtNM 0x07 /* Device-Not-Available */
  72. #define IdtDF 0x08 /* Double-Fault */
  73. #define Idt09 0x09 /* unsupported */
  74. #define IdtTS 0x0a /* Invalid-TSS */
  75. #define IdtNP 0x0b /* Segment-Not-Present */
  76. #define IdtSS 0x0c /* Stack */
  77. #define IdtGP 0x0d /* General-Protection */
  78. #define IdtPF 0x0e /* Page-Fault */
  79. #define Idt0F 0x0f /* reserved */
  80. #define IdtMF 0x10 /* x87 FPE-Pending */
  81. #define IdtAC 0x11 /* Alignment-Check */
  82. #define IdtMC 0x12 /* Machine-Check */
  83. #define IdtXF 0x13 /* SIMD Floating-Point */
  84. #define SdISTM 0x0000000700000000ull /* Interrupt Stack Table Mask */
  85. #define SdA 0x0000010000000000ull /* Accessed */
  86. #define SdR 0x0000020000000000ull /* Readable (Code) */
  87. #define SdW 0x0000020000000000ull /* Writeable (Data) */
  88. #define SdE 0x0000040000000000ull /* Expand Down */
  89. #define SdaTSS 0x0000090000000000ull /* Available TSS */
  90. #define SdbTSS 0x00000b0000000000ull /* Busy TSS */
  91. #define SdCG 0x00000c0000000000ull /* Call Gate */
  92. #define SdIG 0x00000e0000000000ull /* Interrupt Gate */
  93. #define SdTG 0x00000f0000000000ull /* Trap Gate */
  94. #define SdCODE 0x0000080000000000ull /* Code/Data */
  95. #define SdS 0x0000100000000000ull /* System/User */
  96. #define SdDPL0 0x0000000000000000ull /* Descriptor Privilege Level */
  97. #define SdDPL1 0x0000200000000000ull
  98. #define SdDPL2 0x0000400000000000ull
  99. #define SdDPL3 0x0000600000000000ull
  100. #define SdP 0x0000800000000000ull /* Present */
  101. #define Sd4G 0x000f00000000ffffull /* 4G Limit */
  102. #define SdL 0x0020000000000000ull /* Long Attribute */
  103. #define SdD 0x0040000000000000ull /* Default Operand Size */
  104. #define SdG 0x0080000000000000ull /* Granularity */
  105. #define SsRPL0 0x0000 /* Requestor Privilege Level */
  106. #define SsRPL1 0x0001
  107. #define SsRPL2 0x0002
  108. #define SsRPL3 0x0003
  109. #define SsTIGDT 0x0000 /* GDT Table Indicator */
  110. #define SsTILDT 0x0004 /* LDT Table Indicator */
  111. #define SsSIM 0xfff8 /* Selector Index Mask */
  112. #define SSEL(si, tirpl) (((si)<<3)|(tirpl)) /* Segment Selector */
  113. #define SiNULL 0 /* NULL selector index */
  114. #define SiCS 1 /* CS selector index */
  115. #define SiDS 2 /* DS selector index */
  116. #define SiLCS 3 /* Legacy CS selector index */
  117. #define SiUDS 4 /* User DS selector index */
  118. #define SiUCS 5 /* User CS selector index */
  119. #define SiTSS 6 /* TSS selector index */