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.

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