Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1510 lines
35 KiB

  1. #include "kxalpha.h"
  2. //
  3. // Pointer size in bytes
  4. //
  5. #define SizeofPointer 0x8
  6. //
  7. // Process State Enumerated Type Values
  8. //
  9. #define ProcessInMemory 0x0
  10. #define ProcessOutOfMemory 0x1
  11. #define ProcessInTransition 0x2
  12. //
  13. // Thread State Enumerated Type Values
  14. //
  15. #define Initialized 0x0
  16. #define Ready 0x1
  17. #define Running 0x2
  18. #define Standby 0x3
  19. #define Terminated 0x4
  20. #define Waiting 0x5
  21. //
  22. // Wait Reason and Wait Type Enumerated Type Values
  23. //
  24. #define WrExecutive 0x0
  25. #define WrEventPair 0xe
  26. #define WaitAny 0x1
  27. #define WaitAll 0x0
  28. //
  29. // Apc State Structure Offset Definitions
  30. //
  31. #define AsApcListHead 0x0
  32. #define AsProcess 0x20
  33. #define AsKernelApcInProgress 0x28
  34. #define AsKernelApcPending 0x29
  35. #define AsUserApcPending 0x2a
  36. //
  37. // Bug Check Code Definitions
  38. //
  39. #define APC_INDEX_MISMATCH 0x1
  40. #define ATTEMPTED_SWITCH_FROM_DPC 0xb8
  41. #define DATA_BUS_ERROR 0x2e
  42. #define DATA_COHERENCY_EXCEPTION 0x55
  43. #define HAL1_INITIALIZATION_FAILED 0x61
  44. #define INSTRUCTION_BUS_ERROR 0x2f
  45. #define INSTRUCTION_COHERENCY_EXCEPTION 0x56
  46. #define INTERRUPT_EXCEPTION_NOT_HANDLED 0x3d
  47. #define INTERRUPT_UNWIND_ATTEMPTED 0x3c
  48. #define INVALID_AFFINITY_SET 0x3
  49. #define INVALID_DATA_ACCESS_TRAP 0x4
  50. #define IRQL_GT_ZERO_AT_SYSTEM_SERVICE 0x4a
  51. #define IRQL_NOT_LESS_OR_EQUAL 0xa
  52. #define KMODE_EXCEPTION_NOT_HANDLED 0x1e
  53. #define NMI_HARDWARE_FAILURE 0x80
  54. #define NO_USER_MODE_CONTEXT 0xe
  55. #define PAGE_FAULT_WITH_INTERRUPTS_OFF 0x49
  56. #define PANIC_STACK_SWITCH 0x2b
  57. #define SPIN_LOCK_INIT_FAILURE 0x81
  58. #define SYSTEM_EXIT_OWNED_MUTEX 0x39
  59. #define SYSTEM_SERVICE_EXCEPTION 0x3b
  60. #define SYSTEM_UNWIND_PREVIOUS_USER 0x3a
  61. #define TRAP_CAUSE_UNKNOWN 0x12
  62. #define UNEXPECTED_KERNEL_MODE_TRAP 0x7f
  63. //
  64. // Breakpoint type definitions
  65. //
  66. #define DBG_STATUS_CONTROL_C 0x1
  67. //
  68. // Client Id Structure Offset Definitions
  69. //
  70. #define CidUniqueProcess 0x0
  71. #define CidUniqueThread 0x8
  72. //
  73. // Critical Section Structure Offset Definitions
  74. //
  75. #define CsDebugInfo 0x0
  76. #define CsLockCount 0x8
  77. #define CsRecursionCount 0xc
  78. #define CsOwningThread 0x10
  79. #define CsLockSemaphore 0x18
  80. #define CsSpinCount 0x20
  81. //
  82. // Critical Section Debug Information Structure Offset Definitions
  83. //
  84. #define CsType 0x0
  85. #define CsCreatorBackTraceIndex 0x2
  86. #define CsCriticalSection 0x8
  87. #define CsProcessLocksList 0x10
  88. #define CsEntryCount 0x20
  89. #define CsContentionCount 0x24
  90. //
  91. // Dispatcher Context Structure Offset Definitions
  92. //
  93. #define DcControlPc 0x0
  94. #define DcFunctionEntry 0x8
  95. #define DcEstablisherFrame 0x10
  96. #define DcContextRecord 0x18
  97. //
  98. // Exception Record Offset, Flag, and Enumerated Type Definitions
  99. //
  100. #define EXCEPTION_NONCONTINUABLE 0x1
  101. #define EXCEPTION_UNWINDING 0x2
  102. #define EXCEPTION_EXIT_UNWIND 0x4
  103. #define EXCEPTION_STACK_INVALID 0x8
  104. #define EXCEPTION_NESTED_CALL 0x10
  105. #define EXCEPTION_TARGET_UNWIND 0x20
  106. #define EXCEPTION_COLLIDED_UNWIND 0x40
  107. #define EXCEPTION_UNWIND 0x66
  108. #define EXCEPTION_EXECUTE_HANDLER 0x1
  109. #define EXCEPTION_CONTINUE_SEARCH 0x0
  110. #define EXCEPTION_CONTINUE_EXECUTION 0xffffffff
  111. #define ExceptionContinueExecution 0x0
  112. #define ExceptionContinueSearch 0x1
  113. #define ExceptionNestedException 0x2
  114. #define ExceptionCollidedUnwind 0x3
  115. #define ErExceptionCode 0x0
  116. #define ErExceptionFlags 0x4
  117. #define ErExceptionRecord 0x8
  118. #define ErExceptionAddress 0x10
  119. #define ErNumberParameters 0x18
  120. #define ErExceptionInformation 0x20
  121. #define ExceptionRecordLength 0xa0
  122. //
  123. // Fast Mutex Structure Offset Definitions
  124. //
  125. #define FmCount 0x0
  126. #define FmOwner 0x8
  127. #define FmContention 0x10
  128. #define FmEvent 0x18
  129. #define FmOldIrql 0x30
  130. //
  131. // Interrupt Priority Request Level Definitions
  132. //
  133. #define APC_LEVEL 0x1
  134. #define DISPATCH_LEVEL 0x2
  135. #define IPI_LEVEL 0x6
  136. #define POWER_LEVEL 0x7
  137. #define PROFILE_LEVEL 0x3
  138. #define HIGH_LEVEL 0x7
  139. #define SYNCH_LEVEL 0x5
  140. //
  141. // Large Integer Structure Offset Definitions
  142. //
  143. #define LiLowPart 0x0
  144. #define LiHighPart 0x4
  145. //
  146. // List Entry Structure Offset Definitions
  147. //
  148. #define LsFlink 0x0
  149. #define LsBlink 0x8
  150. //
  151. // String Structure Offset Definitions
  152. //
  153. #define StrLength 0x0
  154. #define StrMaximumLength 0x2
  155. #define StrBuffer 0x8
  156. //
  157. // Time Structure Offset Definitions
  158. //
  159. #define TmLowTime 0x0
  160. #define TmHighTime 0x4
  161. //
  162. // Thread Switch Counter Offset Definitions
  163. //
  164. #define TwFindAny 0x0
  165. #define TwFindIdeal 0x4
  166. #define TwFindLast 0x8
  167. #define TwIdleAny 0xc
  168. #define TwIdleCurrent 0x10
  169. #define TwIdleIdeal 0x14
  170. #define TwIdleLast 0x18
  171. #define TwPreemptAny 0x1c
  172. #define TwPreemptCurrent 0x20
  173. #define TwPreemptLast 0x24
  174. #define TwSwitchToIdle 0x28
  175. //
  176. // Status Code Definitions
  177. //
  178. #define STATUS_ALPHA_ARITHMETIC_EXCEPTION 0xc0000092
  179. #define STATUS_ALPHA_BAD_VIRTUAL_ADDRESS 0xc0000005
  180. #define STATUS_ALPHA_FLOATING_NOT_IMPLEMENTED 0xc000014a
  181. #define STATUS_ALPHA_GENTRAP 0xc00000aa
  182. #define STATUS_ALPHA_MACHINE_CHECK 0xdfff002e
  183. #define STATUS_ACCESS_VIOLATION 0xc0000005
  184. #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xc000008c
  185. #define STATUS_BAD_COMPRESSION_BUFFER 0xc0000242
  186. #define STATUS_BREAKPOINT 0x80000003
  187. #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
  188. #define STATUS_FLOAT_DENORMAL_OPERAND 0xc000008d
  189. #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xc000008e
  190. #define STATUS_FLOAT_INEXACT_RESULT 0xc000008f
  191. #define STATUS_FLOAT_INVALID_OPERATION 0xc0000090
  192. #define STATUS_FLOAT_OVERFLOW 0xc0000091
  193. #define STATUS_FLOAT_STACK_CHECK 0xc0000092
  194. #define STATUS_FLOAT_UNDERFLOW 0xc0000093
  195. #define STATUS_FLOAT_MULTIPLE_FAULTS 0xc00002b4
  196. #define STATUS_FLOAT_MULTIPLE_TRAPS 0xc00002b5
  197. #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
  198. #define STATUS_ILLEGAL_FLOAT_CONTEXT 0xc000014a
  199. #define STATUS_ILLEGAL_INSTRUCTION 0xc000001d
  200. #define STATUS_INSTRUCTION_MISALIGNMENT 0xc00000aa
  201. #define STATUS_INVALID_HANDLE 0xc0000008
  202. #define STATUS_INVALID_LOCK_SEQUENCE 0xc000001e
  203. #define STATUS_INVALID_OWNER 0xc000005a
  204. #define STATUS_INVALID_PARAMETER_1 0xc00000ef
  205. #define STATUS_INVALID_SYSTEM_SERVICE 0xc000001c
  206. #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xc0000094
  207. #define STATUS_INTEGER_OVERFLOW 0xc0000095
  208. #define STATUS_IN_PAGE_ERROR 0xc0000006
  209. #define STATUS_KERNEL_APC 0x100
  210. #define STATUS_LONGJUMP 0x80000026
  211. #define STATUS_NO_CALLBACK_ACTIVE 0xc0000258
  212. #define STATUS_NO_EVENT_PAIR 0xc000014e
  213. #define STATUS_PRIVILEGED_INSTRUCTION 0xc0000096
  214. #define STATUS_SINGLE_STEP 0x80000004
  215. #define STATUS_STACK_OVERFLOW 0xc00000fd
  216. #define STATUS_SUCCESS 0x0
  217. #define STATUS_THREAD_IS_TERMINATING 0xc000004b
  218. #define STATUS_TIMEOUT 0x102
  219. #define STATUS_UNWIND 0xc0000027
  220. #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007
  221. //
  222. // APC Object Structure Offset Definitions
  223. //
  224. #define ApType 0x0
  225. #define ApSize 0x2
  226. #define ApThread 0x8
  227. #define ApApcListEntry 0x10
  228. #define ApKernelRoutine 0x20
  229. #define ApRundownRoutine 0x28
  230. #define ApNormalRoutine 0x30
  231. #define ApNormalContext 0x38
  232. #define ApSystemArgument1 0x40
  233. #define ApSystemArgument2 0x48
  234. #define ApApcStateIndex 0x50
  235. #define ApApcMode 0x51
  236. #define ApInserted 0x52
  237. #define ApcObjectLength 0x58
  238. //
  239. // DPC object Structure Offset Definitions
  240. //
  241. #define DpType 0x0
  242. #define DpNumber 0x2
  243. #define DpImportance 0x3
  244. #define DpDpcListEntry 0x8
  245. #define DpDeferredRoutine 0x18
  246. #define DpDeferredContext 0x20
  247. #define DpSystemArgument1 0x28
  248. #define DpSystemArgument2 0x30
  249. #define DpLock 0x38
  250. #define DpcObjectLength 0x40
  251. //
  252. // Device Queue Object Structure Offset Definitions
  253. //
  254. #define DvType 0x0
  255. #define DvSize 0x2
  256. #define DvDeviceListHead 0x8
  257. #define DvSpinLock 0x18
  258. #define DvBusy 0x20
  259. #define DeviceQueueObjectLength 0x28
  260. //
  261. // Device Queue Entry Structure Offset Definitions
  262. //
  263. #define DeDeviceListEntry 0x0
  264. #define DeSortKey 0x10
  265. #define DeInserted 0x14
  266. #define DeviceQueueEntryLength 0x18
  267. //
  268. // Event Object Structure Offset Definitions
  269. //
  270. #define EvType 0x0
  271. #define EvSize 0x2
  272. #define EvSignalState 0x4
  273. #define EvWaitListHead 0x8
  274. #define EventObjectLength 0x18
  275. //
  276. // Event Pair Object Structure Offset Definitions
  277. //
  278. #define EpType 0x0
  279. #define EpSize 0x2
  280. #define EpEventLow 0x8
  281. #define EpEventHigh 0x20
  282. //
  283. // Interrupt Object Structure Offset Definitions
  284. //
  285. #define InLevelSensitive 0x0
  286. #define InLatched 0x1
  287. #define InType 0x0
  288. #define InSize 0x2
  289. #define InInterruptListEntry 0x8
  290. #define InServiceRoutine 0x18
  291. #define InServiceContext 0x20
  292. #define InSpinLock 0x28
  293. #define InTickCount 0x30
  294. #define InActualLock 0x38
  295. #define InDispatchAddress 0x40
  296. #define InVector 0x48
  297. #define InIrql 0x4c
  298. #define InSynchronizeIrql 0x4d
  299. #define InFloatingSave 0x4e
  300. #define InConnected 0x4f
  301. #define InNumber 0x50
  302. #define InMode 0x54
  303. #define InShareVector 0x51
  304. #define InDispatchCount 0x5c
  305. #define InDispatchCode 0x60
  306. #define InServiceCount 0x58
  307. #define InterruptObjectLength 0x70
  308. //
  309. // Process Object Structure Offset Definitions
  310. //
  311. #define PrType 0x0
  312. #define PrSize 0x2
  313. #define PrSignalState 0x4
  314. #define PrProfileListHead 0x18
  315. #define PrDirectoryTableBase 0x28
  316. #define PrActiveProcessors 0x38
  317. #define PrRunOnProcessors 0x3c
  318. #define PrProcessSequence 0x40
  319. #define PrProcessAsn 0x48
  320. #define PrKernelTime 0x4c
  321. #define PrUserTime 0x50
  322. #define PrReadyListHead 0x58
  323. #define PrSwapListEntry 0x68
  324. #define PrThreadListHead 0x78
  325. #define PrProcessLock 0x88
  326. #define PrAffinity 0x90
  327. #define PrStackCount 0x94
  328. #define PrBasePriority 0x96
  329. #define PrThreadQuantum 0x97
  330. #define PrAutoAlignment 0x98
  331. #define PrState 0x99
  332. #define ProcessObjectLength 0xb0
  333. #define ExtendedProcessObjectLength 0x420
  334. //
  335. // Profile Object Structure Offset Definitions
  336. //
  337. #define PfType 0x0
  338. #define PfSize 0x2
  339. #define PfProfileListEntry 0x8
  340. #define PfProcess 0x18
  341. #define PfRangeBase 0x20
  342. #define PfRangeLimit 0x28
  343. #define PfBucketShift 0x30
  344. #define PfBuffer 0x38
  345. #define PfSegment 0x40
  346. #define PfAffinity 0x44
  347. #define PfSource 0x48
  348. #define PfStarted 0x4a
  349. #define ProfileObjectLength 0x50
  350. //
  351. // Queue Object Structure Offset Definitions
  352. //
  353. #define QuType 0x0
  354. #define QuSize 0x2
  355. #define QuSignalState 0x4
  356. #define QuEntryListHead 0x18
  357. #define QuCurrentCount 0x28
  358. #define QuMaximumCount 0x2c
  359. #define QuThreadListHead 0x30
  360. #define QueueObjectLength 0x40
  361. //
  362. // Thread Object Structure Offset Definitions
  363. //
  364. #define EeKernelEventPair 0x0
  365. #define EtCid 0x370
  366. #define EtPerformanceCountLow 0x3ac
  367. #define EtPerformanceCountHigh 0x404
  368. #define EtEthreadLength 0x430
  369. #define ThType 0x0
  370. #define ThSize 0x2
  371. #define ThSignalState 0x4
  372. #define ThMutantListHead 0x18
  373. #define ThInitialStack 0x28
  374. #define ThStackLimit 0x30
  375. #define ThTeb 0x38
  376. #define ThTlsArray 0x40
  377. #define ThKernelStack 0x48
  378. #define ThDebugActive 0x50
  379. #define ThState 0x51
  380. #define ThAlerted 0x52
  381. #define ThIopl 0x54
  382. #define ThNpxState 0x55
  383. #define ThSaturation 0x56
  384. #define ThPriority 0x57
  385. #define ThApcState 0x58
  386. #define ThContextSwitches 0x88
  387. #define ThWaitStatus 0x90
  388. #define ThWaitIrql 0x98
  389. #define ThWaitMode 0x99
  390. #define ThWaitNext 0x9a
  391. #define ThWaitReason 0x9b
  392. #define ThWaitBlockList 0xa0
  393. #define ThWaitListEntry 0xa8
  394. #define ThWaitTime 0xb8
  395. #define ThBasePriority 0xbc
  396. #define ThDecrementCount 0xbd
  397. #define ThPriorityDecrement 0xbe
  398. #define ThQuantum 0xbf
  399. #define ThWaitBlock 0xc0
  400. #define ThKernelApcDisable 0x188
  401. #define ThUserAffinity 0x18c
  402. #define ThSystemAffinityActive 0x190
  403. #define ThServiceTable 0x198
  404. #define ThQueue 0x1a0
  405. #define ThApcQueueLock 0x1a8
  406. #define ThTimer 0x1b0
  407. #define ThQueueListEntry 0x1f0
  408. #define ThAffinity 0x204
  409. #define ThPreempted 0x208
  410. #define ThProcessReadyQueue 0x209
  411. #define ThKernelStackResident 0x20a
  412. #define ThNextProcessor 0x20b
  413. #define ThCallbackStack 0x210
  414. #define ThWin32Thread 0x218
  415. #define ThTrapFrame 0x220
  416. #define ThApcStatePointer 0x228
  417. #define ThPreviousMode 0x238
  418. #define ThEnableStackSwap 0x239
  419. #define ThLargeStack 0x23a
  420. #define ThKernelTime 0x23c
  421. #define ThUserTime 0x240
  422. #define ThSavedApcState 0x248
  423. #define ThAlertable 0x278
  424. #define ThApcStateIndex 0x279
  425. #define ThApcQueueable 0x27a
  426. #define ThAutoAlignment 0x27b
  427. #define ThStackBase 0x280
  428. #define ThSuspendApc 0x288
  429. #define ThSuspendSemaphore 0x2e0
  430. #define ThThreadListEntry 0x300
  431. #define ThFreezeCount 0x310
  432. #define ThSuspendCount 0x311
  433. #define ThIdealProcessor 0x312
  434. #define ThDisableBoost 0x313
  435. #define ThSoftAffinity 0x200
  436. #define ThreadObjectLength 0x320
  437. #define ExtendedThreadObjectLength 0x430
  438. #define EVENT_WAIT_BLOCK_OFFSET 0x120
  439. //
  440. // Timer object Structure Offset Definitions
  441. //
  442. #define TiType 0x0
  443. #define TiSize 0x2
  444. #define TiInserted 0x3
  445. #define TiSignalState 0x4
  446. #define TiDueTime 0x18
  447. #define TiTimerListEntry 0x20
  448. #define TiDpc 0x30
  449. #define TiPeriod 0x38
  450. #define TimerObjectLength 0x40
  451. #define TIMER_TABLE_SIZE 0x80
  452. //
  453. // Wait Block Structure Offset Definitions
  454. //
  455. #define WbWaitListEntry 0x0
  456. #define WbThread 0x10
  457. #define WbObject 0x18
  458. #define WbNextWaitBlock 0x20
  459. #define WbWaitKey 0x28
  460. #define WbWaitType 0x2a
  461. //
  462. // Fiber Structure Offset Definitions
  463. //
  464. #define FbFiberData 0x0
  465. #define FbExceptionList 0x8
  466. #define FbStackBase 0x10
  467. #define FbStackLimit 0x18
  468. #define FbDeallocationStack 0x20
  469. #define FbFiberContext 0x28
  470. #define FbWx86Tib 0x258
  471. //
  472. // Process Environment Block Structure Offset Definitions
  473. //
  474. #define PeKernelCallbackTable 0x58
  475. //
  476. // System Service Descriptor Table Structure Definitions
  477. //
  478. #define NUMBER_SERVICE_TABLES 0x4
  479. #define SERVICE_NUMBER_MASK 0xfff
  480. #define SERVICE_TABLE_SHIFT 0x7
  481. #define SERVICE_TABLE_MASK 0x60
  482. #define SERVICE_TABLE_TEST 0x20
  483. #define SdBase 0x0
  484. #define SdCount 0x8
  485. #define SdLimit 0x10
  486. #define SdNumber 0x18
  487. //
  488. // Thread Environment Block Structure Offset Definitions
  489. //
  490. #define TeStackBase 0x8
  491. #define TeStackLimit 0x10
  492. #define TeFiberData 0x20
  493. #define TeEnvironmentPointer 0x38
  494. #define TeClientId 0x40
  495. #define TeActiveRpcHandle 0x50
  496. #define TeThreadLocalStoragePointer 0x58
  497. #define TeCountOfOwnedCriticalSections 0x6c
  498. #define TePeb 0x60
  499. #define TeCsrClientThread 0x70
  500. #define TeWOW32Reserved 0x100
  501. #define TeSoftFpcr 0x10c
  502. #define TeGdiClientPID 0x7f0
  503. #define TeGdiClientTID 0x7f4
  504. #define TeGdiThreadLocalInfo 0x7f8
  505. #define TeglDispatchTable 0x9f0
  506. #define TeglReserved1 0x1138
  507. #define TeglReserved2 0x1220
  508. #define TeglSectionInfo 0x1228
  509. #define TeglSection 0x1230
  510. #define TeglTable 0x1238
  511. #define TeglCurrentRC 0x1240
  512. #define TeglContext 0x1248
  513. #define TeDeallocationStack 0x1478
  514. #define TeTlsSlots 0x1480
  515. #define TeVdm 0x1690
  516. #define TeGdiBatchCount 0x1740
  517. #define TeInstrumentation 0x16b8
  518. #define ThreadEnvironmentBlockLength 0x17a8
  519. //
  520. // Lock Queue Structure Offset Definitions
  521. //
  522. #define LOCK_QUEUE_WAIT 0x1
  523. #define LOCK_QUEUE_OWNER 0x2
  524. #define LOCK_QUEUE_HEADER_SIZE 0x10
  525. #define LockQueueDispatcherLock 0x0
  526. #define LockQueueContextSwapLock 0x1
  527. #define LqNext 0x0
  528. #define LqLock 0x8
  529. #define LqhNext 0x0
  530. #define LqhLock 0x8
  531. #define LqhOldIrql 0x10
  532. //
  533. // Processor Control Registers Structure Offset Definitions
  534. //
  535. #define PCR_MINOR_VERSION 0x1
  536. #define PCR_MAJOR_VERSION 0x1
  537. #define PcMinorVersion 0x0
  538. #define PcMajorVersion 0x4
  539. #define PcPalBaseAddress 0x8
  540. #define PcPalMajorVersion 0x10
  541. #define PcPalMinorVersion 0x14
  542. #define PcPalSequenceVersion 0x18
  543. #define PcPalMajorSpecification 0x1c
  544. #define PcPalMinorSpecification 0x20
  545. #define PcFirmwareRestartAddress 0x28
  546. #define PcRestartBlock 0x30
  547. #define PcPalReserved 0x38
  548. #define PcPalAlignmentFixupCount 0xc30
  549. #define PcPanicStack 0xc38
  550. #define PcProcessorType 0xc40
  551. #define PcProcessorRevision 0xc44
  552. #define PcPhysicalAddressBits 0xc48
  553. #define PcMaximumAddressSpaceNumber 0xc4c
  554. #define PcPageSize 0xc50
  555. #define PcFirstLevelDcacheSize 0xc54
  556. #define PcFirstLevelDcacheFillSize 0xc58
  557. #define PcFirstLevelIcacheSize 0xc5c
  558. #define PcFirstLevelIcacheFillSize 0xc60
  559. #define PcFirmwareRevisionId 0xc64
  560. #define PcSystemType 0xc68
  561. #define PcSystemVariant 0xc70
  562. #define PcSystemRevision 0xc74
  563. #define PcSystemSerialNumber 0xc78
  564. #define PcCycleClockPeriod 0xc88
  565. #define PcSecondLevelCacheSize 0xc8c
  566. #define PcSecondLevelCacheFillSize 0xc90
  567. #define PcThirdLevelCacheSize 0xc94
  568. #define PcThirdLevelCacheFillSize 0xc98
  569. #define PcFourthLevelCacheSize 0xc9c
  570. #define PcFourthLevelCacheFillSize 0xca0
  571. #define PcPrcb 0xca8
  572. #define PcNumber 0xcb0
  573. #define PcSetMember 0xcb4
  574. #define PcHalReserved 0xcb8
  575. #define PcIrqlTable 0xeb8
  576. #define PcIrqlMask 0xed8
  577. #define PcInterruptRoutine 0x10e8
  578. #define PcReservedVectors 0x18e8
  579. #define PcMachineCheckError 0x18f8
  580. #define PcDpcStack 0x1900
  581. #define PcNotMember 0x18ec
  582. #define PcCurrentPid 0x190c
  583. #define PcSystemServiceDispatchStart 0x1918
  584. #define PcSystemServiceDispatchEnd 0x1920
  585. #define PcIdleThread 0x1928
  586. #define ProcessorControlRegisterLength 0x1930
  587. #define SharedUserData 0xffffffffff000000
  588. #define UsTickCountLow 0x0
  589. #define UsTickCountMultiplier 0x4
  590. #define UsInterruptTime 0x8
  591. #define UsSystemTime 0x14
  592. //
  593. // Processor Block Structure Offset Definitions
  594. //
  595. #define PRCB_MINOR_VERSION 0x1
  596. #define PRCB_MAJOR_VERSION 0x2
  597. #define PbMinorVersion 0x0
  598. #define PbMajorVersion 0x2
  599. #define PbCurrentThread 0x8
  600. #define PbNextThread 0x10
  601. #define PbIdleThread 0x18
  602. #define PbNumber 0x20
  603. #define PbBuildType 0x22
  604. #define PbSetMember 0x24
  605. #define PbRestartBlock 0x28
  606. #define PbInterruptCount 0x30
  607. #define PbDpcTime 0x34
  608. #define PbInterruptTime 0x38
  609. #define PbKernelTime 0x3c
  610. #define PbUserTime 0x40
  611. #define PbQuantumEndDpc 0x48
  612. #define PbIpiFrozen 0xa0
  613. #define PbIpiCounts 0x348
  614. #define PbProcessorState 0xa8
  615. #define PbAlignmentFixupCount 0x378
  616. #define PbContextSwitches 0x37c
  617. #define PbDcacheFlushCount 0x380
  618. #define PbExceptionDispatchCount 0x384
  619. #define PbFirstLevelTbFills 0x388
  620. #define PbFloatingEmulationCount 0x38c
  621. #define PbIcacheFlushCount 0x390
  622. #define PbSecondLevelTbFills 0x394
  623. #define PbSystemCalls 0x398
  624. #define PbLockQueue 0x5e0
  625. #define PbPacketBarrier 0x77c
  626. #define PbCurrentPacket 0x780
  627. #define PbTargetSet 0x798
  628. #define PbWorkerRoutine 0x7a0
  629. #define PbRequestSummary 0x7d8
  630. #define PbDpcListHead 0x880
  631. #define PbDpcLock 0x890
  632. #define PbDpcCount 0x898
  633. #define PbLastDpcCount 0x2d8
  634. #define PbQuantumEnd 0x89c
  635. #define PbStartCount 0x878
  636. #define PbSoftwareInterrupts 0x2e0
  637. #define PbInterruptTrapFrame 0x2e8
  638. #define PbDpcRoutineActive 0x8a0
  639. #define PbDpcQueueDepth 0x8a4
  640. #define PbDpcRequestRate 0x874
  641. #define PbDpcBypassCount 0x2dc
  642. #define PbApcBypassCount 0x2f0
  643. #define PbDispatchInterruptCount 0x2f4
  644. #define PbDebugDpcTime 0x2f8
  645. #define PbDpcInterruptRequested 0x818
  646. #define PbMaximumDpcQueueDepth 0x868
  647. #define PbMinimumDpcRate 0x86c
  648. #define PbAdjustDpcThreshold 0x870
  649. #define PbPowerState 0x8b0
  650. #define ProcessorBlockLength 0x940
  651. //
  652. // Processor Power State Offset Definitions
  653. //
  654. #define PpIdleFunction 0x0
  655. //
  656. // Immediate Interprocessor Command Definitions
  657. //
  658. #define IPI_APC 0x1
  659. #define IPI_DPC 0x2
  660. #define IPI_FREEZE 0x4
  661. #define IPI_PACKET_READY 0x8
  662. //
  663. // Interprocessor Interrupt Count Structure Offset Definitions
  664. //
  665. #define IcFreeze 0x0
  666. #define IcPacket 0x4
  667. #define IcDPC 0x8
  668. #define IcAPC 0xc
  669. #define IcFlushSingleTb 0x10
  670. #define IcFlushEntireTb 0x18
  671. #define IcChangeColor 0x20
  672. #define IcSweepDcache 0x24
  673. #define IcSweepIcache 0x28
  674. #define IcSweepIcacheRange 0x2c
  675. #define IcFlushIoBuffers 0x30
  676. //
  677. // LPC Structure Offset Definitions
  678. //
  679. #define PmLength 0x0
  680. #define PmClientId 0x8
  681. #define PmProcess 0x8
  682. #define PmThread 0x10
  683. #define PmMessageId 0x18
  684. #define PmClientViewSize 0x20
  685. #define PortMessageLength 0x28
  686. //
  687. // Client Id Structure Offset Definitions
  688. //
  689. #define CidUniqueProcess 0x0
  690. #define CidUniqueThread 0x8
  691. //
  692. // Context Frame Offset and Flag Definitions
  693. //
  694. #define CONTEXT_FULL 0x20007
  695. #define CONTEXT_CONTROL 0x20001
  696. #define CONTEXT_FLOATING_POINT 0x20002
  697. #define CONTEXT_INTEGER 0x20004
  698. #define CxFltF0 0x0
  699. #define CxFltF1 0x8
  700. #define CxFltF2 0x10
  701. #define CxFltF3 0x18
  702. #define CxFltF4 0x20
  703. #define CxFltF5 0x28
  704. #define CxFltF6 0x30
  705. #define CxFltF7 0x38
  706. #define CxFltF8 0x40
  707. #define CxFltF9 0x48
  708. #define CxFltF10 0x50
  709. #define CxFltF11 0x58
  710. #define CxFltF12 0x60
  711. #define CxFltF13 0x68
  712. #define CxFltF14 0x70
  713. #define CxFltF15 0x78
  714. #define CxFltF16 0x80
  715. #define CxFltF17 0x88
  716. #define CxFltF18 0x90
  717. #define CxFltF19 0x98
  718. #define CxFltF20 0xa0
  719. #define CxFltF21 0xa8
  720. #define CxFltF22 0xb0
  721. #define CxFltF23 0xb8
  722. #define CxFltF24 0xc0
  723. #define CxFltF25 0xc8
  724. #define CxFltF26 0xd0
  725. #define CxFltF27 0xd8
  726. #define CxFltF28 0xe0
  727. #define CxFltF29 0xe8
  728. #define CxFltF30 0xf0
  729. #define CxFltF31 0xf8
  730. #define CxIntV0 0x100
  731. #define CxIntT0 0x108
  732. #define CxIntT1 0x110
  733. #define CxIntT2 0x118
  734. #define CxIntT3 0x120
  735. #define CxIntT4 0x128
  736. #define CxIntT5 0x130
  737. #define CxIntT6 0x138
  738. #define CxIntT7 0x140
  739. #define CxIntS0 0x148
  740. #define CxIntS1 0x150
  741. #define CxIntS2 0x158
  742. #define CxIntS3 0x160
  743. #define CxIntS4 0x168
  744. #define CxIntS5 0x170
  745. #define CxIntFp 0x178
  746. #define CxIntA0 0x180
  747. #define CxIntA1 0x188
  748. #define CxIntA2 0x190
  749. #define CxIntA3 0x198
  750. #define CxIntA4 0x1a0
  751. #define CxIntA5 0x1a8
  752. #define CxIntT8 0x1b0
  753. #define CxIntT9 0x1b8
  754. #define CxIntT10 0x1c0
  755. #define CxIntT11 0x1c8
  756. #define CxIntRa 0x1d0
  757. #define CxIntT12 0x1d8
  758. #define CxIntAt 0x1e0
  759. #define CxIntGp 0x1e8
  760. #define CxIntSp 0x1f0
  761. #define CxIntZero 0x1f8
  762. #define CxFpcr 0x200
  763. #define CxSoftFpcr 0x208
  764. #define CxFir 0x210
  765. #define CxPsr 0x218
  766. #define CxContextFlags 0x21c
  767. #define ContextFrameLength 0x230
  768. //
  769. // Exception Frame Offset Definitions and Length
  770. //
  771. #define ExFltF2 0x8
  772. #define ExFltF3 0x10
  773. #define ExFltF4 0x18
  774. #define ExFltF5 0x20
  775. #define ExFltF6 0x28
  776. #define ExFltF7 0x30
  777. #define ExFltF8 0x38
  778. #define ExFltF9 0x40
  779. #define ExIntS0 0x48
  780. #define ExIntS1 0x50
  781. #define ExIntS2 0x58
  782. #define ExIntS3 0x60
  783. #define ExIntS4 0x68
  784. #define ExIntS5 0x70
  785. #define ExIntFp 0x78
  786. #define ExPsr 0x88
  787. #define ExSwapReturn 0x80
  788. #define ExIntRa 0x0
  789. #define ExceptionFrameLength 0xa0
  790. //
  791. // Jump Offset Definitions and Length
  792. //
  793. #define JbFp 0x0
  794. #define JbPc 0x8
  795. #define JbSeb 0x10
  796. #define JbType 0x18
  797. #define JbFltF2 0x20
  798. #define JbFltF3 0x28
  799. #define JbFltF4 0x30
  800. #define JbFltF5 0x38
  801. #define JbFltF6 0x40
  802. #define JbFltF7 0x48
  803. #define JbFltF8 0x50
  804. #define JbFltF9 0x58
  805. #define JbIntS0 0x60
  806. #define JbIntS1 0x68
  807. #define JbIntS2 0x70
  808. #define JbIntS3 0x78
  809. #define JbIntS4 0x80
  810. #define JbIntS5 0x88
  811. #define JbIntS6 0x90
  812. #define JbIntSp 0x98
  813. #define JbFir 0xa0
  814. //
  815. // Trap Frame Offset Definitions and Length
  816. //
  817. #define TrFltF0 0x178
  818. #define TrFltF1 0x188
  819. #define TrFltF10 0x190
  820. #define TrFltF11 0x198
  821. #define TrFltF12 0x1a0
  822. #define TrFltF13 0x1a8
  823. #define TrFltF14 0x1b0
  824. #define TrFltF15 0x1b8
  825. #define TrFltF16 0x1c0
  826. #define TrFltF17 0x1c8
  827. #define TrFltF18 0x1d0
  828. #define TrFltF19 0x1d8
  829. #define TrFltF20 0x1e0
  830. #define TrFltF21 0x1e8
  831. #define TrFltF22 0x1f0
  832. #define TrFltF23 0x1f8
  833. #define TrFltF24 0x200
  834. #define TrFltF25 0x208
  835. #define TrFltF26 0x210
  836. #define TrFltF27 0x218
  837. #define TrFltF28 0x220
  838. #define TrFltF29 0x228
  839. #define TrFltF30 0x230
  840. #define TrIntV0 0xf0
  841. #define TrIntT0 0xf8
  842. #define TrIntT1 0x100
  843. #define TrIntT2 0x108
  844. #define TrIntT3 0x110
  845. #define TrIntT4 0x118
  846. #define TrIntT5 0x120
  847. #define TrIntT6 0x128
  848. #define TrIntT7 0x130
  849. #define TrIntFp 0x18
  850. #define TrIntA0 0x20
  851. #define TrIntA1 0x28
  852. #define TrIntA2 0x30
  853. #define TrIntA3 0x38
  854. #define TrIntA4 0x168
  855. #define TrIntA5 0x170
  856. #define TrIntT8 0x138
  857. #define TrIntT9 0x140
  858. #define TrIntT10 0x148
  859. #define TrIntT11 0x150
  860. #define TrIntT12 0x158
  861. #define TrIntAt 0x160
  862. #define TrIntGp 0x48
  863. #define TrIntSp 0x0
  864. #define TrFpcr 0x180
  865. #define TrPsr 0x10
  866. #define TrFir 0x8
  867. #define TrExceptionRecord 0x50
  868. #define TrOldIrql 0x238
  869. #define TrPreviousMode 0x23c
  870. #define TrIntRa 0x40
  871. #define TrTrapFrame 0x240
  872. #define TrapFrameLength 0x260
  873. //
  874. // Firmware frame offset defintions and length
  875. //
  876. #define FW_EXC_MCHK 0xdec0
  877. #define FW_EXC_ARITH 0xdec1
  878. #define FW_EXC_INTERRUPT 0xdec2
  879. #define FW_EXC_DFAULT 0xdec3
  880. #define FW_EXC_ITBMISS 0xdec4
  881. #define FW_EXC_ITBACV 0xdec5
  882. #define FW_EXC_NDTBMISS 0xdec6
  883. #define FW_EXC_PDTBMISS 0xdec7
  884. #define FW_EXC_UNALIGNED 0xdec8
  885. #define FW_EXC_OPCDEC 0xdec9
  886. #define FW_EXC_FEN 0xdeca
  887. #define FW_EXC_HALT 0xdecb
  888. #define FW_EXC_BPT 0xdecc
  889. #define FW_EXC_GENTRAP 0xdecd
  890. #define FW_EXC_HALT_INTERRUPT 0xdece
  891. #define FwType 0x0
  892. #define FwParam1 0x8
  893. #define FwParam2 0x10
  894. #define FwParam3 0x18
  895. #define FwParam4 0x20
  896. #define FwParam5 0x28
  897. #define FwPsr 0x30
  898. #define FwMmcsr 0x38
  899. #define FwVa 0x40
  900. #define FwFir 0x48
  901. #define FwIntV0 0x50
  902. #define FwIntT0 0x58
  903. #define FwIntT1 0x60
  904. #define FwIntT2 0x68
  905. #define FwIntT3 0x70
  906. #define FwIntT4 0x78
  907. #define FwIntT5 0x80
  908. #define FwIntT6 0x88
  909. #define FwIntT7 0x90
  910. #define FwIntS0 0x98
  911. #define FwIntS1 0xa0
  912. #define FwIntS2 0xa8
  913. #define FwIntS3 0xb0
  914. #define FwIntS4 0xb8
  915. #define FwIntS5 0xc0
  916. #define FwIntFp 0xc8
  917. #define FwIntA0 0xd0
  918. #define FwIntA1 0xd8
  919. #define FwIntA2 0xe0
  920. #define FwIntA3 0xe8
  921. #define FwIntA4 0xf0
  922. #define FwIntA5 0xf8
  923. #define FwIntT8 0x100
  924. #define FwIntT9 0x108
  925. #define FwIntT10 0x110
  926. #define FwIntT11 0x118
  927. #define FwIntRa 0x120
  928. #define FwIntT12 0x128
  929. #define FwIntAt 0x130
  930. #define FwIntGp 0x138
  931. #define FwIntSp 0x140
  932. #define FwIntZero 0x148
  933. #define FwFltF0 0x150
  934. #define FwFltF1 0x158
  935. #define FwFltF2 0x160
  936. #define FwFltF3 0x168
  937. #define FwFltF4 0x170
  938. #define FwFltF5 0x178
  939. #define FwFltF6 0x180
  940. #define FwFltF7 0x188
  941. #define FwFltF8 0x190
  942. #define FwFltF9 0x198
  943. #define FwFltF10 0x1a0
  944. #define FwFltF11 0x1a8
  945. #define FwFltF12 0x1b0
  946. #define FwFltF13 0x1b8
  947. #define FwFltF14 0x1c0
  948. #define FwFltF15 0x1c8
  949. #define FwFltF16 0x1d0
  950. #define FwFltF17 0x1d8
  951. #define FwFltF18 0x1e0
  952. #define FwFltF19 0x1e8
  953. #define FwFltF20 0x1f0
  954. #define FwFltF21 0x1f8
  955. #define FwFltF22 0x200
  956. #define FwFltF23 0x208
  957. #define FwFltF24 0x210
  958. #define FwFltF25 0x218
  959. #define FwFltF26 0x220
  960. #define FwFltF27 0x228
  961. #define FwFltF28 0x230
  962. #define FwFltF29 0x238
  963. #define FwFltF30 0x240
  964. #define FwFltF31 0x248
  965. #define FirmwareFrameLength 0x250
  966. //
  967. // Usermode callout frame definitions
  968. //
  969. #define CuF2 0x0
  970. #define CuF3 0x8
  971. #define CuF4 0x10
  972. #define CuF5 0x18
  973. #define CuF6 0x20
  974. #define CuF7 0x28
  975. #define CuF8 0x30
  976. #define CuF9 0x38
  977. #define CuS0 0x40
  978. #define CuS1 0x48
  979. #define CuS2 0x50
  980. #define CuS3 0x58
  981. #define CuS4 0x60
  982. #define CuS5 0x68
  983. #define CuFP 0x70
  984. #define CuCbStk 0x78
  985. #define CuInStk 0x80
  986. #define CuTrFr 0x88
  987. #define CuTrFir 0x90
  988. #define CuRa 0x98
  989. #define CuA0 0xa0
  990. #define CuA1 0xa8
  991. #define CuFrameLength 0xb0
  992. //
  993. // Usermode callout user frame definitions
  994. //
  995. #define CkBuffer 0x0
  996. #define CkLength 0x8
  997. #define CkApiNumber 0xc
  998. #define CkSp 0x18
  999. #define CkRa 0x20
  1000. //
  1001. // KFLOATING_SAVE definitions
  1002. //
  1003. #define KfsFpcr 0x0
  1004. #define KfsSoftFpcr 0x8
  1005. #define KfsReserved1 0x10
  1006. #define KfsReserved2 0x14
  1007. #define KfsReserved3 0x18
  1008. #define KfsReserved4 0x1c
  1009. //
  1010. // Loader Parameter Block Offset Definitions
  1011. //
  1012. #define LpbLoadOrderListHead 0x0
  1013. #define LpbMemoryDescriptorListHead 0x10
  1014. #define LpbKernelStack 0x30
  1015. #define LpbPrcb 0x38
  1016. #define LpbProcess 0x40
  1017. #define LpbThread 0x48
  1018. #define LpbRegistryLength 0x50
  1019. #define LpbRegistryBase 0x58
  1020. #define LpbDpcStack 0xb8
  1021. #define LpbFirstLevelDcacheSize 0xc0
  1022. #define LpbFirstLevelDcacheFillSize 0xc4
  1023. #define LpbFirstLevelIcacheSize 0xc8
  1024. #define LpbFirstLevelIcacheFillSize 0xcc
  1025. #define LpbGpBase 0xd0
  1026. #define LpbPanicStack 0xd8
  1027. #define LpbPcrPage 0xe0
  1028. #define LpbPdrPage 0xe4
  1029. #define LpbSecondLevelDcacheSize 0xe8
  1030. #define LpbSecondLevelDcacheFillSize 0xec
  1031. #define LpbSecondLevelIcacheSize 0xf0
  1032. #define LpbSecondLevelIcacheFillSize 0xf4
  1033. #define LpbPhysicalAddressBits 0xf8
  1034. #define LpbMaximumAddressSpaceNumber 0xfc
  1035. #define LpbSystemSerialNumber 0x100
  1036. #define LpbSystemType 0x110
  1037. #define LpbSystemVariant 0x118
  1038. #define LpbSystemRevision 0x11c
  1039. #define LpbProcessorType 0x120
  1040. #define LpbProcessorRevision 0x124
  1041. #define LpbCycleClockPeriod 0x128
  1042. #define LpbPageSize 0x12c
  1043. #define LpbRestartBlock 0x130
  1044. #define LpbFirmwareRestartAddress 0x138
  1045. #define LpbFirmwareRevisionId 0x140
  1046. #define LpbPalBaseAddress 0x148
  1047. //
  1048. // Restart Block Structure Definitions
  1049. //
  1050. #define RbSignature 0x0
  1051. #define RbLength 0x4
  1052. #define RbVersion 0x8
  1053. #define RbRevision 0xa
  1054. #define RbNextRestartBlock 0xc
  1055. #define RbRestartAddress 0x10
  1056. #define RbBootMasterId 0x14
  1057. #define RbProcessorId 0x18
  1058. #define RbBootStatus 0x1c
  1059. #define RbCheckSum 0x20
  1060. #define RbSaveAreaLength 0x24
  1061. #define RbSaveArea 0x28
  1062. #define RbHaltReason 0x28
  1063. #define RbLogoutFrame 0x2c
  1064. #define RbPalBase 0x30
  1065. #define RbIntV0 0x38
  1066. #define RbIntT0 0x40
  1067. #define RbIntT1 0x48
  1068. #define RbIntT2 0x50
  1069. #define RbIntT3 0x58
  1070. #define RbIntT4 0x60
  1071. #define RbIntT5 0x68
  1072. #define RbIntT6 0x70
  1073. #define RbIntT7 0x78
  1074. #define RbIntS0 0x80
  1075. #define RbIntS1 0x88
  1076. #define RbIntS2 0x90
  1077. #define RbIntS3 0x98
  1078. #define RbIntS4 0xa0
  1079. #define RbIntS5 0xa8
  1080. #define RbIntFp 0xb0
  1081. #define RbIntA0 0xb8
  1082. #define RbIntA1 0xc0
  1083. #define RbIntA2 0xc8
  1084. #define RbIntA3 0xd0
  1085. #define RbIntA4 0xd8
  1086. #define RbIntA5 0xe0
  1087. #define RbIntT8 0xe8
  1088. #define RbIntT9 0xf0
  1089. #define RbIntT10 0xf8
  1090. #define RbIntT11 0x100
  1091. #define RbIntRa 0x108
  1092. #define RbIntT12 0x110
  1093. #define RbIntAT 0x118
  1094. #define RbIntGp 0x120
  1095. #define RbIntSp 0x128
  1096. #define RbIntZero 0x130
  1097. #define RbFpcr 0x138
  1098. #define RbFltF0 0x140
  1099. #define RbFltF1 0x148
  1100. #define RbFltF2 0x150
  1101. #define RbFltF3 0x158
  1102. #define RbFltF4 0x160
  1103. #define RbFltF5 0x168
  1104. #define RbFltF6 0x170
  1105. #define RbFltF7 0x178
  1106. #define RbFltF8 0x180
  1107. #define RbFltF9 0x188
  1108. #define RbFltF10 0x190
  1109. #define RbFltF11 0x198
  1110. #define RbFltF12 0x1a0
  1111. #define RbFltF13 0x1a8
  1112. #define RbFltF14 0x1b0
  1113. #define RbFltF15 0x1b8
  1114. #define RbFltF16 0x1c0
  1115. #define RbFltF17 0x1c8
  1116. #define RbFltF18 0x1d0
  1117. #define RbFltF19 0x1d8
  1118. #define RbFltF20 0x1e0
  1119. #define RbFltF21 0x1e8
  1120. #define RbFltF22 0x1f0
  1121. #define RbFltF23 0x1f8
  1122. #define RbFltF24 0x200
  1123. #define RbFltF25 0x208
  1124. #define RbFltF26 0x210
  1125. #define RbFltF27 0x218
  1126. #define RbFltF28 0x220
  1127. #define RbFltF29 0x228
  1128. #define RbFltF30 0x230
  1129. #define RbFltF31 0x238
  1130. #define RbAsn 0x240
  1131. #define RbGeneralEntry 0x244
  1132. #define RbIksp 0x248
  1133. #define RbInterruptEntry 0x24c
  1134. #define RbKgp 0x250
  1135. #define RbMces 0x254
  1136. #define RbMemMgmtEntry 0x258
  1137. #define RbPanicEntry 0x25c
  1138. #define RbPcr 0x260
  1139. #define RbPdr 0x264
  1140. #define RbPsr 0x268
  1141. #define RbReiRestartAddress 0x26c
  1142. #define RbSirr 0x270
  1143. #define RbSyscallEntry 0x274
  1144. #define RbTeb 0x278
  1145. #define RbThread 0x27c
  1146. #define RbPerProcessorState 0x280
  1147. //
  1148. // Address Space Layout Definitions
  1149. //
  1150. #define KSEG0_BASE 0xffffffff80000000
  1151. #define KSEG2_BASE 0xffffffffc0000000
  1152. #define SYSTEM_BASE 0xfffffe0200000000
  1153. #define PDE_BASE 0xfffffe01807fe000
  1154. #define PTE_BASE 0xfffffe0000000000
  1155. #define PDE64_BASE 0xfffffe0180600000
  1156. #define PTE64_BASE 0xfffffe0000000000
  1157. //
  1158. // Page Table and Directory Entry Definitions
  1159. //
  1160. #define PAGE_SIZE 0x2000
  1161. #define PAGE_SHIFT 0xd
  1162. #define PDI_SHIFT 0x17
  1163. #define PTI_SHIFT 0xd
  1164. //
  1165. // Breakpoint Definitions
  1166. //
  1167. #define USER_BREAKPOINT 0x0
  1168. #define KERNEL_BREAKPOINT 0x1
  1169. #define BREAKIN_BREAKPOINT 0x19
  1170. #define DEBUG_PRINT_BREAKPOINT 0x14
  1171. #define DEBUG_PROMPT_BREAKPOINT 0x15
  1172. #define DEBUG_STOP_BREAKPOINT 0x16
  1173. #define DEBUG_LOAD_SYMBOLS_BREAKPOINT 0x17
  1174. #define DEBUG_UNLOAD_SYMBOLS_BREAKPOINT 0x18
  1175. //
  1176. // Trap Code Definitions
  1177. //
  1178. #define GENTRAP_INTEGER_OVERFLOW 0xffffffff
  1179. #define GENTRAP_INTEGER_DIVIDE_BY_ZERO 0xfffffffe
  1180. #define GENTRAP_FLOATING_OVERFLOW 0xfffffffd
  1181. #define GENTRAP_FLOATING_DIVIDE_BY_ZERO 0xfffffffc
  1182. #define GENTRAP_FLOATING_UNDERFLOW 0xfffffffb
  1183. #define GENTRAP_FLOATING_INVALID_OPERAND 0xfffffffa
  1184. #define GENTRAP_FLOATING_INEXACT_RESULT 0xfffffff9
  1185. //
  1186. // Miscellaneous Definitions
  1187. //
  1188. #define Executive 0x0
  1189. #define KernelMode 0x0
  1190. #define FALSE 0x0
  1191. #define TRUE 0x1
  1192. #define BASE_PRIORITY_THRESHOLD 0x8
  1193. #define EVENT_PAIR_INCREMENT 0x1
  1194. #define LOW_REALTIME_PRIORITY 0x10
  1195. #define MM_USER_PROBE_ADDRESS 0x000003ffffff0000
  1196. #define KERNEL_STACK_SIZE 0x6000
  1197. #define KERNEL_LARGE_STACK_COMMIT 0x6000
  1198. #define SET_LOW_WAIT_HIGH 0xfffffffe
  1199. #define SET_HIGH_WAIT_LOW 0xffffffff
  1200. #define CLOCK_QUANTUM_DECREMENT 0x3
  1201. #define READY_SKIP_QUANTUM 0x2
  1202. #define THREAD_QUANTUM 0x6
  1203. #define WAIT_QUANTUM_DECREMENT 0x1
  1204. #define ROUND_TRIP_DECREMENT_COUNT 0x10
  1205. #define PROCESSOR_ALPHA_21064 0x5248
  1206. #define PROCESSOR_ALPHA_21164 0x52ac
  1207. #define PROCESSOR_ALPHA_21066 0x524a
  1208. #define PROCESSOR_ALPHA_21068 0x524c
  1209. #define PROCESSOR_ALPHA_21164PC 0x52ad
  1210. #define PROCESSOR_ALPHA_21264 0x5310
  1211. #define PTE_VALID_MASK 0x1
  1212. #define PTE_VALID 0x0
  1213. #define PTE_FOW_MASK 0x4
  1214. #define PTE_FOW 0x2
  1215. #define PTE_GLOBAL_MASK 0x10
  1216. #define PTE_GLOBAL 0x4
  1217. #define PTE_GH_MASK 0x60
  1218. #define PTE_GH 0x5
  1219. #define PTE_KRE_MASK 0x100
  1220. #define PTE_KRE 0x8
  1221. #define PTE_URE_MASK 0x200
  1222. #define PTE_URE 0x9
  1223. #define PTE_KWE_MASK 0x1000
  1224. #define PTE_KWE 0xc
  1225. #define PTE_UWE_MASK 0x2000
  1226. #define PTE_UWE 0xd
  1227. #define PTE_WRITE_MASK 0x10000
  1228. #define PTE_WRITE 0x10
  1229. #define PTE_COPY_ON_WRITE_MASK 0x20000
  1230. #define PTE_COPY_ON_WRITE 0x11
  1231. #define PTE_SOFTWARE_MASK 0xfffc0000
  1232. #define PTE_SOFTWARE 0x12
  1233. #define PTE_PFN_MASK 0xffffffff00000000
  1234. #define PTE_PFN 0x20
  1235. #define PSR_MODE_MASK 0x1
  1236. #define PSR_MODE 0x0
  1237. #define PSR_USER_MODE 0x1
  1238. #define PSR_IE_MASK 0x2
  1239. #define PSR_IE 0x1
  1240. #define PSR_IRQL_MASK 0x1c
  1241. #define PSR_IRQL 0x2
  1242. #define IE_SFW_MASK 0x3
  1243. #define IE_SFW 0x0
  1244. #define IE_HDW_MASK 0xfc
  1245. #define IE_HDW 0x2
  1246. #define MCHK_CORRECTABLE_MASK 0x1
  1247. #define MCHK_CORRECTABLE 0x0
  1248. #define MCHK_RETRYABLE_MASK 0x2
  1249. #define MCHK_RETRYABLE 0x1
  1250. #define MCES_MCK_MASK 0x1
  1251. #define MCES_MCK 0x0
  1252. #define MCES_SCE_MASK 0x2
  1253. #define MCES_SCE 0x1
  1254. #define MCES_PCE_MASK 0x4
  1255. #define MCES_PCE 0x2
  1256. #define MCES_DPC_MASK 0x8
  1257. #define MCES_DPC 0x3
  1258. #define MCES_DSC_MASK 0x10
  1259. #define MCES_DSC 0x4
  1260. #define MCES_DMCK_MASK 0x20
  1261. #define MCES_DMCK 0x5
  1262. #define EXCSUM_SWC_MASK 0x1
  1263. #define EXCSUM_SWC 0x0
  1264. #define EXCSUM_INV_MASK 0x2
  1265. #define EXCSUM_INV 0x1
  1266. #define EXCSUM_DZE_MASK 0x4
  1267. #define EXCSUM_DZE 0x2
  1268. #define EXCSUM_OVF_MASK 0x8
  1269. #define EXCSUM_OVF 0x3
  1270. #define EXCSUM_UNF_MASK 0x10
  1271. #define EXCSUM_UNF 0x4
  1272. #define EXCSUM_INE_MASK 0x20
  1273. #define EXCSUM_INE 0x5
  1274. #define EXCSUM_IOV_MASK 0x40
  1275. #define EXCSUM_IOV 0x6
  1276. //
  1277. // Call PAL Mnemonics
  1278. //
  1279. // begin callpal
  1280. #define bpt 0x80
  1281. #define callsys 0x83
  1282. #define imb 0x86
  1283. #define gentrap 0xaa
  1284. #define rdteb 0xab
  1285. #define kbpt 0xac
  1286. #define callkd 0xad
  1287. #define rdteb64 0xae
  1288. #define halt 0x0
  1289. #define restart 0x1
  1290. #define draina 0x2
  1291. #define reboot 0x3
  1292. #define initpal 0x4
  1293. #define wrentry 0x5
  1294. #define swpirql 0x6
  1295. #define rdirql 0x7
  1296. #define di 0x8
  1297. #define ei 0x9
  1298. #define swppal 0xa
  1299. #define ssir 0xc
  1300. #define csir 0xd
  1301. #define rfe 0xe
  1302. #define retsys 0xf
  1303. #define swpctx 0x10
  1304. #define swpprocess 0x11
  1305. #define rdmces 0x12
  1306. #define wrmces 0x13
  1307. #define tbia 0x14
  1308. #define tbis 0x15
  1309. #define tbisasn 0x17
  1310. #define dtbis 0x16
  1311. #define rdksp 0x18
  1312. #define swpksp 0x19
  1313. #define rdpsr 0x1a
  1314. #define rdpcr 0x1c
  1315. #define rdthread 0x1e
  1316. #define tbim 0x20
  1317. #define tbimasn 0x21
  1318. #define tbim64 0x22
  1319. #define tbis64 0x23
  1320. #define ealnfix 0x24
  1321. #define dalnfix 0x25
  1322. #define rdcounters 0x30
  1323. #define rdstate 0x31
  1324. #define wrperfmon 0x32
  1325. #define cp_sleep 0x39
  1326. #define initpcr 0x38
  1327. // end callpal
  1328. //
  1329. // Bios Argument Structure Definitions
  1330. //
  1331. #define BaEax 0x0
  1332. #define BaEbx 0x4
  1333. #define BaEcx 0x8
  1334. #define BaEdx 0xc
  1335. #define BaEsi 0x10
  1336. #define BaEdi 0x14
  1337. #define BaEbp 0x18
  1338. #define BiosArgumentLength 0x1c
  1339. //
  1340. // Define Vendor Callback Read/Write Error Frame Operation Types
  1341. //
  1342. #define ReadFrame 0x1
  1343. #define WriteFrame 0x2
  1344. //
  1345. // Define Vendor Callback Vector Base Address
  1346. //
  1347. #define SYSTEM_VECTOR_BASE 0xffffffff806fe028
  1348. //
  1349. // Define Vendor Callback Offsets
  1350. //
  1351. #define VnCallBiosRoutine 0x38
  1352. #define VnReadWriteErrorFrameRoutine 0x98
  1353. #define VnVideoDisplayInitializeRoutine 0x10
  1354. //
  1355. // Define Firmware Callback Vector Base Address
  1356. //
  1357. #define FIRMWARE_VECTOR_BASE 0xffffffff806fe020
  1358. //
  1359. // Define Firmware Callback Offsets
  1360. //
  1361. #define FwGetEnvironmentRoutine 0x78
  1362. #define FwSetEnvironmentRoutine 0x7c