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.

236 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. kd1394.h
  5. Abstract:
  6. 1394 Kernel Debugger DLL
  7. Author:
  8. Peter Binder (pbinder)
  9. Revision History:
  10. Date Who What
  11. ---------- --------- ------------------------------------------------------------
  12. 06/21/2001 pbinder having fun...
  13. --*/
  14. //
  15. // boot.ini parameters
  16. //
  17. #define BUSPARAMETERS_OPTION "BUSPARAMS"
  18. #define CHANNEL_OPTION "CHANNEL"
  19. #define BUS_OPTION "NOBUS"
  20. // global 1394 debug controller data
  21. #define DBG_BUS1394_CROM_BUFFER_SIZE 64
  22. #define TIMEOUT_COUNT 1024*500
  23. #define MAX_REGISTER_READS 400000
  24. typedef struct _DEBUG_1394_DATA {
  25. //
  26. // our config rom - must be 1k aligned
  27. //
  28. ULONG CromBuffer[DBG_BUS1394_CROM_BUFFER_SIZE];
  29. //
  30. // our ohci register map
  31. //
  32. POHCI_REGISTER_MAP BaseAddress;
  33. //
  34. // our config for this session
  35. //
  36. DEBUG_1394_CONFIG Config;
  37. //
  38. // our send packet (isoch packet)
  39. //
  40. DEBUG_1394_SEND_PACKET SendPacket;
  41. //
  42. // our receive packet
  43. //
  44. DEBUG_1394_RECEIVE_PACKET ReceivePacket;
  45. } DEBUG_1394_DATA, *PDEBUG_1394_DATA;
  46. //
  47. // Debug 1394 Parameters
  48. //
  49. typedef struct _DEBUG_1394_PARAMETERS {
  50. //
  51. // device descriptor (pci slot, bus, etc)
  52. //
  53. DEBUG_DEVICE_DESCRIPTOR DbgDeviceDescriptor;
  54. //
  55. // is the debugger active?
  56. //
  57. BOOLEAN DebuggerActive;
  58. //
  59. // should we disable 1394bus?
  60. //
  61. ULONG NoBus;
  62. //
  63. // Id for this target
  64. //
  65. ULONG Id;
  66. } DEBUG_1394_PARAMETERS, *PDEBUG_1394_PARAMETERS;
  67. //
  68. // Global Data Structures
  69. //
  70. #ifdef _KD1394_C
  71. DEBUG_1394_PARAMETERS Kd1394Parameters;
  72. PDEBUG_1394_DATA Kd1394Data;
  73. #else
  74. extern DEBUG_1394_PARAMETERS Kd1394Parameters;
  75. extern PDEBUG_1394_DATA Kd1394Data;
  76. #endif
  77. //
  78. // kd1394.c
  79. //
  80. BOOLEAN
  81. Kd1394pInitialize(
  82. IN PDEBUG_1394_PARAMETERS DebugParameters,
  83. IN PLOADER_PARAMETER_BLOCK LoaderBlock
  84. );
  85. NTSTATUS
  86. KdD0Transition(
  87. void
  88. );
  89. NTSTATUS
  90. KdD3Transition(
  91. void
  92. );
  93. NTSTATUS
  94. KdDebuggerInitialize0(
  95. IN PLOADER_PARAMETER_BLOCK LoaderBlock
  96. );
  97. NTSTATUS
  98. KdDebuggerInitialize1(
  99. IN PLOADER_PARAMETER_BLOCK LoaderBlock
  100. );
  101. NTSTATUS
  102. KdSave(
  103. IN BOOLEAN KdSleepTransition
  104. );
  105. NTSTATUS
  106. KdRestore(
  107. IN BOOLEAN KdSleepTransition
  108. );
  109. //
  110. // kd1394io.c
  111. //
  112. ULONG
  113. KdpComputeChecksum(
  114. IN PUCHAR Buffer,
  115. IN ULONG Length
  116. );
  117. void
  118. KdpSendControlPacket(
  119. IN USHORT PacketType,
  120. IN ULONG PacketId OPTIONAL
  121. );
  122. ULONG
  123. KdReceivePacket (
  124. IN ULONG PacketType,
  125. OUT PSTRING MessageHeader,
  126. OUT PSTRING MessageData,
  127. OUT PULONG DataLength,
  128. IN OUT PKD_CONTEXT KdContext
  129. );
  130. void
  131. KdSendPacket(
  132. IN ULONG PacketType,
  133. IN PSTRING MessageHeader,
  134. IN PSTRING MessageData OPTIONAL,
  135. IN OUT PKD_CONTEXT KdContext
  136. );
  137. //
  138. // ohci1394.c
  139. //
  140. ULONG
  141. FASTCALL
  142. Dbg1394_ByteSwap(
  143. IN ULONG Source
  144. );
  145. ULONG
  146. Dbg1394_CalculateCrc(
  147. IN PULONG Quadlet,
  148. IN ULONG length
  149. );
  150. ULONG
  151. Dbg1394_Crc16(
  152. IN ULONG data,
  153. IN ULONG check
  154. );
  155. NTSTATUS
  156. Dbg1394_ReadPhyRegister(
  157. PDEBUG_1394_DATA DebugData,
  158. ULONG Offset,
  159. PUCHAR pData
  160. );
  161. NTSTATUS
  162. Dbg1394_WritePhyRegister(
  163. PDEBUG_1394_DATA DebugData,
  164. ULONG Offset,
  165. UCHAR Data
  166. );
  167. BOOLEAN
  168. Dbg1394_InitializeController(
  169. IN PDEBUG_1394_DATA DebugData,
  170. IN PDEBUG_1394_PARAMETERS DebugParameters
  171. );
  172. ULONG
  173. Dbg1394_StallExecution(
  174. ULONG LoopCount
  175. );
  176. void
  177. Dbg1394_EnablePhysicalAccess(
  178. IN PDEBUG_1394_DATA DebugData
  179. );
  180. ULONG
  181. Dbg1394_ReadPacket(
  182. PDEBUG_1394_DATA DebugData,
  183. OUT PKD_PACKET PacketHeader,
  184. OUT PSTRING MessageHeader,
  185. OUT PSTRING MessageData,
  186. BOOLEAN Wait
  187. );