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.

129 lines
3.3 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Debug engine Ioctls for extending EXDI.
  4. // Covers:
  5. // Read/write MSRs.
  6. // Multiprocessor description and control.
  7. // Determination of what breakpoint was hit for hrBp.
  8. //
  9. //----------------------------------------------------------------------------
  10. #ifndef __DBGENG_EXDI_IO_H__
  11. #define __DBGENG_EXDI_IO_H__
  12. //
  13. // Specific Ioctl operations.
  14. // All Ioctl structures must have the Ioctl code as the first member.
  15. //
  16. typedef enum
  17. {
  18. // Marker for the beginning of the enum. Start at
  19. // a value other than zero to prevent obvious collisions
  20. // with other Ioctl codes.
  21. DBGENG_EXDI_IOC_BEFORE_FIRST = 0x8664,
  22. DBGENG_EXDI_IOC_IDENTIFY,
  23. DBGENG_EXDI_IOC_READ_MSR,
  24. DBGENG_EXDI_IOC_WRITE_MSR,
  25. DBGENG_EXDI_IOC_IDENTIFY_PROCESSORS,
  26. DBGENG_EXDI_IOC_GET_CURRENT_PROCESSOR,
  27. DBGENG_EXDI_IOC_SET_CURRENT_PROCESSOR,
  28. DBGENG_EXDI_IOC_GET_BREAKPOINT_HIT,
  29. // Marker for the end of the enum.
  30. DBGENG_EXDI_IOC_AFTER_LAST
  31. } DBGENG_EXDI_IOCTL_CODE;
  32. //
  33. // Basic Ioctl containing only a code for the Ioctl input.
  34. //
  35. typedef struct _DBGENG_EXDI_IOCTL_BASE_IN
  36. {
  37. DBGENG_EXDI_IOCTL_CODE Code;
  38. } DBGENG_EXDI_IOCTL_BASE_IN;
  39. //
  40. // IDENTIFY - Verify and describe Ioctl support.
  41. //
  42. #define DBGENG_EXDI_IOCTL_IDENTIFY_SIGNATURE '468E'
  43. typedef struct _DBGENG_EXDI_IOCTL_IDENTIFY_OUT
  44. {
  45. ULONG Signature;
  46. DBGENG_EXDI_IOCTL_CODE BeforeFirst;
  47. DBGENG_EXDI_IOCTL_CODE AfterLast;
  48. } DBGENG_EXDI_IOCTL_IDENTIFY_OUT;
  49. //
  50. // {READ|WRITE}_MSR - Access processor MSRs.
  51. //
  52. // Input structure is used for both read and write.
  53. typedef struct _DBGENG_EXDI_IOCTL_MSR_IN
  54. {
  55. DBGENG_EXDI_IOCTL_CODE Code;
  56. ULONG Index;
  57. // Value is only used for write.
  58. ULONG64 Value;
  59. } DBGENG_EXDI_IOCTL_MSR_IN;
  60. typedef struct _DBGENG_EXDI_IOCTL_READ_MSR_OUT
  61. {
  62. ULONG64 Value;
  63. } DBGENG_EXDI_IOCTL_READ_MSR_OUT;
  64. //
  65. // Multiprocessor support. Basic EXDI doesn't support
  66. // multiprocessor machines so add Ioctls to query and
  67. // control a "current" processor that the EXDI methods
  68. // apply to.
  69. //
  70. //
  71. // IDENTIFY_PROCESSORS - Used to query the processor configuration.
  72. // Currently only the count is used. Other fields are zeroed.
  73. //
  74. typedef struct _DBGENG_EXDI_IOCTL_IDENTIFY_PROCESSORS_OUT
  75. {
  76. ULONG Flags;
  77. ULONG NumberProcessors;
  78. ULONG64 Reserved[7];
  79. } DBGENG_EXDI_IOCTL_IDENTIFY_PROCESSORS_OUT;
  80. //
  81. // {GET|SET}_CURRENT_PROCESSOR - Current processor control.
  82. //
  83. typedef struct _DBGENG_EXDI_IOCTL_GET_CURRENT_PROCESSOR_OUT
  84. {
  85. ULONG Processor;
  86. } DBGENG_EXDI_IOCTL_GET_CURRENT_PROCESSOR_OUT;
  87. typedef struct _DBGENG_EXDI_IOCTL_SET_CURRENT_PROCESSOR_IN
  88. {
  89. DBGENG_EXDI_IOCTL_CODE Code;
  90. ULONG Processor;
  91. } DBGENG_EXDI_IOCTL_SET_CURRENT_PROCESSOR_IN;
  92. //
  93. // GET_BREAKPOINT_HIT - Determine which breakpoint was hit
  94. // after a breakpoint halt reason.
  95. //
  96. #define DBGENG_EXDI_IOCTL_BREAKPOINT_NONE 0
  97. #define DBGENG_EXDI_IOCTL_BREAKPOINT_CODE 1
  98. #define DBGENG_EXDI_IOCTL_BREAKPOINT_DATA 2
  99. typedef struct _DBGENG_EXDI_IOCTL_GET_BREAKPOINT_HIT_OUT
  100. {
  101. ADDRESS_TYPE Address;
  102. ULONG AccessWidth;
  103. DATA_ACCESS_TYPE AccessType;
  104. ULONG Type;
  105. } DBGENG_EXDI_IOCTL_GET_BREAKPOINT_HIT_OUT, *PDBGENG_EXDI_IOCTL_GET_BREAKPOINT_HIT_OUT;
  106. #endif // #ifndef __DBGENG_EXDI_IO_H__