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.

221 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. genvdmtb.m4
  5. Abstract:
  6. This module implements a source code which generates a source .obj
  7. for genxx.exe. This results in definitions for kernel structures that
  8. are accessed in x86 assembly.
  9. This version is preprocessed with M4, then compiled with the 386 compiler.
  10. To build, go to vdm\up and do "nmake UMAPPL=genvdmtb" to generate
  11. genvdmtb.obj. Then run "genxx -vdm" to create \nt\private\vdmtb.inc.
  12. Author:
  13. Bryan M. Willman (bryanwi) 16-Oct-90
  14. Revision History:
  15. Dave Hastings (daveh) 27-Mar-93
  16. Stolen from the ke directory to correct a maintinence problem
  17. Forrest Foltz (forrestf) 24-Jan-1998
  18. Modified format to use new obj-based procedure.
  19. --*/
  20. #include "crt\excpt.h"
  21. #include "crt\stdarg.h"
  22. #include "ntdef.h"
  23. #include "ntstatus.h"
  24. #include "ntkeapi.h"
  25. #include "nti386.h"
  26. #include "ntseapi.h"
  27. #include "ntobapi.h"
  28. #include "ntimage.h"
  29. #include "ntldr.h"
  30. #include "ntpsapi.h"
  31. #include "ntxcapi.h"
  32. #include "ntlpcapi.h"
  33. #include "ntioapi.h"
  34. #include "ntexapi.h"
  35. #include "ntmmapi.h"
  36. #include "ntnls.h"
  37. #include "ntrtl.h"
  38. #include "nturtl.h"
  39. #include "ntconfig.h"
  40. #include "ntcsrsrv.h"
  41. #include "ntdef.h"
  42. #include "vdm.h"
  43. #include "stdio.h"
  44. include(`..\..\ke\genxx.h')
  45. //
  46. // Element description array is here
  47. //
  48. STRUC_ELEMENT ElementList[] = {
  49. START_LIST
  50. genTxt("IFDEF NEC_98\n")
  51. genVal(FIXED_NTVDMSTATE_SEGMENT, 0x60)
  52. genTxt("else\n")
  53. genVal(FIXED_NTVDMSTATE_SEGMENT, 0x70)
  54. genTxt("endif\n")
  55. genNam(FIXED_NTVDMSTATE_OFFSET)
  56. genTxt("FIXED_NTVDMSTATE_LINEAR EQU ((FIXED_NTVDMSTATE_SEGMENT SHL 4 ) + FIXED_NTVDMSTATE_OFFSET)\n")
  57. genNam(FIXED_NTVDMSTATE_SIZE)
  58. genCom("VdmFlags")
  59. genNam(VDM_INT_HARDWARE)
  60. genNam(VDM_INT_TIMER)
  61. genNam(VDM_INTERRUPT_PENDING)
  62. genVal(VDM_INTS_HOOKED_IN_PM, 0x4)
  63. genNam(VDM_BREAK_EXCEPTIONS)
  64. genNam(VDM_BREAK_DEBUGGER)
  65. genNam(VDM_PROFILE)
  66. genNam(VDM_ANALYZE_PROFILE)
  67. genNam(VDM_TRACE_HISTORY)
  68. genNam(VDM_32BIT_APP)
  69. genVal(VDM_VIRTUAL_INTERRUPTS, EFLAGS_IF_MASK)
  70. genVal(VDM_VIRTUAL_AC, EFLAGS_AC_MASK)
  71. genVal(VDM_VIRTUAL_NT, EFLAGS_NT_MASK)
  72. genVal(MIPS_BIT_MASK, VDM_ON_MIPS)
  73. genNam(VDM_ON_MIPS)
  74. genNam(VDM_EXEC)
  75. genNam(VDM_RM)
  76. genNam(VDM_USE_DBG_VDMEVENT)
  77. genNam(VDM_WOWBLOCKED)
  78. genNam(VDM_IDLEACTIVITY)
  79. genNam(VDM_WOWHUNGAPP)
  80. genNam(VDM_PE_MASK)
  81. genCom("Interrupt handler flags")
  82. genNam(VDM_INT_INT_GATE)
  83. genNam(VDM_INT_TRAP_GATE)
  84. genNam(VDM_INT_32)
  85. genNam(VDM_INT_16)
  86. genNam(VDM_INT_HOOKED)
  87. genCom("EFlags values")
  88. genNam(EFLAGS_TF_MASK)
  89. genVal(EFLAGS_INTERRUPT_MASK, EFLAGS_IF_MASK)
  90. genVal(EFLAGS_IOPL_MASK, EFLAGS_PL_MASK)
  91. genNam(EFLAGS_NT_MASK)
  92. genCom("Selector Flags")
  93. genVal(SEL_TYPE_READ, 0x00000001)
  94. genVal(SEL_TYPE_WRITE, 0x00000002)
  95. genVal(SEL_TYPE_EXECUTE, 0x00000004)
  96. genVal(SEL_TYPE_BIG, 0x00000008)
  97. genVal(SEL_TYPE_ED, 0x00000010)
  98. genVal(SEL_TYPE_2GIG, 0x00000020)
  99. genCom("VdmEvent Enumerations")
  100. genNam(VdmIO)
  101. genNam(VdmStringIO)
  102. genNam(VdmMemAccess)
  103. genNam(VdmIntAck)
  104. genNam(VdmBop)
  105. genNam(VdmError)
  106. genNam(VdmIrq13)
  107. genNam(VdmMaxEvent)
  108. genCom("VdmTib offsets")
  109. genDef(Vt, VDM_TIB,MonitorContext)
  110. genDef(Vt, VDM_TIB,VdmContext)
  111. genAlt(VtInterruptTable, VDM_TIB, VdmInterruptTable)
  112. genAlt(VtFaultTable, VDM_TIB, VdmFaultTable)
  113. genDef(Vt, VDM_TIB,EventInfo)
  114. genVal(VtEIEvent,
  115. OFFSET(VDM_TIB,EventInfo) + OFFSET(VDMEVENTINFO,Event))
  116. genVal(VtEIInstSize,
  117. OFFSET(VDM_TIB,EventInfo) + OFFSET(VDMEVENTINFO,InstructionSize))
  118. genVal(VtEIBopNumber,
  119. OFFSET(VDM_TIB,EventInfo) + OFFSET(VDMEVENTINFO, BopNumber))
  120. genVal(VtEIIntAckInfo,
  121. OFFSET(VDM_TIB,EventInfo) + OFFSET(VDMEVENTINFO, IntAckInfo))
  122. genDef(Vt, VDM_TIB,DpmiInfo)
  123. genDef(Ei, VDMEVENTINFO,Event)
  124. genDef(Ei, VDMEVENTINFO,InstructionSize)
  125. genDef(Ei, VDMEVENTINFO,BopNumber)
  126. genDef(Ei, VDMEVENTINFO,IntAckInfo)
  127. genCom("WOW TD offsets")
  128. genVal(WtdFastWowEsp, 0x8)
  129. genCom("VdmInterrupHandler offsets")
  130. genDef(Vi, VDM_INTERRUPTHANDLER,CsSelector)
  131. genDef(Vi, VDM_INTERRUPTHANDLER,Eip)
  132. genDef(Vi, VDM_INTERRUPTHANDLER,Flags)
  133. genVal(VDM_INTERRUPT_HANDLER_SIZE, sizeof(VDM_INTERRUPTHANDLER))
  134. genCom("VdmFaultHandler offsets")
  135. genDef(Vf, VDM_FAULTHANDLER,CsSelector)
  136. genDef(Vf, VDM_FAULTHANDLER,Eip)
  137. genDef(Vf, VDM_FAULTHANDLER,SsSelector)
  138. genDef(Vf, VDM_FAULTHANDLER,Esp)
  139. genDef(Vf, VDM_FAULTHANDLER,Flags)
  140. genVal(VDM_FAULT_HANDLER_SIZE, sizeof(VDM_FAULTHANDLER))
  141. genCom("VdmDpmiInfo offsets")
  142. genDef(Vp, VDM_DPMIINFO,LockCount)
  143. genDef(Vp, VDM_DPMIINFO,Flags)
  144. genDef(Vp, VDM_DPMIINFO,SsSelector)
  145. genDef(Vp, VDM_DPMIINFO,SaveSsSelector)
  146. genDef(Vp, VDM_DPMIINFO,SaveEsp)
  147. genDef(Vp, VDM_DPMIINFO,SaveEip)
  148. genDef(Vp, VDM_DPMIINFO,DosxIntIret)
  149. genDef(Vp, VDM_DPMIINFO,DosxIntIretD)
  150. genDef(Vp, VDM_DPMIINFO,DosxFaultIret)
  151. genDef(Vp, VDM_DPMIINFO,DosxFaultIretD)
  152. genDef(Vp, VDM_DPMIINFO,DosxRmReflector)
  153. genCom("VdmTrace codes")
  154. genNam(VDMTR_KERNEL_OP_PM)
  155. genNam(VDMTR_KERNEL_OP_V86)
  156. genNam(VDMTR_KERNEL_HW_INT)
  157. genCom("Misc defines")
  158. genVal(DBG_SINGLESTEP, 0x5)
  159. genVal(DBG_BREAK, 0x6)
  160. genVal(DBG_GPFAULT, 0x7)
  161. genVal(DBG_STACKFAULT, 0x10)
  162. genVal(STATUS_VDM_EVENT, 0x40000005)
  163. END_LIST
  164. };