Source code of Windows XP (NT5)
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.

668 lines
18 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. genoff.c
  5. Abstract:
  6. This module implements a program which generates structure offset
  7. definitions for kernel structures that are accessed in assembly code.
  8. Author:
  9. Bryan M. Willman (bryanwi) 16-Oct-90
  10. To build:
  11. in ke\up do a "nmake UMAPPL=geni386"
  12. watch out for precompiled headers
  13. Revision History:
  14. Forrest Foltz (forrestf) 24-Jan-1998
  15. Modified format to use new obj-based procedure.
  16. --*/
  17. #include "ki.h"
  18. #pragma hdrstop
  19. #include "nturtl.h"
  20. #include "vdmntos.h"
  21. #include "abios.h"
  22. include(`..\genxx.h')
  23. #define KS386 KERNEL
  24. #define HAL386 HAL
  25. STRUC_ELEMENT ElementList[] = {
  26. START_LIST
  27. EnableInc(KS386)
  28. #include "genxx.inc"
  29. //
  30. // Generate architecture dependent definitions.
  31. //
  32. genCom("Apc Record Structure Offset Definitions")
  33. genDef(Ar, KAPC_RECORD, NormalRoutine)
  34. genDef(Ar, KAPC_RECORD, NormalContext)
  35. genDef(Ar, KAPC_RECORD, SystemArgument1)
  36. genDef(Ar, KAPC_RECORD, SystemArgument2)
  37. genVal(ApcRecordLength, sizeof(KAPC_RECORD))
  38. genSpc()
  39. EnableInc(HAL386)
  40. genCom("Processor Control Registers Structure Offset Definitions")
  41. genNam( KI_BEGIN_KERNEL_RESERVED )
  42. genTxt("ifdef NT_UP\n")
  43. genStr(" P0PCRADDRESS equ 0%lXH\n", KIP0PCRADDRESS)
  44. genStr(" PCR equ ds:[0%lXH]\n", KIP0PCRADDRESS)
  45. genTxt("else\n")
  46. genTxt(" PCR equ fs:\n")
  47. genTxt("endif\n\n")
  48. genAlt(PcExceptionList, KPCR, NtTib.ExceptionList)
  49. genAlt(PcInitialStack, KPCR, NtTib.StackBase)
  50. genAlt(PcStackLimit, KPCR, NtTib.StackLimit)
  51. genDef(Pc, KPCR, SelfPcr)
  52. genDef(Pc, KPCR, Prcb)
  53. genAlt(PcTeb, KPCR, NtTib.Self)
  54. genDef(Pc, KPCR, Irql)
  55. genDef(Pc, KPCR, IRR)
  56. genDef(Pc, KPCR, IrrActive)
  57. genDef(Pc, KPCR, IDR)
  58. genAlt(PcIdt, KPCR, IDT)
  59. genAlt(PcGdt, KPCR, GDT)
  60. genAlt(PcTss, KPCR, TSS)
  61. genDef(Pc, KPCR, DebugActive)
  62. genDef(Pc, KPCR, Number)
  63. genDef(Pc, KPCR, VdmAlert)
  64. genDef(Pc, KPCR, SetMember)
  65. genDef(Pc, KPCR, StallScaleFactor)
  66. genAlt(PcHal, KPCR, HalReserved)
  67. DisableInc (HAL386)
  68. genDef(Pc, KPCR, PrcbData)
  69. genVal(ProcessorControlRegisterLength, sizeof(KPCR))
  70. genAlt(TebPeb, TEB, ProcessEnvironmentBlock)
  71. genDef(Peb, PEB, BeingDebugged)
  72. genDef(Peb, PEB, KernelCallbackTable)
  73. EnableInc (HAL386)
  74. genCom("Defines for user shared data")
  75. genVal(USER_SHARED_DATA, KI_USER_SHARED_DATA)
  76. genNam(MM_SHARED_USER_DATA_VA)
  77. genStr("USERDATA equ ds:[0%lXH]\n", KI_USER_SHARED_DATA)
  78. genDef(Us, KUSER_SHARED_DATA, TickCountLow)
  79. genDef(Us, KUSER_SHARED_DATA, TickCountMultiplier)
  80. genDef(Us, KUSER_SHARED_DATA, InterruptTime)
  81. genDef(Us, KUSER_SHARED_DATA, SystemTime)
  82. genDef(Us, KUSER_SHARED_DATA, SystemCall)
  83. genCom("Tss Structure Offset Definitions")
  84. genDef(Tss, KTSS, Esp0)
  85. genDef(Tss, KTSS, CR3)
  86. genDef(Tss, KTSS, Eip)
  87. genDef(Tss, KTSS, EFlags)
  88. genDef(Tss, KTSS, Eax)
  89. genDef(Tss, KTSS, Ebx)
  90. genDef(Tss, KTSS, Ecx)
  91. genDef(Tss, KTSS, Edx)
  92. genDef(Tss, KTSS, Esp)
  93. genDef(Tss, KTSS, Ebp)
  94. genDef(Tss, KTSS, Esi)
  95. genDef(Tss, KTSS, Edi)
  96. genDef(Tss, KTSS, Es)
  97. genDef(Tss, KTSS, Cs)
  98. genDef(Tss, KTSS, Ss)
  99. genDef(Tss, KTSS, Ds)
  100. genDef(Tss, KTSS, Fs)
  101. genDef(Tss, KTSS, Gs)
  102. genDef(Tss, KTSS, IoMapBase)
  103. genDef(Tss, KTSS, IoMaps)
  104. genVal(TssLength, sizeof(KTSS))
  105. DisableInc (HAL386)
  106. EnableInc (HAL386)
  107. genCom("Gdt Descriptor Offset Definitions")
  108. genNam(KGDT_R3_DATA)
  109. genNam(KGDT_R3_CODE)
  110. genNam(KGDT_R0_CODE)
  111. genNam(KGDT_R0_DATA)
  112. genNam(KGDT_R0_PCR)
  113. genNam(KGDT_STACK16)
  114. genNam(KGDT_CODE16)
  115. genNam(KGDT_TSS)
  116. DisableInc (HAL386)
  117. genNam(KGDT_R3_TEB)
  118. genNam(KGDT_DF_TSS)
  119. genNam(KGDT_NMI_TSS)
  120. genNam(KGDT_LDT)
  121. EnableInc (HAL386)
  122. genCom("GdtEntry Offset Definitions")
  123. genDef(Kgdt, KGDTENTRY, BaseLow)
  124. genAlt(KgdtBaseMid, KGDTENTRY, HighWord.Bytes.BaseMid)
  125. genAlt(KgdtBaseHi, KGDTENTRY, HighWord.Bytes.BaseHi)
  126. genAlt(KgdtLimitHi, KGDTENTRY, HighWord.Bytes.Flags2)
  127. genDef(Kgdt, KGDTENTRY, LimitLow)
  128. genSpc()
  129. //
  130. // Processor block structure definitions.
  131. //
  132. genCom("Processor Block Structure Offset Definitions")
  133. genDef(Pb, KPRCB, CurrentThread)
  134. genDef(Pb, KPRCB, NextThread)
  135. genDef(Pb, KPRCB, IdleThread)
  136. genDef(Pb, KPRCB, Number)
  137. genDef(Pb, KPRCB, SetMember)
  138. genDef(Pb, KPRCB, CpuID)
  139. genDef(Pb, KPRCB, CpuType)
  140. genDef(Pb, KPRCB, CpuStep)
  141. genDef(Pb, KPRCB, ProcessorState)
  142. genDef(Pb, KPRCB, HalReserved)
  143. genDef(Pb, KPRCB, LockQueue)
  144. DisableInc (HAL386)
  145. genDef(Pb, KPRCB, NpxThread)
  146. genDef(Pb, KPRCB, InterruptCount)
  147. genDef(Pb, KPRCB, KernelTime)
  148. genDef(Pb, KPRCB, UserTime)
  149. genDef(Pb, KPRCB, DpcTime)
  150. genDef(Pb, KPRCB, DebugDpcTime)
  151. genDef(Pb, KPRCB, InterruptTime)
  152. genDef(Pb, KPRCB, AdjustDpcThreshold)
  153. genDef(Pb, KPRCB, PageColor)
  154. genDef(Pb, KPRCB, SkipTick)
  155. genDef(Pb, KPRCB, MultiThreadProcessorSet)
  156. genDef(Pb, KPRCB, ThreadStartCount)
  157. genAlt(PbAlignmentFixupCount, KPRCB, KeAlignmentFixupCount)
  158. genAlt(PbContextSwitches, KPRCB, KeContextSwitches)
  159. genAlt(PbDcacheFlushCount, KPRCB, KeDcacheFlushCount)
  160. genAlt(PbExceptionDispatchCount, KPRCB, KeExceptionDispatchCount)
  161. genAlt(PbFirstLevelTbFills, KPRCB, KeFirstLevelTbFills)
  162. genAlt(PbFloatingEmulationCount, KPRCB, KeFloatingEmulationCount)
  163. genAlt(PbIcacheFlushCount, KPRCB, KeIcacheFlushCount)
  164. genAlt(PbSecondLevelTbFills, KPRCB, KeSecondLevelTbFills)
  165. genAlt(PbSystemCalls, KPRCB, KeSystemCalls)
  166. genDef(Pb, KPRCB, PPLookasideList)
  167. genDef(Pb, KPRCB, PPNPagedLookasideList)
  168. genDef(Pb, KPRCB, PPPagedLookasideList)
  169. genDef(Pb, KPRCB, PacketBarrier)
  170. genDef(Pb, KPRCB, ReverseStall)
  171. genDef(Pb, KPRCB, IpiFrame)
  172. genDef(Pb, KPRCB, CurrentPacket)
  173. genDef(Pb, KPRCB, TargetSet)
  174. genDef(Pb, KPRCB, WorkerRoutine)
  175. genDef(Pb, KPRCB, IpiFrozen)
  176. genDef(Pb, KPRCB, RequestSummary)
  177. genDef(Pb, KPRCB, SignalDone)
  178. genDef(Pb, KPRCB, DpcListHead)
  179. genDef(Pb, KPRCB, DpcStack)
  180. genDef(Pb, KPRCB, DpcCount)
  181. genDef(Pb, KPRCB, DpcQueueDepth)
  182. genDef(Pb, KPRCB, DpcRoutineActive)
  183. genDef(Pb, KPRCB, DpcInterruptRequested)
  184. genDef(Pb, KPRCB, DpcLastCount)
  185. genDef(Pb, KPRCB, DpcRequestRate)
  186. genDef(Pb, KPRCB, MaximumDpcQueueDepth)
  187. genDef(Pb, KPRCB, MinimumDpcRate)
  188. genDef(Pb, KPRCB, QuantumEnd)
  189. genDef(Pb, KPRCB, DpcLock)
  190. genDef(Pb, KPRCB, NpxSaveArea)
  191. genDef(Pb, KPRCB, ChainedInterruptList)
  192. genDef(Pb, KPRCB, PowerState)
  193. genVal(ProcessorBlockLength, ((sizeof(KPRCB) + 15) & ~15))
  194. //
  195. // Prcb power state
  196. //
  197. genCom("Processor Power State Offset Definitions")
  198. genDef(Pp, PROCESSOR_POWER_STATE, IdleFunction)
  199. //
  200. // Interprocessor command definitions.
  201. //
  202. genCom("Immediate Interprocessor Command Definitions")
  203. genVal(IPI_APC, IPI_APC)
  204. genVal(IPI_DPC, IPI_DPC)
  205. genVal(IPI_FREEZE, IPI_FREEZE)
  206. genVal(IPI_PACKET_READY, IPI_PACKET_READY)
  207. genVal(IPI_SYNCH_REQUEST, IPI_SYNCH_REQUEST)
  208. genCom("Thread Environment Block Structure Offset Definitions")
  209. genAlt(TbExceptionList, TEB, NtTib.ExceptionList)
  210. genAlt(TbStackBase, TEB, NtTib.StackBase)
  211. genAlt(TbStackLimit, TEB, NtTib.StackLimit)
  212. genDef(Tb, TEB, EnvironmentPointer)
  213. genAlt(TbVersion, TEB, NtTib.Version)
  214. genAlt(TbFiberData, TEB, NtTib.FiberData)
  215. genAlt(TbArbitraryUserPointer, TEB, NtTib.ArbitraryUserPointer)
  216. genDef(Tb, TEB, ClientId)
  217. genDef(Tb, TEB, ThreadLocalStoragePointer)
  218. genDef(Tb, TEB, CountOfOwnedCriticalSections)
  219. genDef(Tb, TEB, SystemReserved1)
  220. genDef(Tb, TEB, Vdm)
  221. genDef(Tb, TEB, CsrClientThread)
  222. genDef(Tb, TEB, GdiThreadLocalInfo)
  223. genDef(Tb, TEB, glDispatchTable)
  224. genDef(Tb, TEB, glSectionInfo)
  225. genDef(Tb, TEB, glSection)
  226. genDef(Tb, TEB, glTable)
  227. genDef(Tb, TEB, glCurrentRC)
  228. genDef(Tb, TEB, glContext)
  229. genDef(Tb, TEB, WOW32Reserved)
  230. genDef(Tb, TEB, ExceptionCode)
  231. genDef(Tb, TEB, DeallocationStack)
  232. genDef(Tb, TEB, GdiBatchCount)
  233. EnableInc (HAL386)
  234. genCom("Time Fields (TIME_FIELDS) Structure Offset Definitions")
  235. genDef(Tf, TIME_FIELDS, Second)
  236. genDef(Tf, TIME_FIELDS, Minute)
  237. genDef(Tf, TIME_FIELDS, Hour)
  238. genDef(Tf, TIME_FIELDS, Weekday)
  239. genDef(Tf, TIME_FIELDS, Day)
  240. genDef(Tf, TIME_FIELDS, Month)
  241. genDef(Tf, TIME_FIELDS, Year)
  242. genDef(Tf, TIME_FIELDS, Milliseconds)
  243. genSpc()
  244. DisableInc (HAL386)
  245. EnableInc (HAL386)
  246. genCom("constants for system irql and IDT vector conversion")
  247. genNam(MAXIMUM_IDTVECTOR)
  248. genNam(MAXIMUM_PRIMARY_VECTOR)
  249. genNam(PRIMARY_VECTOR_BASE)
  250. genNam(RPL_MASK)
  251. genNam(MODE_MASK)
  252. genCom("Flags in the CR0 register")
  253. genNam(CR0_PG)
  254. genNam(CR0_ET)
  255. genNam(CR0_TS)
  256. genNam(CR0_EM)
  257. genNam(CR0_MP)
  258. genNam(CR0_PE)
  259. genNam(CR0_CD)
  260. genNam(CR0_NW)
  261. genNam(CR0_AM)
  262. genNam(CR0_WP)
  263. genNam(CR0_NE)
  264. genCom("Flags in the CR4 register")
  265. genNam(CR4_VME)
  266. genNam(CR4_PVI)
  267. genNam(CR4_TSD)
  268. genNam(CR4_DE)
  269. genNam(CR4_PSE)
  270. genNam(CR4_PAE)
  271. genNam(CR4_MCE)
  272. genNam(CR4_PGE)
  273. genNam(CR4_FXSR)
  274. genNam(CR4_XMMEXCPT)
  275. genCom("Miscellaneous Definitions")
  276. genNam(MAXIMUM_PROCESSORS)
  277. genNam(INITIAL_STALL_COUNT)
  278. genNam(IRQL_NOT_GREATER_OR_EQUAL)
  279. genNam(IRQL_NOT_LESS_OR_EQUAL)
  280. genNam(MUTEX_ALREADY_OWNED)
  281. genNam(THREAD_NOT_MUTEX_OWNER)
  282. genNam(SPIN_LOCK_ALREADY_OWNED)
  283. genNam(SPIN_LOCK_NOT_OWNED)
  284. DisableInc (HAL386)
  285. genNam(BASE_PRIORITY_THRESHOLD)
  286. genNam(EVENT_PAIR_INCREMENT)
  287. genNam(LOW_REALTIME_PRIORITY)
  288. genVal(BlackHole, 0xffffa000)
  289. genNam(KERNEL_LARGE_STACK_COMMIT)
  290. genNam(KERNEL_STACK_SIZE)
  291. genNam(DOUBLE_FAULT_STACK_SIZE)
  292. genNam(EFLAG_SELECT)
  293. genNam(BREAKPOINT_BREAK )
  294. genNam(IPI_FREEZE)
  295. genNam(CLOCK_QUANTUM_DECREMENT)
  296. genNam(READY_SKIP_QUANTUM)
  297. genNam(THREAD_QUANTUM)
  298. genNam(WAIT_QUANTUM_DECREMENT)
  299. genNam(ROUND_TRIP_DECREMENT_COUNT)
  300. //
  301. // Print trap frame offsets relative to sp.
  302. //
  303. EnableInc (HAL386)
  304. genCom("Trap Frame Offset Definitions and Length")
  305. genDef(Ts, KTRAP_FRAME, ExceptionList)
  306. genDef(Ts, KTRAP_FRAME, PreviousPreviousMode)
  307. genDef(Ts, KTRAP_FRAME, SegGs)
  308. genDef(Ts, KTRAP_FRAME, SegFs)
  309. genDef(Ts, KTRAP_FRAME, SegEs)
  310. genDef(Ts, KTRAP_FRAME, SegDs)
  311. genDef(Ts, KTRAP_FRAME, Edi)
  312. genDef(Ts, KTRAP_FRAME, Esi)
  313. genDef(Ts, KTRAP_FRAME, Ebp)
  314. genDef(Ts, KTRAP_FRAME, Ebx)
  315. genDef(Ts, KTRAP_FRAME, Edx)
  316. genDef(Ts, KTRAP_FRAME, Ecx)
  317. genDef(Ts, KTRAP_FRAME, Eax)
  318. genDef(Ts, KTRAP_FRAME, ErrCode)
  319. genDef(Ts, KTRAP_FRAME, Eip)
  320. genDef(Ts, KTRAP_FRAME, SegCs)
  321. genAlt(TsEflags, KTRAP_FRAME, EFlags)
  322. genDef(Ts, KTRAP_FRAME, HardwareEsp)
  323. genDef(Ts, KTRAP_FRAME, HardwareSegSs)
  324. genDef(Ts, KTRAP_FRAME, TempSegCs)
  325. genDef(Ts, KTRAP_FRAME, TempEsp)
  326. genDef(Ts, KTRAP_FRAME, DbgEbp)
  327. genDef(Ts, KTRAP_FRAME, DbgEip)
  328. genDef(Ts, KTRAP_FRAME, DbgArgMark)
  329. genDef(Ts, KTRAP_FRAME, DbgArgPointer)
  330. genDef(Ts, KTRAP_FRAME, Dr0)
  331. genDef(Ts, KTRAP_FRAME, Dr1)
  332. genDef(Ts, KTRAP_FRAME, Dr2)
  333. genDef(Ts, KTRAP_FRAME, Dr3)
  334. genDef(Ts, KTRAP_FRAME, Dr6)
  335. genDef(Ts, KTRAP_FRAME, Dr7)
  336. genDef(Ts, KTRAP_FRAME, V86Es)
  337. genDef(Ts, KTRAP_FRAME, V86Ds)
  338. genDef(Ts, KTRAP_FRAME, V86Fs)
  339. genDef(Ts, KTRAP_FRAME, V86Gs)
  340. genNam(KTRAP_FRAME_LENGTH)
  341. genNam(KTRAP_FRAME_ALIGN)
  342. genNam(FRAME_EDITED)
  343. genNam(EFLAGS_ALIGN_CHECK)
  344. genNam(EFLAGS_V86_MASK)
  345. genNam(EFLAGS_INTERRUPT_MASK)
  346. genNam(EFLAGS_TF)
  347. genNam(EFLAGS_VIF)
  348. genNam(EFLAGS_VIP)
  349. genNam(EFLAGS_USER_SANITIZE)
  350. genCom("Context Frame Offset and Flag Definitions")
  351. genNam(CONTEXT_FULL)
  352. genNam(CONTEXT_DEBUG_REGISTERS)
  353. genNam(CONTEXT_CONTROL)
  354. genNam(CONTEXT_FLOATING_POINT)
  355. genNam(CONTEXT_INTEGER)
  356. genNam(CONTEXT_SEGMENTS)
  357. genSpc()
  358. //
  359. // Print context frame offsets relative to sp.
  360. //
  361. genDef(Cs, CONTEXT, ContextFlags)
  362. genDef(Cs, CONTEXT, Dr0)
  363. genDef(Cs, CONTEXT, Dr1)
  364. genDef(Cs, CONTEXT, Dr2)
  365. genDef(Cs, CONTEXT, Dr3)
  366. genDef(Cs, CONTEXT, Dr6)
  367. genDef(Cs, CONTEXT, Dr7)
  368. genDef(Cs, CONTEXT, FloatSave)
  369. genDef(Cs, CONTEXT, SegGs)
  370. genDef(Cs, CONTEXT, SegFs)
  371. genDef(Cs, CONTEXT, SegEs)
  372. genDef(Cs, CONTEXT, SegDs)
  373. genDef(Cs, CONTEXT, Edi)
  374. genDef(Cs, CONTEXT, Esi)
  375. genDef(Cs, CONTEXT, Ebx)
  376. genDef(Cs, CONTEXT, Edx)
  377. genDef(Cs, CONTEXT, Ecx)
  378. genDef(Cs, CONTEXT, Eax)
  379. genDef(Cs, CONTEXT, Ebp)
  380. genDef(Cs, CONTEXT, Eip)
  381. genDef(Cs, CONTEXT, SegCs)
  382. genAlt(CsEflags, CONTEXT, EFlags)
  383. genDef(Cs, CONTEXT, Esp)
  384. genDef(Cs, CONTEXT, SegSs)
  385. genDef(Cs, CONTEXT, ExtendedRegisters)
  386. genVal(ContextFrameLength, ROUND_UP(sizeof(CONTEXT), 16))
  387. genNam(DR6_LEGAL)
  388. genNam(DR7_LEGAL)
  389. genNam(DR7_ACTIVE)
  390. //
  391. // Print Registration Record Offsets relative to base
  392. //
  393. genDef(Err, EXCEPTION_REGISTRATION_RECORD, Handler)
  394. genDef(Err, EXCEPTION_REGISTRATION_RECORD, Next)
  395. //
  396. // Print floating point field offsets relative to Context.FloatSave
  397. //
  398. genCom("Floating save area field offset definitions")
  399. genDef(Fp, FLOATING_SAVE_AREA, ControlWord)
  400. genDef(Fp, FLOATING_SAVE_AREA, StatusWord)
  401. genDef(Fp, FLOATING_SAVE_AREA, TagWord)
  402. genDef(Fp, FLOATING_SAVE_AREA, ErrorOffset)
  403. genDef(Fp, FLOATING_SAVE_AREA, ErrorSelector)
  404. genDef(Fp, FLOATING_SAVE_AREA, DataOffset)
  405. genDef(Fp, FLOATING_SAVE_AREA, DataSelector)
  406. genDef(Fp, FLOATING_SAVE_AREA, RegisterArea)
  407. genDef(FpCtxt, FLOATING_SAVE_AREA, Cr0NpxState)
  408. //
  409. // Print floating point field offsets relative to Kernel Stack
  410. // The floating save area on kernel stack is bigger for FXSR mode
  411. //
  412. genCom("FX Floating save area field offset definitions")
  413. genDef(Fx, FXSAVE_FORMAT, ControlWord)
  414. genDef(Fx, FXSAVE_FORMAT, StatusWord)
  415. genDef(Fx, FXSAVE_FORMAT, TagWord)
  416. genDef(Fx, FXSAVE_FORMAT, ErrorOpcode)
  417. genDef(Fx, FXSAVE_FORMAT, ErrorOffset)
  418. genDef(Fx, FXSAVE_FORMAT, ErrorSelector)
  419. genDef(Fx, FXSAVE_FORMAT, DataOffset)
  420. genDef(Fx, FXSAVE_FORMAT, DataSelector)
  421. genDef(Fx, FXSAVE_FORMAT, MXCsr)
  422. genDef(FxFp, FXSAVE_FORMAT, RegisterArea)
  423. genDef(Fp, FX_SAVE_AREA, NpxSavedCpu)
  424. genDef(Fp, FX_SAVE_AREA, Cr0NpxState)
  425. genSpc()
  426. genVal(NPX_FRAME_LENGTH, sizeof(FX_SAVE_AREA))
  427. //
  428. // Processor State Frame offsets relative to base
  429. //
  430. genCom("Processor State Frame Offset Definitions\n")
  431. genDef(Ps, KPROCESSOR_STATE, ContextFrame)
  432. genDef(Ps, KPROCESSOR_STATE, SpecialRegisters)
  433. genDef(Sr, KSPECIAL_REGISTERS, Cr0)
  434. genDef(Sr, KSPECIAL_REGISTERS, Cr2)
  435. genDef(Sr, KSPECIAL_REGISTERS, Cr3)
  436. genDef(Sr, KSPECIAL_REGISTERS, Cr4)
  437. genDef(Sr, KSPECIAL_REGISTERS, KernelDr0)
  438. genDef(Sr, KSPECIAL_REGISTERS, KernelDr1)
  439. genDef(Sr, KSPECIAL_REGISTERS, KernelDr2)
  440. genDef(Sr, KSPECIAL_REGISTERS, KernelDr3)
  441. genDef(Sr, KSPECIAL_REGISTERS, KernelDr6)
  442. genDef(Sr, KSPECIAL_REGISTERS, KernelDr7)
  443. genAlt(SrGdtr, KSPECIAL_REGISTERS, Gdtr.Limit)
  444. genAlt(SrIdtr, KSPECIAL_REGISTERS, Idtr.Limit)
  445. genDef(Sr, KSPECIAL_REGISTERS, Tr)
  446. genDef(Sr, KSPECIAL_REGISTERS, Ldtr)
  447. genVal(ProcessorStateLength, ROUND_UP(sizeof(KPROCESSOR_STATE), 15))
  448. DisableInc (HAL386)
  449. //
  450. // E Process fields relative to base
  451. //
  452. genCom("EPROCESS")
  453. genDef(Ep, EPROCESS, DebugPort)
  454. genDef(Ep, EPROCESS, VdmObjects)
  455. //
  456. // Define machine type (temporarily)
  457. //
  458. EnableInc (HAL386)
  459. genCom("Machine type definitions (Temporarily)")
  460. genNam(MACHINE_TYPE_ISA)
  461. genNam(MACHINE_TYPE_EISA)
  462. genNam(MACHINE_TYPE_MCA)
  463. DisableInc (HAL386)
  464. genCom("KeFeatureBits defines")
  465. genNam(KF_V86_VIS)
  466. genNam(KF_RDTSC)
  467. genNam(KF_CR4)
  468. genNam(KF_GLOBAL_PAGE)
  469. genNam(KF_LARGE_PAGE)
  470. genNam(KF_CMPXCHG8B)
  471. genNam(KF_FAST_SYSCALL)
  472. EnableInc (HAL386)
  473. genCom("LoaderParameterBlock offsets relative to base")
  474. genDef(Lpb, LOADER_PARAMETER_BLOCK, LoadOrderListHead)
  475. genDef(Lpb, LOADER_PARAMETER_BLOCK, MemoryDescriptorListHead)
  476. genDef(Lpb, LOADER_PARAMETER_BLOCK, KernelStack)
  477. genDef(Lpb, LOADER_PARAMETER_BLOCK, Prcb)
  478. genDef(Lpb, LOADER_PARAMETER_BLOCK, Process)
  479. genDef(Lpb, LOADER_PARAMETER_BLOCK, Thread)
  480. genAlt(LpbI386, LOADER_PARAMETER_BLOCK, u.I386)
  481. genDef(Lpb, LOADER_PARAMETER_BLOCK, RegistryLength)
  482. genDef(Lpb, LOADER_PARAMETER_BLOCK, RegistryBase)
  483. genDef(Lpb, LOADER_PARAMETER_BLOCK, ConfigurationRoot)
  484. genDef(Lpb, LOADER_PARAMETER_BLOCK, ArcBootDeviceName)
  485. genDef(Lpb, LOADER_PARAMETER_BLOCK, ArcHalDeviceName)
  486. DisableInc (HAL386)
  487. genNam(PAGE_SIZE)
  488. //
  489. // Define the VDM instruction emulation count indexes
  490. //
  491. genCom("VDM equates.")
  492. genNam(VDM_INDEX_Invalid)
  493. genNam(VDM_INDEX_0F)
  494. genNam(VDM_INDEX_ESPrefix)
  495. genNam(VDM_INDEX_CSPrefix)
  496. genNam(VDM_INDEX_SSPrefix)
  497. genNam(VDM_INDEX_DSPrefix)
  498. genNam(VDM_INDEX_FSPrefix)
  499. genNam(VDM_INDEX_GSPrefix)
  500. genNam(VDM_INDEX_OPER32Prefix)
  501. genNam(VDM_INDEX_ADDR32Prefix)
  502. genNam(VDM_INDEX_INSB)
  503. genNam(VDM_INDEX_INSW)
  504. genNam(VDM_INDEX_OUTSB)
  505. genNam(VDM_INDEX_OUTSW)
  506. genNam(VDM_INDEX_PUSHF)
  507. genNam(VDM_INDEX_POPF)
  508. genNam(VDM_INDEX_INTnn)
  509. genNam(VDM_INDEX_INTO)
  510. genNam(VDM_INDEX_IRET)
  511. genNam(VDM_INDEX_NPX)
  512. genNam(VDM_INDEX_INBimm)
  513. genNam(VDM_INDEX_INWimm)
  514. genNam(VDM_INDEX_OUTBimm)
  515. genNam(VDM_INDEX_OUTWimm)
  516. genNam(VDM_INDEX_INB)
  517. genNam(VDM_INDEX_INW)
  518. genNam(VDM_INDEX_OUTB)
  519. genNam(VDM_INDEX_OUTW)
  520. genNam(VDM_INDEX_LOCKPrefix)
  521. genNam(VDM_INDEX_REPNEPrefix)
  522. genNam(VDM_INDEX_REPPrefix)
  523. genNam(VDM_INDEX_CLI)
  524. genNam(VDM_INDEX_STI)
  525. genNam(VDM_INDEX_HLT)
  526. genNam(MAX_VDM_INDEX)
  527. //
  528. // Vdm feature bits
  529. //
  530. genCom("VDM feature bits.")
  531. genNam(V86_VIRTUAL_INT_EXTENSIONS)
  532. genNam(PM_VIRTUAL_INT_EXTENSIONS)
  533. //
  534. // Selector type
  535. //
  536. genCom("Selector types.")
  537. genNam(SEL_TYPE_NP)
  538. //
  539. // Usermode callout frame
  540. //
  541. DisableInc (HAL386)
  542. genCom("Usermode callout frame definitions")
  543. genDef(Cu, KCALLOUT_FRAME, InStk)
  544. genDef(Cu, KCALLOUT_FRAME, TrFr)
  545. genDef(Cu, KCALLOUT_FRAME, CbStk)
  546. genDef(Cu, KCALLOUT_FRAME, Edi)
  547. genDef(Cu, KCALLOUT_FRAME, Esi)
  548. genDef(Cu, KCALLOUT_FRAME, Ebx)
  549. genDef(Cu, KCALLOUT_FRAME, Ebp)
  550. genDef(Cu, KCALLOUT_FRAME, Ret)
  551. genDef(Cu, KCALLOUT_FRAME, OutBf)
  552. genDef(Cu, KCALLOUT_FRAME, OutLn)
  553. //
  554. // VDM_PROCESS_OBJECTS
  555. //
  556. genCom("VDM_PROCESS_OBJECTS")
  557. genDef(Vp, VDM_PROCESS_OBJECTS, VdmTib)
  558. EnableInc (HAL386)
  559. END_LIST
  560. };