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.

1874 lines
43 KiB

  1. #include "kxia64.h"
  2. #include "regia64.h"
  3. //
  4. // Pointer size in bytes
  5. //
  6. #define SizeofPointer 0x8
  7. //
  8. // Process State Enumerated Type Values
  9. //
  10. #define ProcessInMemory 0x0
  11. #define ProcessOutOfMemory 0x1
  12. #define ProcessInTransition 0x2
  13. //
  14. // Thread State Enumerated Type Values
  15. //
  16. #define Initialized 0x0
  17. #define Ready 0x1
  18. #define Running 0x2
  19. #define Standby 0x3
  20. #define Terminated 0x4
  21. #define Waiting 0x5
  22. //
  23. // Wait Reason and Wait Type Enumerated Type Values
  24. //
  25. #define WrExecutive 0x0
  26. #define WrMutex 0x1d
  27. #define WrDispatchInt 0x1f
  28. #define WrQuantumEnd 0x1e
  29. #define WrEventPair 0xe
  30. #define WaitAny 0x1
  31. #define WaitAll 0x0
  32. //
  33. // Apc State Structure Offset Definitions
  34. //
  35. #define AsApcListHead 0x0
  36. #define AsProcess 0x20
  37. #define AsKernelApcInProgress 0x28
  38. #define AsKernelApcPending 0x29
  39. #define AsUserApcPending 0x2a
  40. //
  41. // Bug Check Code Definitions
  42. //
  43. #define APC_INDEX_MISMATCH 0x1
  44. #define ATTEMPTED_SWITCH_FROM_DPC 0xb8
  45. #define DATA_BUS_ERROR 0x2e
  46. #define DATA_COHERENCY_EXCEPTION 0x55
  47. #define HAL1_INITIALIZATION_FAILED 0x61
  48. #define INSTRUCTION_BUS_ERROR 0x2f
  49. #define INSTRUCTION_COHERENCY_EXCEPTION 0x56
  50. #define INTERRUPT_EXCEPTION_NOT_HANDLED 0x3d
  51. #define INTERRUPT_UNWIND_ATTEMPTED 0x3c
  52. #define INVALID_AFFINITY_SET 0x3
  53. #define INVALID_DATA_ACCESS_TRAP 0x4
  54. #define IRQL_GT_ZERO_AT_SYSTEM_SERVICE 0x4a
  55. #define IRQL_NOT_LESS_OR_EQUAL 0xa
  56. #define KMODE_EXCEPTION_NOT_HANDLED 0x1e
  57. #define NMI_HARDWARE_FAILURE 0x80
  58. #define NO_USER_MODE_CONTEXT 0xe
  59. #define PAGE_FAULT_WITH_INTERRUPTS_OFF 0x49
  60. #define PANIC_STACK_SWITCH 0x2b
  61. #define SPIN_LOCK_INIT_FAILURE 0x81
  62. #define SYSTEM_EXIT_OWNED_MUTEX 0x39
  63. #define SYSTEM_SERVICE_EXCEPTION 0x3b
  64. #define SYSTEM_UNWIND_PREVIOUS_USER 0x3a
  65. #define TRAP_CAUSE_UNKNOWN 0x12
  66. #define UNEXPECTED_KERNEL_MODE_TRAP 0x7f
  67. #define HARDWARE_INTERRUPT_STORM 0xf2
  68. #define RECURSIVE_MACHINE_CHECK 0xfb
  69. //
  70. // Breakpoint type definitions
  71. //
  72. #define DBG_STATUS_CONTROL_C 0x1
  73. //
  74. // Client Id Structure Offset Definitions
  75. //
  76. #define CidUniqueProcess 0x0
  77. #define CidUniqueThread 0x8
  78. //
  79. // Critical Section Structure Offset Definitions
  80. //
  81. #define CsDebugInfo 0x0
  82. #define CsLockCount 0x8
  83. #define CsRecursionCount 0xc
  84. #define CsOwningThread 0x10
  85. #define CsLockSemaphore 0x18
  86. #define CsSpinCount 0x20
  87. //
  88. // Critical Section Debug Information Structure Offset Definitions
  89. //
  90. #define CsType 0x0
  91. #define CsCreatorBackTraceIndex 0x2
  92. #define CsCriticalSection 0x8
  93. #define CsProcessLocksList 0x10
  94. #define CsEntryCount 0x20
  95. #define CsContentionCount 0x24
  96. //
  97. // Exception Record Offset, Flag, and Enumerated Type Definitions
  98. //
  99. #define EXCEPTION_NONCONTINUABLE 0x1
  100. #define EXCEPTION_UNWINDING 0x2
  101. #define EXCEPTION_EXIT_UNWIND 0x4
  102. #define EXCEPTION_STACK_INVALID 0x8
  103. #define EXCEPTION_NESTED_CALL 0x10
  104. #define EXCEPTION_TARGET_UNWIND 0x20
  105. #define EXCEPTION_COLLIDED_UNWIND 0x40
  106. #define EXCEPTION_UNWIND 0x66
  107. #define EXCEPTION_EXECUTE_HANDLER 0x1
  108. #define EXCEPTION_CONTINUE_SEARCH 0x0
  109. #define EXCEPTION_CONTINUE_EXECUTION 0xffffffff
  110. #define ExceptionContinueExecution 0x0
  111. #define ExceptionContinueSearch 0x1
  112. #define ExceptionNestedException 0x2
  113. #define ExceptionCollidedUnwind 0x3
  114. #define ErExceptionCode 0x0
  115. #define ErExceptionFlags 0x4
  116. #define ErExceptionRecord 0x8
  117. #define ErExceptionAddress 0x10
  118. #define ErNumberParameters 0x18
  119. #define ErExceptionInformation 0x20
  120. #define ExceptionRecordLength 0xa0
  121. //
  122. // Fast Mutex Structure Offset Definitions
  123. //
  124. #define FmCount 0x0
  125. #define FmOwner 0x8
  126. #define FmContention 0x10
  127. #define FmEvent 0x18
  128. #define FmOldIrql 0x30
  129. //
  130. // Interrupt Priority Request Level Definitions
  131. //
  132. #define PASSIVE_LEVEL 0x0
  133. #define APC_LEVEL 0x1
  134. #define DISPATCH_LEVEL 0x2
  135. #define IPI_LEVEL 0xe
  136. #define POWER_LEVEL 0xf
  137. #define PROFILE_LEVEL 0xf
  138. #define HIGH_LEVEL 0xf
  139. #ifdef NT_UP
  140. #define SYNCH_LEVEL 0x2
  141. #else
  142. #define SYNCH_LEVEL 0xc
  143. #endif
  144. //
  145. // Large Integer Structure Offset Definitions
  146. //
  147. #define LiLowPart 0x0
  148. #define LiHighPart 0x4
  149. //
  150. // List Entry Structure Offset Definitions
  151. //
  152. #define LsFlink 0x0
  153. #define LsBlink 0x8
  154. //
  155. // String Structure Offset Definitions
  156. //
  157. #define StrLength 0x0
  158. #define StrMaximumLength 0x2
  159. #define StrBuffer 0x8
  160. //
  161. // Tick Count Offset Definitions
  162. //
  163. #define UsTickCount 0x320
  164. //
  165. // Time Structure Offset Definitions
  166. //
  167. #define TmLowTime 0x0
  168. #define TmHighTime 0x4
  169. //
  170. // Thread Switch Counter Offset Definitions
  171. //
  172. #define TwFindAny 0x0
  173. #define TwFindIdeal 0x4
  174. #define TwFindLast 0x8
  175. #define TwIdleAny 0xc
  176. #define TwIdleCurrent 0x10
  177. #define TwIdleIdeal 0x14
  178. #define TwIdleLast 0x18
  179. #define TwPreemptAny 0x1c
  180. #define TwPreemptCurrent 0x20
  181. #define TwPreemptLast 0x24
  182. #define TwSwitchToIdle 0x28
  183. //
  184. // Status Code Definitions
  185. //
  186. #define STATUS_IA64_INVALID_STACK 0xc0000028
  187. #define STATUS_ACCESS_VIOLATION 0xc0000005
  188. #define STATUS_ARRAY_BOUNDS_EXCEEDED 0xc000008c
  189. #define STATUS_BAD_COMPRESSION_BUFFER 0xc0000242
  190. #define STATUS_BREAKPOINT 0x80000003
  191. #define STATUS_DATATYPE_MISALIGNMENT 0x80000002
  192. #define STATUS_FLOAT_DENORMAL_OPERAND 0xc000008d
  193. #define STATUS_FLOAT_DIVIDE_BY_ZERO 0xc000008e
  194. #define STATUS_FLOAT_INEXACT_RESULT 0xc000008f
  195. #define STATUS_FLOAT_INVALID_OPERATION 0xc0000090
  196. #define STATUS_FLOAT_OVERFLOW 0xc0000091
  197. #define STATUS_FLOAT_STACK_CHECK 0xc0000092
  198. #define STATUS_FLOAT_UNDERFLOW 0xc0000093
  199. #define STATUS_FLOAT_MULTIPLE_FAULTS 0xc00002b4
  200. #define STATUS_FLOAT_MULTIPLE_TRAPS 0xc00002b5
  201. #define STATUS_GUARD_PAGE_VIOLATION 0x80000001
  202. #define STATUS_ILLEGAL_FLOAT_CONTEXT 0xc000014a
  203. #define STATUS_ILLEGAL_INSTRUCTION 0xc000001d
  204. #define STATUS_INSTRUCTION_MISALIGNMENT 0xc00000aa
  205. #define STATUS_INVALID_HANDLE 0xc0000008
  206. #define STATUS_INVALID_LOCK_SEQUENCE 0xc000001e
  207. #define STATUS_INVALID_OWNER 0xc000005a
  208. #define STATUS_INVALID_PARAMETER_1 0xc00000ef
  209. #define STATUS_INVALID_SYSTEM_SERVICE 0xc000001c
  210. #define STATUS_INTEGER_DIVIDE_BY_ZERO 0xc0000094
  211. #define STATUS_INTEGER_OVERFLOW 0xc0000095
  212. #define STATUS_IN_PAGE_ERROR 0xc0000006
  213. #define STATUS_KERNEL_APC 0x100
  214. #define STATUS_LONGJUMP 0x80000026
  215. #define STATUS_NO_CALLBACK_ACTIVE 0xc0000258
  216. #define STATUS_NO_EVENT_PAIR 0xc000014e
  217. #define STATUS_PRIVILEGED_INSTRUCTION 0xc0000096
  218. #define STATUS_SINGLE_STEP 0x80000004
  219. #define STATUS_STACK_OVERFLOW 0xc00000fd
  220. #define STATUS_SUCCESS 0x0
  221. #define STATUS_THREAD_IS_TERMINATING 0xc000004b
  222. #define STATUS_TIMEOUT 0x102
  223. #define STATUS_UNWIND 0xc0000027
  224. #define STATUS_UNWIND_CONSOLIDATE 0x80000029
  225. #define STATUS_WAKE_SYSTEM_DEBUGGER 0x80000007
  226. //
  227. // APC Object Structure Offset Definitions
  228. //
  229. #define ApType 0x0
  230. #define ApSize 0x2
  231. #define ApThread 0x8
  232. #define ApApcListEntry 0x10
  233. #define ApKernelRoutine 0x20
  234. #define ApRundownRoutine 0x28
  235. #define ApNormalRoutine 0x30
  236. #define ApNormalContext 0x38
  237. #define ApSystemArgument1 0x40
  238. #define ApSystemArgument2 0x48
  239. #define ApApcStateIndex 0x50
  240. #define ApApcMode 0x51
  241. #define ApInserted 0x52
  242. #define ApcObjectLength 0x58
  243. //
  244. // DPC object Structure Offset Definitions
  245. //
  246. #define DpType 0x0
  247. #define DpNumber 0x2
  248. #define DpImportance 0x3
  249. #define DpDpcListEntry 0x8
  250. #define DpDeferredRoutine 0x18
  251. #define DpDeferredContext 0x20
  252. #define DpSystemArgument1 0x28
  253. #define DpSystemArgument2 0x30
  254. #define DpDpcData 0x38
  255. #define DpcObjectLength 0x40
  256. //
  257. // Device Queue Object Structure Offset Definitions
  258. //
  259. #define DvType 0x0
  260. #define DvSize 0x2
  261. #define DvDeviceListHead 0x8
  262. #define DvSpinLock 0x18
  263. #define DvBusy 0x20
  264. #define DeviceQueueObjectLength 0x28
  265. //
  266. // Device Queue Entry Structure Offset Definitions
  267. //
  268. #define DeDeviceListEntry 0x0
  269. #define DeSortKey 0x10
  270. #define DeInserted 0x14
  271. #define DeviceQueueEntryLength 0x18
  272. //
  273. // Event Object Structure Offset Definitions
  274. //
  275. #define EvType 0x0
  276. #define EvSize 0x2
  277. #define EvSignalState 0x4
  278. #define EvWaitListHead 0x8
  279. #define EventObjectLength 0x18
  280. //
  281. // Event Pair Object Structure Offset Definitions
  282. //
  283. #define EpType 0x0
  284. #define EpSize 0x2
  285. #define EpEventLow 0x8
  286. #define EpEventHigh 0x20
  287. #define SET_LOW_WAIT_HIGH 0xffffffd0
  288. #define SET_HIGH_WAIT_LOW 0xffffffe8
  289. #define SET_EVENT_PAIR_MASK 0x18
  290. //
  291. // Interrupt Object Structure Offset Definitions
  292. //
  293. #define InLevelSensitive 0x0
  294. #define InLatched 0x1
  295. #define InType 0x0
  296. #define InSize 0x2
  297. #define InInterruptListEntry 0x8
  298. #define InServiceRoutine 0x18
  299. #define InServiceContext 0x20
  300. #define InSpinLock 0x28
  301. #define InTickCount 0x30
  302. #define InActualLock 0x38
  303. #define InDispatchAddress 0x40
  304. #define InVector 0x48
  305. #define InIrql 0x4c
  306. #define InSynchronizeIrql 0x4d
  307. #define InFloatingSave 0x4e
  308. #define InConnected 0x4f
  309. #define InNumber 0x50
  310. #define InShareVector 0x51
  311. #define InMode 0x54
  312. #define InServiceCount 0x58
  313. #define InDispatchCount 0x5c
  314. #define InDispatchCode 0x60
  315. #define InterruptObjectLength 0x70
  316. //
  317. // Process Object Structure Offset Definitions
  318. //
  319. #define PrType 0x0
  320. #define PrSize 0x2
  321. #define PrSignalState 0x4
  322. #define PrProfileListHead 0x18
  323. #define PrDirectoryTableBase 0x28
  324. #define PrProcessRegion 0x38
  325. #define PrSessionMapInfo 0x48
  326. #define PrSessionParentBase 0x50
  327. #define PrActiveProcessors 0x58
  328. #define PrKernelTime 0x60
  329. #define PrUserTime 0x64
  330. #define PrReadyListHead 0x68
  331. #define PrSwapListEntry 0x78
  332. #define PrThreadListHead 0x88
  333. #define PrProcessLock 0x98
  334. #define PrAffinity 0xa0
  335. #define PrStackCount 0xa8
  336. #define PrBasePriority 0xaa
  337. #define PrThreadQuantum 0xab
  338. #define PrAutoAlignment 0xac
  339. #define PrState 0xad
  340. #define ProcessObjectLength 0xc0
  341. #define ExtendedProcessObjectLength 0x410
  342. //
  343. // Profile Object Structure Offset Definitions
  344. //
  345. #define PfType 0x0
  346. #define PfSize 0x2
  347. #define PfProfileListEntry 0x8
  348. #define PfProcess 0x18
  349. #define PfRangeBase 0x20
  350. #define PfRangeLimit 0x28
  351. #define PfBucketShift 0x30
  352. #define PfBuffer 0x38
  353. #define PfSegment 0x40
  354. #define PfAffinity 0x48
  355. #define PfSource 0x50
  356. #define PfStarted 0x52
  357. #define ProfileObjectLength 0x58
  358. //
  359. // Queue Object Structure Offset Definitions
  360. //
  361. #define QuType 0x0
  362. #define QuSize 0x2
  363. #define QuSignalState 0x4
  364. #define QuEntryListHead 0x18
  365. #define QuCurrentCount 0x28
  366. #define QuMaximumCount 0x2c
  367. #define QuThreadListHead 0x30
  368. #define QueueObjectLength 0x40
  369. //
  370. // Thread Object Structure Offset Definitions
  371. //
  372. #define EeKernelEventPair 0x0
  373. #define EtCid 0x390
  374. #define EtEthreadLength 0x450
  375. #define ThType 0x0
  376. #define ThSize 0x2
  377. #define ThDebugActive 0x3
  378. #define ThSignalState 0x4
  379. #define ThMutantListHead 0x18
  380. #define ThInitialStack 0x28
  381. #define ThThreadLock 0x60
  382. #define ThStackLimit 0x30
  383. #define ThKernelStack 0x38
  384. #define ThInitialBStore 0x40
  385. #define ThBStoreLimit 0x48
  386. #define ThNumber 0x50
  387. #define ThKernelBStore 0x58
  388. #define ThContextSwitches 0x68
  389. #define ThState 0x6c
  390. #define ThNpxState 0x6d
  391. #define ThWaitIrql 0x6e
  392. #define ThWaitMode 0x6f
  393. #define ThTeb 0x70
  394. #define ThApcState 0x78
  395. #define ThApcQueueLock 0xa8
  396. #define ThWaitStatus 0xb0
  397. #define ThWaitBlockList 0xb8
  398. #define ThAlertable 0xc0
  399. #define ThWaitNext 0xc1
  400. #define ThWaitReason 0xc2
  401. #define ThPriority 0xc3
  402. #define ThEnableStackSwap 0xc4
  403. #define ThSwapBusy 0xc5
  404. #define ThAlerted 0xc6
  405. #define ThWaitListEntry 0xc8
  406. #define ThQueue 0xd8
  407. #define ThWaitTime 0xe0
  408. #define ThCombinedApcDisable 0xe4
  409. #define ThKernelApcDisable 0xe4
  410. #define ThSpecialApcDisable 0xe6
  411. #define ThTimer 0xe8
  412. #define ThWaitBlock 0x128
  413. #define ThQueueListEntry 0x1e8
  414. #define ThApcStateIndex 0x1f8
  415. #define ThApcQueueable 0x1f9
  416. #define ThPreempted 0x1fa
  417. #define ThProcessReadyQueue 0x1fb
  418. #define ThKernelStackResident 0x1fc
  419. #define ThSaturation 0x1fd
  420. #define ThIdealProcessor 0x1fe
  421. #define ThNextProcessor 0x1ff
  422. #define ThBasePriority 0x200
  423. #define ThPriorityDecrement 0x202
  424. #define ThQuantum 0x203
  425. #define ThSystemAffinityActive 0x204
  426. #define ThPreviousMode 0x205
  427. #define ThResourceIndex 0x206
  428. #define ThDisableBoost 0x207
  429. #define ThUserAffinity 0x208
  430. #define ThProcess 0x210
  431. #define ThAffinity 0x218
  432. #define ThServiceTable 0x220
  433. #define ThApcStatePointer 0x228
  434. #define ThSavedApcState 0x238
  435. #define ThCallbackBStore 0x270
  436. #define ThCallbackStack 0x268
  437. #define ThWin32Thread 0x278
  438. #define ThTrapFrame 0x280
  439. #define ThKernelTime 0x288
  440. #define ThUserTime 0x28c
  441. #define ThStackBase 0x290
  442. #define ThSuspendApc 0x298
  443. #define ThSuspendSemaphore 0x2f0
  444. #define ThTlsArray 0x310
  445. #define ThLegoData 0x318
  446. #define ThThreadListEntry 0x320
  447. #define ThLargeStack 0x330
  448. #define ThPowerState 0x331
  449. #define ThNpxIrql 0x332
  450. #define ThAutoAlignment 0x334
  451. #define ThIopl 0x335
  452. #define ThFreezeCount 0x336
  453. #define ThSuspendCount 0x337
  454. #define ThUserIdealProcessor 0x339
  455. #define ThreadObjectLength 0x340
  456. #define ExtendedThreadObjectLength 0x450
  457. #define EVENT_WAIT_BLOCK_OFFSET 0x188
  458. //
  459. // Timer object Structure Offset Definitions
  460. //
  461. #define TiType 0x0
  462. #define TiSize 0x2
  463. #define TiInserted 0x3
  464. #define TiSignalState 0x4
  465. #define TiDueTime 0x18
  466. #define TiTimerListEntry 0x20
  467. #define TiDpc 0x30
  468. #define TiPeriod 0x38
  469. #define TimerObjectLength 0x40
  470. #define TIMER_TABLE_SIZE 0x100
  471. //
  472. // Wait Block Structure Offset Definitions
  473. //
  474. #define WbWaitListEntry 0x0
  475. #define WbThread 0x10
  476. #define WbObject 0x18
  477. #define WbNextWaitBlock 0x20
  478. #define WbWaitKey 0x28
  479. #define WbWaitType 0x2a
  480. //
  481. // Fiber Structure Offset Definitions
  482. //
  483. #define FbFiberData 0x0
  484. #define FbExceptionList 0x8
  485. #define FbStackBase 0x10
  486. #define FbStackLimit 0x18
  487. #define FbDeallocationStack 0x20
  488. #define FbFiberContext 0x30
  489. #define FbWx86Tib 0xaa0
  490. #define FbDeallocationBStore 0xaa8
  491. #define FbBStoreLimit 0xab0
  492. #define FbFlsData 0xab8
  493. //
  494. // Process Environment Block Structure Offset Definitions
  495. //
  496. #define PeKernelCallbackTable 0x58
  497. #define ProcessEnvironmentBlockLength 0x358
  498. //
  499. // System Service Descriptor Table Structure Definitions
  500. //
  501. #define NUMBER_SERVICE_TABLES 0x4
  502. #define SERVICE_NUMBER_MASK 0xfff
  503. #define SERVICE_TABLE_SHIFT 0x7
  504. #define SERVICE_TABLE_MASK 0x60
  505. #define SERVICE_TABLE_TEST 0x20
  506. #define SdBase 0x0
  507. #define SdCount 0x8
  508. #define SdLimit 0x10
  509. #define SdTableBaseGpOffset 0x14
  510. #define SdNumber 0x18
  511. //
  512. // Thread Environment Block Structure Offset Definitions
  513. //
  514. #define TeCmTeb 0x0
  515. #define TeStackBase 0x8
  516. #define TeStackLimit 0x10
  517. #define TeFiberData 0x20
  518. #define TeSelf 0x30
  519. #define TeEnvironmentPointer 0x38
  520. #define TeClientId 0x40
  521. #define TeActiveRpcHandle 0x50
  522. #define TeThreadLocalStoragePointer 0x58
  523. #define TeCountOfOwnedCriticalSections 0x6c
  524. #define TePeb 0x60
  525. #define TeCsrClientThread 0x70
  526. #define TeWOW32Reserved 0x100
  527. #define TeSoftFpcr 0x10c
  528. #define TeExceptionCode 0x2c0
  529. #define TeGdiClientPID 0x7f0
  530. #define TeGdiClientTID 0x7f4
  531. #define TeGdiThreadLocalInfo 0x7f8
  532. #define TeglDispatchTable 0x9f0
  533. #define TeglReserved1 0x1138
  534. #define TeglReserved2 0x1220
  535. #define TeglSectionInfo 0x1228
  536. #define TeglSection 0x1230
  537. #define TeglTable 0x1238
  538. #define TeglCurrentRC 0x1240
  539. #define TeglContext 0x1248
  540. #define TeDeallocationStack 0x1478
  541. #define TeTlsSlots 0x1480
  542. #define TeVdm 0x1690
  543. #define TeGdiBatchCount 0x1740
  544. #define TeInstrumentation 0x16b8
  545. #define TeExceptionList 0x0
  546. #define TeDeallocationBStore 0x1788
  547. #define TeBStoreLimit 0x1790
  548. #define TeFlsData 0x17c8
  549. #define ThreadEnvironmentBlockLength 0x17d0
  550. #define CmThreadEnvironmentBlockOffset 0x2000
  551. //
  552. // Lock Queue Structure Offset Definitions
  553. //
  554. #define LOCK_QUEUE_WAIT 0x1
  555. #define LOCK_QUEUE_OWNER 0x2
  556. #define LOCK_QUEUE_HEADER_SIZE 0x10
  557. #define LockQueueDispatcherLock 0x0
  558. #define LqNext 0x0
  559. #define LqLock 0x8
  560. #define LqhNext 0x0
  561. #define LqhLock 0x8
  562. #define LqhOldIrql 0x10
  563. //
  564. // Performance Definitions
  565. //
  566. #define PERF_CONTEXTSWAP_OFFSET 0x4
  567. #define PERF_CONTEXTSWAP_FLAG 0x4
  568. #define PERF_INTERRUPT_OFFSET 0x4
  569. #define PERF_INTERRUPT_FLAG 0x4000
  570. //
  571. // EPROCESS offset used for debugging.
  572. //
  573. #define PrWow64Process 0x2b0
  574. //
  575. // Processor OS_MCA HandOff Structure Offset Definitions
  576. //
  577. #define SalHandOffPalProcEntryPoint 0x0
  578. #define SalHandOffSalProcEntryPoint 0x8
  579. #define SalHandOffSalGlobalPointer 0x10
  580. #define SalHandOffRendezVousResult 0x18
  581. #define SalHandOffSalReturnAddress 0x20
  582. #define SalHandOffMinStateSavePtr 0x28
  583. //
  584. // Processor OS_INIT HandOff Structure Offset Definitions
  585. //
  586. #define OsHandOffResult 0x0
  587. #define OsHandOffSalGlobalPointer 0x8
  588. #define OsHandOffMinStateSavePtr 0x10
  589. #define OsHandOffSalReturnAddress 0x18
  590. #define OsHandOffNewContextFlag 0x20
  591. //
  592. // SAL Event Resouces Structure Offset Definitions
  593. //
  594. #define SerSalToOsHandOff 0x0
  595. #define SerOsToSalHandOff 0x30
  596. #define SerStateDumpPhysical 0x60
  597. #define SerBackStore 0x68
  598. #define SerBackStoreLimit 0x70
  599. #define SerStack 0x78
  600. #define SerStackLimit 0x80
  601. #define SerPTOM 0x88
  602. #define SerStackFrame 0x90
  603. #define SerEventPool 0xd0
  604. #define SerEventPoolSize 0xd8
  605. #define SER_EVENT_STACK_FRAME_ENTRIES 0x8
  606. //
  607. // PAL mini-save area Structure Offset Definitions
  608. //
  609. #define PmsIntNats 0x0
  610. #define PmsIntGp 0x8
  611. #define PmsIntT0 0x10
  612. #define PmsIntT1 0x18
  613. #define PmsIntS0 0x20
  614. #define PmsIntS1 0x28
  615. #define PmsIntS2 0x30
  616. #define PmsIntS3 0x38
  617. #define PmsIntV0 0x40
  618. #define PmsIntT2 0x48
  619. #define PmsIntT3 0x50
  620. #define PmsIntT4 0x58
  621. #define PmsIntSp 0x60
  622. #define PmsIntTeb 0x68
  623. #define PmsIntT5 0x70
  624. #define PmsIntT6 0x78
  625. #define PmsB0R16 0x80
  626. #define PmsIntT7 0x100
  627. #define PmsIntT8 0x108
  628. #define PmsIntT9 0x110
  629. #define PmsIntT10 0x118
  630. #define PmsIntT11 0x120
  631. #define PmsIntT12 0x128
  632. #define PmsIntT13 0x130
  633. #define PmsIntT14 0x138
  634. #define PmsIntT15 0x140
  635. #define PmsIntT16 0x148
  636. #define PmsIntT17 0x150
  637. #define PmsIntT18 0x158
  638. #define PmsIntT19 0x160
  639. #define PmsIntT20 0x168
  640. #define PmsIntT21 0x170
  641. #define PmsIntT22 0x178
  642. #define PmsPreds 0x180
  643. #define PmsBrRp 0x188
  644. #define PmsRsRSC 0x190
  645. #define PmsStIIP 0x198
  646. #define PmsStIPSR 0x1a0
  647. #define PmsStIFS 0x1a8
  648. #define PmsXIP 0x1b0
  649. #define PmsXPSR 0x1b8
  650. #define PmsXFS 0x1c0
  651. #define PalMiniSaveLength 0x1d0
  652. //
  653. // Processor Control Registers Structure Offset Definitions
  654. //
  655. #define PCR_MINOR_VERSION 0x1
  656. #define PCR_MAJOR_VERSION 0x1
  657. #define PcMinorVersion 0x0
  658. #define PcMajorVersion 0x4
  659. #define PcInterruptRoutine 0x300
  660. #define PcFirstLevelDcacheSize 0x8
  661. #define PcFirstLevelDcacheFillSize 0xc
  662. #define PcFirstLevelIcacheSize 0x10
  663. #define PcFirstLevelIcacheFillSize 0x14
  664. #define PcSecondLevelDcacheSize 0x18
  665. #define PcSecondLevelDcacheFillSize 0x1c
  666. #define PcSecondLevelIcacheSize 0x20
  667. #define PcSecondLevelIcacheFillSize 0x24
  668. #define PcPrcb 0xb18
  669. #define PcDcacheAlignment 0x28
  670. #define PcDcacheFillSize 0x2c
  671. #define PcIcacheAlignment 0x30
  672. #define PcIcacheFillSize 0x34
  673. #define PcProcessorId 0x38
  674. #define PcProfileInterval 0x3c
  675. #define PcProfileCount 0x40
  676. #define PcStallExecutionCount 0x44
  677. #define PcStallScaleFactor 0x48
  678. #define PcNumber 0xb28
  679. #define PcKernelDebugActive 0xb2a
  680. #define PcCurrentIrql 0xb2b
  681. #define PcSoftwareInterruptPending 0xb2c
  682. #define PcApcInterrupt 0xb2c
  683. #define PcDispatchInterrupt 0xb2d
  684. #define PcIrqlMask 0x280
  685. #define PcIrqlTable 0x2c0
  686. #define PcSetMember 0xb08
  687. #define PcCurrentThread 0xb20
  688. #define PcNotMember 0xb10
  689. #define PcSystemReserved 0x50
  690. #define PcHalReserved 0x80
  691. #define PcKernelGP 0xb58
  692. #define PcInitialStack 0xb60
  693. #define PcInitialBStore 0xb68
  694. #define PcStackLimit 0xb70
  695. #define PcBStoreLimit 0xb78
  696. #define PcPanicStack 0xb80
  697. #define PcSavedIIM 0xb88
  698. #define PcSavedIFA 0xb90
  699. #define PcFpbLock 0xb98
  700. #define PcForwardProgressBuffer 0xba0
  701. #define PcEOITable 0xb30
  702. #define PcInOsMca 0xb38
  703. #define PcInOsInit 0xb39
  704. #define PcInOsCmc 0xb3a
  705. #define PcInOsCpe 0xb3b
  706. #define PcOsMcaResourcePtr 0xb40
  707. #define PcHighFpOwner 0xb50
  708. #define PcInterruptionCount 0x4c
  709. #define PcPteUbase 0xc28
  710. #define PcPteKbase 0xc30
  711. #define PcPteSbase 0xc38
  712. #define PcPdeUbase 0xc40
  713. #define PcPdeKbase 0xc48
  714. #define PcPdeSbase 0xc50
  715. #define PcPdeUtbase 0xc58
  716. #define PcPdeKtbase 0xc60
  717. #define PcPdeStbase 0xc68
  718. #define MAX_NUMBER_OF_IHISTORY_RECORDS 0x80
  719. #define ProcessorControlRegisterLength 0xe30
  720. #define UsTickCountMultiplier 0x4
  721. #define UsInterruptTime 0x8
  722. #define UsSystemTime 0x14
  723. //
  724. // Processor Block Structure Offset Definitions
  725. //
  726. #define PRCB_MINOR_VERSION 0x1
  727. #define PRCB_MAJOR_VERSION 0x1
  728. #define PbMinorVersion 0x0
  729. #define PbMajorVersion 0x2
  730. #define PbCurrentThread 0x8
  731. #define PbNextThread 0x10
  732. #define PbIdleThread 0x18
  733. #define PbNumber 0x20
  734. #define PbBuildType 0x22
  735. #define PbSetMember 0x28
  736. #define PbRestartBlock 0x30
  737. #define PbPcrPage 0x38
  738. #define PbProcessorModel 0x50
  739. #define PbProcessorRevision 0x54
  740. #define PbProcessorFamily 0x58
  741. #define PbProcessorSerialNumber 0x60
  742. #define PbProcessorFeatureBits 0x68
  743. #define PbProcessorVendorString 0x70
  744. #define PbSystemReserved 0x80
  745. #define PbHalReserved 0xc0
  746. #define PbWakeIdle 0x21
  747. #define PbDpcTime 0x140
  748. #define PbInterruptTime 0x144
  749. #define PbKernelTime 0x148
  750. #define PbUserTime 0x14c
  751. #define PbInterruptCount 0x150
  752. #define PbDispatchInterruptCount 0x154
  753. #define PbIpiFrozen 0x180
  754. #define PbProcessorState 0x190
  755. #define PbCcFastReadNoWait 0x1080
  756. #define PbCcFastReadWait 0x1084
  757. #define PbCcFastReadNotPossible 0x1088
  758. #define PbCcCopyReadNoWait 0x108c
  759. #define PbCcCopyReadWait 0x1090
  760. #define PbCcCopyReadNoWaitMiss 0x1094
  761. #define PbAlignmentFixupCount 0x1098
  762. #define PbContextSwitches 0x109c
  763. #define PbDcacheFlushCount 0x10a0
  764. #define PbExceptionDispatchCount 0x10a4
  765. #define PbFirstLevelTbFills 0x10a8
  766. #define PbFloatingEmulationCount 0x10ac
  767. #define PbIcacheFlushCount 0x10b0
  768. #define PbSecondLevelTbFills 0x10b4
  769. #define PbSystemCalls 0x10b8
  770. #define PbLockQueue 0x11f0
  771. #define PbReservedCounter 0x10bc
  772. #define PbPacketBarrier 0x1800
  773. #define PbCurrentPacket 0x1900
  774. #define PbTargetSet 0x1918
  775. #define PbWorkerRoutine 0x1920
  776. #define PbRequestSummary 0x1980
  777. #define PbSignalDone 0x1988
  778. #define PbDpcListHead 0x1a00
  779. #define PbDpcLock 0x1a10
  780. #define PbDpcQueueDepth 0x1a18
  781. #define PbDpcCount 0x1a1c
  782. #define PbMaximumDpcQueueDepth 0x1a40
  783. #define PbDpcRequestRate 0x1a44
  784. #define PbMinimumDpcRate 0x1a48
  785. #define PbDpcLastCount 0x1a4c
  786. #define PbDpcInterruptRequested 0x1a50
  787. #define PbDpcThreadRequested 0x1a54
  788. #define PbDpcRoutineActive 0x1a58
  789. #define PbDpcThreadActive 0x1a5c
  790. #define PbTimerHand 0x1a60
  791. #define PbThreadDpcEnable 0x1a68
  792. #define PbQuantumEnd 0x1a6c
  793. #define PbDpcSetEventRequest 0x1a70
  794. #define PbAdjustDpcThreshold 0x1a74
  795. #define PbStartCount 0x1a78
  796. #define PbIdleSchedule 0x1ae0
  797. #define PbDeferredReadyListHead 0x1af0
  798. #define PbPrcbLock 0x1ae8
  799. #define PbReadySummary 0x1b10
  800. #define PbDispatcherReadyListHead 0x1b18
  801. #define PbSkipTick 0x1d80
  802. #define ProcessorBlockLength 0x1f00
  803. //
  804. // Immediate Interprocessor Command Definitions
  805. //
  806. #define IPI_APC 0x1
  807. #define IPI_DPC 0x2
  808. #define IPI_FREEZE 0x4
  809. #define IPI_PACKET_READY 0x8
  810. //
  811. // Interprocessor Interrupt Count Structure Offset Definitions
  812. //
  813. #define IcFreeze 0x0
  814. #define IcPacket 0x4
  815. #define IcDPC 0x8
  816. #define IcAPC 0xc
  817. #define IcFlushSingleTb 0x10
  818. #define IcFlushMultipleTb 0x14
  819. #define IcFlushEntireTb 0x18
  820. #define IcGenericCall 0x1c
  821. #define IcChangeColor 0x20
  822. #define IcSweepDcache 0x24
  823. #define IcSweepIcache 0x28
  824. #define IcSweepIcacheRange 0x2c
  825. #define IcFlushIoBuffers 0x30
  826. #define IcGratuitousDPC 0x34
  827. //
  828. // Context Frame Offset and Flag Definitions
  829. //
  830. #define CONTEXT_FULL 0x8002f
  831. #define CONTEXT_CONTROL 0x80001
  832. #define CONTEXT_INTEGER 0x80008
  833. #define CONTEXT_LOWER_FLOATING_POINT 0x80002
  834. #define CONTEXT_HIGHER_FLOATING_POINT 0x80004
  835. #define CONTEXT_FLOATING_POINT 0x80006
  836. #define CONTEXT_DEBUG 0x80010
  837. #define CONTEXT_IA32_CONTROL 0x80020
  838. #define CxContextFlags 0x0
  839. #define CxDbI0 0x10
  840. #define CxDbI1 0x18
  841. #define CxDbI2 0x20
  842. #define CxDbI3 0x28
  843. #define CxDbI4 0x30
  844. #define CxDbI5 0x38
  845. #define CxDbI6 0x40
  846. #define CxDbI7 0x48
  847. #define CxDbD0 0x50
  848. #define CxDbD1 0x58
  849. #define CxDbD2 0x60
  850. #define CxDbD3 0x68
  851. #define CxDbD4 0x70
  852. #define CxDbD5 0x78
  853. #define CxDbD6 0x80
  854. #define CxDbD7 0x88
  855. #define CxFltS0 0x90
  856. #define CxFltS1 0xa0
  857. #define CxFltS2 0xb0
  858. #define CxFltS3 0xc0
  859. #define CxFltT0 0xd0
  860. #define CxFltT1 0xe0
  861. #define CxFltT2 0xf0
  862. #define CxFltT3 0x100
  863. #define CxFltT4 0x110
  864. #define CxFltT5 0x120
  865. #define CxFltT6 0x130
  866. #define CxFltT7 0x140
  867. #define CxFltT8 0x150
  868. #define CxFltT9 0x160
  869. #define CxFltS4 0x170
  870. #define CxFltS5 0x180
  871. #define CxFltS6 0x190
  872. #define CxFltS7 0x1a0
  873. #define CxFltS8 0x1b0
  874. #define CxFltS9 0x1c0
  875. #define CxFltS10 0x1d0
  876. #define CxFltS11 0x1e0
  877. #define CxFltS12 0x1f0
  878. #define CxFltS13 0x200
  879. #define CxFltS14 0x210
  880. #define CxFltS15 0x220
  881. #define CxFltS16 0x230
  882. #define CxFltS17 0x240
  883. #define CxFltS18 0x250
  884. #define CxFltS19 0x260
  885. #define CxFltF32 0x270
  886. #define CxFltF33 0x280
  887. #define CxFltF34 0x290
  888. #define CxFltF35 0x2a0
  889. #define CxFltF36 0x2b0
  890. #define CxFltF37 0x2c0
  891. #define CxFltF38 0x2d0
  892. #define CxFltF39 0x2e0
  893. #define CxFltF40 0x2f0
  894. #define CxFltF41 0x300
  895. #define CxFltF42 0x310
  896. #define CxFltF43 0x320
  897. #define CxFltF44 0x330
  898. #define CxFltF45 0x340
  899. #define CxFltF46 0x350
  900. #define CxFltF47 0x360
  901. #define CxFltF48 0x370
  902. #define CxFltF49 0x380
  903. #define CxFltF50 0x390
  904. #define CxFltF51 0x3a0
  905. #define CxFltF52 0x3b0
  906. #define CxFltF53 0x3c0
  907. #define CxFltF54 0x3d0
  908. #define CxFltF55 0x3e0
  909. #define CxFltF56 0x3f0
  910. #define CxFltF57 0x400
  911. #define CxFltF58 0x410
  912. #define CxFltF59 0x420
  913. #define CxFltF60 0x430
  914. #define CxFltF61 0x440
  915. #define CxFltF62 0x450
  916. #define CxFltF63 0x460
  917. #define CxFltF64 0x470
  918. #define CxFltF65 0x480
  919. #define CxFltF66 0x490
  920. #define CxFltF67 0x4a0
  921. #define CxFltF68 0x4b0
  922. #define CxFltF69 0x4c0
  923. #define CxFltF70 0x4d0
  924. #define CxFltF71 0x4e0
  925. #define CxFltF72 0x4f0
  926. #define CxFltF73 0x500
  927. #define CxFltF74 0x510
  928. #define CxFltF75 0x520
  929. #define CxFltF76 0x530
  930. #define CxFltF77 0x540
  931. #define CxFltF78 0x550
  932. #define CxFltF79 0x560
  933. #define CxFltF80 0x570
  934. #define CxFltF81 0x580
  935. #define CxFltF82 0x590
  936. #define CxFltF83 0x5a0
  937. #define CxFltF84 0x5b0
  938. #define CxFltF85 0x5c0
  939. #define CxFltF86 0x5d0
  940. #define CxFltF87 0x5e0
  941. #define CxFltF88 0x5f0
  942. #define CxFltF89 0x600
  943. #define CxFltF90 0x610
  944. #define CxFltF91 0x620
  945. #define CxFltF92 0x630
  946. #define CxFltF93 0x640
  947. #define CxFltF94 0x650
  948. #define CxFltF95 0x660
  949. #define CxFltF96 0x670
  950. #define CxFltF97 0x680
  951. #define CxFltF98 0x690
  952. #define CxFltF99 0x6a0
  953. #define CxFltF100 0x6b0
  954. #define CxFltF101 0x6c0
  955. #define CxFltF102 0x6d0
  956. #define CxFltF103 0x6e0
  957. #define CxFltF104 0x6f0
  958. #define CxFltF105 0x700
  959. #define CxFltF106 0x710
  960. #define CxFltF107 0x720
  961. #define CxFltF108 0x730
  962. #define CxFltF109 0x740
  963. #define CxFltF110 0x750
  964. #define CxFltF111 0x760
  965. #define CxFltF112 0x770
  966. #define CxFltF113 0x780
  967. #define CxFltF114 0x790
  968. #define CxFltF115 0x7a0
  969. #define CxFltF116 0x7b0
  970. #define CxFltF117 0x7c0
  971. #define CxFltF118 0x7d0
  972. #define CxFltF119 0x7e0
  973. #define CxFltF120 0x7f0
  974. #define CxFltF121 0x800
  975. #define CxFltF122 0x810
  976. #define CxFltF123 0x820
  977. #define CxFltF124 0x830
  978. #define CxFltF125 0x840
  979. #define CxFltF126 0x850
  980. #define CxFltF127 0x860
  981. #define CxStFPSR 0x870
  982. #define CxIntGp 0x878
  983. #define CxIntT0 0x880
  984. #define CxIntT1 0x888
  985. #define CxIntS0 0x890
  986. #define CxIntS1 0x898
  987. #define CxIntS2 0x8a0
  988. #define CxIntS3 0x8a8
  989. #define CxIntV0 0x8b0
  990. #define CxIntT2 0x8b8
  991. #define CxIntT3 0x8c0
  992. #define CxIntT4 0x8c8
  993. #define CxIntSp 0x8d0
  994. #define CxIntTeb 0x8d8
  995. #define CxIntT5 0x8e0
  996. #define CxIntT6 0x8e8
  997. #define CxIntT7 0x8f0
  998. #define CxIntT8 0x8f8
  999. #define CxIntT9 0x900
  1000. #define CxIntT10 0x908
  1001. #define CxIntT11 0x910
  1002. #define CxIntT12 0x918
  1003. #define CxIntT13 0x920
  1004. #define CxIntT14 0x928
  1005. #define CxIntT15 0x930
  1006. #define CxIntT16 0x938
  1007. #define CxIntT17 0x940
  1008. #define CxIntT18 0x948
  1009. #define CxIntT19 0x950
  1010. #define CxIntT20 0x958
  1011. #define CxIntT21 0x960
  1012. #define CxIntT22 0x968
  1013. #define CxIntNats 0x970
  1014. #define CxPreds 0x978
  1015. #define CxBrRp 0x980
  1016. #define CxBrS0 0x988
  1017. #define CxBrS1 0x990
  1018. #define CxBrS2 0x998
  1019. #define CxBrS3 0x9a0
  1020. #define CxBrS4 0x9a8
  1021. #define CxBrT0 0x9b0
  1022. #define CxBrT1 0x9b8
  1023. #define CxApUNAT 0x9c0
  1024. #define CxApLC 0x9c8
  1025. #define CxApEC 0x9d0
  1026. #define CxApCCV 0x9d8
  1027. #define CxApDCR 0x9e0
  1028. #define CxRsPFS 0x9e8
  1029. #define CxRsBSP 0x9f0
  1030. #define CxRsBSPSTORE 0x9f8
  1031. #define CxRsRSC 0xa00
  1032. #define CxRsRNAT 0xa08
  1033. #define CxStIPSR 0xa10
  1034. #define CxStIIP 0xa18
  1035. #define CxStIFS 0xa20
  1036. #define CxStFCR 0xa28
  1037. #define CxEflag 0xa30
  1038. #define CxSegCSD 0xa38
  1039. #define CxSegSSD 0xa40
  1040. #define CxCflag 0xa48
  1041. #define CxStFSR 0xa50
  1042. #define CxStFIR 0xa58
  1043. #define CxStFDR 0xa60
  1044. #define ContextFrameLength 0xa70
  1045. //
  1046. // Dispatcher Context Structure Offset Definitions
  1047. //
  1048. #define DcControlPc 0x10
  1049. #define DcFunctionEntry 0x20
  1050. #define DcEstablisherFrame 0x0
  1051. #define DcContextRecord 0x28
  1052. //
  1053. // Debug Register Offset Definitions and Length
  1054. //
  1055. #define TsAr21 0x0
  1056. #define TsAr24 0x8
  1057. #define TsAr26 0x18
  1058. #define TsAr27 0x20
  1059. #define TsAr28 0x28
  1060. #define TsAr29 0x30
  1061. #define TsAr30 0x38
  1062. //
  1063. // Higher FP Volatile Offset Definitions and Length
  1064. //
  1065. #define HiFltF32 0x0
  1066. #define HiFltF33 0x10
  1067. #define HiFltF34 0x20
  1068. #define HiFltF35 0x30
  1069. #define HiFltF36 0x40
  1070. #define HiFltF37 0x50
  1071. #define HiFltF38 0x60
  1072. #define HiFltF39 0x70
  1073. #define HiFltF40 0x80
  1074. #define HiFltF41 0x90
  1075. #define HiFltF42 0xa0
  1076. #define HiFltF43 0xb0
  1077. #define HiFltF44 0xc0
  1078. #define HiFltF45 0xd0
  1079. #define HiFltF46 0xe0
  1080. #define HiFltF47 0xf0
  1081. #define HiFltF48 0x100
  1082. #define HiFltF49 0x110
  1083. #define HiFltF50 0x120
  1084. #define HiFltF51 0x130
  1085. #define HiFltF52 0x140
  1086. #define HiFltF53 0x150
  1087. #define HiFltF54 0x160
  1088. #define HiFltF55 0x170
  1089. #define HiFltF56 0x180
  1090. #define HiFltF57 0x190
  1091. #define HiFltF58 0x1a0
  1092. #define HiFltF59 0x1b0
  1093. #define HiFltF60 0x1c0
  1094. #define HiFltF61 0x1d0
  1095. #define HiFltF62 0x1e0
  1096. #define HiFltF63 0x1f0
  1097. #define HiFltF64 0x200
  1098. #define HiFltF65 0x210
  1099. #define HiFltF66 0x220
  1100. #define HiFltF67 0x230
  1101. #define HiFltF68 0x240
  1102. #define HiFltF69 0x250
  1103. #define HiFltF70 0x260
  1104. #define HiFltF71 0x270
  1105. #define HiFltF72 0x280
  1106. #define HiFltF73 0x290
  1107. #define HiFltF74 0x2a0
  1108. #define HiFltF75 0x2b0
  1109. #define HiFltF76 0x2c0
  1110. #define HiFltF77 0x2d0
  1111. #define HiFltF78 0x2e0
  1112. #define HiFltF79 0x2f0
  1113. #define HiFltF80 0x300
  1114. #define HiFltF81 0x310
  1115. #define HiFltF82 0x320
  1116. #define HiFltF83 0x330
  1117. #define HiFltF84 0x340
  1118. #define HiFltF85 0x350
  1119. #define HiFltF86 0x360
  1120. #define HiFltF87 0x370
  1121. #define HiFltF88 0x380
  1122. #define HiFltF89 0x390
  1123. #define HiFltF90 0x3a0
  1124. #define HiFltF91 0x3b0
  1125. #define HiFltF92 0x3c0
  1126. #define HiFltF93 0x3d0
  1127. #define HiFltF94 0x3e0
  1128. #define HiFltF95 0x3f0
  1129. #define HiFltF96 0x400
  1130. #define HiFltF97 0x410
  1131. #define HiFltF98 0x420
  1132. #define HiFltF99 0x430
  1133. #define HiFltF100 0x440
  1134. #define HiFltF101 0x450
  1135. #define HiFltF102 0x460
  1136. #define HiFltF103 0x470
  1137. #define HiFltF104 0x480
  1138. #define HiFltF105 0x490
  1139. #define HiFltF106 0x4a0
  1140. #define HiFltF107 0x4b0
  1141. #define HiFltF108 0x4c0
  1142. #define HiFltF109 0x4d0
  1143. #define HiFltF110 0x4e0
  1144. #define HiFltF111 0x4f0
  1145. #define HiFltF112 0x500
  1146. #define HiFltF113 0x510
  1147. #define HiFltF114 0x520
  1148. #define HiFltF115 0x530
  1149. #define HiFltF116 0x540
  1150. #define HiFltF117 0x550
  1151. #define HiFltF118 0x560
  1152. #define HiFltF119 0x570
  1153. #define HiFltF120 0x580
  1154. #define HiFltF121 0x590
  1155. #define HiFltF122 0x5a0
  1156. #define HiFltF123 0x5b0
  1157. #define HiFltF124 0x5c0
  1158. #define HiFltF125 0x5d0
  1159. #define HiFltF126 0x5e0
  1160. #define HiFltF127 0x5f0
  1161. //
  1162. // Debug Register Offset Definitions and Length
  1163. //
  1164. #define DrDbI0 0x0
  1165. #define DrDbI1 0x8
  1166. #define DrDbI2 0x10
  1167. #define DrDbI3 0x18
  1168. #define DrDbI4 0x20
  1169. #define DrDbI5 0x28
  1170. #define DrDbI6 0x30
  1171. #define DrDbI7 0x38
  1172. #define DrDbD0 0x40
  1173. #define DrDbD1 0x48
  1174. #define DrDbD2 0x50
  1175. #define DrDbD3 0x58
  1176. #define DrDbD4 0x60
  1177. #define DrDbD5 0x68
  1178. #define DrDbD6 0x70
  1179. #define DrDbD7 0x78
  1180. #define TsAppRegisters 0x0
  1181. #define TsPerfRegisters 0x40
  1182. #define TsHigherFPVolatile 0x80
  1183. #define TsDebugRegisters 0x680
  1184. #define ThreadStateSaveAreaLength 0x700
  1185. //
  1186. // Exception Frame Offset Definitions and Length
  1187. //
  1188. #define ExFltS0 0x60
  1189. #define ExFltS1 0x70
  1190. #define ExFltS2 0x80
  1191. #define ExFltS3 0x90
  1192. #define ExFltS4 0xa0
  1193. #define ExFltS5 0xb0
  1194. #define ExFltS6 0xc0
  1195. #define ExFltS7 0xd0
  1196. #define ExFltS8 0xe0
  1197. #define ExFltS9 0xf0
  1198. #define ExFltS10 0x100
  1199. #define ExFltS11 0x110
  1200. #define ExFltS12 0x120
  1201. #define ExFltS13 0x130
  1202. #define ExFltS14 0x140
  1203. #define ExFltS15 0x150
  1204. #define ExFltS16 0x160
  1205. #define ExFltS17 0x170
  1206. #define ExFltS18 0x180
  1207. #define ExFltS19 0x190
  1208. #define ExIntS0 0x18
  1209. #define ExIntS1 0x20
  1210. #define ExIntS2 0x28
  1211. #define ExIntS3 0x30
  1212. #define ExIntNats 0x10
  1213. #define ExBrS0 0x38
  1214. #define ExBrS1 0x40
  1215. #define ExBrS2 0x48
  1216. #define ExBrS3 0x50
  1217. #define ExBrS4 0x58
  1218. #define ExApEC 0x0
  1219. #define ExApLC 0x8
  1220. #define ExceptionFrameLength 0x1a0
  1221. //
  1222. // Switch Frame Offset Definitions and Length
  1223. //
  1224. #define SwExFrame 0x30
  1225. #define SwPreds 0x0
  1226. #define SwRp 0x8
  1227. #define SwPFS 0x10
  1228. #define SwFPSR 0x18
  1229. #define SwBsp 0x20
  1230. #define SwRnat 0x28
  1231. #define SwitchFrameLength 0x1d0
  1232. //
  1233. // Plabel structure offset definitions
  1234. //
  1235. #define PlEntryPoint 0x0
  1236. #define PlGlobalPointer 0x8
  1237. //
  1238. // Jump Offset Definitions and Length
  1239. //
  1240. #define JbRegistration 0x18
  1241. #define JbTryLevel 0x1c
  1242. #define JbCookie 0x20
  1243. #define JbUnwindFunc 0x24
  1244. #define JbUnwindData 0x28
  1245. #define JbFPSR 0x180
  1246. #define JbFltS0 0x40
  1247. #define JbFltS1 0x50
  1248. #define JbFltS2 0x60
  1249. #define JbFltS3 0x70
  1250. #define JbFltS4 0x80
  1251. #define JbFltS5 0x90
  1252. #define JbFltS6 0xa0
  1253. #define JbFltS7 0xb0
  1254. #define JbFltS8 0xc0
  1255. #define JbFltS9 0xd0
  1256. #define JbFltS10 0xe0
  1257. #define JbFltS11 0xf0
  1258. #define JbFltS12 0x100
  1259. #define JbFltS13 0x110
  1260. #define JbFltS14 0x120
  1261. #define JbFltS15 0x130
  1262. #define JbFltS16 0x140
  1263. #define JbFltS17 0x150
  1264. #define JbFltS18 0x160
  1265. #define JbFltS19 0x170
  1266. #define JbStIIP 0x188
  1267. #define JbBrS0 0x190
  1268. #define JbBrS1 0x198
  1269. #define JbBrS2 0x1a0
  1270. #define JbBrS3 0x1a8
  1271. #define JbBrS4 0x1b0
  1272. #define JbRsBSP 0x1d8
  1273. #define JbRsPFS 0x1e0
  1274. #define JbApUNAT 0x1e8
  1275. #define JbApLC 0x1f0
  1276. #define JbIntS0 0x1b8
  1277. #define JbIntS1 0x1c0
  1278. #define JbIntS2 0x1c8
  1279. #define JbIntS3 0x1d0
  1280. #define JbIntSp 0x1f8
  1281. #define JbIntNats 0x200
  1282. #define JbPreds 0x208
  1283. #define JumpBufferLength 0x210
  1284. //
  1285. // Trap Frame Offset Definitions and Length
  1286. //
  1287. #define TrFltT0 0x50
  1288. #define TrFltT1 0x60
  1289. #define TrFltT2 0x70
  1290. #define TrFltT3 0x80
  1291. #define TrFltT4 0x90
  1292. #define TrFltT5 0xa0
  1293. #define TrFltT6 0xb0
  1294. #define TrFltT7 0xc0
  1295. #define TrFltT8 0xd0
  1296. #define TrFltT9 0xe0
  1297. #define TrIntGp 0xf0
  1298. #define TrIntT0 0xf8
  1299. #define TrIntT1 0x100
  1300. #define TrApUNAT 0x108
  1301. #define TrApCCV 0x110
  1302. #define TrSegCSD 0x118
  1303. #define TrPreds 0x120
  1304. #define TrIntV0 0x128
  1305. #define TrIntT2 0x130
  1306. #define TrIntT3 0x138
  1307. #define TrIntT4 0x140
  1308. #define TrIntSp 0x148
  1309. #define TrIntTeb 0x150
  1310. #define TrIntT5 0x158
  1311. #define TrIntT6 0x160
  1312. #define TrIntT7 0x168
  1313. #define TrIntT8 0x170
  1314. #define TrIntT9 0x178
  1315. #define TrIntT10 0x180
  1316. #define TrIntT11 0x188
  1317. #define TrIntT12 0x190
  1318. #define TrIntT13 0x198
  1319. #define TrIntT14 0x1a0
  1320. #define TrIntT15 0x1a8
  1321. #define TrIntT16 0x1b0
  1322. #define TrIntT17 0x1b8
  1323. #define TrIntT18 0x1c0
  1324. #define TrIntT19 0x1c8
  1325. #define TrIntT20 0x1d0
  1326. #define TrIntT21 0x1d8
  1327. #define TrIntT22 0x1e0
  1328. #define TrIntNats 0x1e8
  1329. #define TrBrRp 0x1f0
  1330. #define TrBrT0 0x1f8
  1331. #define TrBrT1 0x200
  1332. #define TrRsPFS 0x228
  1333. #define TrRsBSP 0x210
  1334. #define TrRsRSC 0x208
  1335. #define TrRsRNAT 0x220
  1336. #define TrRsBSPSTORE 0x218
  1337. #define TrStIPSR 0x230
  1338. #define TrStISR 0x250
  1339. #define TrStIFA 0x258
  1340. #define TrStIIP 0x238
  1341. #define TrStIIPA 0x260
  1342. #define TrStIFS 0x240
  1343. #define TrStIIM 0x268
  1344. #define TrStIHA 0x270
  1345. #define TrStFPSR 0x248
  1346. #define TrOldIrql 0x278
  1347. #define TrPreviousMode 0x27c
  1348. #define TrTrapFrame 0x280
  1349. #define TrNewBSP 0x328
  1350. #define TrEOFMarker 0x330
  1351. #define TrExceptionRecord 0x288
  1352. #define TrapFrameLength 0x340
  1353. #define TrapFrameArguments 0x40
  1354. #define KTRAP_FRAME_EOF 0xe0f0e0f0e0f0e000
  1355. //
  1356. // Usermode callout kernel frame definitions
  1357. //
  1358. #define CuBrRp 0x0
  1359. #define CuRsPFS 0x8
  1360. #define CuPreds 0x10
  1361. #define CuApUNAT 0x18
  1362. #define CuApLC 0x20
  1363. #define CuIntS0 0x38
  1364. #define CuIntS1 0x40
  1365. #define CuIntS2 0x48
  1366. #define CuIntS3 0x50
  1367. #define CuBrS0 0x58
  1368. #define CuBrS1 0x60
  1369. #define CuBrS2 0x68
  1370. #define CuBrS3 0x70
  1371. #define CuBrS4 0x78
  1372. #define CuRsRNAT 0x28
  1373. #define CuIntNats 0x30
  1374. #define CuFltS0 0x80
  1375. #define CuFltS1 0x90
  1376. #define CuFltS2 0xa0
  1377. #define CuFltS3 0xb0
  1378. #define CuFltS4 0xc0
  1379. #define CuFltS5 0xd0
  1380. #define CuFltS6 0xe0
  1381. #define CuFltS7 0xf0
  1382. #define CuFltS8 0x100
  1383. #define CuFltS9 0x110
  1384. #define CuFltS10 0x120
  1385. #define CuFltS11 0x130
  1386. #define CuFltS12 0x140
  1387. #define CuFltS13 0x150
  1388. #define CuFltS14 0x160
  1389. #define CuFltS15 0x170
  1390. #define CuFltS16 0x180
  1391. #define CuFltS17 0x190
  1392. #define CuFltS18 0x1a0
  1393. #define CuFltS19 0x1b0
  1394. #define CuA0 0x1c0
  1395. #define CuA1 0x1c8
  1396. #define CuCbStk 0x1d0
  1397. #define CuInStack 0x1d8
  1398. #define CuCbBStore 0x1e0
  1399. #define CuInBStore 0x1e8
  1400. #define CuTrFrame 0x1f0
  1401. #define CuTrStIIP 0x1f8
  1402. #define CuFrameLength 0x200
  1403. //
  1404. // Usermode callout user frame definitions
  1405. //
  1406. #define CkBuffer 0x0
  1407. #define CkLength 0x8
  1408. #define CkApiNumber 0xc
  1409. #define CkIntSp 0x10
  1410. #define CkRsPFS 0x18
  1411. #define CkBrRp 0x20
  1412. //
  1413. // Translation Register Info Definitions
  1414. //
  1415. #define TrInfoValid 0x0
  1416. #define TrInfoPageSize 0x4
  1417. #define TrInfoVirtualAddress 0x8
  1418. #define TrInfoLength 0x28
  1419. //
  1420. // Loader Parameter Block Offset Definitions
  1421. //
  1422. #define LpbLoadOrderListHead 0x0
  1423. #define LpbMemoryDescriptorListHead 0x10
  1424. #define LpbKernelStack 0x30
  1425. #define LpbPrcb 0x38
  1426. #define LpbProcess 0x40
  1427. #define LpbThread 0x48
  1428. #define LpbAcpiRsdt 0x108
  1429. #define LpbKernelPhysicalBase 0xc0
  1430. #define LpbKernelVirtualBase 0xc8
  1431. #define LpbInterruptStack 0xd0
  1432. #define LpbPanicStack 0xd8
  1433. #define LpbPcrPage 0xe0
  1434. #define LpbPdrPage 0xe8
  1435. #define LpbPcrPage2 0xf0
  1436. #define LpbMachineType 0xb8
  1437. #define LpbItrInfo 0x188
  1438. #define LpbDtrInfo 0x2c8
  1439. //
  1440. // Address Space Layout Definitions
  1441. //
  1442. #define UREGION_INDEX 0x0
  1443. #define KSEG0_BASE 0xe000000080000000
  1444. #define KSEG2_BASE 0xe0000000a0000000
  1445. #define KADDRESS_BASE 0xe000000000000000
  1446. #define UADDRESS_BASE 0x0
  1447. #define SADDRESS_BASE 0x2000000000000000
  1448. #define SYSTEM_BASE 0xe0000000c3000000
  1449. #define KSEG3_BASE 0x8000000000000000
  1450. #define KSEG3_LIMIT 0x8000100000000000
  1451. //
  1452. // Page Table and Directory Entry Definitions
  1453. //
  1454. #define PAGE_SIZE 0x2000
  1455. #define PAGE_SHIFT 0xd
  1456. #define PDI_SHIFT 0x17
  1457. #define PTI_SHIFT 0xd
  1458. #define PTE_SHIFT 0x3
  1459. #define VHPT_PDE_BITS 0x28
  1460. #define LARGE_PAGE_SIZE 0x1000000
  1461. #define LARGE_PAGE_SHIFT 0x18
  1462. //
  1463. // Breakpoint Definitions
  1464. //
  1465. #define USER_BREAKPOINT 0x80002
  1466. #define KERNEL_BREAKPOINT 0x80001
  1467. #define BREAKPOINT_BREAKIN 0x80019
  1468. #define UNKNOWN_ERROR_BREAK 0x0
  1469. #define INTEGER_DIVIDE_BY_ZERO_BREAK 0x1
  1470. #define INTEGER_OVERFLOW_BREAK 0x2
  1471. #define RANGE_CHECK_BREAK 0x3
  1472. #define NULL_POINTER_DEFERENCE_BREAK 0x4
  1473. #define MISALIGNED_DATA_BREAK 0x5
  1474. #define DECIMAL_OVERFLOW_BREAK 0x6
  1475. #define DECIMAL_DIVIDE_BY_ZERO_BREAK 0x7
  1476. #define PACKED_DECIMAL_ERROR_BREAK 0x8
  1477. #define INVALID_ASCII_DIGIT_BREAK 0x9
  1478. #define INVALID_DECIMAL_DIGIT_BREAK 0xa
  1479. #define PARAGRAPH_STACK_OVERFLOW_BREAK 0xb
  1480. #define BREAKPOINT_PRINT 0x80014
  1481. #define BREAKPOINT_PROMPT 0x80015
  1482. #define BREAKPOINT_STOP 0x80016
  1483. #define BREAKPOINT_LOAD_SYMBOLS 0x80017
  1484. #define BREAKPOINT_UNLOAD_SYMBOLS 0x80018
  1485. #define BREAKPOINT_COMMAND_STRING 0x8001a
  1486. //
  1487. // IA64 Specific Definitions
  1488. //
  1489. #define BREAK_APP_BASE 0x40000
  1490. #define BREAK_DEBUG_BASE 0x80000
  1491. #define BREAK_SYSCALL_BASE 0x180000
  1492. #define BREAK_SYSCALL 0x180000
  1493. #define BREAK_FASTSYS_BASE 0x1c0000
  1494. #define BREAK_SET_LOW_WAIT_HIGH 0x1c0020
  1495. #define BREAK_SET_HIGH_WAIT_LOW 0x1c0010
  1496. #define SYSCALL_FRAME 0x0
  1497. #define INTERRUPT_FRAME 0x1
  1498. #define EXCEPTION_FRAME 0x2
  1499. #define CONTEXT_FRAME 0xa
  1500. //
  1501. // Miscellaneous Definitions
  1502. //
  1503. #define Executive 0x0
  1504. #define KernelMode 0x0
  1505. #define UserMode 0x1
  1506. #define FALSE 0x0
  1507. #define TRUE 0x1
  1508. #define KiPcr 0xe0000000ffff0000
  1509. #define KiPcr2 0xe0000000fffe0000
  1510. #define BASE_PRIORITY_THRESHOLD 0x8
  1511. #define EVENT_PAIR_INCREMENT 0x1
  1512. #define LOW_REALTIME_PRIORITY 0x10
  1513. #define KERNEL_STACK_SIZE 0x8000
  1514. #define KERNEL_BSTORE_SIZE 0x8000
  1515. #define KERNEL_LARGE_STACK_COMMIT 0x8000
  1516. #define KERNEL_LARGE_BSTORE_COMMIT 0x8000
  1517. #define MI_USER_PROBE_ADDRESS 0x000006fbffff0000
  1518. #define MM_EPC_VA 0xe0000000ffa00000
  1519. #define THREAD_QUANTUM 0x6
  1520. #define CLOCK_QUANTUM_DECREMENT 0x3
  1521. #define WAIT_QUANTUM_DECREMENT 0x1
  1522. #define READY_SKIP_QUANTUM 0x2
  1523. #define ROUND_TRIP_DECREMENT_COUNT 0x10
  1524. //
  1525. // kernel special register frame offset definitions
  1526. //
  1527. #define KpsSpecialRegisters 0xa70
  1528. #define KsKernelDbI0 0x0
  1529. #define KsKernelDbI1 0x8
  1530. #define KsKernelDbI2 0x10
  1531. #define KsKernelDbI3 0x18
  1532. #define KsKernelDbI4 0x20
  1533. #define KsKernelDbI5 0x28
  1534. #define KsKernelDbI6 0x30
  1535. #define KsKernelDbI7 0x38
  1536. #define KsKernelDbD0 0x40
  1537. #define KsKernelDbD1 0x48
  1538. #define KsKernelDbD2 0x50
  1539. #define KsKernelDbD3 0x58
  1540. #define KsKernelDbD4 0x60
  1541. #define KsKernelDbD5 0x68
  1542. #define KsKernelDbD6 0x70
  1543. #define KsKernelDbD7 0x78
  1544. #define KsKernelPfC0 0x80
  1545. #define KsKernelPfC1 0x88
  1546. #define KsKernelPfC2 0x90
  1547. #define KsKernelPfC3 0x98
  1548. #define KsKernelPfC4 0xa0
  1549. #define KsKernelPfC5 0xa8
  1550. #define KsKernelPfC6 0xb0
  1551. #define KsKernelPfC7 0xb8
  1552. #define KsKernelPfD0 0xc0
  1553. #define KsKernelPfD1 0xc8
  1554. #define KsKernelPfD2 0xd0
  1555. #define KsKernelPfD3 0xd8
  1556. #define KsKernelPfD4 0xe0
  1557. #define KsKernelPfD5 0xe8
  1558. #define KsKernelPfD6 0xf0
  1559. #define KsKernelPfD7 0xf8
  1560. #define KsIntH16 0x100
  1561. #define KsIntH17 0x108
  1562. #define KsIntH18 0x110
  1563. #define KsIntH19 0x118
  1564. #define KsIntH20 0x120
  1565. #define KsIntH21 0x128
  1566. #define KsIntH22 0x130
  1567. #define KsIntH23 0x138
  1568. #define KsIntH24 0x140
  1569. #define KsIntH25 0x148
  1570. #define KsIntH26 0x150
  1571. #define KsIntH27 0x158
  1572. #define KsIntH28 0x160
  1573. #define KsIntH29 0x168
  1574. #define KsIntH30 0x170
  1575. #define KsIntH31 0x178
  1576. #define KsApCPUID0 0x180
  1577. #define KsApCPUID1 0x188
  1578. #define KsApCPUID2 0x190
  1579. #define KsApCPUID3 0x198
  1580. #define KsApCPUID4 0x1a0
  1581. #define KsApCPUID5 0x1a8
  1582. #define KsApCPUID6 0x1b0
  1583. #define KsApCPUID7 0x1b8
  1584. #define KsApKR0 0x1c0
  1585. #define KsApKR1 0x1c8
  1586. #define KsApKR2 0x1d0
  1587. #define KsApKR3 0x1d8
  1588. #define KsApKR4 0x1e0
  1589. #define KsApKR5 0x1e8
  1590. #define KsApKR6 0x1f0
  1591. #define KsApKR7 0x1f8
  1592. #define KsApITC 0x200
  1593. #define KsApITM 0x208
  1594. #define KsApIVA 0x210
  1595. #define KsApPTA 0x218
  1596. #define KsApGPTA 0x220
  1597. #define KsStISR 0x228
  1598. #define KsStIFA 0x230
  1599. #define KsStITIR 0x238
  1600. #define KsStIIPA 0x240
  1601. #define KsStIIM 0x248
  1602. #define KsStIHA 0x250
  1603. #define KsSaLID 0x258
  1604. #define KsSaIVR 0x260
  1605. #define KsSaTPR 0x268
  1606. #define KsSaEOI 0x270
  1607. #define KsSaIRR0 0x278
  1608. #define KsSaIRR1 0x280
  1609. #define KsSaIRR2 0x288
  1610. #define KsSaIRR3 0x290
  1611. #define KsSaITV 0x298
  1612. #define KsSaPMV 0x2a0
  1613. #define KsSaCMCV 0x2a8
  1614. #define KsSaLRR0 0x2b0
  1615. #define KsSaLRR1 0x2b8
  1616. #define KsRr0 0x2c0
  1617. #define KsRr1 0x2c8
  1618. #define KsRr2 0x2d0
  1619. #define KsRr3 0x2d8
  1620. #define KsRr4 0x2e0
  1621. #define KsRr5 0x2e8
  1622. #define KsRr6 0x2f0
  1623. #define KsRr7 0x2f8
  1624. #define KsPkr0 0x300
  1625. #define KsPkr1 0x308
  1626. #define KsPkr2 0x310
  1627. #define KsPkr3 0x318
  1628. #define KsPkr4 0x320
  1629. #define KsPkr5 0x328
  1630. #define KsPkr6 0x330
  1631. #define KsPkr7 0x338
  1632. #define KsPkr8 0x340
  1633. #define KsPkr9 0x348
  1634. #define KsPkr10 0x350
  1635. #define KsPkr11 0x358
  1636. #define KsPkr12 0x360
  1637. #define KsPkr13 0x368
  1638. #define KsPkr14 0x370
  1639. #define KsPkr15 0x378
  1640. #define KsTrI0 0x380
  1641. #define KsTrI1 0x388
  1642. #define KsTrI2 0x390
  1643. #define KsTrI3 0x398
  1644. #define KsTrI4 0x3a0
  1645. #define KsTrI5 0x3a8
  1646. #define KsTrI6 0x3b0
  1647. #define KsTrI7 0x3b8
  1648. #define KsTrD0 0x3c0
  1649. #define KsTrD1 0x3c8
  1650. #define KsTrD2 0x3d0
  1651. #define KsTrD3 0x3d8
  1652. #define KsTrD4 0x3e0
  1653. #define KsTrD5 0x3e8
  1654. #define KsTrD6 0x3f0
  1655. #define KsTrD7 0x3f8
  1656. #define KsSrMSR0 0x400
  1657. #define KsSrMSR1 0x408
  1658. #define KsSrMSR2 0x410
  1659. #define KsSrMSR3 0x418
  1660. #define KsSrMSR4 0x420
  1661. #define KsSrMSR5 0x428
  1662. #define KsSrMSR6 0x430
  1663. #define KsSrMSR7 0x438