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.

1481 lines
35 KiB

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