Advertisement
BaSs_HaXoR

Ps3tmapi.h (PS3TMAPI Header)

Nov 9th, 2014
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 475.27 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////////////////
  2. ///
  3. ///      Copyright (C) 2011, Sony Computer Entertainment Inc. / SN Systems Limited.
  4. ///
  5. ///  @file      ps3tmapi.h
  6. ///  @brief     Target Manager SDK for Sony PlayStation3.
  7. ///  @author    support@snsys.com
  8. ///  @date      21/03/11
  9. ///
  10. //////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifndef PS3TMAPI_H_INC
  13. #define PS3TMAPI_H_INC
  14.  
  15. #include "APIBase.h" // Include platform generic definitions.
  16. #include "APIUtf8.h"
  17. #include "time.h"
  18.  
  19. #if defined __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23.  
  24. #pragma warning(disable : 4200)         // nonstandard extension used : zero-sized array in struct/union
  25.  
  26. //////////////////////////////////////////////////////////////////////////////
  27. /// @enum       ESNPS3UNIT
  28. ///     @brief  Identifies the different units on the target. Used by any function
  29. ///                     which specifies a unit.
  30. //////////////////////////////////////////////////////////////////////////////
  31.  
  32. typedef enum ESNPS3UNIT {
  33.         /// Main PPU unit.
  34.         PS3_UI_CPU = 0,
  35.         /// SPU Unit.
  36.         PS3_UI_SPU,
  37.         /// Raw SPU Unit.
  38.         PS3_UI_SPU_RAW,
  39.         /// Not a type, just used for counts.
  40.         PS3_UI_NUM_TYPES
  41. } ESNPS3UNIT;
  42.  
  43. //////////////////////////////////////////////////////////////////////////////
  44. /// @enum       ESNPS3MEMSPACE
  45. ///     @brief  Identifies the different memory spaces on the target.
  46. //////////////////////////////////////////////////////////////////////////////
  47.  
  48. typedef enum ESNPS3MEMSPACE {
  49.         // Main memory space.
  50.         PS3_MEMSPACE_MAIN = 0,
  51. } ESNPS3MEMSPACE;
  52.  
  53. // @name <LoadFlags>
  54. //@{
  55. //! Load flag.
  56. const UINT32 SNPS3_LOAD_FLAG_ENABLE_DEBUGGING           = 0x00000001;
  57. const UINT32 SNPS3_LOAD_FLAG_USE_ELF_PRIORITY           = 0x00000100;
  58. const UINT32 SNPS3_LOAD_FLAG_USE_ELF_STACKSIZE  = 0x00000200;
  59. const UINT32 SNPS3_LOAD_FLAG_WAIT_BD_MOUNTED            = 0x00002000;
  60. const UINT32 SNPS3_LOAD_FLAG_PPU_NOT_DEBUG              = 0x00010000;
  61. const UINT32 SNPS3_LOAD_FLAG_SPU_NOT_DEBUG              = 0x00020000;
  62. const UINT32 SNPS3_LOAD_FLAG_IGNORE_DEFAULTS            = 0x80000000;
  63. //! Use ELF directory when fileserving PARAM.SFO.
  64. const UINT32 SNPS3_PROCESS_LOAD_FLAG_PARAMSFO_USEELFDIR         = 0x00100000;
  65. //! Use custom directory when fileserving PARAM.SFO. Set directory with SNPS3SetCustomParamSFOMappingDirectory().
  66. const UINT32 SNPS3_PROCESS_LOAD_FLAG_PARAMSFO_USECUSTOMDIR      = 0x00200000;  
  67. //@}
  68.  
  69. // @name <ExtraLoadFlags>
  70. //@{
  71. //! Extra load flag (XLF).
  72. const UINT64 SNPS3_XLF_ENABLE_LV2_EXCEPTION_HANDLER             = 0x01;
  73. const UINT64 SNPS3_XLF_ENABLE_REMOTE_PLAY                               = 0x02;
  74. const UINT64 SNPS3_XLF_ENABLE_GCM_DEBUG                                 = 0x04;
  75. const UINT64 SNPS3_XLF_LOAD_LIBPROF_SPRX_AUTOMATICALLY  = 0x08;
  76. const UINT64 SNPS3_XLF_ENABLE_CORE_DUMP                                 = 0x10;
  77. const UINT64 SNPS3_XLF_ENABLE_ACC_FOR_REMOTE_PLAY               = 0x20;
  78. const UINT64 SNPS3_XLF_ENABLE_HUD_RSX_TOOLS                             = 0x40;
  79. const UINT64 SNPS3_XLF_ENABLE_MAT                                               = 0x80;
  80. const UINT64 SNPS3_XLF_ENABLE_MISC_SETTINGS                             = 0x8000000000000000;
  81. const UINT64 SNPS3_XLF_GAME_ATTRIBUTE_INVITE_MESSAGE    = 0x100;
  82. const UINT64 SNPS3_XLF_GAME_ATTRIBUTE_CUSTOM_MESSAGE    = 0x200;
  83. const UINT64 SNPS3_XLF_LOADING_PATCH                                    = 0x1000;
  84. const UINT64 SNPS3_XLF_ENABLE_M4HD_FOR_REMOTE_PLAY              = 0x2000;
  85. //@}
  86.  
  87. // @name <ExtraLoadFlagMasks>
  88. //@{
  89. //! Extra load flag (XLF) mask.
  90. const UINT64 SNPS3_XLF_GAME_ATTRIBUTE_MESSAGE_MASK              = 0xF00;
  91. const UINT64 SNPS3_XLF_ALL_FLAG_MASK                                    = SNPS3_XLF_ENABLE_LV2_EXCEPTION_HANDLER | SNPS3_XLF_ENABLE_REMOTE_PLAY | SNPS3_XLF_ENABLE_GCM_DEBUG |
  92.                                                                                                                         SNPS3_XLF_LOAD_LIBPROF_SPRX_AUTOMATICALLY | SNPS3_XLF_ENABLE_CORE_DUMP | SNPS3_XLF_ENABLE_ACC_FOR_REMOTE_PLAY |
  93. SNPS3_XLF_ENABLE_MISC_SETTINGS | SNPS3_XLF_ENABLE_HUD_RSX_TOOLS | SNPS3_XLF_ENABLE_MAT | SNPS3_XLF_GAME_ATTRIBUTE_MESSAGE_MASK |SNPS3_XLF_LOADING_PATCH | SNPS3_XLF_ENABLE_M4HD_FOR_REMOTE_PLAY;
  94. //! Extra load flag (XLF) mask - backward compatibility.
  95. const UINT64 SNPS3_XLF_OVERRIDE_TV_GUI_MASK                             = SNPS3_XLF_ENABLE_MISC_SETTINGS;
  96. //@}
  97.  
  98. // @name <StackSizes>
  99. //@{
  100. //! Stack size value.
  101. const UINT32 SNPS3_ELF_STACK_SIZE_32K           = 0x00000020;           // 32 KBytes.
  102. const UINT32 SNPS3_ELF_STACK_SIZE_64K           = 0x00000040;           // 64 KBytes (default).
  103. const UINT32 SNPS3_ELF_STACK_SIZE_96K           = 0x00000060;           // 96 KBytes.
  104. const UINT32 SNPS3_ELF_STACK_SIZE_128K          = 0x00000080;           // 128 KBytes.
  105. const UINT32 SNPS3_ELF_STACK_SIZE_256K          = 0x00000100;           // 256 KBytes.
  106. const UINT32 SNPS3_ELF_STACK_SIZE_512K          = 0x00000200;           // 512 KBytes.
  107. const UINT32 SNPS3_ELF_STACK_SIZE_1024K         = 0x00000400;           // 1024 KBytes.
  108. const UINT32 SNPS3_ELF_STACK_SIZE_DEFAULT       = SNPS3_ELF_STACK_SIZE_64K;
  109. //@}
  110.  
  111. // @name <RsxFlags>
  112. //@{
  113. //! RSX flag.
  114. const UINT64 SNPS3_HUD_RSX_USE_RSX_PROFILING_TOOLS = 0x01;
  115. const UINT64 SNPS3_HUD_RSX_USE_FULL_HUD_FEATURES = 0x02;
  116. //@}
  117.  
  118. // @name <VramFlags>
  119. //@{
  120. //! VRAM flag.
  121. const UINT64 SNPS3_ENABLE_VRAM_CAPTURE = 0x01;
  122. //@}
  123.  
  124. // @name <SdkVersionMacros>
  125. //@{
  126. //! SDK Version macro.
  127. #define SNPS3_GET_SDK_VER_MAJOR(v)      ((v>>16)&0xff)
  128. #define SNPS3_GET_SDK_VER_MINOR(v)      ((v>>8)&0xff)
  129. #define SNPS3_GET_SDK_VER_FIX(v)        (v&0xff)
  130. //@}
  131.  
  132. //////////////////////////////////////////////////////////////////////////////
  133. // PPU Register Definitions.
  134. //////////////////////////////////////////////////////////////////////////////
  135.  
  136. //! All registers are abstracted by the comms to size SNPS3_REGLEN.
  137. // The user must translate these registers to the correct size.
  138. #define SNPS3_REGLEN                    (16)
  139.  
  140. // @name <PpuGeneralPurposeRegisters>
  141. //@{
  142. //! PPU general purpose register.
  143. #define SNPS3_gpr_0                             0x00
  144. #define SNPS3_gpr_1                             0x01
  145. #define SNPS3_gpr_2                             0x02
  146. #define SNPS3_gpr_3                             0x03
  147. #define SNPS3_gpr_4                             0x04
  148. #define SNPS3_gpr_5                             0x05
  149. #define SNPS3_gpr_6                             0x06
  150. #define SNPS3_gpr_7                             0x07
  151. #define SNPS3_gpr_8                             0x08
  152. #define SNPS3_gpr_9                             0x09
  153. #define SNPS3_gpr_10                    0x0a
  154. #define SNPS3_gpr_11                    0x0b
  155. #define SNPS3_gpr_12                    0x0c
  156. #define SNPS3_gpr_13                    0x0d
  157. #define SNPS3_gpr_14                    0x0e
  158. #define SNPS3_gpr_15                    0x0f
  159. #define SNPS3_gpr_16                    0x10
  160. #define SNPS3_gpr_17                    0x11
  161. #define SNPS3_gpr_18                    0x12
  162. #define SNPS3_gpr_19                    0x13
  163. #define SNPS3_gpr_20                    0x14
  164. #define SNPS3_gpr_21                    0x15
  165. #define SNPS3_gpr_22                    0x16
  166. #define SNPS3_gpr_23                    0x17
  167. #define SNPS3_gpr_24                    0x18
  168. #define SNPS3_gpr_25                    0x19
  169. #define SNPS3_gpr_26                    0x1a
  170. #define SNPS3_gpr_27                    0x1b
  171. #define SNPS3_gpr_28                    0x1c
  172. #define SNPS3_gpr_29                    0x1d
  173. #define SNPS3_gpr_30                    0x1e
  174. #define SNPS3_gpr_31                    0x1f
  175. //@}
  176.  
  177. // @name <PpuFloatingPointRegisters>
  178. //@{
  179. //! PPU floating point register.
  180. #define SNPS3_fpr_0                             0x20
  181. #define SNPS3_fpr_1                             0x21
  182. #define SNPS3_fpr_2                             0x22
  183. #define SNPS3_fpr_3                             0x23
  184. #define SNPS3_fpr_4                             0x24
  185. #define SNPS3_fpr_5                             0x25
  186. #define SNPS3_fpr_6                             0x26
  187. #define SNPS3_fpr_7                             0x27
  188. #define SNPS3_fpr_8                             0x28
  189. #define SNPS3_fpr_9                             0x29
  190. #define SNPS3_fpr_10                    0x2A
  191. #define SNPS3_fpr_11                    0x2B
  192. #define SNPS3_fpr_12                    0x2C
  193. #define SNPS3_fpr_13                    0x2D
  194. #define SNPS3_fpr_14                    0x2E
  195. #define SNPS3_fpr_15                    0x2F
  196. #define SNPS3_fpr_16                    0x30
  197. #define SNPS3_fpr_17                    0x31
  198. #define SNPS3_fpr_18                    0x32
  199. #define SNPS3_fpr_19                    0x33
  200. #define SNPS3_fpr_20                    0x34
  201. #define SNPS3_fpr_21                    0x35
  202. #define SNPS3_fpr_22                    0x36
  203. #define SNPS3_fpr_23                    0x37
  204. #define SNPS3_fpr_24                    0x38
  205. #define SNPS3_fpr_25                    0x39
  206. #define SNPS3_fpr_26                    0x3A
  207. #define SNPS3_fpr_27                    0x3B
  208. #define SNPS3_fpr_28                    0x3C
  209. #define SNPS3_fpr_29                    0x3D
  210. #define SNPS3_fpr_30                    0x3E
  211. #define SNPS3_fpr_31                    0x3F
  212. //@}
  213.  
  214. // @name <PpuRegisters>
  215. //@{
  216. //! PPU register.
  217. #define SNPS3_pc                                0x40
  218. #define SNPS3_cr                                0x41
  219. #define SNPS3_lr                                0x42
  220. #define SNPS3_ctr                               0x43
  221. #define SNPS3_xer                               0x44
  222. #define SNPS3_fpscr                             0x45
  223. #define SNPS3_vscr                              0x46
  224. #define SNPS3_vrsave                    0x47
  225. #define SNPS3_msr                               0x48
  226.  
  227. #define SNPS3_vmx_0                             0x60
  228. #define SNPS3_vmx_1                             0x61
  229. #define SNPS3_vmx_2                             0x62
  230. #define SNPS3_vmx_3                             0x63
  231. #define SNPS3_vmx_4                             0x64
  232. #define SNPS3_vmx_5                             0x65
  233. #define SNPS3_vmx_6                             0x66
  234. #define SNPS3_vmx_7                             0x67
  235. #define SNPS3_vmx_8                             0x68
  236. #define SNPS3_vmx_9                             0x69
  237. #define SNPS3_vmx_10                    0x6A
  238. #define SNPS3_vmx_11                    0x6B
  239. #define SNPS3_vmx_12                    0x6C
  240. #define SNPS3_vmx_13                    0x6D
  241. #define SNPS3_vmx_14                    0x6E
  242. #define SNPS3_vmx_15                    0x6F
  243. #define SNPS3_vmx_16                    0x70
  244. #define SNPS3_vmx_17                    0x71
  245. #define SNPS3_vmx_18                    0x72
  246. #define SNPS3_vmx_19                    0x73
  247. #define SNPS3_vmx_20                    0x74
  248. #define SNPS3_vmx_21                    0x75
  249. #define SNPS3_vmx_22                    0x76
  250. #define SNPS3_vmx_23                    0x77
  251. #define SNPS3_vmx_24                    0x78
  252. #define SNPS3_vmx_25                    0x79
  253. #define SNPS3_vmx_26                    0x7A
  254. #define SNPS3_vmx_27                    0x7B
  255. #define SNPS3_vmx_28                    0x7C
  256. #define SNPS3_vmx_29                    0x7D
  257. #define SNPS3_vmx_30                    0x7E
  258. #define SNPS3_vmx_31                    0x7F
  259. //@}
  260.  
  261. //////////////////////////////////////////////////////////////////////////////
  262. // SPU Register Definitions
  263. //////////////////////////////////////////////////////////////////////////////
  264.  
  265. // @name <SpuGeneralPurposeRegisters>
  266. //@{
  267. //! SPU general purpose register.
  268. #define SNPS3_spu_gpr_0                 0x00
  269. #define SNPS3_spu_gpr_1                 0x01
  270. #define SNPS3_spu_gpr_2                 0x02
  271. #define SNPS3_spu_gpr_3                 0x03
  272. #define SNPS3_spu_gpr_4                 0x04
  273. #define SNPS3_spu_gpr_5                 0x05
  274. #define SNPS3_spu_gpr_6                 0x06
  275. #define SNPS3_spu_gpr_7                 0x07
  276. #define SNPS3_spu_gpr_8                 0x08
  277. #define SNPS3_spu_gpr_9                 0x09
  278. #define SNPS3_spu_gpr_10                0x0a
  279. #define SNPS3_spu_gpr_11                0x0b
  280. #define SNPS3_spu_gpr_12                0x0c
  281. #define SNPS3_spu_gpr_13                0x0d
  282. #define SNPS3_spu_gpr_14                0x0e
  283. #define SNPS3_spu_gpr_15                0x0f
  284. #define SNPS3_spu_gpr_16                0x10
  285. #define SNPS3_spu_gpr_17                0x11
  286. #define SNPS3_spu_gpr_18                0x12
  287. #define SNPS3_spu_gpr_19                0x13
  288. #define SNPS3_spu_gpr_20                0x14
  289. #define SNPS3_spu_gpr_21                0x15
  290. #define SNPS3_spu_gpr_22                0x16
  291. #define SNPS3_spu_gpr_23                0x17
  292. #define SNPS3_spu_gpr_24                0x18
  293. #define SNPS3_spu_gpr_25                0x19
  294. #define SNPS3_spu_gpr_26                0x1a
  295. #define SNPS3_spu_gpr_27                0x1b
  296. #define SNPS3_spu_gpr_28                0x1c
  297. #define SNPS3_spu_gpr_29                0x1d
  298. #define SNPS3_spu_gpr_30                0x1e
  299. #define SNPS3_spu_gpr_31                0x1f
  300.  
  301. #define SNPS3_spu_gpr_32                0x20
  302. #define SNPS3_spu_gpr_33                0x21
  303. #define SNPS3_spu_gpr_34                0x22
  304. #define SNPS3_spu_gpr_35                0x23
  305. #define SNPS3_spu_gpr_36                0x24
  306. #define SNPS3_spu_gpr_37                0x25
  307. #define SNPS3_spu_gpr_38                0x26
  308. #define SNPS3_spu_gpr_39                0x27
  309. #define SNPS3_spu_gpr_40                0x28
  310. #define SNPS3_spu_gpr_41                0x29
  311. #define SNPS3_spu_gpr_42                0x2a
  312. #define SNPS3_spu_gpr_43                0x2b
  313. #define SNPS3_spu_gpr_44                0x2c
  314. #define SNPS3_spu_gpr_45                0x2d
  315. #define SNPS3_spu_gpr_46                0x2e
  316. #define SNPS3_spu_gpr_47                0x2f
  317. #define SNPS3_spu_gpr_48                0x30
  318. #define SNPS3_spu_gpr_49                0x31
  319. #define SNPS3_spu_gpr_50                0x32
  320. #define SNPS3_spu_gpr_51                0x33
  321. #define SNPS3_spu_gpr_52                0x34
  322. #define SNPS3_spu_gpr_53                0x35
  323. #define SNPS3_spu_gpr_54                0x36
  324. #define SNPS3_spu_gpr_55                0x37
  325. #define SNPS3_spu_gpr_56                0x38
  326. #define SNPS3_spu_gpr_57                0x39
  327. #define SNPS3_spu_gpr_58                0x3a
  328. #define SNPS3_spu_gpr_59                0x3b
  329. #define SNPS3_spu_gpr_60                0x3c
  330. #define SNPS3_spu_gpr_61                0x3d
  331. #define SNPS3_spu_gpr_62                0x3e
  332. #define SNPS3_spu_gpr_63                0x3f
  333.  
  334. #define SNPS3_spu_gpr_64                0x40
  335. #define SNPS3_spu_gpr_65                0x41
  336. #define SNPS3_spu_gpr_66                0x42
  337. #define SNPS3_spu_gpr_67                0x43
  338. #define SNPS3_spu_gpr_68                0x44
  339. #define SNPS3_spu_gpr_69                0x45
  340. #define SNPS3_spu_gpr_70                0x46
  341. #define SNPS3_spu_gpr_71                0x47
  342. #define SNPS3_spu_gpr_72                0x48
  343. #define SNPS3_spu_gpr_73                0x49
  344. #define SNPS3_spu_gpr_74                0x4a
  345. #define SNPS3_spu_gpr_75                0x4b
  346. #define SNPS3_spu_gpr_76                0x4c
  347. #define SNPS3_spu_gpr_77                0x4d
  348. #define SNPS3_spu_gpr_78                0x4e
  349. #define SNPS3_spu_gpr_79                0x4f
  350. #define SNPS3_spu_gpr_80                0x50
  351. #define SNPS3_spu_gpr_81                0x51
  352. #define SNPS3_spu_gpr_82                0x52
  353. #define SNPS3_spu_gpr_83                0x53
  354. #define SNPS3_spu_gpr_84                0x54
  355. #define SNPS3_spu_gpr_85                0x55
  356. #define SNPS3_spu_gpr_86                0x56
  357. #define SNPS3_spu_gpr_87                0x57
  358. #define SNPS3_spu_gpr_88                0x58
  359. #define SNPS3_spu_gpr_89                0x59
  360. #define SNPS3_spu_gpr_90                0x5a
  361. #define SNPS3_spu_gpr_91                0x5b
  362. #define SNPS3_spu_gpr_92                0x5c
  363. #define SNPS3_spu_gpr_93                0x5d
  364. #define SNPS3_spu_gpr_94                0x5e
  365. #define SNPS3_spu_gpr_95                0x5f
  366.  
  367. #define SNPS3_spu_gpr_96                0x60
  368. #define SNPS3_spu_gpr_97                0x61
  369. #define SNPS3_spu_gpr_98                0x62
  370. #define SNPS3_spu_gpr_99                0x63
  371. #define SNPS3_spu_gpr_100               0x64
  372. #define SNPS3_spu_gpr_101               0x65
  373. #define SNPS3_spu_gpr_102               0x66
  374. #define SNPS3_spu_gpr_103               0x67
  375. #define SNPS3_spu_gpr_104               0x68
  376. #define SNPS3_spu_gpr_105               0x69
  377. #define SNPS3_spu_gpr_106               0x6a
  378. #define SNPS3_spu_gpr_107               0x6b
  379. #define SNPS3_spu_gpr_108               0x6c
  380. #define SNPS3_spu_gpr_109               0x6d
  381. #define SNPS3_spu_gpr_110               0x6e
  382. #define SNPS3_spu_gpr_111               0x6f
  383. #define SNPS3_spu_gpr_112               0x70
  384. #define SNPS3_spu_gpr_113               0x71
  385. #define SNPS3_spu_gpr_114               0x72
  386. #define SNPS3_spu_gpr_115               0x73
  387. #define SNPS3_spu_gpr_116               0x74
  388. #define SNPS3_spu_gpr_117               0x75
  389. #define SNPS3_spu_gpr_118               0x76
  390. #define SNPS3_spu_gpr_119               0x77
  391. #define SNPS3_spu_gpr_120               0x78
  392. #define SNPS3_spu_gpr_121               0x79
  393. #define SNPS3_spu_gpr_122               0x7a
  394. #define SNPS3_spu_gpr_123               0x7b
  395. #define SNPS3_spu_gpr_124               0x7c
  396. #define SNPS3_spu_gpr_125               0x7d
  397. #define SNPS3_spu_gpr_126               0x7e
  398. #define SNPS3_spu_gpr_127               0x7f
  399. //@}
  400.  
  401. // @name <SpuRegisters>
  402. //@{
  403. //! SPU register.
  404. #define SNPS3_spu_pc                    0x80
  405. #define SNPS3_spu_fpscr                 0x81
  406.  
  407. #define SNPS3_spu_decrementer   0x90
  408. #define SNPS3_spu_srr0                  0x91
  409. #define SNPS3_spu_mb_stat               0x92
  410. #define SNPS3_spu_mb_0                  0x93
  411. #define SNPS3_spu_mb_1                  0x94
  412. #define SNPS3_spu_mb_2                  0x95
  413. #define SNPS3_spu_mb_3                  0x96
  414. #define SNPS3_pu_mb                             0x97
  415. #define SNPS3_spu_status                0x98
  416. #define SNPS3_spu_cfg                   0x99
  417.  
  418. #define SNPS3_mfc_cq_sr0                0xa0
  419. #define SNPS3_mfc_cq_sr1                0xa1
  420. #define SNPS3_mfc_cq_sr2                0xa2
  421. #define SNPS3_mfc_cq_sr3                0xa3
  422. #define SNPS3_mfc_cq_sr4                0xa4
  423. #define SNPS3_mfc_cq_sr5                0xa5
  424. #define SNPS3_mfc_cq_sr6                0xa6
  425. #define SNPS3_mfc_cq_sr7                0xa7
  426. #define SNPS3_mfc_cq_sr8                0xa8
  427. #define SNPS3_mfc_cq_sr9                0xa9
  428. #define SNPS3_mfc_cq_sr10               0xaa
  429. #define SNPS3_mfc_cq_sr11               0xab
  430. #define SNPS3_mfc_cq_sr12               0xac
  431. #define SNPS3_mfc_cq_sr13               0xad
  432. #define SNPS3_mfc_cq_sr14               0xae
  433. #define SNPS3_mfc_cq_sr15               0xaf
  434. #define SNPS3_mfc_cq_sr16               0xb0
  435. #define SNPS3_mfc_cq_sr17               0xb1
  436. #define SNPS3_mfc_cq_sr18               0xb2
  437. #define SNPS3_mfc_cq_sr19               0xb3
  438. #define SNPS3_mfc_cq_sr20               0xb4
  439. #define SNPS3_mfc_cq_sr21               0xb5
  440. #define SNPS3_mfc_cq_sr22               0xb6
  441. #define SNPS3_mfc_cq_sr23               0xb7
  442. #define SNPS3_mfc_cq_sr24               0xb8
  443. #define SNPS3_mfc_cq_sr25               0xb9
  444. #define SNPS3_mfc_cq_sr26               0xba
  445. #define SNPS3_mfc_cq_sr27               0xbb
  446. #define SNPS3_mfc_cq_sr28               0xbc
  447. #define SNPS3_mfc_cq_sr29               0xbd
  448. #define SNPS3_mfc_cq_sr30               0xbe
  449. #define SNPS3_mfc_cq_sr31               0xbf
  450.  
  451. #define SNPS3_mfc_cq_sr32               0xc0
  452. #define SNPS3_mfc_cq_sr33               0xc1
  453. #define SNPS3_mfc_cq_sr34               0xc2
  454. #define SNPS3_mfc_cq_sr35               0xc3
  455. #define SNPS3_mfc_cq_sr36               0xc4
  456. #define SNPS3_mfc_cq_sr37               0xc5
  457. #define SNPS3_mfc_cq_sr38               0xc6
  458. #define SNPS3_mfc_cq_sr39               0xc7
  459. #define SNPS3_mfc_cq_sr40               0xc8
  460. #define SNPS3_mfc_cq_sr41               0xc9
  461. #define SNPS3_mfc_cq_sr42               0xca
  462. #define SNPS3_mfc_cq_sr43               0xcb
  463. #define SNPS3_mfc_cq_sr44               0xcc
  464. #define SNPS3_mfc_cq_sr45               0xcd
  465. #define SNPS3_mfc_cq_sr46               0xce
  466. #define SNPS3_mfc_cq_sr47               0xcf
  467. #define SNPS3_mfc_cq_sr48               0xd0
  468. #define SNPS3_mfc_cq_sr49               0xd1
  469. #define SNPS3_mfc_cq_sr50               0xd2
  470. #define SNPS3_mfc_cq_sr51               0xd3
  471. #define SNPS3_mfc_cq_sr52               0xd4
  472. #define SNPS3_mfc_cq_sr53               0xd5
  473. #define SNPS3_mfc_cq_sr54               0xd6
  474. #define SNPS3_mfc_cq_sr55               0xd7
  475. #define SNPS3_mfc_cq_sr56               0xd8
  476. #define SNPS3_mfc_cq_sr57               0xd9
  477. #define SNPS3_mfc_cq_sr58               0xda
  478. #define SNPS3_mfc_cq_sr59               0xdb
  479. #define SNPS3_mfc_cq_sr60               0xdc
  480. #define SNPS3_mfc_cq_sr61               0xdd
  481. #define SNPS3_mfc_cq_sr62               0xde
  482. #define SNPS3_mfc_cq_sr63               0xdf
  483.  
  484. #define SNPS3_mfc_cq_sr64               0xe0
  485. #define SNPS3_mfc_cq_sr65               0xe1
  486. #define SNPS3_mfc_cq_sr66               0xe2
  487. #define SNPS3_mfc_cq_sr67               0xe3
  488. #define SNPS3_mfc_cq_sr68               0xe4
  489. #define SNPS3_mfc_cq_sr69               0xe5
  490. #define SNPS3_mfc_cq_sr70               0xe6
  491. #define SNPS3_mfc_cq_sr71               0xe7
  492. #define SNPS3_mfc_cq_sr72               0xe8
  493. #define SNPS3_mfc_cq_sr73               0xe9
  494. #define SNPS3_mfc_cq_sr74               0xea
  495. #define SNPS3_mfc_cq_sr75               0xeb
  496. #define SNPS3_mfc_cq_sr76               0xec
  497. #define SNPS3_mfc_cq_sr77               0xed
  498. #define SNPS3_mfc_cq_sr78               0xee
  499. #define SNPS3_mfc_cq_sr79               0xef
  500. #define SNPS3_mfc_cq_sr80               0xf0
  501. #define SNPS3_mfc_cq_sr81               0xf1
  502. #define SNPS3_mfc_cq_sr82               0xf2
  503. #define SNPS3_mfc_cq_sr83               0xf3
  504. #define SNPS3_mfc_cq_sr84               0xf4
  505. #define SNPS3_mfc_cq_sr85               0xf5
  506. #define SNPS3_mfc_cq_sr86               0xf6
  507. #define SNPS3_mfc_cq_sr87               0xf7
  508. #define SNPS3_mfc_cq_sr88               0xf8
  509. #define SNPS3_mfc_cq_sr89               0xf9
  510. #define SNPS3_mfc_cq_sr90               0xfa
  511. #define SNPS3_mfc_cq_sr91               0xfb
  512. #define SNPS3_mfc_cq_sr92               0xfc
  513. #define SNPS3_mfc_cq_sr93               0xfd
  514. #define SNPS3_mfc_cq_sr94               0xfe
  515. #define SNPS3_mfc_cq_sr95               0xff
  516. //@}
  517.  
  518. //////////////////////////////////////////////////////////////////////////////
  519. // PLAYSTATION(R)3 Target Events.
  520. //////////////////////////////////////////////////////////////////////////////
  521.  
  522. #pragma pack(push, 1)
  523.  
  524. //////////////////////////////////////////////////////////////////////////////
  525. /// @struct             SNPS3_DBG_EVENT_HDR
  526. ///     @brief          Header for debug events.
  527. ///     @details        When a target event of type SN_TGT_EVENT_TARGET_SPECIFIC occurs,
  528. ///             the event header \link Apibase::SN_EVENT_TARGET_HDR SN_EVENT_TARGET_HDR\endlink will be followed by an
  529. ///             \link Apibase::SNPS3_DBG_EVENT_HDR SNPS3_DBG_EVENT_HDR\endlink
  530. ///             struct, followed by an \link Apibase::SNPS3_DBG_EVENT_DATA SNPS3_DBG_EVENT_DATA\endlink.
  531. //////////////////////////////////////////////////////////////////////////////
  532.  
  533. struct SNPS3_DBG_EVENT_HDR {
  534.         /// Command ID - Always equals fixed value DBGP_EVENT_NOTIFICATION - see DBGP specification if more details are required.
  535.         UINT32  uCommandID;
  536.         /// Request ID from DBGP header, should be ignored, see DBGP specification if if more details are required.
  537.         UINT32  uRequestID;
  538.         /// Length of data in bytes.
  539.         UINT32  uDataLength;
  540.         /// Process ID where relevant to event, see DBGP specification if if more details are required.
  541.         UINT32  uProcessID;
  542.         /// Result code from DBGP header, always zero, should be ignored, see DBGP specification if if more details are required.
  543.         UINT32  uResult;
  544. };
  545. typedef struct SNPS3_DBG_EVENT_HDR SNPS3_DBG_EVENT_HDR;
  546.  
  547. // @name <TargetSpecificEvents>
  548. //@{
  549. //! Target specific event.
  550. #define SNPS3_DBG_EVENT_PROCESS_CREATE                          (0x00000000)
  551. #define SNPS3_DBG_EVENT_PROCESS_EXIT                            (0x00000001)
  552. #define SNPS3_DBG_EVENT_PROCESS_KILL                            (0x00000002)
  553. #define SNPS3_DBG_EVENT_PROCESS_EXITSPAWN                       (0x00000003)
  554.  
  555. #define SNPS3_DBG_EVENT_PPU_EXP_TRAP                            (0x00000010)
  556. #define SNPS3_DBG_EVENT_PPU_EXP_PREV_INT                        (0x00000011)
  557. #define SNPS3_DBG_EVENT_PPU_EXP_ALIGNMENT                       (0x00000012)
  558. #define SNPS3_DBG_EVENT_PPU_EXP_ILL_INST                        (0x00000013)
  559. #define SNPS3_DBG_EVENT_PPU_EXP_TEXT_HTAB_MISS          (0x00000014)
  560. #define SNPS3_DBG_EVENT_PPU_EXP_TEXT_SLB_MISS           (0x00000015)
  561. #define SNPS3_DBG_EVENT_PPU_EXP_DATA_HTAB_MISS          (0x00000016)
  562. #define SNPS3_DBG_EVENT_PPU_EXP_FLOAT                           (0x00000017)
  563. #define SNPS3_DBG_EVENT_PPU_EXP_DATA_SLB_MISS           (0x00000018)
  564. #define SNPS3_DBG_EVENT_PPU_EXP_DABR_MATCH                      (0x00000019)
  565. #define SNPS3_DBG_EVENT_PPU_EXP_STOP                            (0x0000001a)
  566. #define SNPS3_DBG_EVENT_PPU_EXP_STOP_INIT                       (0x0000001b)
  567. #define SNPS3_DBG_EVENT_PPU_EXC_DATA_MAT                        (0x0000001c)
  568.  
  569. #define SNPS3_DBG_EVENT_PPU_THREAD_CREATE                       (0x00000020)
  570. #define SNPS3_DBG_EVENT_PPU_THREAD_EXIT                         (0x00000021)
  571.  
  572. #define SNPS3_DBG_EVENT_SPU_THREAD_START                        (0x00000030)
  573. #define SNPS3_DBG_EVENT_SPU_THREAD_STOP                         (0x00000031)
  574. #define SNPS3_DBG_EVENT_SPU_THREAD_STOP_INIT            (0x00000032)
  575. #define SNPS3_DBG_EVENT_SPU_THREAD_GROUP_DESTROY        (0x00000033)
  576. #define SNPS3_DBG_EVENT_SPU_THREAD_STOP_EX                      (0x00000034)
  577. #define SNPS3_DBG_EVENT_RAW_NOTIFY                                      (0xf000000f)
  578.  
  579. #define SNPS3_DBG_EVENT_PRX_LOAD                                        (0x00000040)
  580. #define SNPS3_DBG_EVENT_PRX_UNLOAD                                      (0x00000041)
  581.  
  582. #define SNPS3_DBG_EVENT_DA_INITIALIZED                          (0x00000060)
  583.  
  584. #define SNPS3_DBG_EVENT_FOOTSWITCH_EVENT                    (0x00000070)
  585.  
  586. #define SNPS3_DBG_EVENT_INSTALL_PACKAGE_PATH            (0x00000081)
  587.  
  588. /// Due to internal SDK limitation, these events are only triggered
  589. /// if coredump is generated in app_home
  590. #define SNPS3_DBG_EVENT_CORE_DUMP_COMPLETE                      (0x00000100)
  591. #define SNPS3_DBG_EVENT_CORE_DUMP_START                         (0x00000101)
  592.  
  593. //@}
  594.  
  595. //////////////////////////////////////////////////////////////////////////////
  596. /// @struct             SNPS3_PPU_PROCESS_CREATE_DATA
  597. ///     @brief          Data associated with process create event.
  598. //////////////////////////////////////////////////////////////////////////////
  599.  
  600. struct SNPS3_PPU_PROCESS_CREATE_DATA {
  601.         UINT32                  uParentProcessID;
  602.         ///  UTF-8 null-terminated file name string.
  603.         UCHAR                   szFilename[];
  604. };
  605. typedef struct SNPS3_PPU_PROCESS_CREATE_DATA SNPS3_PPU_PROCESS_CREATE_DATA;
  606.  
  607. //////////////////////////////////////////////////////////////////////////////
  608. /// @struct             SNPS3_PPU_PROCESS_EXIT_DATA
  609. ///     @brief          Data associated with process exit event.
  610. //////////////////////////////////////////////////////////////////////////////
  611.  
  612. struct SNPS3_PPU_PROCESS_EXIT_DATA {
  613.         UINT64                  uExitCode;
  614. };
  615. typedef struct SNPS3_PPU_PROCESS_EXIT_DATA SNPS3_PPU_PROCESS_EXIT_DATA;
  616.  
  617. //////////////////////////////////////////////////////////////////////////////
  618. /// @struct             SNPS3_PPU_PROCESS_EXITSPAWN_DATA
  619. ///     @brief          Data associated with process exitspawn event.
  620. //////////////////////////////////////////////////////////////////////////////
  621.  
  622. struct SNPS3_PPU_PROCESS_EXITSPAWN_DATA {
  623.         /// sys_dbg_process_wait_for_game_process() status if ret == success, else ret value.
  624.         UINT64                  uStatus;
  625.         /// Exited process ID is in the header.
  626.         UINT32                  uNewProcessID;
  627. };
  628. typedef struct SNPS3_PPU_PROCESS_EXITSPAWN_DATA SNPS3_PPU_PROCESS_EXITSPAWN_DATA;
  629.  
  630. //////////////////////////////////////////////////////////////////////////////
  631. /// @struct             SNPS3_PPU_EXP_TRAP_DATA
  632. ///     @brief          Data associated with ppu trap event.
  633. //////////////////////////////////////////////////////////////////////////////
  634.  
  635. struct SNPS3_PPU_EXP_TRAP_DATA {
  636.         UINT64                  uPPUThreadID;
  637.         UINT32                  uHWThreadNumber;
  638.         UINT64                  uPC;
  639.         UINT64                  uSP;
  640. };
  641. typedef struct SNPS3_PPU_EXP_TRAP_DATA SNPS3_PPU_EXP_TRAP_DATA;
  642.  
  643. //////////////////////////////////////////////////////////////////////////////
  644. /// @struct             SNPS3_PPU_EXP_PREV_INT_DATA
  645. ///     @brief          Data associated with privileged instruction event.
  646. //////////////////////////////////////////////////////////////////////////////
  647.  
  648. struct SNPS3_PPU_EXP_PREV_INT_DATA {
  649.         UINT64                  uPPUThreadID;
  650.         UINT32                  uHWThreadNumber;
  651.         UINT64                  uPC;
  652.         UINT64                  uSP;
  653. };
  654. typedef struct SNPS3_PPU_EXP_PREV_INT_DATA SNPS3_PPU_EXP_PREV_INT_DATA;
  655.  
  656. //////////////////////////////////////////////////////////////////////////////
  657. /// @struct             SNPS3_PPU_EXP_ALIGNMENT_DATA
  658. ///     @brief          Data associated with alignment error event.
  659. //////////////////////////////////////////////////////////////////////////////
  660.  
  661. struct SNPS3_PPU_EXP_ALIGNMENT_DATA {
  662.         UINT64                  uPPUThreadID;
  663.         UINT32                  uHWThreadNumber;
  664.         UINT64                  uDSISR;
  665.         UINT64                  uDAR;
  666.         UINT64                  uPC;
  667.         UINT64                  uSP;
  668. };
  669. typedef struct SNPS3_PPU_EXP_ALIGNMENT_DATA SNPS3_PPU_EXP_ALIGNMENT_DATA;
  670.  
  671. //////////////////////////////////////////////////////////////////////////////
  672. /// @struct             SNPS3_PPU_EXP_DATA_MAT_DATA
  673. ///     @brief          Data associated with memory access trap event.
  674. //////////////////////////////////////////////////////////////////////////////
  675.  
  676. struct SNPS3_PPU_EXP_DATA_MAT_DATA {
  677.         UINT64                  uPPUThreadID;
  678.         UINT32                  uHWThreadNumber;
  679.         UINT64                  uDSISR;
  680.         UINT64                  uDAR;
  681.         UINT64                  uPC;
  682.         UINT64                  uSP;
  683. };
  684. typedef struct SNPS3_PPU_EXP_DATA_MAT_DATA SNPS3_PPU_EXP_DATA_MAT_DATA;
  685.  
  686. //////////////////////////////////////////////////////////////////////////////
  687. /// @struct             SNPS3_PPU_EXP_ILL_INST_DATA
  688. ///     @brief          Data associated with illegal instruction event.
  689. //////////////////////////////////////////////////////////////////////////////
  690.  
  691. struct SNPS3_PPU_EXP_ILL_INST_DATA {
  692.         UINT64                  uPPUThreadID;
  693.         UINT32                  uHWThreadNumber;
  694.         UINT64                  uDSISR;
  695.         UINT64                  uPC;
  696.         UINT64                  uSP;
  697. };
  698. typedef struct SNPS3_PPU_EXP_ILL_INST_DATA SNPS3_PPU_EXP_ILL_INST_DATA;
  699.  
  700. //////////////////////////////////////////////////////////////////////////////
  701. /// @struct             SNPS3_PPU_EXP_TEXT_HTAB_MISS_DATA
  702. ///     @brief          Data associated with htab miss event (reading instructions).
  703. //////////////////////////////////////////////////////////////////////////////
  704.  
  705. struct SNPS3_PPU_EXP_TEXT_HTAB_MISS_DATA {
  706.         UINT64                  uPPUThreadID;
  707.         UINT32                  uHWThreadNumber;
  708.         UINT64                  uPC;
  709.         UINT64                  uSP;
  710. };
  711. typedef struct SNPS3_PPU_EXP_TEXT_HTAB_MISS_DATA SNPS3_PPU_EXP_TEXT_HTAB_MISS_DATA;
  712.  
  713. //////////////////////////////////////////////////////////////////////////////
  714. /// @struct             SNPS3_PPU_EXP_TEXT_SLB_MISS_DATA
  715. ///     @brief          Data associated with slb miss event (reading instructions).
  716. //////////////////////////////////////////////////////////////////////////////
  717.  
  718. struct SNPS3_PPU_EXP_TEXT_SLB_MISS_DATA {
  719.         UINT64                  uPPUThreadID;
  720.         UINT32                  uHWThreadNumber;
  721.         UINT64                  uPC;
  722.         UINT64                  uSP;
  723. };
  724. typedef struct SNPS3_PPU_EXP_TEXT_SLB_MISS_DATA SNPS3_PPU_EXP_TEXT_SLB_MISS_DATA;
  725.  
  726. //////////////////////////////////////////////////////////////////////////////
  727. /// @struct             SNPS3_PPU_EXP_DATA_HTAB_MISS_DATA
  728. ///     @brief          Data associated with htab miss event (reading data).
  729. //////////////////////////////////////////////////////////////////////////////
  730.  
  731. struct SNPS3_PPU_EXP_DATA_HTAB_MISS_DATA {
  732.         UINT64                  uPPUThreadID;
  733.         UINT32                  uHWThreadNumber;
  734.         UINT64                  uPC;
  735.         UINT64                  uSP;
  736. };
  737. typedef struct SNPS3_PPU_EXP_DATA_HTAB_MISS_DATA SNPS3_PPU_EXP_DATA_HTAB_MISS_DATA;
  738.  
  739. //////////////////////////////////////////////////////////////////////////////
  740. /// @struct             SNPS3_PPU_EXP_FLOAT_DATA
  741. ///     @brief          Data associated with floating point exception event.
  742. //////////////////////////////////////////////////////////////////////////////
  743.  
  744. struct SNPS3_PPU_EXP_FLOAT_DATA {
  745.         UINT64                  uPPUThreadID;
  746.         UINT32                  uHWThreadNumber;
  747.         UINT64                  uPC;
  748.         UINT64                  uSP;
  749. };
  750. typedef struct SNPS3_PPU_EXP_FLOAT_DATA SNPS3_PPU_EXP_FLOAT_DATA;
  751.  
  752. //////////////////////////////////////////////////////////////////////////////
  753. /// @struct             SNPS3_PPU_EXP_DATA_SLB_MISS_DATA
  754. ///     @brief          Data associated with slb miss event (reading data).
  755. //////////////////////////////////////////////////////////////////////////////
  756.  
  757. struct SNPS3_PPU_EXP_DATA_SLB_MISS_DATA {
  758.         UINT64                  uPPUThreadID;
  759.         UINT32                  uHWThreadNumber;
  760.         UINT64                  uPC;
  761.         UINT64                  uSP;
  762. };
  763. typedef struct SNPS3_PPU_EXP_DATA_SLB_MISS_DATA SNPS3_PPU_EXP_DATA_SLB_MISS_DATA;
  764.  
  765. //////////////////////////////////////////////////////////////////////////////
  766. /// @struct             SNPS3_PPU_EXP_DABR_MATCH_DATA
  767. ///     @brief          Data associated with data access breakpoint register event.
  768. //////////////////////////////////////////////////////////////////////////////
  769.  
  770. struct SNPS3_PPU_EXP_DABR_MATCH_DATA {
  771.         UINT64                  uPPUThreadID;
  772.         UINT32                  uHWThreadNumber;
  773.         UINT64                  uPC;
  774.         UINT64                  uSP;
  775. };
  776. typedef struct SNPS3_PPU_EXP_DABR_MATCH_DATA SNPS3_PPU_EXP_DABR_MATCH_DATA;
  777.  
  778. //////////////////////////////////////////////////////////////////////////////
  779. /// @struct             SNPS3_PPU_EXP_STOP_DATA
  780. ///     @brief          Data associated with ppu stop event.
  781. //////////////////////////////////////////////////////////////////////////////
  782.  
  783. struct SNPS3_PPU_EXP_STOP_DATA {
  784.         UINT64                  uPPUThreadID;
  785.         UINT32                  uHWThreadNumber;
  786.         UINT64                  uPC;
  787.         UINT64                  uSP;
  788. };
  789. typedef struct SNPS3_PPU_EXP_STOP_DATA SNPS3_PPU_EXP_STOP_DATA;
  790.  
  791. //////////////////////////////////////////////////////////////////////////////
  792. /// @struct             SNPS3_PPU_EXP_STOP_INIT_DATA
  793. ///     @brief          Data associated with ppu stop init event.
  794. //////////////////////////////////////////////////////////////////////////////
  795.  
  796. struct SNPS3_PPU_EXP_STOP_INIT_DATA {
  797.         UINT64                  uPPUThreadID;
  798.         UINT32                  uHWThreadNumber;
  799.         UINT64                  uPC;
  800.         UINT64                  uSP;
  801. };
  802. typedef struct SNPS3_PPU_EXP_STOP_INIT_DATA SNPS3_PPU_EXP_STOP_INIT_DATA;
  803.  
  804. //////////////////////////////////////////////////////////////////////////////
  805. /// @struct             SNPS3_PPU_THREAD_CREATE_DATA
  806. ///     @brief          Data associated with ppu thread create event.
  807. //////////////////////////////////////////////////////////////////////////////
  808.  
  809. struct SNPS3_PPU_THREAD_CREATE_DATA {
  810.         UINT64                  uPPUThreadID;
  811. };
  812. typedef struct SNPS3_PPU_THREAD_CREATE_DATA SNPS3_PPU_THREAD_CREATE_DATA;
  813.  
  814.  
  815. //////////////////////////////////////////////////////////////////////////////
  816. /// @struct             SNPS3_PPU_THREAD_EXIT_DATA
  817. ///     @brief          Data associated with ppu thread exit event.
  818. //////////////////////////////////////////////////////////////////////////////
  819.  
  820. struct SNPS3_PPU_THREAD_EXIT_DATA {
  821.         UINT64                  uPPUThreadID;
  822. };
  823. typedef struct SNPS3_PPU_THREAD_EXIT_DATA SNPS3_PPU_THREAD_EXIT_DATA;
  824.  
  825. //////////////////////////////////////////////////////////////////////////////
  826. /// @struct             SNPS3_SPU_THREAD_START_DATA
  827. ///     @brief          Data associated with spu threadgroup start event.
  828. //////////////////////////////////////////////////////////////////////////////
  829.  
  830. struct SNPS3_SPU_THREAD_START_DATA {
  831.         UINT32                  uSPUThreadGroupID;
  832.         UINT32                  uSPUThreadID;
  833.         /// UTF-8 filename of SPU ELF loaded onto thread.
  834.         UCHAR                   aData[];
  835. };
  836. typedef struct SNPS3_SPU_THREAD_START_DATA SNPS3_SPU_THREAD_START_DATA;
  837.  
  838. // @name <SpuThreadStopReason>
  839. //@{
  840. //! No exception.
  841. #define SNPS3_SPU_EXP_NO_EXCEPTION                      (0x00000000)
  842. //! DMA alignment.
  843. #define SNPS3_SPU_EXP_DMA_ALIGNMENT                     (0x00000001)
  844. //! DMA command.
  845. #define SNPS3_SPU_EXP_DMA_COMMAND                       (0x00000002)
  846. //! Error.
  847. #define SNPS3_SPU_EXP_ERROR                                     (0x00000004)
  848. //! MFC FIR.
  849. #define SNPS3_SPU_EXP_MFC_FIR                           (0x00000008)
  850. //! MFC segment.
  851. #define SNPS3_SPU_EXP_MFC_SEGMENT                       (0x00000010)
  852. //! MFC storage.
  853. #define SNPS3_SPU_EXP_MFC_STORAGE                       (0x00000020)
  854. //! No value.
  855. #define SNPS3_SPU_EXP_NO_VALUE                          (0x00000040)
  856. //! Stop call.
  857. #define SNPS3_SPU_EXP_STOP_CALL                         (0x00000100)
  858. //! Stop call.
  859. #define SNPS3_SPU_EXP_STOPD_CALL                        (0x00000200)
  860. //! Halt.
  861. #define SNPS3_SPU_EXP_HALT                                      (0x00000400)
  862. //@}
  863.  
  864. //////////////////////////////////////////////////////////////////////////////
  865. /// @struct             SNPS3_SPU_THREAD_STOP_DATA
  866. ///     @brief          Data associated with spu thread stop event.
  867. //////////////////////////////////////////////////////////////////////////////
  868.  
  869. struct SNPS3_SPU_THREAD_STOP_DATA {
  870.         UINT32                  uSPUThreadGroupID;
  871.         UINT32                  uSPUThreadID;
  872.         UINT32                  uPC;
  873.         UINT32                  uReason;
  874.         UINT32                  uSP;
  875. };
  876. typedef struct SNPS3_SPU_THREAD_STOP_DATA SNPS3_SPU_THREAD_STOP_DATA;
  877.  
  878. //////////////////////////////////////////////////////////////////////////////
  879. /// @struct             SNPS3_SPU_THREAD_STOP_EX_DATA
  880. ///     @brief          Extended data associated with spu thread stop events MFC_STORAGE,
  881. ///             MFC_SEGMENT and MAT access.
  882. //////////////////////////////////////////////////////////////////////////////
  883.  
  884. struct SNPS3_SPU_THREAD_STOP_EX_DATA {
  885.         UINT32                  uSPUThreadGroupID;
  886.         UINT32                  uSPUThreadID;
  887.         UINT32                  uPC;
  888.         UINT32                  uReason;
  889.         UINT32                  uSP;
  890.         UINT64                  uMfc_dsisr;
  891.         UINT64                  uMfc_dsipr;
  892.         UINT64                  uMfc_dar;
  893. };
  894.  
  895. //////////////////////////////////////////////////////////////////////////////
  896. /// @deprecated Use     SNPS3_SPU_THREAD_STOP_EX_DATA.
  897. /// @brief Use SNPS3_SPU_THREAD_STOP_EX_DATA.
  898. //////////////////////////////////////////////////////////////////////////////
  899. SNDEPRECATED("use SNPS3_SPU_THREAD_STOP_EX_DATA instead")
  900. struct SNPS3_SPU_THREAD_STOP_DATA_EX
  901. {
  902.         UINT32                  uSPUThreadGroupID;
  903.         UINT32                  uSPUThreadID;
  904.         UINT32                  uPC;
  905.         UINT32                  uReason;
  906.         UINT32                  uSP;
  907.         UINT64                  uMfc_dsisr;
  908.         UINT64                  uMfc_dar;
  909.         UINT64                  uMfc_dsipr;    
  910. };
  911.  
  912. //////////////////////////////////////////////////////////////////////////////
  913. /// @struct             SNPS3_SPU_THREAD_GROUP_DESTROY_DATA
  914. ///     @brief          Data associated with spu thread group destroy event.
  915. //////////////////////////////////////////////////////////////////////////////
  916.  
  917. struct SNPS3_SPU_THREAD_GROUP_DESTROY_DATA {
  918.         UINT32                  uSPUThreadGroupID;
  919. };
  920. typedef struct SNPS3_SPU_THREAD_GROUP_DESTROY_DATA SNPS3_SPU_THREAD_GROUP_DESTROY_DATA;
  921.  
  922. //////////////////////////////////////////////////////////////////////////////
  923. /// @struct             SNPS3_EVENTNOTIFY_PRX_LOAD_DATA
  924. ///     @brief          Data associated with PRX load event.
  925. //////////////////////////////////////////////////////////////////////////////
  926.  
  927. struct SNPS3_EVENTNOTIFY_PRX_LOAD_DATA {
  928.         UINT64                  uPPUThreadID;
  929.         UINT32                  uPRXID;
  930.         UINT64                  uTimestamp;
  931. };
  932. typedef struct SNPS3_EVENTNOTIFY_PRX_LOAD_DATA SNPS3_EVENTNOTIFY_PRX_LOAD_DATA;
  933.  
  934. //////////////////////////////////////////////////////////////////////////////
  935. /// @struct             SNPS3_EVENTNOTIFY_PRX_UNLOAD_DATA
  936. ///     @brief          Data associated with PRX unload event.
  937. //////////////////////////////////////////////////////////////////////////////
  938.  
  939. struct SNPS3_EVENTNOTIFY_PRX_UNLOAD_DATA {
  940.         UINT64                  uPPUThreadID;
  941.         UINT32                  uPRXID;
  942.         UINT64                  uTimestamp;
  943. };
  944. typedef struct SNPS3_EVENTNOTIFY_PRX_UNLOAD_DATA SNPS3_EVENTNOTIFY_PRX_UNLOAD_DATA;
  945.  
  946. //////////////////////////////////////////////////////////////////////////////
  947. /// @struct             SNPS3_EVENTNOTIFY_FOOTSWITCH
  948. ///     @brief          Data associated with footswitch event.
  949. //////////////////////////////////////////////////////////////////////////////
  950.  
  951. struct SNPS3_EVENTNOTIFY_FOOTSWITCH
  952. {
  953.         UINT64                  uEventSource;
  954.         UINT64                  uEventData1;
  955.         UINT64                  uEventData2;
  956.         UINT64                  uEventData3;
  957.         UINT64                  uReserved;
  958. };
  959. typedef struct SNPS3_EVENTNOTIFY_FOOTSWITCH SNPS3_EVENTNOTIFY_FOOTSWITCH;
  960.  
  961. //////////////////////////////////////////////////////////////////////////////
  962. /// @struct             SNPS3_EVENTNOTIFY_INSTALL_PACKAGE_PATH
  963. ///     @brief          Data associated with install package path event.
  964. //////////////////////////////////////////////////////////////////////////////
  965.  
  966. struct SNPS3_EVENTNOTIFY_INSTALL_PACKAGE_PATH
  967. {
  968.         ///  UTF-8 null-terminated string.
  969.         char                    path[1024];
  970. };
  971. typedef struct SNPS3_EVENTNOTIFY_INSTALL_PACKAGE_PATH SNPS3_EVENTNOTIFY_INSTALL_PACKAGE_PATH;
  972.  
  973. //////////////////////////////////////////////////////////////////////////////
  974. /// @struct             SNPS3_EVENTNOTIFY_CORE_DUMP_COMPLETE
  975. ///     @brief          Data associated with core dump complete event.
  976. //////////////////////////////////////////////////////////////////////////////
  977.  
  978. struct SNPS3_EVENTNOTIFY_CORE_DUMP_COMPLETE
  979. {
  980.         ///  UTF-8 null-terminated string.
  981.         char                    filename[1024];
  982. };
  983.  
  984. //////////////////////////////////////////////////////////////////////////////
  985. /// @struct             SNPS3_EVENTNOTIFY_CORE_DUMP_START
  986. ///     @brief          Data associated with core dump start event.
  987. //////////////////////////////////////////////////////////////////////////////
  988.  
  989. struct SNPS3_EVENTNOTIFY_CORE_DUMP_START
  990. {
  991.         ///  UTF-8 null-terminated string.
  992.         char                    filename[1024];
  993. };
  994.  
  995. //////////////////////////////////////////////////////////////////////////////
  996. /// @struct             SNPS3_DBG_EVENT_DATA
  997. ///     @brief          Overall data structure for debug events.
  998. ///     @details        When a target event of type SN_TGT_EVENT_TARGET_SPECIFIC occurs,
  999. ///             the event header \link Apibase::SN_EVENT_TARGET_HDR SN_EVENT_TARGET_HDR\endlink will be followed by an
  1000. ///             \link Apibase::SNPS3_DBG_EVENT_HDR SNPS3_DBG_EVENT_HDR\endlink
  1001. ///             struct, followed by an \link Apibase::SNPS3_DBG_EVENT_DATA SNPS3_DBG_EVENT_DATA\endlink  
  1002. ///             whose uEventType member will be one of \link SNPS3_DBG_EVENT_PROCESS_CREATE SNPS3_DBG_EVENT_PROCESS_CREATE\endlink
  1003. ///             etc. Data should be interpreted according to this value.
  1004. //////////////////////////////////////////////////////////////////////////////
  1005.  
  1006. struct SNPS3_DBG_EVENT_DATA
  1007. {
  1008.         UINT32                  uEventType;
  1009.  
  1010.         union {
  1011.                 SNPS3_PPU_PROCESS_CREATE_DATA                           ppu_process_create;
  1012.                 SNPS3_PPU_PROCESS_EXIT_DATA                                     ppu_process_exit;
  1013.                 SNPS3_PPU_PROCESS_EXITSPAWN_DATA                        ppu_process_exitspawn;
  1014.                 SNPS3_PPU_EXP_TRAP_DATA                                         ppu_exc_trap;
  1015.                 SNPS3_PPU_EXP_PREV_INT_DATA                                     ppu_exc_prev_int;
  1016.                 SNPS3_PPU_EXP_ALIGNMENT_DATA                            ppu_exc_alignment;
  1017.                 SNPS3_PPU_EXP_ILL_INST_DATA                                     ppu_exc_ill_inst;
  1018.                 SNPS3_PPU_EXP_TEXT_HTAB_MISS_DATA                       ppu_exc_text_htab_miss;
  1019.                 SNPS3_PPU_EXP_TEXT_SLB_MISS_DATA                        ppu_exc_text_slb_miss;
  1020.                 SNPS3_PPU_EXP_DATA_HTAB_MISS_DATA                       ppu_exc_data_htab_miss;
  1021.                 SNPS3_PPU_EXP_FLOAT_DATA                                        ppu_exc_float;
  1022.                 SNPS3_PPU_EXP_DATA_SLB_MISS_DATA                        ppu_exc_data_slb_miss;
  1023.                 SNPS3_PPU_EXP_DABR_MATCH_DATA                           ppu_exc_dabr_match;
  1024.                 SNPS3_PPU_EXP_STOP_DATA                                         ppu_exc_stop;
  1025.                 SNPS3_PPU_EXP_STOP_INIT_DATA                            ppu_exc_stop_init;
  1026.                 SNPS3_PPU_EXP_DATA_MAT_DATA                                     ppu_exc_data_mat;
  1027.  
  1028.                 SNPS3_PPU_THREAD_CREATE_DATA                            ppu_thread_create;
  1029.                 SNPS3_PPU_THREAD_EXIT_DATA                                      ppu_thread_exit;
  1030.  
  1031.                 SNPS3_SPU_THREAD_START_DATA                                     spu_thread_start;
  1032.                 SNPS3_SPU_THREAD_STOP_DATA                                      spu_thread_stop;
  1033.                 SNPS3_SPU_THREAD_STOP_EX_DATA                           spu_thread_stop_ex;
  1034.                 SNPS3_SPU_THREAD_STOP_DATA                                      spu_thread_stop_init;
  1035.                 SNPS3_SPU_THREAD_GROUP_DESTROY_DATA                     spu_thread_group_destroy;
  1036.  
  1037.                 SNPS3_EVENTNOTIFY_PRX_LOAD_DATA                         prx_load;
  1038.                 SNPS3_EVENTNOTIFY_PRX_UNLOAD_DATA                       prx_unload;
  1039.  
  1040.                 SNPS3_EVENTNOTIFY_FOOTSWITCH                            footswitch_data;
  1041.  
  1042.                 SNPS3_EVENTNOTIFY_INSTALL_PACKAGE_PATH          install_package_path;
  1043.  
  1044.                 SNPS3_EVENTNOTIFY_CORE_DUMP_START                       core_dump_start;
  1045.                 SNPS3_EVENTNOTIFY_CORE_DUMP_COMPLETE            core_dump_complete;
  1046.         };
  1047. };
  1048. typedef struct SNPS3_DBG_EVENT_DATA SNPS3_DBG_EVENT_DATA;
  1049.  
  1050. #pragma pack(pop)
  1051.  
  1052. //////////////////////////////////////////////////////////////////////////////
  1053. /// @struct             SNPS3TargetInfo
  1054. ///     @brief          Contains parameters which define a target
  1055. ///             (see SNPS3GetTargetInfo() and SNPS3SetTargetInfo()).
  1056. //////////////////////////////////////////////////////////////////////////////
  1057.  
  1058. struct SNPS3TargetInfo {
  1059.         /// Flags indicating what values returned/to be set (see defines SN_TI_TARGETID to SN_TI_BOOT).
  1060.         UINT32        nFlags;
  1061.         /// Handle to target.
  1062.         HTARGET     hTarget;
  1063.         /// Target name. UTF-8 null-terminated string.
  1064.         const char  *pszName;
  1065.         /// Target type. UTF-8 null-terminated string.
  1066.         const char      *pszType;
  1067.         /// Target information. UTF-8 null-terminated string.
  1068.         const char  *pszInfo;
  1069.         /// Home directory of target. UTF-8 null-terminated string.
  1070.         const char  *pszHomeDir;
  1071.         /// File serving directory of target. UTF-8 null-terminated string.
  1072.         const char  *pszFSDir;
  1073.         /// Boot flags for target.
  1074.         UINT64      boot;
  1075. };
  1076. typedef struct SNPS3TargetInfo SNPS3TargetInfo;
  1077.  
  1078. // @name <SystemInfoFlags>
  1079. //@{
  1080. //! System information flag.
  1081. #define SYS_INFO_SDK_VERSION       (0x00000001)
  1082. #define SYS_INFO_TIMEBASE_FREQ     (0x00000002)
  1083. #define SYS_INFO_RT_SDK_VERSION    (0x00000004)
  1084. #define SYS_INFO_TOTAL_SYSTEM_MEM  (0x00000008)
  1085. #define SYS_INFO_AVAILABLE_SYS_MEM (0x00000010)
  1086. #define SYS_INFO_DCM_BUFFER_SIZE   (0x00000020)
  1087. //@}
  1088.  
  1089. //////////////////////////////////////////////////////////////////////////////
  1090. /// @struct             SNPS3SystemInfo
  1091. ///     @brief          Contains miscellaneous information about the system. (see SNPS3GetSystemInfo()).
  1092. //////////////////////////////////////////////////////////////////////////////
  1093.  
  1094. struct SNPS3SystemInfo
  1095. {
  1096.         /// SDK version used to build debug agent.
  1097.         UINT32                  uCellSdkVersion;
  1098.         /// The timebase frequency of the target.
  1099.         UINT64                  uTimebaseFrequency;
  1100.         /// The runtime version of the target SDK.
  1101.         UINT32                  uCellRuntimeSdkVersion;
  1102.         /// The total system memory of the target.
  1103.         UINT32                  uTotalSystemMemory;
  1104.         /// The available system memory.
  1105.         UINT32                  uAvailableSystemMemory;
  1106.         /// Max size of DBGP buffer     .
  1107.         UINT32                  uDCMBufferSize;
  1108. };
  1109. typedef struct SNPS3SystemInfo SNPS3SystemInfo;
  1110.  
  1111. //! Maximum length of a directory entry name.
  1112. #define SNPS3_DIRENT_NAME_LEN   (256)
  1113.  
  1114. // @name <DirectoryEntryTypes>
  1115. //@{
  1116. //! Directory entry type.
  1117. #define SNPS3_DIRENT_TYPE_UNKNOWN       (0)
  1118. #define SNPS3_DIRENT_TYPE_DIRECTORY     (1)
  1119. #define SNPS3_DIRENT_TYPE_REGULAR       (2)
  1120. #define SNPS3_DIRENT_TYPE_SYMLINK       (3)
  1121. //@}
  1122.  
  1123. //////////////////////////////////////////////////////////////////////////////
  1124. /// @struct     SNPS3DirEntry
  1125. ///     @brief  Contains parameters which define a directory entry
  1126. ///                     (see SNPS3GetDirectoryList()).
  1127. //////////////////////////////////////////////////////////////////////////////
  1128.  
  1129. struct SNPS3DirEntry
  1130. {
  1131.         /// The file type. See SNPS3_DIRENT_TYPE_* defines    
  1132.         UINT32 Type;
  1133.         /// File access attributes in standard octal format.
  1134.         UINT32 Mode;
  1135.         /// The last access time of the file.
  1136.         struct tm AccessTime;
  1137.         /// The modified time of the file.
  1138.         struct tm ModifiedTime;
  1139.         /// The create time of the file.
  1140.         struct tm CreateTime;
  1141.         /// The file size.
  1142.         UINT64 Size;
  1143.         /// The file name. UTF-8 null-terminated string.
  1144.         char Name[SNPS3_DIRENT_NAME_LEN];
  1145. };
  1146. typedef struct SNPS3DirEntry SNPS3DirEntry;
  1147.  
  1148. //////////////////////////////////////////////////////////////////////////////
  1149. /// @struct     SNPS3TargetTimezone
  1150. ///     @brief  Contains parameters which define the target timezone and
  1151. ///         dst settings
  1152. //////////////////////////////////////////////////////////////////////////////
  1153.  
  1154. struct SNPS3TargetTimezone
  1155. {
  1156.         /// The timezone settings (offset from gmt, in seconds)
  1157.         INT32 Timezone;
  1158.         /// The daylight saving time settings (in seconds)
  1159.         INT32 Dst;
  1160. };
  1161. typedef struct SNPS3TargetTimezone SNPS3TargetTimezone;
  1162.  
  1163. //////////////////////////////////////////////////////////////////////////////
  1164. /// @struct     SNPS3DirEntryEx
  1165. ///     @brief  Contains parameters which define a directory entry
  1166. ///                     (see SNPS3GetDirectoryListEx()).
  1167. ///          File timestamp is returned in time_t UTC format.
  1168. //////////////////////////////////////////////////////////////////////////////
  1169.  
  1170. struct SNPS3DirEntryEx
  1171. {
  1172.         /// The file type. See SNPS3_DIRENT_TYPE_* defines    
  1173.         UINT32 Type;
  1174.         /// File access attributes in standard octal format.
  1175.         UINT32 Mode;
  1176.         /// The last access time of the file.
  1177.         UINT64 AccessTimeUTC;
  1178.         /// The modified time of the file.
  1179.         UINT64 ModifiedTimeUTC;
  1180.         /// The create time of the file.
  1181.         UINT64 CreateTimeUTC;
  1182.         /// The file size.
  1183.         UINT64 Size;
  1184.         /// The file name. UTF-8 null-terminated string.
  1185.         char Name[SNPS3_DIRENT_NAME_LEN];
  1186. };
  1187. typedef struct SNPS3DirEntryEx SNPS3DirEntryEx;
  1188.  
  1189. //! Maximum path length on PS3.
  1190. #define SNPS3_MAX_TARGET_PATH (1024 + 32)
  1191.  
  1192. //////////////////////////////////////////////////////////////////////////////
  1193. /// @struct     SNPS3Transfer
  1194. ///     @brief  File transfer information (see SNPS3GetFileTransferInfo(),
  1195. ///                     SNPS3GetFileTransferList()).
  1196. //////////////////////////////////////////////////////////////////////////////
  1197.  
  1198. struct SNPS3Transfer
  1199. {
  1200.         /// Status ID's.
  1201.         enum STATUS {
  1202.                 PENDING         = (1<<0),
  1203.                 FAILED          = (1<<1),
  1204.                 SUCCEEDED       = (1<<2),
  1205.                 SKIPPED         = (1<<3),
  1206.                 IN_PROGRESS     = (1<<4),
  1207.                 CANCELLED       = (1<<5)
  1208.         };
  1209.  
  1210.         /// Transfer ID.
  1211.         UINT32 ID;
  1212.         /// Status of transfer.
  1213.         UINT32 Status;
  1214.         /// Source path. UTF-8 null-terminated string.
  1215.         char Source[MAX_PATH];
  1216.         /// Destination path. UTF-8 null-terminated string.
  1217.         char Destination[SNPS3_MAX_TARGET_PATH];
  1218.         /// Total size of file in bytes.
  1219.         UINT64 Size;
  1220.         /// Total number of bytes read.
  1221.         UINT64 Read;
  1222. };
  1223. typedef struct SNPS3Transfer SNPS3Transfer;
  1224.  
  1225. //////////////////////////////////////////////////////////////////////////////
  1226. ///
  1227. ///  @brief     Returns a textual description of an SN error code.
  1228. ///
  1229. ///  @param     snr              SN error code.
  1230. ///  @param     ppszErrorString  Pointer to receive error string. UTF-8 null-terminated string.
  1231. ///
  1232. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1233. ///             SN_S_OK - Error string found and translated.\n
  1234. ///             SN_E_BAD_PARAM - ppszErrorString was NULL pointer.\n
  1235. ///             SN_E_ERROR - snr was an invalid code.
  1236. ///
  1237. //////////////////////////////////////////////////////////////////////////////
  1238.  
  1239. SNAPI SNRESULT SNPS3TranslateError(SNRESULT snr, const char **ppszErrorString);
  1240.  
  1241. //////////////////////////////////////////////////////////////////////////////
  1242. ///
  1243. ///  @brief     Initialises target communications and launches Target Manager.
  1244. ///  This function must be called by each application thread before functions in
  1245. ///  the DLL can be used by that thread. It sets up any necessary data structures and establishes
  1246. ///  communication with the Target Manager.\n
  1247. ///  Note that because this function internally starts thread(s), it should not be called inside
  1248. ///  DllMain() / DLL_PROCESS_ATTACH, or deadlock can occur.
  1249. ///  When the application has finished using the DLL, SNPS3CloseTargetComms() should be called.
  1250. ///
  1251. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1252. ///             SN_S_OK - Communications initialised successfully.\n
  1253. ///             SN_S_TM_VERSION - Warning: Different version of Target Manager.\n
  1254. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  1255. ///             SN_E_ERROR - Internal error.
  1256. ///
  1257. //////////////////////////////////////////////////////////////////////////////
  1258.  
  1259. SNAPI SNRESULT SNPS3InitTargetComms(void);
  1260.  
  1261. //////////////////////////////////////////////////////////////////////////////
  1262. ///
  1263. ///  @brief     Shuts down internal communications (but does not close the
  1264. ///             Target Manager) and frees resources.
  1265. ///             Note that because this function internally stops thread(s), it
  1266. ///             should not be called inside DllMain() / DLL_PROCESS_DETACH, or
  1267. ///             deadlock can occur.
  1268. ///
  1269. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1270. ///             SN_S_OK - Communications closed.
  1271. ///
  1272. //////////////////////////////////////////////////////////////////////////////
  1273.  
  1274. SNAPI SNRESULT SNPS3CloseTargetComms(void);
  1275.  
  1276. //////////////////////////////////////////////////////////////////////////////
  1277. ///
  1278. ///  @brief     List available target types.
  1279. ///             Call this function with pTypes = NULL to get the number of types.
  1280. ///             To get the target types, set pTypes to point to an allocated memory block of size
  1281. ///             (*puNumTypes * sizeof(\link TMAPI_TARGET_TYPE TMAPI_TARGET_TYPE\endlink)),
  1282. ///             and call the function again.\n
  1283. ///
  1284. ///  @param     puNumTypes      Pointer to unsigned int containing number of
  1285. ///                             instances of \link TMAPI_TARGET_TYPE TMAPI_TARGET_TYPE\endlink to go in pTypes buffer
  1286. ///                             (the size of which should be this value * sizeof(\link TMAPI_TARGET_TYPE TMAPI_TARGET_TYPE\endlink)).
  1287. ///  @param     pTypes                  Pointer to buffer to receive list of target
  1288. ///                             \link TMAPI_TARGET_TYPE TMAPI_TARGET_TYPE\endlink structures. If this
  1289. ///                             parameter is NULL then the value puNumTypes
  1290. ///                             points to is set to the no. of types available
  1291. ///                             and SN_S_OK is returned.
  1292. ///                             If puNumTypes is less than the no. of types
  1293. ///                             available then the value it points to is set to
  1294. ///                             the no. of types available and SN_S_OUT_OF_MEM is
  1295. ///                             returned.
  1296. ///
  1297. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1298. ///             SN_S_OK - Successfully retrieved target types or number of types.\n
  1299. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() SNPS3InitTargetComms() or SNPS3InitTargetComms first.\n
  1300. ///             SN_E_BAD_PARAM - puNumTypes was NULL pointer.\n
  1301. ///             SN_E_OUT_OF_MEM - There are more types available than specified in puNumTypes.
  1302. ///
  1303. //////////////////////////////////////////////////////////////////////////////
  1304.  
  1305. SNAPI SNRESULT SNPS3ListTargetTypes(UINT32 *puNumTypes, TMAPI_TARGET_TYPE *pTypes);
  1306.  
  1307. //////////////////////////////////////////////////////////////////////////////
  1308. ///
  1309. ///  @brief     Add a new target to the Target Manager.
  1310. ///             Creates a new PS3 target based on the parameters supplied.
  1311. ///             If the target already exists with different type/parameters the
  1312. ///             function will return SN_E_BAD_TARGET.
  1313. ///
  1314. ///  @param     pszName         Pointer to zero terminated UTF-8 char array containing
  1315. ///                             target name (for example "ps3devtool").
  1316. ///  @param     pszType                 Pointer to zero terminated char array containing
  1317. ///                             target type (one of the types returned by
  1318. ///                             \link SNPS3ListTargetTypes() SNPS3ListTargetTypes()\endlink).
  1319. ///  @param     uConnParamSize  Size of connect parameter in bytes (for IP
  1320. ///                             targets this is sizeof(\link TMAPI_TCPIP_CONNECT_PROP TMAPI_TCPIP_CONNECT_PROP\endlink)).
  1321. ///  @param             pConnParams             Pointer to connection parameters block, for
  1322. ///                             IP targets this is an instance of \link TMAPI_TCPIP_CONNECT_PROP TMAPI_TCPIP_CONNECT_PROP\endlink.
  1323. ///                             If this is NULL then default connection parameters are used.
  1324. ///  @param     pnTarget        Pointer to handle to receive target ID.
  1325. ///
  1326. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1327. ///             SN_S_OK - Target added successfully.\n
  1328. ///             SN_S_NO_ACTION - Target with same name, same type and same connect parameters already exists.\n
  1329. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1330. ///             SN_E_BAD_TARGET - Target already exists, or invalid target type.\n
  1331. ///             SN_E_BAD_PARAM - pnTarget is NULL pointer, or pConnParams is NULL pointer and uConnParamSize is non-zero.
  1332. ///
  1333. //////////////////////////////////////////////////////////////////////////////
  1334.  
  1335. SNAPI SNRESULT SNPS3AddTarget(const char *pszName, const char *pszType, UINT32 uConnParamSize,
  1336.                                                           BYTE *pConnParams, HTARGET *pnTarget);
  1337.  
  1338. //! Invalid target handle value.
  1339. const HTARGET SNPS3_INVALID_TARGET = 0xffffffff;
  1340.  
  1341. //! Default target special handle value.
  1342. const HTARGET SNPS3_DEFAULT_TARGET = 0xfffffffe;
  1343.  
  1344. //////////////////////////////////////////////////////////////////////////////
  1345. ///
  1346. ///  @brief     Gets the default target.\n
  1347. ///                             To set the default target, see SNPS3SetDefaultTarget().
  1348. ///                             If there is no default target, the function returns SN_E_BAD_TARGET, and writes
  1349. ///                             SNPS3_INVALID_TARGET to pTarget.
  1350. ///                             This should ONLY happen if TM Server has no targets.
  1351. ///
  1352. ///  @param     pTarget        Default target ID.
  1353. ///
  1354. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1355. ///                             SN_S_OK - Successfully retrieved default target.\n
  1356. ///                             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1357. ///                             SN_E_BAD_TARGET - No default target currently set.\n
  1358. ///                             SN_E_BAD_PARAM - pnTarget is NULL pointer.
  1359. ///
  1360. //////////////////////////////////////////////////////////////////////////////
  1361.  
  1362. SNAPI SNRESULT SNPS3GetDefaultTarget(HTARGET *pTarget);
  1363.  
  1364. //////////////////////////////////////////////////////////////////////////////
  1365. ///
  1366. ///  @brief     Sets the default target.\n
  1367. ///
  1368. ///  @param     pTarget        Default target ID.
  1369. ///
  1370. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1371. ///                             SN_S_OK - Successfully set default target.\n
  1372. ///                             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1373. ///                             SN_E_BAD_TARGET - hTarget was invalid.\n
  1374. ///
  1375. //////////////////////////////////////////////////////////////////////////////
  1376.  
  1377. SNAPI SNRESULT SNPS3SetDefaultTarget(HTARGET hTarget);
  1378.  
  1379. //////////////////////////////////////////////////////////////////////////////
  1380. ///
  1381. ///  @brief     Delete a specified target from the Target Manager.
  1382. ///
  1383. ///             Warning - this operation is irreversible.
  1384. ///
  1385. ///  @param     hTarget           Handle to valid target.
  1386. ///
  1387. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1388. ///             SN_S_OK - Successfully deleted target.\n
  1389. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1390. ///             SN_E_BAD_TARGET - hTarget was invalid.
  1391. ///
  1392. //////////////////////////////////////////////////////////////////////////////
  1393.  
  1394. SNAPI SNRESULT SNPS3DeleteTarget(HTARGET hTarget);
  1395.  
  1396. //////////////////////////////////////////////////////////////////////////////
  1397. ///
  1398. ///  @deprecated  Use SNPS3EnumerateTargets().
  1399. ///  @brief  Use SNPS3EnumerateTargets().
  1400. ///
  1401. //////////////////////////////////////////////////////////////////////////////
  1402. SNDEPRECATED("use SNPS3EnumerateTargets instead")
  1403. SNAPI SNRESULT SNPS3EnumTargets(TMAPI_EnumTargetsCB pfnCallBack);
  1404.  
  1405. //////////////////////////////////////////////////////////////////////////////
  1406. ///
  1407. ///  @deprecated  Use SNPS3EnumerateTargetsEx().
  1408. ///  @brief  Use SNPS3EnumerateTargetsEx().
  1409. ///
  1410. //////////////////////////////////////////////////////////////////////////////
  1411. SNDEPRECATED("use SNPS3EnumerateTargetsEx instead")
  1412. SNAPI SNRESULT SNPS3EnumTargetsEx(TMAPI_EnumTargetsExCB pfnCallBack, void *pArg);
  1413.  
  1414. //////////////////////////////////////////////////////////////////////////////
  1415. ///
  1416. ///  @brief     Displays a dialog centered in the window passed or to the
  1417. ///             desktop if NULL is passed in which displays a list of the
  1418. ///             targets available in the Target Manager.
  1419. ///             The user can choose a target which is returned through the
  1420. ///             buffer passed in.\n
  1421. ///             If no targets are available, the dialog will not be displayed
  1422. ///             and the function will return SN_E_NO_TARGETS.\n
  1423. ///             If the user presses cancel or does not select a target before
  1424. ///             clicking OK, the function will return SN_E_NO_SEL.\n
  1425. ///             If the function succeeds, the function will return SN_S_OK
  1426. ///             and the contents of the buffer pointed to by phTarget will be
  1427. ///             set to the handle for the selected target.\n
  1428. ///             This handle can then be used in subsequent operations.
  1429. ///
  1430. ///  @param     hWndOwner    Handle to owner window or NULL for desktop.
  1431. ///  @param     phTarget     Pointer to buffer to receive target handle.
  1432. ///
  1433. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1434. ///             SN_S_OK - Target chosen successfully.\n
  1435. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1436. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1437. ///             SN_E_BAD_PARAM - phTarget was NULL pointer.\n
  1438. ///             SN_E_NO_TARGETS - No targets available.\n
  1439. ///             SN_E_OUT_OF_MEM - Not enough memory available for target picker.\n
  1440. ///             SN_E_NO_SEL - User did not select a target.
  1441. ///
  1442. //////////////////////////////////////////////////////////////////////////////
  1443.  
  1444. SNAPI SNRESULT SNPS3PickTarget(HWND hWndOwner, HTARGET *phTarget);
  1445.  
  1446. //////////////////////////////////////////////////////////////////////////////
  1447. ///
  1448. ///  @brief     Connect to specified target.
  1449. ///
  1450. ///  @param     hTarget           Handle to valid target.
  1451. ///  @param     pszApplication    Name of connecting application.
  1452. ///                               Reserved for future use, should be NULL.
  1453. ///
  1454. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1455. ///             SN_S_OK - Successfully connected to target.\n
  1456. ///             SN_S_NO_ACTION - Target already connected.\n
  1457. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1458. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1459. ///             SN_E_COMMS_ERR - Error communicating with target.
  1460. ///
  1461. //////////////////////////////////////////////////////////////////////////////
  1462.  
  1463. SNAPI SNRESULT SNPS3Connect(HTARGET hTarget, const char *pszApplication);
  1464.  
  1465. //////////////////////////////////////////////////////////////////////////////
  1466. ///
  1467. ///  @brief     Connect to specified target.
  1468. ///
  1469. ///  @param     hTarget           Handle to valid target.
  1470. ///  @param     pszApplication    Name of connecting application.
  1471. ///                               Reserved for future use, should be NULL.
  1472. ///  @param     bForceFlag        Set to true to force disconnect an already connected user.
  1473. ///                               If false, then same behaviour as SNPS3Connect()
  1474. ///
  1475. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1476. ///             SN_S_OK - Successfully connected to target.\n
  1477. ///             SN_S_NO_ACTION - Target already connected.\n
  1478. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1479. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1480. ///             SN_E_COMMS_ERR - Error communicating with target.
  1481. ///
  1482. //////////////////////////////////////////////////////////////////////////////
  1483.  
  1484. SNAPI SNRESULT SNPS3ConnectEx(HTARGET hTarget, const char *pszApplication, BOOL bForceFlag);
  1485.  
  1486. //////////////////////////////////////////////////////////////////////////////
  1487. ///
  1488. ///  @brief     Disconnect from specified target.
  1489. ///
  1490. ///  @param     hTarget    Handle to valid target.
  1491. ///
  1492. ///  @result    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1493. ///             SN_S_OK - Successfully disconnected from target.\n
  1494. ///             SN_S_NO_ACTION - Not connected to target.\n
  1495. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1496. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1497. ///             SN_E_COMMS_ERR - Error communicating with target.
  1498. ///
  1499. //////////////////////////////////////////////////////////////////////////////
  1500.  
  1501. SNAPI SNRESULT SNPS3Disconnect(HTARGET hTarget);
  1502.  
  1503. //////////////////////////////////////////////////////////////////////////////
  1504. ///
  1505. ///  @brief     Forcibly disconnect another user from the specified target.
  1506. ///
  1507. ///  @param     hTarget    Handle to valid target.
  1508. ///
  1509. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1510. ///             SN_S_OK - Successfully disconnected another user.\n
  1511. ///             SN_S_NO_ACTION - Currently connected - can not forcibly disconnect oneself. Call SNPS3Disconnect() for this purpose.\n
  1512. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1513. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1514. ///             SN_E_COMMS_ERR - Error communicating with target.
  1515. /////////////////////////////////////////////////////////////////////////////////
  1516.  
  1517.  
  1518. SNAPI SNRESULT SNPS3ForceDisconnect(HTARGET hTarget);
  1519.  
  1520. //////////////////////////////////////////////////////////////////////////////
  1521. ///
  1522. ///  @brief     Returns the connection status of the specified target.
  1523. ///             If this function succeeds it returns SN_S_OK and
  1524. ///             *pnConnectStatus contains the connection status of the target.\n
  1525. ///             If *pnConnectStatus is \link ApiBase::CS_IN_USE CS_IN_USE\endlink, then ppszUsage will point to
  1526. ///             a string containing details of the current user. Otherwise, ppszUsage will point to
  1527. ///             a string signifying that the target is not in use. The content
  1528. ///             of the string returned is temporary and must be copied to a
  1529. ///             permanent location.
  1530. ///
  1531. ///  @param     hTarget            Handle to target.
  1532. ///  @param     puConnectStatus    Pointer to variable for connect status.
  1533. ///                                (See \link ApiBase::ECONNECTSTATUS ECONNECTSTATUS\endlink).
  1534. ///  @param     ppszUsage          Returns a pointer to the UTF-8 null-terminated usage string.
  1535. ///
  1536. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1537. ///             SN_S_OK - Successfully retrieved connect status.\n
  1538. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1539. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1540. ///             SN_E_BAD_PARAM - puConnectStatus or ppszUsage is NULL.\n
  1541. ///             SN_E_OUT_OF_MEM - Not enough memory available for temporary string.\n
  1542. ///             SN_E_COMMS_ERR - Error communicating with target.
  1543. ///
  1544. //////////////////////////////////////////////////////////////////////////////
  1545.  
  1546. SNAPI SNRESULT SNPS3GetConnectStatus(HTARGET hTarget, ECONNECTSTATUS *puConnectStatus, char **ppszUsage);
  1547.  
  1548. //////////////////////////////////////////////////////////////////////////////
  1549. ///
  1550. ///  @brief     List all available TTY streams for a particular target.
  1551. ///             To obtain a list of TTY Streams, call this function passing
  1552. ///             NULL for pStreams to get the number of TTY streams. Allocate
  1553. ///             a block of \link TTYSTREAM TTYSTREAM\endlink structures and call this function again
  1554. ///             passing in a pointer to this buffer.
  1555. ///
  1556. ///  @param     hTarget            Handle to target.
  1557. ///  @param     puNumTTYStreams    [in] Size of buffer in number of streams.\n
  1558. ///                                [out] Number of streams for which space is required,
  1559. ///                                or if buffer is big enough, number written to buffer.
  1560. ///  @param     pStreams           Pointer to buffer to receive array of
  1561. ///                                stream info structures.
  1562. ///
  1563. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1564. ///             SN_S_OK - Successfully retrieved streams list or number of streams.\n
  1565. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1566. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1567. ///             SN_E_BAD_PARAM - puNumTTYStreams is a NULL pointer.\n
  1568. ///             SN_E_OUT_OF_MEM - Number of streams in puNumTTYStreams is less than actual number of streams.\n
  1569. ///             SN_E_COMMS_ERR - Error communicating with target.
  1570. ///
  1571. //////////////////////////////////////////////////////////////////////////////
  1572.  
  1573. SNAPI SNRESULT SNPS3ListTTYStreams(HTARGET hTarget, UINT32 *puNumTTYStreams, TTYSTREAM *pStreams);
  1574.  
  1575. //////////////////////////////////////////////////////////////////////////////
  1576. ///
  1577. ///  @brief     Kick the event notification queue. When an application registers one or more callbacks,
  1578. ///             this function must be called to retrieve events and facilitate the calling of callbacks.
  1579. ///                             Version 370+ has changed the way it operates in a multi-threaded environment.
  1580. ///                             Calling SNPS3Kick() in a specific thread will now only kick the callbacks that were
  1581. ///                             registered in that thread.
  1582. ///                             This means it is now safe to register callbacks in any thread that
  1583. ///                             needs to process notifications, as long as SNPS3Kick() is called in each thread.
  1584. ///
  1585. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1586. ///             SN_S_OK - One or more events were processed.\n
  1587. ///             SN_S_NO_MSG - There were no messages to process.\n
  1588. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.
  1589. ///
  1590. //////////////////////////////////////////////////////////////////////////////
  1591.  
  1592. SNAPI SNRESULT SNPS3Kick();
  1593.  
  1594. //////////////////////////////////////////////////////////////////////////////
  1595. ///
  1596. ///  @deprecated  Use SNPS3RegisterTTYEventHandler()
  1597. ///  @brief  Use SNPS3RegisterTTYEventHandler()
  1598. ///
  1599. //////////////////////////////////////////////////////////////////////////////
  1600. SNDEPRECATED("use SNPS3RegisterTTYEventHandler instead")
  1601. SNAPI SNRESULT SNPS3RegisterTTYEvents(HTARGET hTarget, UINT32 uStream, TMAPI_HandleEventCB pfnCallBack, void *pUserData);
  1602.  
  1603. //! Specifies that all available TTY streams are to be acted on, rather than an individual stream.
  1604. #define SNPS3_TTY_ALL_STREAMS                                   (UINT32) -1
  1605.  
  1606. //////////////////////////////////////////////////////////////////////////////
  1607. ///
  1608. ///  @brief     Register a callback function which will be called when TTY
  1609. ///             output is available from a target.
  1610. ///             The callback will only be invoked when SNPS3Kick() is called.
  1611. ///
  1612. ///  @param             hTarget                 Handle to a target.
  1613. ///  @param     uStream                 TTY stream to receive TTY events on or SNPS3_TTY_ALL_STREAMS for all streams.\n
  1614. ///                             If SNPS3_TTY_ALL_STREAMS is specified and an error occurs (other than SN_E_BAD_PARAM or SN_E_DLL_NOT_INITIALISED),
  1615. ///                             all streams will be unregistered.
  1616. ///  @param     pfnCallBack             Pointer to callback.
  1617. ///  @param             pUserData               Optional user defined data.
  1618. ///
  1619. ///  Callback must be in the form of:
  1620. ///
  1621. /// \code
  1622. ///  __stdcall void Callback(
  1623. ///          HTARGET hTarget,       // Handle to target.
  1624. ///          UINT32 Type,           // SN_EVENT_TTY.
  1625. ///          UINT32 Param,          // Stream ID.
  1626. ///          SNRESULT eResult,      // Success or failure of data fetch.
  1627. ///          UINT32 Length,         // Length of data in event including header.
  1628. ///          BYTE* Data,            // Pointer to event data.
  1629. ///          void* UserData);       // Optional user data.
  1630. /// \endcode
  1631. ///
  1632. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1633. ///             SN_S_OK - Successfully registered for target events.\n
  1634. ///             SN_S_REPLACED - Already registered for TTY events, previous callback function has been replaced.\n
  1635. ///             In the case of SNPS3_TTY_ALL_STREAMS, this signifies a callback for at least one stream was replaced.\n
  1636. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1637. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1638. ///             SN_E_BAD_PARAM - Pointer to callback function was null.\n
  1639. ///             SN_E_ERROR - Internal error.
  1640. ///
  1641. //////////////////////////////////////////////////////////////////////////////
  1642.  
  1643. SNAPI SNRESULT SNPS3RegisterTTYEventHandler(HTARGET hTarget, UINT32 uStream,
  1644.                                                                                         TMAPI_HandleEventCallback pfnCallBack, void *pUserData);
  1645.  
  1646. //////////////////////////////////////////////////////////////////////////////
  1647. ///
  1648. ///  @brief     Unregister the current callback function from receiving TTY.
  1649. ///             If \link PS3TMAPI::SNPS3_TTY_ALL_STREAMS SNPS3_TTY_ALL_STREAMS\endlink is specified and errors occur unregistering
  1650. ///             one or more streams, the returned error code is that of the last failure.
  1651. ///
  1652. ///  @param     hTarget    Handle to target.
  1653. ///  @param     uStream    Stream ID previously registered or \link PS3TMAPI.h::SNPS3_TTY_ALL_STREAMS SNPS3_TTY_ALL_STREAMS\endlink for all streams.
  1654. ///
  1655. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1656. ///             SN_S_OK - Successfully unregistered from TTY events.\n
  1657. ///             SN_S_NO_ACTION - No callback function registered to that stream.\n
  1658. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1659. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1660. ///
  1661. //////////////////////////////////////////////////////////////////////////////
  1662.  
  1663. SNAPI SNRESULT SNPS3CancelTTYEvents(HTARGET hTarget, UINT32 uStream);
  1664.  
  1665. //////////////////////////////////////////////////////////////////////////////
  1666. ///
  1667. ///  @brief     Send TTY data to the specified TTY stream.
  1668. ///
  1669. ///  @param     hTarget    Handle to target.
  1670. ///  @param     uStream    Stream ID.
  1671. ///  @param     pszText    Text.
  1672. ///
  1673. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1674. ///             SN_S_OK - TTY data sent successfully.\n
  1675. ///             SN_E_BAD_PARAM - pszText was NULL pointer.\n
  1676. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1677. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1678. ///             SN_E_COMMS_ERR - Error communicating with target.
  1679. ///
  1680. //////////////////////////////////////////////////////////////////////////////
  1681.  
  1682. SNAPI SNRESULT SNPS3SendTTY(HTARGET hTarget, UINT32 uStream, const char *pszText);
  1683.  
  1684. //////////////////////////////////////////////////////////////////////////////
  1685. ///
  1686. ///  @deprecated  Use SNPS3RegisterTargetEventHandler()
  1687. ///  @brief  Use SNPS3RegisterTargetEventHandler()
  1688. ///
  1689. //////////////////////////////////////////////////////////////////////////////
  1690. SNDEPRECATED("use SNPS3RegisterTargetEventHandler instead")
  1691. SNAPI SNRESULT SNPS3RegisterTargetEvents(HTARGET hTarget,
  1692.                                                                                  TMAPI_HandleEventCB pfnCallBack, void *pUserData);
  1693.  
  1694. //////////////////////////////////////////////////////////////////////////////
  1695. ///
  1696. ///  @brief     Unregister the current callback function from receiving events.
  1697. ///
  1698. ///  @param     hTarget    Handle to target.
  1699. ///
  1700. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1701. ///             SN_S_OK - Target events cancelled successfully.\n
  1702. ///             SN_S_NO_ACTION - No callback function registered.\n
  1703. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1704. ///             SN_E_BAD_TARGET - hTarget was invalid.
  1705. ///
  1706. //////////////////////////////////////////////////////////////////////////////
  1707.  
  1708. SNAPI SNRESULT SNPS3CancelTargetEvents(HTARGET hTarget);
  1709.  
  1710. //////////////////////////////////////////////////////////////////////////////
  1711. ///
  1712. ///  @brief     Retrieves information for a target specified by hTarget
  1713. ///             member of SNPS3TargetInfo() structure.
  1714. ///             SN_TI_TARGETID flag in nFlags member *must* be set.
  1715. ///             Members are set when structure returns and setting of
  1716. ///             other flags has no effect. The boot parameter is not retrieved (on return, see the nFlags
  1717. ///             member to check which members have been set).
  1718. ///             Contents of structure returned are temporary and must be copied to a permanent location.
  1719. ///
  1720. ///  @param     pTargetInfo    Address of target info structure.
  1721. ///
  1722. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1723. ///             SN_S_OK - Successfully retrieved target information.\n
  1724. ///             SN_E_BAD_PARAM - Pointer to structure is NULL or SN_TI_TARGETID not set.\n
  1725. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1726. ///             SN_E_BAD_TARGET - hTarget was invalid.
  1727. ///
  1728. //////////////////////////////////////////////////////////////////////////////
  1729.  
  1730. SNAPI SNRESULT SNPS3GetTargetInfo(SNPS3TargetInfo *pTargetInfo);
  1731.  
  1732. //////////////////////////////////////////////////////////////////////////////
  1733. ///
  1734. ///  @brief     Returns the version of the API the code was built against.
  1735. ///
  1736. ///  @param     ppszVersion    Pointer to a const char* to receive the
  1737. ///                            version.
  1738. ///
  1739. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1740. ///             SN_S_OK - Successfully retrieved API version.\n
  1741. ///             SN_E_BAD_PARAM - ppszVersion was NULL pointer.
  1742. ///
  1743. //////////////////////////////////////////////////////////////////////////////
  1744.  
  1745. SNAPI SNRESULT SNPS3GetAPIVersion(char **ppszVersion);
  1746.  
  1747. //////////////////////////////////////////////////////////////////////////////
  1748. ///
  1749. ///  @brief     Returns the version of the Target Manager currently connected.
  1750. ///
  1751. ///  @param     ppszVersion    Pointer to a const char* to receive the
  1752. ///                             version. The content pointed to is temporary and must be copied to a
  1753. ///                             permanent location.
  1754. ///
  1755. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1756. ///             SN_S_OK - Successfully retrieved Target Manager version.\n
  1757. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1758. ///             SN_E_BAD_PARAM - ppszVersion was NULL pointer.
  1759. ///
  1760. //////////////////////////////////////////////////////////////////////////////
  1761.  
  1762. SNAPI SNRESULT SNPS3GetTMVersion(char **ppszVersion);
  1763.  
  1764. //////////////////////////////////////////////////////////////////////////////
  1765. ///
  1766. ///  @brief     Sets target information based on members of supplied
  1767. ///             SNPS3TargetInfo() structure.
  1768. ///             Only members identified by nFlags member will be set. The
  1769. ///             desired target to change is indicated by the hTarget member
  1770. ///             for which nFlags *must* include the SN_TI_TARGETID flag.\n
  1771. ///             The info field (SN_TI_INFO) and boot parameter field (SN_TI_BOOT)
  1772. ///             cannot be set. See SNPS3SetBootParameter() and SNPS3SetConnectionInfo() to set these.\n
  1773. ///             Target notifications (see SNPS3RegisterTargetEventHandler()) are sent for each field
  1774. ///             changed. See \link ApiBase::SN_TGT_EVENT_DETAILS SN_TGT_EVENT_DETAILS\endlink.
  1775. ///
  1776. ///  @param     pTargetInfo    Address of target info structure.
  1777. ///
  1778. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1779. ///             SN_S_OK - Successfully set target information.\n
  1780. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1781. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1782. ///             SN_E_BAD_PARAM - pTargetInfo was NULL, SN_TI_TARGETID not in flags, SN_TI_INFO or SN_TI_BOOT in flags.
  1783. ///
  1784. //////////////////////////////////////////////////////////////////////////////
  1785.  
  1786. SNAPI SNRESULT SNPS3SetTargetInfo(SNPS3TargetInfo *pTargetInfo);
  1787.  
  1788. //////////////////////////////////////////////////////////////////////////////
  1789. ///
  1790. ///  @brief     Takes a string containing the name of a target (for example
  1791. ///             "ps3devtool") and fills the supplied handle with the
  1792. ///             corresponding target ID.
  1793. ///
  1794. ///  @param     pszTgtName    UTF-8 null-terminated target name string.
  1795. ///  @param     phTarget      Pointer to buffer to receive target handle.
  1796. ///
  1797. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1798. ///             SN_S_OK - Successfully retrieved target ID.\n
  1799. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1800. ///             SN_E_BAD_TARGET - Target does not exist, or pszTgtName was NULL.\n
  1801. ///             SN_E_NO_TARGETS - No targets available.
  1802. ///
  1803. //////////////////////////////////////////////////////////////////////////////
  1804.  
  1805. SNAPI SNRESULT SNPS3GetTargetFromName(const char *pszTgtName, HTARGET *phTarget);
  1806.  
  1807. //////////////////////////////////////////////////////////////////////////////
  1808. ///
  1809. ///  @brief             Returns the number of targets that are currently set up in Target Manager.
  1810. ///
  1811. ///  @param     puNumTargets    Pointer to unsigned int to receive number of targets.
  1812. ///
  1813. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1814. ///             SN_S_OK - Successfully retrieved number of targets.\n
  1815. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1816. ///             SN_E_BAD_PARAM - puNumTargets was NULL.
  1817. ///
  1818. //////////////////////////////////////////////////////////////////////////////
  1819.  
  1820. SNAPI SNRESULT SNPS3GetNumTargets(UINT32 *puNumTargets);
  1821.  
  1822. //////////////////////////////////////////////////////////////////////////////
  1823. ///
  1824. ///  @brief     Retrieves the current status of the specified processor unit.
  1825. ///
  1826. ///  @param     hTarget         Handle to target.
  1827. ///  @param     uUnit           Processor unit (see \link PS3TMAPI::ESNPS3UNIT ESNPS3UNIT\endlink).
  1828. ///  @param     pnUnitStatus    Pointer to variable for status. See \link ApiBase.h::EUNITSTATUS EUNITSTATUS\endlink.
  1829. ///                            
  1830. ///  @param     pnReasonCode    Not used for PS3, should be NULL.
  1831. ///
  1832. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1833. ///             SN_S_OK - Successfully retrieved unit status.\n
  1834. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1835. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1836. ///             SN_E_BAD_PARAM - pnUnitStatus was NULL pointer.\n
  1837. ///             SN_E_BAD_UNIT - uUnit was an invalid unit ID.
  1838. ///            
  1839. //////////////////////////////////////////////////////////////////////////////
  1840.  
  1841. SNAPI SNRESULT SNPS3GetStatus(HTARGET hTarget, UINT32 uUnit, long *pnUnitStatus, long *pnReasonCode);
  1842.  
  1843. // @name <ResetParameters>
  1844. //@{
  1845. //! Perform a soft reset (default).
  1846. const UINT64 SNPS3TM_RESETP_SOFT_RESET                          = 0x0000000000000000ui64;
  1847. //! Perform a hard reset (default = soft).
  1848. const UINT64 SNPS3TM_RESETP_HARD_RESET                          = 0x0000000000000001ui64;
  1849. //! Perform a quick reset.
  1850. const UINT64 SNPS3TM_RESETP_QUICK_RESET                         = 0x0000000000000002ui64;
  1851. //! Do not display reset settings in tty - Do not set this bit in the mask to change current reset only
  1852. //! Setting this bit in the mask will change TM (persisted) settings
  1853. const UINT64 SNPS3TM_RESETP_DONT_DISPLAY_SETTINGS       = 0x2000000000000000ui64;
  1854. //! Perform a reset using separate off/on commands (all other flags are honoured).
  1855. const UINT64 SNPS3TM_RESETP_RESET_EX                            = 0x8000000000000000ui64;      
  1856. //@}
  1857.  
  1858. // @name <ResetParameterMask>
  1859. //@{
  1860. //! Reset parameter mode mask.
  1861. const UINT64 SNPS3TM_RESETP_SOFT_HARD_MASK                      = 0x0000000000000001ui64;
  1862. //! Reset parameter type mask.
  1863. const UINT64 SNPS3TM_RESETP_QUICK_FULL_MASK                     = 0x0000000000000002ui64;
  1864. //! Reset parameter ex mask.
  1865. const UINT64 SNPS3TM_RESETP_RESET_EX_MASK                       = 0x8000000000000000ui64;
  1866. //! Reset parameter all mask.
  1867. const UINT64 SNPS3TM_RESETP_ALL_MASK                            = SNPS3TM_RESETP_SOFT_HARD_MASK | SNPS3TM_RESETP_QUICK_FULL_MASK | SNPS3TM_RESETP_RESET_EX_MASK;
  1868. //@}
  1869.  
  1870. //////////////////////////////////////////////////////////////////////////////
  1871. ///
  1872. ///  @brief     Resets specified target allowing specification of reset parameters.
  1873. ///
  1874. ///  @param     hTarget     Handle to a valid target.
  1875. ///  @param     uReset      PS3 reset parameter - See SNPS3TM_RESETP_SOFT_RESET etc.
  1876. ///
  1877. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1878. ///             SN_S_OK - Successfully reset target.\n
  1879. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1880. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1881. ///             SN_E_COMMS_ERR - Error communicating with target.
  1882. ///
  1883. //////////////////////////////////////////////////////////////////////////////
  1884.  
  1885. SNAPI SNRESULT SNPS3Reset(HTARGET hTarget, UINT64 uReset);
  1886.  
  1887. //! Process priority.
  1888. #define SNPS3_DEF_PROCESS_PRI    (0x3e9)
  1889.  
  1890. //////////////////////////////////////////////////////////////////////////////
  1891. ///
  1892. ///  @brief     Loads an ELF file, returning the process ID and thread ID for the process.
  1893. ///
  1894. ///  @param     hTarget                 Handle to target.
  1895. ///  @param             uPriority               Priority to be given to the primary PPU thread (for example SNPS3_DEF_PROCESS_PRI).
  1896. ///  @param             pszFilename             UTF-8 null-terminated filename of ELF to download. /app_home/ will automatically be added to the start of this path.
  1897. ///                             The maximum size of the path is 1024 bytes.
  1898. ///                                                             To load from dev_hdd0, the path should start with "../dev_hdd0/" in order to bypass automatic addition of /app_home/.
  1899. ///  @param             argc                    Size of list of arguments to be passed to main function.
  1900. ///  @param             argv                    Argument list to be passed to main function. Total max size is 4096 bytes.
  1901. ///  @param             envc                    Size of list of environment variables.
  1902. ///  @param             envv                    List of environment variables to be set for the process in format: VAR=value.
  1903. ///                             Total max size os 4096 bytes.
  1904. ///  @param             puProcessID             Pointer to buffer to receive process ID (or NULL).
  1905. ///  @param             puThreadID              Pointer to buffer to receive thread ID (or NULL).
  1906. ///  @param             uDebugFlags             Debug flags. See SNPS3_LOAD_FLAG_*
  1907. ///
  1908. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.6.0 - latest version.\n
  1909. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  1910. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  1911. ///
  1912. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1913. ///             SN_S_OK - Process successfully loaded.\n
  1914. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1915. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1916. ///             SN_E_BAD_PARAM          - Either pszFilename was NULL pointer or argv or envv were NULL whilst argc or envc were non-zero.\n
  1917. ///             SN_E_DATA_TOO_LONG      - One or more of pszFilename, argv or envv exceeded max size allowed by protocol.\n
  1918. ///             SN_E_DECI_ERROR     - PARAM.SFO was required and not found.\n
  1919. ///             SN_E_TM_COMMS_ERR   - Error communicating with TM Server.\n
  1920. ///             SN_E_COMMS_ERR      - Error launching the process - check tty for more information. Common errors are:\n
  1921. ///                                             0x80010002 - The path exceeds max size allowed by device.\n
  1922. ///                                             0x80010006 - File not found.                          
  1923. ///
  1924. //////////////////////////////////////////////////////////////////////////////
  1925.  
  1926. SNAPI SNRESULT SNPS3ProcessLoad(HTARGET hTarget, UINT32 uPriority, const char *pszFilename,
  1927.                                                                 int argc, const char** argv, int envc, const char** envv,
  1928.                                                                 UINT32 *puProcessID, UINT64 *puThreadID, UINT32 uDebugFlags);
  1929.  
  1930. //////////////////////////////////////////////////////////////////////////////
  1931. ///
  1932. ///  @brief     Fetches a list of processes running on the specified target.
  1933. ///             Call this function with puBuffer = NULL to get the number of processes in puCount.
  1934. ///             To get the process list, set puBuffer to point to a memory block of size (*puCount * sizeof(UINT32)),
  1935. ///             and call the function again.
  1936. ///
  1937. ///  @param     hTarget                 Handle to target.
  1938. ///  @param             puCount                 [in] Maximum number of IDs buffer can hold.\n
  1939. ///                             [out] Number of processes for which space is required,
  1940. ///                             or if buffer is big enough, number written to buffer.
  1941. ///  @param             puBuffer                Pointer to a buffer to receive the information.
  1942. ///                             As a guide, allocate a buffer of 64 * sizeof(UINT32),
  1943. ///                             passing 64 as the count.
  1944. ///
  1945. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.0.0 - latest version.\n
  1946. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  1947. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  1948. ///
  1949. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  1950. ///             SN_S_OK - Successfully retrieved process list or number of processes.\n
  1951. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  1952. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  1953. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  1954. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount (in UINT32s) smaller than required.\n
  1955. ///             SN_E_COMMS_ERR - Error communicating with target.
  1956. ///
  1957. //////////////////////////////////////////////////////////////////////////////
  1958.  
  1959. SNAPI SNRESULT SNPS3ProcessList(HTARGET hTarget, UINT32 *puCount, UINT32 *puBuffer);
  1960.  
  1961. //////////////////////////////////////////////////////////////////////////////
  1962. /// @struct     SNPS3MODULEINFO_HDR
  1963. ///     @brief  PRX module info.
  1964. //////////////////////////////////////////////////////////////////////////////
  1965.  
  1966. struct SNPS3MODULEINFO_HDR {
  1967.         /// Module name.
  1968.         char    aName[30];
  1969.         /// Module version.
  1970.         char    aVersion[2];
  1971.         /// Module attributes.
  1972.         UINT32  uAttribute;
  1973.         /// Address of start entry.
  1974.         UINT32  uStartEntry;
  1975.         /// Address of stop entry.
  1976.         UINT32  uStopEntry;
  1977.         /// Full filename of PRX module.
  1978.         char    aElfName[512];
  1979.         /// Number of segments in module.
  1980.         UINT32  uNumSegments;
  1981. };
  1982. typedef struct SNPS3MODULEINFO_HDR SNPS3MODULEINFO_HDR;
  1983. typedef SNPS3MODULEINFO_HDR *PSNPS3MODULEINFO_HDR;
  1984.  
  1985. //////////////////////////////////////////////////////////////////////////////
  1986. /// @struct     SNPS3PRXSEGMENT
  1987. ///     @brief  Information about segments within PRX module.
  1988. //////////////////////////////////////////////////////////////////////////////
  1989.  
  1990. struct SNPS3PRXSEGMENT {
  1991.         UINT64  uBase;
  1992.         UINT64  uFileSize;
  1993.         UINT64  uMemSize;
  1994.         UINT64  uIndex;
  1995.         UINT64  uElfType;
  1996. };
  1997. typedef struct SNPS3PRXSEGMENT SNPS3PRXSEGMENT;
  1998. typedef SNPS3PRXSEGMENT *PSNPS3PPRXSEGMENT;
  1999.  
  2000. //////////////////////////////////////////////////////////////////////////////
  2001. /// @struct     SNPS3PRXSEGMENTEX
  2002. ///     @brief  Extended information about segment within PRX module.
  2003. //////////////////////////////////////////////////////////////////////////////
  2004.  
  2005. struct SNPS3PRXSEGMENTEX {
  2006.         UINT64  uBase;
  2007.         UINT64  uFileSize;
  2008.         UINT64  uMemSize;
  2009.         UINT64  uIndex;
  2010.         UINT64  uElfType;
  2011.         UINT64  uFlags;
  2012.         UINT64  uAlign;
  2013. };
  2014. typedef struct SNPS3PRXSEGMENTEX SNPS3PRXSEGMENTEX;
  2015. typedef SNPS3PRXSEGMENTEX *SNPS3PPRXSEGMENTEX;
  2016.  
  2017. //////////////////////////////////////////////////////////////////////////////
  2018. /// @struct     SNPS3MODULEINFO
  2019. ///     @brief  Contains parameters which define a module (see SNPS3GetModuleInfo()).
  2020. //////////////////////////////////////////////////////////////////////////////
  2021.  
  2022. struct SNPS3MODULEINFO {
  2023.         SNPS3MODULEINFO_HDR Hdr;
  2024.         SNPS3PRXSEGMENT Segments[];
  2025. };
  2026. typedef struct SNPS3MODULEINFO SNPS3MODULEINFO;
  2027. typedef SNPS3MODULEINFO *PSNPS3MODULEINFO;
  2028.  
  2029. //////////////////////////////////////////////////////////////////////////////
  2030. ///
  2031. ///  @brief             Fetches module information.
  2032. ///             To get the module information, first call this function with pModuleInfo = NULL to get the required size.
  2033. ///             Allocate memory of size of the value pointed to by the returned puBufferSize, set pModuleInfo to point
  2034. ///             to this memory and call the function again.
  2035. ///
  2036. ///  @param     hTarget                 Handle to target.
  2037. ///  @param             uProcessID              ID of the process.
  2038. ///  @param     uModuleID               ID of the module.
  2039. ///  @param             puBufferSize    [in] Size of buffer.\n
  2040. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  2041. ///  @param             pModuleInfo             Pointer to a buffer to hold the module info.
  2042. ///
  2043. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2044. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2045. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2046. ///
  2047. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2048. ///             SN_S_OK - Successfully retrieved module information or required size.\n
  2049. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2050. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2051. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  2052. ///             SN_E_OUT_OF_MEM - Size of buffer defined in puBufferSize was too small.\n
  2053. ///             SN_E_COMMS_ERR - Error communicating with target.
  2054. ///
  2055. //////////////////////////////////////////////////////////////////////////////
  2056.  
  2057. SNAPI SNRESULT SNPS3GetModuleInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uModuleID, UINT64 *puBufferSize, SNPS3MODULEINFO *pModuleInfo);
  2058.  
  2059. //////////////////////////////////////////////////////////////////////////////
  2060. ///     @brief Extended module information
  2061. //////////////////////////////////////////////////////////////////////////////
  2062.  
  2063. struct SNPS3MODULEINFOEX {
  2064.         SNPS3MODULEINFO_HDR Hdr;
  2065.         SNPS3PRXSEGMENTEX Segments[];
  2066. };
  2067. typedef struct SNPS3MODULEINFOEX SNPS3MODULEINFOEX;
  2068. typedef SNPS3MODULEINFOEX *PSNPS3MODULEINFOEX;
  2069.  
  2070. //////////////////////////////////////////////////////////////////////////////
  2071. ///     @brief  MSELF information
  2072. //////////////////////////////////////////////////////////////////////////////
  2073.  
  2074. struct SNPS3MSELFINFO
  2075. {
  2076.         UINT64 uMselfFileOffset;
  2077.         UCHAR  aReserved[32];
  2078. };
  2079. typedef struct SNPS3MSELFINFO SNPS3MSELFINFO;
  2080.  
  2081. //////////////////////////////////////////////////////////////////////////////
  2082. ///     @brief  Extra module information contains GUID of PRX module loaded
  2083. //////////////////////////////////////////////////////////////////////////////
  2084.  
  2085. struct SNPS3EXTRAMODULEINFO
  2086. {
  2087.         UINT32 uaPPU_GUID[5];
  2088. };
  2089. typedef struct SNPS3EXTRAMODULEINFO SNPS3EXTRAMODULEINFO;
  2090.  
  2091. //////////////////////////////////////////////////////////////////////////////
  2092. ///
  2093. ///  @brief     Fetches module information.
  2094. ///             To get the module information, first call this function with pModuleInfo = NULL to get the required size.
  2095. ///             Allocate memory of size of the value pointed to by the returned puBufferSize, set pModuleInfo to point
  2096. ///             to this memory and call the function again.
  2097. ///
  2098. ///  @param     hTarget                         Handle to target
  2099. ///  @param             uProcessID                      ID of the process.
  2100. ///  @param     uModuleID                       ID of the module.
  2101. ///  @param             puBufferSize            [in] Size of the buffer.\n
  2102. ///                                     [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.\n
  2103. ///                                     NOTE: The buffer size holds all module information plus extra MSELF information.
  2104. ///  @param             pModuleInfo                     Pointer to a buffer to hold the module info.
  2105. ///  @param             ppMSELFInfo                     Address of a pointer which will hold the address in buffer of the MSELF information. Can be NULL.
  2106. ///      @param         pExtraModuleInfo        Pointer to an instance of \link SNPS3EXTRAMODULEINFO SNPS3EXTRAMODULEINFO\endlink to hold extra info (if set to NULL it is ignored).
  2107. ///
  2108. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version\n
  2109. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version\n
  2110. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version
  2111. ///
  2112. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2113. ///             SN_S_OK - Successfully retrieved module information or required size.\n
  2114. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2115. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2116. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  2117. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize smaller than required buffer size
  2118. ///             SN_E_COMMS_ERR - Error communicating with target.
  2119. ///
  2120. //////////////////////////////////////////////////////////////////////////////
  2121.  
  2122. SNAPI SNRESULT SNPS3GetModuleInfoEx(HTARGET hTarget, UINT32 uProcessID, UINT32 uModuleID, UINT64 *puBufferSize,
  2123.                                                                         SNPS3MODULEINFOEX *pModuleInfo, SNPS3MSELFINFO** ppMSELFInfo, SNPS3EXTRAMODULEINFO *pExtraModuleInfo);
  2124.  
  2125. //////////////////////////////////////////////////////////////////////////////
  2126. ///
  2127. ///  @brief     Fetches a list of modules loaded by a given process.
  2128. ///             Call this function with puBuffer = NULL to get the number of modules.
  2129. ///             To get the module list, set puBuffer to point to a memory block of size *puCount * sizeof(UINT32),
  2130. ///             and call the function again.
  2131. ///
  2132. ///  @param     hTarget                 Handle to target.
  2133. ///  @param             uProcessID              ID of the process to which the module belongs.
  2134. ///  @param     puCount                 [in] Number of module IDs buffer can hold.\n
  2135. ///                             [out] Number of modules for which space is required,
  2136. ///                             or if buffer is big enough, number written to buffer.
  2137. ///  @param             puBuffer                Pointer to a buffer to receive the information.
  2138. ///
  2139. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2140. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2141. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2142. ///
  2143. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2144. ///             SN_S_OK - Successfully retrieved module list or number of modules.\n
  2145. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2146. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2147. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  2148. ///             SN_E_OUT_OF_MEM - Buffer too small (size signified by (*puCount * sizeof(UINT32))).\n
  2149. ///             SN_E_COMMS_ERR - Error communicating with target.
  2150. ///
  2151. //////////////////////////////////////////////////////////////////////////////
  2152.  
  2153. SNAPI SNRESULT SNPS3GetModuleList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *puBuffer);
  2154.  
  2155. //////////////////////////////////////////////////////////////////////////////
  2156. ///
  2157. ///  @brief     Gets the connection information for a given target.
  2158. ///
  2159. ///  @param     hTarget                 Handle to target.
  2160. ///  @param     pConnection             Pointer to a buffer to receive the
  2161. ///                             \link TMAPI_TCPIP_CONNECT_PROP TMAPI_TCPIP_CONNECT_PROP\endlink structure.
  2162. ///
  2163. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2164. ///             SN_S_OK - Successfully retrieved connection information.\n
  2165. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2166. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2167. ///             SN_E_BAD_PARAM - pConnection was NULL pointer.\n
  2168. ///
  2169. //////////////////////////////////////////////////////////////////////////////
  2170.  
  2171. SNAPI SNRESULT SNPS3GetConnectionInfo(HTARGET hTarget, TMAPI_TCPIP_CONNECT_PROP *pConnection);
  2172.  
  2173. //////////////////////////////////////////////////////////////////////////////
  2174. /// @enum       ESNPS3PROCESSSTATUS
  2175. ///     @brief  This enumerated type defines the different states that a process can be in.
  2176. //////////////////////////////////////////////////////////////////////////////
  2177.  
  2178. enum ESNPS3PROCESSSTATUS {
  2179.         /// Process is being created
  2180.         ESNPS3_PS_CREATING = 1,  
  2181.         /// Process is ready (a PU thread exists in the process)
  2182.         ESNPS3_PS_READY = 2,  
  2183.         /// The process has exited but has not reported the exit status yet
  2184.         ESNPS3_PS_EXITED = 3    
  2185. };
  2186.  
  2187. #pragma pack(push, 1)
  2188.  
  2189. //////////////////////////////////////////////////////////////////////////////
  2190. /// @struct     SNPS3PROCESSINFO_HDR
  2191. ///     @brief  Process information header      
  2192. //////////////////////////////////////////////////////////////////////////////
  2193.  
  2194. struct SNPS3PROCESSINFO_HDR {
  2195.         /// Process status (see \link PS3tmapi.h::ESNPS3PROCESSSTATUS ESNPS3PROCESSSTATUS\endlink).
  2196.         UINT32  uStatus;                      
  2197.         /// Number of PPU threads.
  2198.         UINT32  uNumPPUThreads;        
  2199.         /// Number of SPU threads.
  2200.         UINT32  uNumSPUThreads;        
  2201.         /// Parent process ID.
  2202.         UINT32  uParentProcessID;      
  2203.         /// Maximum memory size for process.
  2204.         UINT64  uMaxMemorySize;        
  2205.         /// Path to the loaded elf. UTF-8 null-terminated string.
  2206.         char    szPath[512];          
  2207. };
  2208. typedef struct SNPS3PROCESSINFO_HDR SNPS3PROCESSINFO_HDR;
  2209. typedef SNPS3PROCESSINFO_HDR *PSNPS3PROCESSINFO_HDR;
  2210.  
  2211. //////////////////////////////////////////////////////////////////////////////
  2212. /// @struct     SNPS3PROCESSINFO
  2213. ///     @brief  This structure contains the parameters that define a process. It is used in the function
  2214. ///                     SNPS3ProcessInfo to obtain information about a particular process.
  2215. //////////////////////////////////////////////////////////////////////////////
  2216.  
  2217. struct SNPS3PROCESSINFO {
  2218.         SNPS3PROCESSINFO_HDR Hdr;
  2219.         UINT64 ThreadIDs[];
  2220. };
  2221. typedef struct SNPS3PROCESSINFO SNPS3PROCESSINFO;
  2222. typedef SNPS3PROCESSINFO *PSNPS3PROCESSINFO;
  2223.  
  2224. //////////////////////////////////////////////////////////////////////////////
  2225. /// @struct     SNPS3EXTRAPROCESSINFO
  2226. ///     @brief  Extra process information (GUID of elf)  
  2227. //////////////////////////////////////////////////////////////////////////////
  2228.  
  2229. struct SNPS3EXTRAPROCESSINFO
  2230. {
  2231.         UINT32 uaPPU_GUID[5];
  2232. };
  2233. typedef struct SNPS3EXTRAPROCESSINFO SNPS3EXTRAPROCESSINFO;
  2234.  
  2235. //////////////////////////////////////////////////////////////////////////////
  2236. /// @struct     SNPS3PROCESSLOADPARAMS
  2237. ///     @brief  Debug parameters passed during load.
  2238. //////////////////////////////////////////////////////////////////////////////
  2239.  
  2240. struct SNPS3PROCESSLOADPARAMS
  2241. {
  2242.         UINT64 uVersion;
  2243.         UINT64 uData[16];
  2244. };
  2245. typedef struct SNPS3PROCESSLOADPARAMS SNPS3PROCESSLOADPARAMS;
  2246.  
  2247. /// @brief Flag set if information in structure is valid.
  2248. #define SNPS3_PROCESSLOADINFO_FLAGS_INFO_VALID                  0x01
  2249.  
  2250. //////////////////////////////////////////////////////////////////////////////
  2251. /// @struct     SNPS3PROCESSLOADINFO
  2252. ///     @brief  Information on debug state of program. Populated by SNPS3ProcessInfoEx2().
  2253. //////////////////////////////////////////////////////////////////////////////
  2254.  
  2255. struct SNPS3PROCESSLOADINFO
  2256. {
  2257.         /// On return from SNPS3ProcessInfoEx2(), value is SNPS3_PROCESSLOADINFO_FLAGS_INFO_VALID if loaded by the debug agent
  2258.         /// (thus the rest of this information will be correct), 0 otherwise.
  2259.         UINT32 uInfoValid;                    
  2260.         /// Load flags passed into the load command
  2261.         UINT32 uDebugFlags;            
  2262.         /// Parameters passed during load
  2263.         SNPS3PROCESSLOADPARAMS LoadInfo;
  2264. };
  2265.  
  2266. //////////////////////////////////////////////////////////////////////////////
  2267. ///
  2268. ///  @brief     Fetches process information for a given process ID.
  2269. ///             Call this function with pProcessInfo = NULL to get the required buffer size.
  2270. ///             To get the process information, set pProcessInfo to point to an allocated memory block of size *puBufferSize,
  2271. ///             and call the function again.
  2272. ///
  2273. ///  @param     hTarget                 Handle to target.
  2274. ///  @param             uProcessID              Process ID.
  2275. ///  @param             puBufferSize    [in] Size of buffer.
  2276. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  2277. ///  @param             pProcessInfo    Buffer for returned process information. This
  2278. ///                             consists of a header \link SNPS3PROCESSINFO_HDR SNPS3PROCESSINFO_HDR\endlink followed
  2279. ///                             by the thread IDs for PPU and SPU respectively.
  2280. ///                             Each thread ID is 64 bits long.
  2281. ///
  2282. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.0.0 - latest version.\n
  2283. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2284. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2285. ///
  2286. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2287. ///             SN_S_OK - Successfully retrieved process information or required size.\n
  2288. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2289. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2290. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  2291. ///             SN_E_OUT_OF_MEM - Size of pProcessInfo buffer specified in puBufferSize was smaller than required.\n
  2292. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2293. ///             SN_E_COMMS_ERR - Error communicating with target, or invalid process ID supplied.
  2294. ///
  2295. //////////////////////////////////////////////////////////////////////////////
  2296.  
  2297. SNAPI SNRESULT SNPS3ProcessInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 *puBufferSize, SNPS3PROCESSINFO *pProcessInfo);
  2298.  
  2299. //////////////////////////////////////////////////////////////////////////////
  2300. ///
  2301. ///  @brief     Gets extended information for a specified process.
  2302. ///             Call this function with pProcessInfo = NULL to get the required buffer size.
  2303. ///             To get the process information, set pProcessInfo to point to an allocated memory block of size *puBufferSize,
  2304. ///             and call the function again.
  2305. ///
  2306. ///  @param     hTarget                 Handle to target.
  2307. ///  @param             uProcessID              Process ID.
  2308. ///  @param             puBufferSize    [in] Size of buffer.\n
  2309. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  2310. ///  @param             pProcessInfo    Buffer for returned process information. This
  2311. ///                             consists of a header \link SNPS3PROCESSINFO_HDR SNPS3PROCESSINFO_HDR\endlink followed
  2312. ///                             by the thread IDs for PPU and SPU respectively.
  2313. ///                             Each thread ID is 64 bits long.
  2314. ///      @param         pExtra                  Pointer to instance of \link SNPS3EXTRAPROCESSINFO SNPS3EXTRAPROCESSINFO\endlink structure to hold data.
  2315. ///
  2316. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.0.0 - latest version\n
  2317. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version\n
  2318. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version
  2319. ///
  2320. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2321. ///             SN_S_OK - Successfully retrieved process information or required size.\n
  2322. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2323. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2324. ///             SN_E_BAD_PARAM - puBufferSize or pExtra was NULL pointer.\n
  2325. ///             SN_E_OUT_OF_MEM - Size of pProcessInfo buffer given in puBufferSize was smaller than required buffer.\n
  2326. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2327. ///             SN_E_COMMS_ERR - Error communicating with target.
  2328. ///
  2329. //////////////////////////////////////////////////////////////////////////////
  2330.  
  2331. SNAPI SNRESULT SNPS3ProcessInfoEx(HTARGET hTarget, UINT32 uProcessID, UINT32 *puBufferSize, SNPS3PROCESSINFO *pProcessInfo,
  2332.         SNPS3EXTRAPROCESSINFO *pExtra);
  2333.  
  2334. //////////////////////////////////////////////////////////////////////////////
  2335. ///
  2336. ///  @brief     Gets further extended information for a specified process.
  2337. ///             Call this function with pProcessInfo = NULL to get the required buffer size.
  2338. ///             To get the process information, set pProcessInfo to point to an allocated memory block of size *puBufferSize,
  2339. ///             and call the function again.
  2340. ///
  2341. ///  @param     hTarget                 Handle to target
  2342. ///  @param             uProcessID              Process ID.
  2343. ///  @param             puBufferSize    [in] Size of buffer.\n
  2344. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  2345. ///  @param             pProcessInfo    Buffer for returned process information. This
  2346. ///                             consists of a header \link SNPS3PROCESSINFO_HDR SNPS3PROCESSINFO_HDR\endlink followed
  2347. ///                             by the thread IDs for PPU and SPU respectively.
  2348. ///                             Each thread ID is 64 bits long.
  2349. ///      @param         pExtra                  Pointer to instance of \link SNPS3EXTRAPROCESSINFO SNPS3EXTRAPROCESSINFO\endlink structure to hold data.
  2350. ///      @param         pDebug                  Optional pointer to instance of \link SNPS3PROCESSLOADINFO SNPS3PROCESSLOADINFO\endlink structure to hold data.
  2351. ///                             Can be NULL.
  2352. ///
  2353. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.0.0 - latest version.\n
  2354. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2355. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2356. ///
  2357. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2358. ///             SN_S_OK - Successfully retrieved process information or required size.\n
  2359. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2360. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2361. ///             SN_E_BAD_PARAM - puBufferSize or pExtra was NULL pointer.\n
  2362. ///             SN_E_OUT_OF_MEM - Size of pProcessInfo buffer given in puBufferSize was smaller than required.\n
  2363. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2364. ///             SN_E_COMMS_ERR - Error communicating with target.
  2365. ///
  2366. //////////////////////////////////////////////////////////////////////////////
  2367.  
  2368. SNAPI SNRESULT SNPS3ProcessInfoEx2(HTARGET hTarget, UINT32 uProcessID, UINT32 *puBufferSize, SNPS3PROCESSINFO *pProcessInfo,
  2369.                                                                    SNPS3EXTRAPROCESSINFO *pExtra, SNPS3PROCESSLOADINFO *pDebug);
  2370.  
  2371. //////////////////////////////////////////////////////////////////////////////
  2372. ///
  2373. ///  @brief     Continues all threads from a specified process.
  2374. ///
  2375. ///  @param     hTarget                 Handle to target.
  2376. ///  @param             uProcessID              Process ID.
  2377. ///
  2378. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.0.0 - latest version.\n
  2379. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2380. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2381. ///
  2382. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2383. ///             SN_S_OK - Successfully continued threads.\n
  2384. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2385. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2386. ///             SN_E_ERROR - Internal error.\n
  2387. ///             SN_E_COMMS_ERR - Error communicating with target.
  2388. ///
  2389. //////////////////////////////////////////////////////////////////////////////
  2390.  
  2391. SNAPI SNRESULT SNPS3ProcessContinue(HTARGET hTarget, UINT32 uProcessID);
  2392.  
  2393. //////////////////////////////////////////////////////////////////////////////
  2394. ///
  2395. ///  @brief     Stops all threads from a specified process.
  2396. ///
  2397. ///  @param     hTarget                 Handle to target.
  2398. ///  @param             uProcessID              Process ID.
  2399. ///
  2400. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.0.0 - latest version.\n
  2401. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2402. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2403. ///
  2404. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2405. ///             SN_S_OK - Successfully stopped threads.\n
  2406. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2407. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2408. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2409. ///             SN_E_ERROR - Internal error.\n
  2410. ///             SN_E_COMMS_ERR - Error communicating with target.
  2411. ///
  2412. //////////////////////////////////////////////////////////////////////////////
  2413.  
  2414. SNAPI SNRESULT SNPS3ProcessStop(HTARGET hTarget, UINT32 uProcessID);
  2415.  
  2416. //////////////////////////////////////////////////////////////////////////////
  2417. ///
  2418. ///  @brief     Kills all threads of a specified process.
  2419. ///             The threads are deleted and cannot be restarted.
  2420. ///
  2421. ///  @param     hTarget                 Handle to target.
  2422. ///  @param             uProcessID              Process ID.
  2423. ///
  2424. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2425. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2426. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2427. ///
  2428. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2429. ///             SN_S_OK - Successfully killed process.\n
  2430. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2431. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2432. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2433. ///             SN_E_ERROR - Internal error.\n
  2434. ///             SN_E_COMMS_ERR - Error communicating with target.
  2435. ///
  2436. //////////////////////////////////////////////////////////////////////////////
  2437.  
  2438. SNAPI SNRESULT SNPS3ProcessKill(HTARGET hTarget, UINT32 uProcessID);
  2439.  
  2440. //////////////////////////////////////////////////////////////////////////////
  2441. ///
  2442. ///  @brief     Gets a range of memory for the specified processor unit on the target specified by
  2443. ///             hTarget.
  2444. ///
  2445. ///  @param     hTarget         Handle to target.
  2446. ///  @param     uUnit           Processor unit (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2447. ///  @param             uProcessID      Process ID.
  2448. ///  @param             uThreadID       Thread ID.\n
  2449. ///                                     For PPU, thread ID ignored.\n
  2450. ///                                     For SPU, specify the thread group ID.
  2451. ///  @param     uAddress        Address to read from.
  2452. ///  @param     nCount          Count in bytes to read.
  2453. ///  @param     pBuffer         Pointer to buffer for memory.
  2454. ///
  2455. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2456. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2457. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2458. ///
  2459. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2460. ///             SN_S_OK - Successfully retrieved process memory.\n
  2461. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2462. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2463. ///             SN_E_BAD_PARAM - Either pBuffer is NULL pointer or process ID / thread group ID (if on SPU) was SYS_PID_INVALID (defined in SDK process.h).\n
  2464. ///             SN_E_BAD_UNIT - Bad unit value (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink for valid values).\n
  2465. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2466. ///             SN_E_ERROR - Internal error.\n
  2467. ///             SN_E_COMMS_ERR - Error communicating with target.
  2468. ///
  2469. //////////////////////////////////////////////////////////////////////////////
  2470.  
  2471. SNAPI SNRESULT SNPS3ProcessGetMemory(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID,
  2472.                                                                          UINT64 uAddress, int nCount, BYTE *pBuffer);
  2473.  
  2474. //////////////////////////////////////////////////////////////////////////////
  2475. ///
  2476. ///  @brief     Sets a range of memory for the specified processor unit.
  2477. ///
  2478. ///  @param     hTarget         Handle to target.
  2479. ///  @param     uUnit           Processor unit (see enum \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2480. ///  @param             uProcessID      Process ID.
  2481. ///  @param             uThreadID       Thread ID.
  2482. ///                                     - For PPU, specify -1.
  2483. ///                                     - For SPU, specify the thread group ID.
  2484. ///  @param     uAddress        Address to write to.
  2485. ///  @param     nCount          Number of bytes to write.
  2486. ///  @param     pBuffer         Pointer to buffer containing data to write.
  2487. ///
  2488. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2489. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2490. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2491. ///
  2492. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2493. ///             SN_S_OK - Successfully set process memory.\n
  2494. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2495. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2496. ///             SN_E_BAD_PARAM - pBuffer NULL pointer or process ID / thread ID (on SPU) was SYS_PID_INVALID (defined in SDK process.h).\n
  2497. ///             SN_E_BAD_UNIT - uUnit was invalid unit value (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).\n
  2498. ///             SN_E_COMMS_ERR - Error communicating with target.
  2499. ///
  2500. //////////////////////////////////////////////////////////////////////////////
  2501.  
  2502. SNAPI SNRESULT SNPS3ProcessSetMemory(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID,
  2503.                                                                          UINT64 uAddress, int nCount, const BYTE *pBuffer);
  2504.  
  2505. //////////////////////////////////////////////////////////////////////////////
  2506. ///
  2507. ///  @brief     Returns a list of threads from a specified process.
  2508. ///             Call this function with pPPUThreadIDs and pSPUThreadGroupIDs both = NULL to get the required buffer sizes.
  2509. ///             To get the thread list, set pPPUThreadIDs to point to an allocated memory block of size (*puNumPPUThreads * sizeof(UINT64)),
  2510. ///             set pSPUThreadGroupIDs to point to an allocated memory block of size (*puNumSPUThreadGroups * sizeof(UINT32))
  2511. ///             and call the function again.
  2512. ///
  2513. ///  @param     hTarget     Handle to a valid target.
  2514. ///      @param         uProcessID      Process ID.
  2515. ///      @param         puNumPPUThreads
  2516. ///                                     [in] Number of thread IDs buffer pPPUThreadIDs points to can hold.\n
  2517. ///                                     [out] Number of thread IDs written to buffer pPPUThreadIDs points to,
  2518. ///                                     or number of thread IDs available (when pPPUThreadIDs was set to null).
  2519. ///      @param     pPPUThreadIDs
  2520. ///                                     Pointer to a buffer to receive the list of thread ids.\n
  2521. ///                         If this parameter is NULL, the function will write the number of IDs the
  2522. ///                                     buffer needs to hold to puNumPPUThreads.
  2523. ///  @param             puNumSPUThreadGroups
  2524. ///                                     [in] Number of thread IDs buffer pSPUThreadGroupIDs points to can hold.\n
  2525. ///                                     [out] Number of thread IDs written to buffer pSPUThreadIDs points to.
  2526. ///                                     or number of thread IDs available (when pSPUThreadIDs was set to null).
  2527. ///      @param     pSPUThreadGroupIDs
  2528. ///                                     Pointer to a buffer to receive the list of thread ids.
  2529. ///                         If this parameter is NULL, the function will write the number of IDs the
  2530. ///                                     buffer needs to hold to puNumSPUThreadGroups.
  2531. ///
  2532. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2533. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2534. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2535. ///
  2536. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2537. ///             SN_S_OK - Successfully retrieved thread list or required size.\n
  2538. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2539. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2540. ///             SN_E_BAD_PARAM - puNumPPUThreads or puNumSPUThreads was NULL pointer or uProcessID invalid value.\n
  2541. ///             SN_E_OUT_OF_MEM - Number of IDs either pPPUThreadIDs or pSPUThreadGroupIDs can hold
  2542. ///             (as specified in puNumPPUThreads or puNumSPUThreadGroups) is too small.\n
  2543. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2544. ///             SN_E_COMMS_ERR - Error communicating with target.
  2545. ///
  2546. //////////////////////////////////////////////////////////////////////////////
  2547.  
  2548. SNAPI SNRESULT SNPS3ThreadList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puNumPPUThreads, UINT64 *pPPUThreadIDs,
  2549.                                                            UINT32 *puNumSPUThreadGroups, UINT64 *pSPUThreadGroupIDs);
  2550.  
  2551. // @name <SpuThreadGroupState>
  2552. //@{
  2553. //! SPU thread group state.
  2554. #define SNPS3_SPU_NOT_CONFIGURED        0x00000000
  2555. #define SNPS3_SPU_CONFIGURED            0x00000001
  2556. #define SNPS3_SPU_READY                         0x00000002
  2557. #define SNPS3_SPU_WAITING                       0x00000003
  2558. #define SNPS3_SPU_SUSPENDED                     0x00000004
  2559. #define SNPS3_SPU_WAITINGSUSPENDED      0x00000005
  2560. #define SNPS3_SPU_RUNNING                       0x00000006
  2561. #define SNPS3_SPU_STOPPED                       0x00000007
  2562. //@}
  2563.  
  2564. //////////////////////////////////////////////////////////////////////////////
  2565. /// @struct SNPS3_SPU_THREADGROUP_INFO
  2566. ///     @brief  SPU threadgroup information.
  2567. //////////////////////////////////////////////////////////////////////////////
  2568.  
  2569. struct SNPS3_SPU_THREADGROUP_INFO
  2570. {
  2571.         /// SPU thread group ID.
  2572.         UINT32  uThreadGroupID;                
  2573.         /// State (see defines SNPS3_SPU_NOT_CONFIGURED to SNPS3_SPU_STOPPED).
  2574.         UINT32  uState;                                
  2575.         /// Priority of thread group.
  2576.         UINT32  uPriority;                            
  2577.         /// Number of threads in group.
  2578.         UINT32  uNumThreads;                  
  2579.         /// Length of thread group name (including NULL terminator).
  2580.         UINT32  uThreadGroupNameLen;  
  2581. };
  2582. typedef struct SNPS3_SPU_THREADGROUP_INFO SNPS3_SPU_THREADGROUP_INFO;
  2583. typedef SNPS3_SPU_THREADGROUP_INFO *PSNPS3_SPU_THREADGROUP_INFO;
  2584.  
  2585. //////////////////////////////////////////////////////////////////////////////
  2586. ///
  2587. ///  @brief     Get information about an SPU thread group.
  2588. ///             Call this function with pBuffer = NULL to get the required buffer size.
  2589. ///             To get the thread group information, set pBuffer to point to an allocated memory block of size *puBufferSize,
  2590. ///             and call the function again.\n
  2591. ///             On success, the buffer contains instance of \link SNPS3_SPU_THREADGROUP_INFO SNPS3_SPU_THREADGROUP_INFO\endlink, followed by an array
  2592. ///             of 32 bit SPU thread IDs in the group and finally the threadgroup name.
  2593. ///
  2594. ///  @param     hTarget                         Handle to a valid target.
  2595. ///      @param         uProcessID                      Process ID.
  2596. ///      @param         uThreadGroupID          64-bit thread group ID.
  2597. ///  @param             puBufferSize            [in] Size of pBuffer.\n
  2598. ///                                     [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  2599. ///  @param             pBuffer                         Pointer to a buffer to receive the information.
  2600. ///
  2601. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2602. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2603. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2604. ///
  2605. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2606. ///             SN_S_OK - Successfully retrieved SPU thread group information or required size.\n
  2607. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2608. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2609. ///             SN_E_BAD_PARAM - puBufferSize was a NULL pointer.\n
  2610. ///             SN_E_OUT_OF_MEM - Size of buffer (specified in puBufferSize) too small.\n
  2611. ///             SN_E_COMMS_ERR - Error communicating with target.
  2612. ///
  2613. //////////////////////////////////////////////////////////////////////////////
  2614.  
  2615. SNAPI SNRESULT SNPS3GetSPUThreadGroupInfo(HTARGET hTarget, UINT32 uProcessID, UINT64 uThreadGroupID,
  2616.                                                                                   UINT32 *puBufferSize ,BYTE *pBuffer);
  2617.  
  2618. // @name <PpuThreadState>
  2619. //@{
  2620. //! PPU thread state.
  2621. #define SNPS3_PPU_IDLE                          0x00000000
  2622. #define SNPS3_PPU_RUNNABLE                      0x00000001
  2623. #define SNPS3_PPU_ONPROC                        0x00000002
  2624. #define SNPS3_PPU_SLEEP                         0x00000003
  2625. #define SNPS3_PPU_SUSPENDED                     0x00000004
  2626. #define SNPS3_PPU_SLEEP_SUSPENDED       0x00000005
  2627. #define SNPS3_PPU_STOP                          0x00000006
  2628. #define SNPS3_PPU_ZOMBIE                        0x00000007
  2629. #define SNPS3_PPU_DELETED                       0x00000008
  2630. //@}
  2631.  
  2632. //////////////////////////////////////////////////////////////////////////////
  2633. /// @struct     SNPS3_PPU_THREAD_INFO  
  2634. /// @brief      This structure contains the parameters that define a PPU thread. It is used in the
  2635. ///                     function SNPS3ThreadInfo() to obtain information about a particular thread.
  2636. //////////////////////////////////////////////////////////////////////////////
  2637.  
  2638. struct SNPS3_PPU_THREAD_INFO
  2639. {
  2640.         /// Thread ID.
  2641.         UINT64  uThreadID;                    
  2642.         /// Current priority.
  2643.         UINT32  uPriority;                    
  2644.         /// Current state (see defines SNPS3_PPU_IDLE to SNPS3_PPU_DELETED).
  2645.         UINT32  uState;                        
  2646.         /// Start address of stack.
  2647.         UINT64  uStackAddress;        
  2648.         /// Stack size (in bytes).
  2649.         UINT64  uStackSize;                    
  2650.         /// Length of thread name (including NULL terminator).
  2651.         UINT32  uThreadNameLen;        
  2652. };
  2653. typedef struct SNPS3_PPU_THREAD_INFO  SNPS3_PPU_THREAD_INFO;
  2654. typedef SNPS3_PPU_THREAD_INFO *PSNPS3_PPU_THREAD_INFO;
  2655.  
  2656. //////////////////////////////////////////////////////////////////////////////
  2657. /// @struct     SNPS3_SPU_THREAD_INFO
  2658. ///     @brief  This structure contains the parameters that define an SPU thread. It is
  2659. ///                     used in the function SNPS3ThreadInfo() function to obtain information about a
  2660. ///                     particular thread.
  2661. //////////////////////////////////////////////////////////////////////////////
  2662.  
  2663. struct SNPS3_SPU_THREAD_INFO
  2664. {
  2665.         /// SPU thread group that this thread belongs to.
  2666.         UINT32  uThreadGroupID;        
  2667.         /// Thread ID.
  2668.         UINT32  uThreadID;                    
  2669.         /// Length of file name (including NULL terminator).
  2670.         UINT32  uFileNameLen;          
  2671.         /// Length of thread name (including NULL terminator).
  2672.         UINT32  uThreadNameLen;        
  2673. };
  2674. typedef struct SNPS3_SPU_THREAD_INFO SNPS3_SPU_THREAD_INFO;
  2675. typedef SNPS3_SPU_THREAD_INFO *PSNPS3_SPU_THREAD_INFO;
  2676.  
  2677. //////////////////////////////////////////////////////////////////////////////
  2678. ///
  2679. ///  @brief     Requests thread information.
  2680. ///             For PPU units the buffer will contain an
  2681. ///             \link SNPS3_PPU_THREAD_INFO SNPS3_PPU_THREAD_INFO\endlink structure followed by the thread name. For SPUs the
  2682. ///             buffer will contain an \link SNPS3_SPU_THREAD_INFO SNPS3_SPU_THREAD_INFO\endlink structure followed by the file
  2683. ///             name and thread name.\n
  2684. ///             Call this function with pBuffer = NULL to get the required buffer size.
  2685. ///             To get the thread information, set pBuffer to point to an allocated memory block of size *puBufferSize,
  2686. ///             and call the function again.\n
  2687. ///             Extended PPU thread information can be obtained using SNPS3PPUThreadInfoEx().
  2688. ///
  2689. ///  @param     hTarget                 Handle to a valid target.
  2690. ///      @param         uUnit                   Processor unit (see enum \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2691. ///      @param         uProcessID              Process ID.
  2692. ///      @param         uThreadID               64-bit Thread ID.
  2693. ///  @param             puBufferSize    [in] Size of buffer.\n
  2694. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  2695. ///  @param             pBuffer                 Pointer to a buffer to receive the information.
  2696. ///                             As a guide, allocate buffer size of at least 1k.
  2697. ///
  2698. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2699. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2700. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2701. ///
  2702. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2703. ///             SN_S_OK - Successfully retrieved thread information or required size.\n
  2704. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2705. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2706. ///             SN_E_BAD_UNIT - uUnit not valid ID (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).\n
  2707. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer or uProcessID invalid value.\n
  2708. ///             SN_E_OUT_OF_MEM - Size of buffer given by puBufferSize was smaller than required size.\n
  2709. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2710. ///             SN_E_COMMS_ERR - Error communicating with target.
  2711. ///
  2712. //////////////////////////////////////////////////////////////////////////////
  2713.  
  2714. SNAPI SNRESULT SNPS3ThreadInfo(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID,
  2715.                                                            UINT32 *puBufferSize, BYTE *pBuffer);
  2716.  
  2717. //////////////////////////////////////////////////////////////////////////////
  2718. /// @struct     SNPS3_PPU_THREAD_INFO_EX
  2719. /// @brief      This structure contains extended information for a PPU thread. It is used in the
  2720. ///                     function SNPS3PPUThreadInfoEx() to obtain information about a particular thread.
  2721. //////////////////////////////////////////////////////////////////////////////
  2722.  
  2723. struct SNPS3_PPU_THREAD_INFO_EX
  2724. {
  2725.         /// Thread ID.
  2726.         UINT64  uThreadID;                    
  2727.         /// Current priority, normally the same as base priority, only differs when thread's priority is elevated due to priority inheritance support.
  2728.         UINT32  uPriority;    
  2729.         /// Base priority.
  2730.         UINT32 uBasePriority;
  2731.         /// Current state (see defines SNPS3_PPU_IDLE to SNPS3_PPU_DELETED).
  2732.         UINT32  uState;                        
  2733.         /// Start address of stack.
  2734.         UINT64  uStackAddress;        
  2735.         /// Stack size (in bytes).
  2736.         UINT64  uStackSize;                    
  2737.         /// Length of thread name (including NULL terminator).
  2738.         UINT32  uThreadNameLen;        
  2739. };
  2740. typedef struct SNPS3_PPU_THREAD_INFO_EX  SNPS3_PPU_THREAD_INFO_EX;
  2741. typedef SNPS3_PPU_THREAD_INFO_EX *PSNPS3_PPU_THREAD_INFO_EX;
  2742.  
  2743. //////////////////////////////////////////////////////////////////////////////
  2744. ///
  2745. ///  @brief     Requests extended information about a PPU thread.
  2746. ///             The buffer will contain an \link SNPS3_PPU_THREAD_INFO_EX SNPS3_PPU_THREAD_INFO_EX\endlink structure followed by the thread name.\n
  2747. ///             Call this function with pBuffer = NULL to get the required buffer size.
  2748. ///             To get the thread information, set pBuffer to point to an allocated memory block of size *puBufferSize,
  2749. ///             and call the function again.\n
  2750. ///             To get standard thread information use SNPS3ThreadInfo() with unit set to PS3_UI_CPU.
  2751. ///
  2752. ///  @param     hTarget                 Handle to a valid target.
  2753. ///      @param         uProcessID              Process ID.
  2754. ///      @param         uThreadID               64-bit Thread ID.
  2755. ///  @param             puBufferSize    [in] Size of buffer.\n
  2756. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  2757. ///  @param             pBuffer                 Pointer to a buffer to receive the information.
  2758. ///                             As a guide, allocate buffer size of at least 1k.
  2759. ///
  2760. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  2761. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  2762. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2763. ///
  2764. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2765. ///             SN_S_OK - Successfully retrieved PPU thread information or required size.\n
  2766. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2767. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2768. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer or uProcessID invalid value.\n
  2769. ///             SN_E_OUT_OF_MEM - Size of buffer given by puBufferSize was smaller than required.\n
  2770. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2771. ///             SN_E_COMMS_ERR - Error communicating with target.
  2772. ///
  2773. //////////////////////////////////////////////////////////////////////////////
  2774.  
  2775. SNAPI SNRESULT SNPS3PPUThreadInfoEx(HTARGET hTarget, UINT32 uProcessID, UINT64 uThreadID, UINT32 *puBufferSize, BYTE *pBuffer);
  2776.  
  2777. //////////////////////////////////////////////////////////////////////////////
  2778. ///
  2779. ///  @brief     Restarts specified thread.
  2780. ///             Note: SPU mode only included for backwards compatibility and only works
  2781. ///             if thread group is stopped, instead use SNPS3ClearSPULoopPoint() with bCurrentPC set to true.
  2782. ///
  2783. ///  @param     hTarget     Handle to a valid target.
  2784. ///  @param     uUnit           Processor unit (see enum \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2785. ///  @param             uProcessID      Process ID.
  2786. ///  @param             uThreadID       64-bit Thread ID.
  2787. ///
  2788. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2789. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2790. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2791. ///
  2792. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2793. ///             SN_S_OK - Successfully continued thread.\n
  2794. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2795. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2796. ///             SN_E_BAD_PARAM - uProcessID was invalid value.\n
  2797. ///             SN_E_COMMS_ERR - Error communicating with target.
  2798. ///
  2799. //////////////////////////////////////////////////////////////////////////////
  2800.  
  2801. SNAPI SNRESULT SNPS3ThreadContinue(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID);
  2802.  
  2803. //////////////////////////////////////////////////////////////////////////////
  2804. ///
  2805. ///  @brief     Stops specified thread.
  2806. ///             Note: SPU mode only included for backwards compatibility and only works
  2807. ///             if thread group is stopped, instead use SNPS3SetSPULoopPoint() with bCurrentPC set to true.
  2808. ///
  2809. ///  @param     hTarget     Handle to a valid target.
  2810. ///  @param     uUnit           Processor unit (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2811. ///  @param             uProcessID      Process ID.
  2812. ///  @param             uThreadID       64-bit Thread ID.
  2813. ///
  2814. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2815. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2816. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2817. ///
  2818. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2819. ///             SN_S_OK - Successfully stopped thread.\n
  2820. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2821. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2822. ///             SN_E_BAD_PARAM - uProcessID was invalid value.\n
  2823. ///             SN_E_COMMS_ERR - Error communicating with target.
  2824. ///
  2825. //////////////////////////////////////////////////////////////////////////////
  2826.  
  2827. SNAPI SNRESULT SNPS3ThreadStop(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID);
  2828.  
  2829. //////////////////////////////////////////////////////////////////////////////
  2830. ///
  2831. ///  @brief     Reads an array of registers from the specified thread.
  2832. ///             Thread must be stopped before calling this function. See SNPS3ThreadStop().
  2833. ///
  2834. ///  @param     hTarget     Handle to a valid target.
  2835. ///  @param     uUnit           Processor unit (see enum \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2836. ///  @param             uProcessID      Process ID.
  2837. ///  @param             uThreadID       64-bit Thread ID.
  2838. ///  @param             uNumRegisters
  2839. ///                         Number of registers to get.
  2840. ///  @param             puNum           Pointer to buffer holding array of register numbers to get.
  2841. ///  @param             pRegBuffer      Buffer to hold values returned.
  2842. ///                                     Note: this buffer must be big enough to hold the
  2843. ///                                     returned registers. Allocate a buffer of
  2844. ///                                     uNumRegisters * SNPS3_REGLEN.
  2845. ///
  2846. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  2847. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  2848. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  2849. ///
  2850. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2851. ///             SN_S_OK - Successfully retrieved registers.\n
  2852. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2853. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2854. ///             SN_E_BAD_PARAM - puNum or pReg buffer were NULL pointers, process ID/thread ID not a valid value or
  2855. ///             invalid register number supplied.\n
  2856. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  2857. ///             SN_E_BAD_UNIT - Unit value not valid (see enum \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).\n
  2858. ///             SN_E_COMMS_ERR - Error communicating with target.
  2859. ///
  2860. //////////////////////////////////////////////////////////////////////////////
  2861.  
  2862. SNAPI SNRESULT SNPS3ThreadGetRegisters(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID,
  2863.                                                                            UINT32 uNumRegisters, UINT32 *puNum, BYTE *pRegBuffer);
  2864.  
  2865. //////////////////////////////////////////////////////////////////////////////
  2866. ///
  2867. ///  @brief     Sets the registers for a thread.
  2868. ///             Thread must be stopped before calling this function. See SNPS3ThreadStop().
  2869. ///
  2870. ///  @param     hTarget     Handle to a valid target.
  2871. ///  @param     uUnit           Processor unit (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2872. ///  @param             uProcessID      Process ID.
  2873. ///  @param             uThreadID       64-bit Thread ID.
  2874. ///  @param             uNumRegisters
  2875. ///                         Number of registers to set.
  2876. ///  @param             puNum           Pointer to buffer holding array of register
  2877. ///                         numbers to set.
  2878. ///  @param             pRegBuffer      Buffer containing values of registers to set.
  2879. ///                                     Each register is of size SNPS3_REGLEN.
  2880. ///
  2881. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version\n
  2882. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version\n
  2883. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version
  2884. ///
  2885. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2886. ///             SN_S_OK - Successfully set registers.\n
  2887. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2888. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2889. ///             SN_E_BAD_PARAM - puNum or pReg buffer were NULL pointers or process ID/thread ID -1 value.\n
  2890. ///             SN_E_COMMS_ERR - Process ID/thread ID invalid value or an unknown problem occurred communicating with the target.\n
  2891. ///             SN_E_BAD_UNIT - Unit value not valid (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  2892. ///
  2893. //////////////////////////////////////////////////////////////////////////////
  2894.  
  2895. SNAPI SNRESULT SNPS3ThreadSetRegisters(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID,
  2896.                                                                            UINT32 uNumRegisters, UINT32 *puNum, const BYTE *pRegBuffer);
  2897.  
  2898. //////////////////////////////////////////////////////////////////////////////
  2899. ///
  2900. ///  @brief     Enables and disables automatic client notification of unit
  2901. ///             status changes.
  2902. ///             Normally, Target Manager will notify all registered clients
  2903. ///             whenever another client modifies memory or register contents.
  2904. ///             It does this by sending a SN_TGT_EVENT_UNIT_STATUS_CHANGE notification for
  2905. ///             that unit.\n
  2906. ///             In some circumstances this may be undesirable, for example if the
  2907. ///             TMAPI application is carrying out many memory writes, and the
  2908. ///             ProDG Debugger is connected at the same time, it will
  2909. ///             automatically refresh itself for each update and slow down
  2910. ///             the SDK function. For these cases, notifications can be
  2911. ///             disabled by calling this function.\n
  2912. ///             This feature is enabled by default. Once set it remains set
  2913. ///             for the lifetime of the Target Manager and is reset to
  2914. ///             enabled when restarted. The previous
  2915. ///             setting should be restored at the end of the SDK application.
  2916. ///
  2917. ///  @param     hTarget        Handle to target.
  2918. ///  @param     uEnabled       New state for auto notifications. 0 = disabled, 1 = enabled.
  2919. ///  @param     puPrevState    Pointer to a buffer to receive previous state.
  2920. ///
  2921. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2922. ///             SN_S_OK - Successfully enabled / disabled status update.\n
  2923. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2924. ///             SN_E_BAD_TARGET - hTarget was invalid.
  2925. ///
  2926. //////////////////////////////////////////////////////////////////////////////
  2927.  
  2928. SNAPI SNRESULT SNPS3EnableAutoStatusUpdate(HTARGET hTarget, UINT32 uEnabled, UINT32 *puPrevState);
  2929.  
  2930. //////////////////////////////////////////////////////////////////////////////
  2931. ///
  2932. ///  @brief     Sets the default primary PPU thread stack size for the target.
  2933. ///
  2934. ///  @param     hTarget        Handle to target.
  2935. ///  @param     uSize          Size of the stack (should be one of the
  2936. ///                            predefined constants, see SNPS3_ELF_STACK_SIZE_*).
  2937. ///
  2938. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2939. ///             SN_S_OK - Successfully set stack size.\n
  2940. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2941. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2942. ///             SN_E_BAD_PARAM - Invalid size.
  2943. ///
  2944. //////////////////////////////////////////////////////////////////////////////
  2945.  
  2946. SNAPI SNRESULT SNPS3SetDefaultPPUThreadStackSize(HTARGET hTarget, UINT32 uSize);
  2947.  
  2948. //////////////////////////////////////////////////////////////////////////////
  2949. ///
  2950. ///  @brief     Gets the default primary PPU thread stack size for the target.
  2951. ///
  2952. ///  @param     hTarget        Handle to target.
  2953. ///  @param     puSize         Pointer to a UINT32 to hold the size.
  2954. ///
  2955. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2956. ///             SN_S_OK - Successfully retrieved stack size.\n
  2957. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2958. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2959. ///             SN_E_BAD_PARAM - puSize was NULL pointer.
  2960. ///
  2961. //////////////////////////////////////////////////////////////////////////////
  2962.  
  2963. SNAPI SNRESULT SNPS3GetDefaultPPUThreadStackSize(HTARGET hTarget, UINT32 *puSize);
  2964.  
  2965. // @name <TargetPowerState>
  2966. //@{
  2967. //! Target power state.
  2968. #define SNPS3_POWER_STATE_OFF                           0
  2969. #define SNPS3_POWER_STATE_ON                            1
  2970. #define SNPS3_POWER_STATE_SUSPENDED                     2
  2971. #define SNPS3_POWER_STATE_UNKNOWN                       4
  2972. #define SNPS3_POWER_STATE_SWITCHING_ON          5
  2973. //@}
  2974.  
  2975. //////////////////////////////////////////////////////////////////////////////
  2976. ///
  2977. ///  @brief     Retrieves the current power status of the specified target.
  2978. ///             See SNPS3_POWER_STATE_OFF etc.
  2979. ///
  2980. ///  @param     hTarget        Handle to target.
  2981. ///  @param     pnStatus       Pointer to a long to hold the status.
  2982. ///
  2983. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  2984. ///             SN_S_OK - Successfully retrieved power status.\n
  2985. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  2986. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  2987. ///             SN_E_BAD_PARAM - pnStatus is null pointer.\n
  2988. ///             SN_E_COMMS_ERR - Error communicating with target.
  2989. ///                    
  2990. //////////////////////////////////////////////////////////////////////////////
  2991.  
  2992. SNAPI SNRESULT SNPS3GetPowerStatus(HTARGET hTarget, long *pnStatus);
  2993.  
  2994. //////////////////////////////////////////////////////////////////////////////
  2995. ///
  2996. ///  @brief     Powers on the specified target.
  2997. ///
  2998. ///  @param     hTarget        Handle to target.
  2999. ///
  3000. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  3001. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.4.0 - latest version (must have WOL enabled).\n
  3002. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3003. ///
  3004. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3005. ///             SN_S_OK - Successfully powered on.\n
  3006. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3007. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3008. ///             SN_S_NO_ACTION - Already powered on.\n
  3009. ///             SN_E_COMMS_ERR - Error communicating with target.
  3010. ///
  3011. //////////////////////////////////////////////////////////////////////////////
  3012.  
  3013. SNAPI SNRESULT SNPS3PowerOn(HTARGET hTarget);
  3014.  
  3015. //////////////////////////////////////////////////////////////////////////////
  3016. ///
  3017. ///  @brief     Powers off the specified target.
  3018. ///
  3019. ///  @param     hTarget        Handle to target.
  3020. ///  @param     uForce         If non-zero, target will be forced off.
  3021. ///
  3022. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  3023. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.4.0 - latest version (must have Wake-On-LAN (WOL) enabled).\n
  3024. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3025. ///
  3026. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3027. ///             SN_S_OK - Successfully powered off target.\n
  3028. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3029. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3030. ///             SN_S_NO_ACTION - Already powered off (reference tool).\n
  3031. ///             SN_E_NOT_CONNECTED - Already powered off (debugging station).\n
  3032. ///             SN_E_COMMS_ERR - Error communicating with target.
  3033. ///
  3034. //////////////////////////////////////////////////////////////////////////////
  3035.  
  3036. SNAPI SNRESULT SNPS3PowerOff(HTARGET hTarget, UINT32 uForce);
  3037.  
  3038. //////////////////////////////////////////////////////////////////////////////
  3039. ///
  3040. ///  @brief     Resets specified target allowing specification of boot, reset and system parameters.
  3041. ///
  3042. ///  @param     hTarget     Handle to a valid target.
  3043. ///  @param     uBoot       See SNPS3TM_BOOTP_DEFAULT to SNPS3TM_BOOTP_NIC_DUAL.
  3044. ///  @param     uBootMask   See SNPS3TM_BOOTP_BOOT_MODE_MASK to SNPS3TM_BOOTP_ALL_MASK
  3045. ///  @param     uReset      PS3 reset parameters (SNPS3TM_RESETP_*).
  3046. ///  @param     uResetMask  Mask for reset parameters, or SNPS3TM_RESETP_ALL_MASK.
  3047. ///  @param     uSystem     PS3 system parameters (SNPS3TM_SYSTEMP_*)
  3048. ///  @param     uSystemMask Mask for system parameters (typically SNPS3TM_SYSTEMP_MODEL_MASK).
  3049. ///
  3050. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3051. ///             SN_S_OK - Successfully reset target.\n
  3052. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3053. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3054. ///             SN_E_COMMS_ERR - Error communicating with target.
  3055. ///
  3056. //////////////////////////////////////////////////////////////////////////////
  3057.  
  3058. SNAPI SNRESULT SNPS3ResetEx(HTARGET hTarget, UINT64 uBoot, UINT64 uBootMask, UINT64 uReset, UINT64 uResetMask,
  3059.                                                         UINT64 uSystem, UINT64 uSystemMask);
  3060.  
  3061. //////////////////////////////////////////////////////////////////////////////
  3062. ///
  3063. ///  @brief     Query the current reset parameter settings.
  3064. ///             See SNPS3_BOOT_MODE_DBG, SNPS3_BOOT_MODE_MASK etc.\n
  3065. ///             Boot and System parameters are the parameters which will be used
  3066. ///             on the next reset (having already been masked). The boot and system
  3067. ///             mask parameters are the masks which were used on the last call to
  3068. ///             SNPS3ResetEx(). The reset parameter and masks are those used in the last
  3069. ///             reset.
  3070. ///
  3071. ///  @param     hTarget      Handle to a valid target.
  3072. ///  @param     puBoot       See SNPS3TM_BOOTP_DEFAULT to SNPS3TM_BOOTP_NIC_DUAL.
  3073. ///  @param     puBootMask   See SNPS3TM_BOOTP_BOOT_MODE_MASK to SNPS3TM_BOOTP_ALL_MASK
  3074. ///  @param     puReset      PS3 reset parameters (SNPS3TM_RESETP_*).
  3075. ///  @param     puResetMask  Mask for reset parameters, or SNPS3TM_RESETP_ALL_MASK.
  3076. ///  @param     puSystem     PS3 system parameters (SNPS3TM_SYSTEMP_*).
  3077. ///  @param     puSystemMask Mask for system parameters (typically SNPS3TM_SYSTEMP_MODEL_MASK).
  3078. ///
  3079. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  3080. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3081. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3082. ///
  3083. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3084. ///             SN_S_OK - Successfully retrieved reset parameters.\n
  3085. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3086. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3087. ///             SN_E_BAD_PARAM - One of the pointers was null.\n
  3088. ///             SN_E_COMMS_ERR - Error communicating with target.
  3089. ///
  3090. //////////////////////////////////////////////////////////////////////////////
  3091.  
  3092. SNAPI SNRESULT SNPS3GetResetParameters(HTARGET hTarget, UINT64 *puBoot, UINT64 *puBootMask,
  3093.                                                                            UINT64 *puReset, UINT64 *puResetMask, UINT64 *puSystem, UINT64 *puSystemMask);
  3094.  
  3095.  
  3096. // @name <BootParameter>
  3097. //@{
  3098. //! Default boot parameter.
  3099. const UINT64 SNPS3TM_BOOTP_DEFAULT                              = 0x0000000000000000;
  3100.  
  3101. //! System mode.
  3102. const UINT64 SNPS3TM_BOOTP_SYSTEM_MODE                  = 0x0000000000000011;
  3103.  
  3104. //! Release mode.
  3105. const UINT64 SNPS3TM_BOOTP_RELEASE_MODE                 = 0x0000000000000001;
  3106.  
  3107. //! Debug mode.
  3108. const UINT64 SNPS3TM_BOOTP_DEBUG_MODE                   = 0x0000000000000010;
  3109.  
  3110. //! Limit available memory to console setting (default = tool setting).
  3111. const UINT64 SNPS3TM_BOOTP_MEM_CONSOLE                  = 0x0000000000000002;
  3112.  
  3113. //! Use BD drive (default = use BD emulator).
  3114. const UINT64 SNPS3TM_BOOTP_BD_EMU_OFF                   = 0x0000000000000004;
  3115.  
  3116. //! Match transfer rate of BD emulator (default = HDD native).
  3117. const UINT64 SNPS3TM_BOOTP_TRANSFER_RATE_BD             = 0x0000000000000008;
  3118.  
  3119. //! Use USB mass storage BD emulator (default = Internal HDD (DEV)).
  3120. const UINT64 SNPS3TM_BOOTP_BD_EMU_USB                   = 0x0000000000000020;
  3121.  
  3122. //! Use game port (default = DEV LAN).
  3123. const UINT64 SNPS3TM_BOOTP_HOSTFS_TARGET                = 0x0000000000000040;
  3124.  
  3125. //! Default = single.
  3126. const UINT64 SNPS3TM_BOOTP_NIC_DUAL                             = 0x0000000000000080;
  3127. //@}
  3128.  
  3129. // @name <BootParameterMasks>
  3130. //@{
  3131. //! See \link SNPS3TM_BOOTP_SYSTEM_MODE SNPS3TM_BOOTP_SYSTEM_MODE\endlink, \link SNPS3TM_BOOTP_RELEASE_MODE SNPS3TM_BOOTP_RELEASE_MODE\endlink and \link SNPS3TM_BOOTP_DEBUG_MODE SNPS3TM_BOOTP_DEBUG_MODE\endlink.
  3132. const UINT64 SNPS3TM_BOOTP_BOOT_MODE_MASK               = 0x0000000000000011;
  3133.  
  3134. //! See \link SNPS3TM_BOOTP_MEM_CONSOLE SNPS3TM_BOOTP_MEM_CONSOLE\endlink.
  3135. const UINT64 SNPS3TM_BOOTP_MEMSIZE_MASK                 = 0x0000000000000002;
  3136.  
  3137. //! See \link SNPS3TM_BOOTP_BD_EMU_OFF SNPS3TM_BOOTP_BD_EMU_OFF\endlink.
  3138. const UINT64 SNPS3TM_BOOTP_BLURAY_EMU_MASK              = 0x0000000000000004;
  3139.  
  3140. //! See \link SNPS3TM_BOOTP_TRANSFER_RATE_BD SNPS3TM_BOOTP_TRANSFER_RATE_BD\endlink.
  3141. const UINT64 SNPS3TM_BOOTP_HDD_SPEED_MASK               = 0x0000000000000008;
  3142.  
  3143. //! See \link SNPS3TM_BOOTP_BD_EMU_USB SNPS3TM_BOOTP_BD_EMU_USB\endlink.
  3144. const UINT64 SNPS3TM_BOOTP_BLURAY_EMU_SEL_MASK  = 0x0000000000000020;
  3145.  
  3146. //! See \link SNPS3TM_BOOTP_HOSTFS_TARGET SNPS3TM_BOOTP_HOSTFS_TARGET\endlink.
  3147. const UINT64 SNPS3TM_BOOTP_HOSTFS_MASK                  = 0x0000000000000040;
  3148.  
  3149. //! See \link SNPS3TM_BOOTP_NIC_DUAL SNPS3TM_BOOTP_NIC_DUAL\endlink.
  3150. const UINT64 SNPS3TM_BOOTP_NIC_MASK                             = 0x0000000000000080;
  3151.  
  3152. //! Mask for all boot parameters.
  3153. const UINT64 SNPS3TM_BOOTP_ALL_MASK                             =       SNPS3TM_BOOTP_BOOT_MODE_MASK | SNPS3TM_BOOTP_MEMSIZE_MASK | SNPS3TM_BOOTP_BLURAY_EMU_MASK
  3154.                                                                                                         | SNPS3TM_BOOTP_HDD_SPEED_MASK | SNPS3TM_BOOTP_BLURAY_EMU_SEL_MASK | SNPS3TM_BOOTP_HOSTFS_MASK
  3155.                                                                                                         | SNPS3TM_BOOTP_NIC_MASK;
  3156. //@}
  3157.  
  3158. //! @deprecated - use \link SNPS3TM_BOOTP_BOOT_MODE_MASK SNPS3TM_BOOTP_BOOT_MODE_MASK\endlink.
  3159. #define SNPS3_BOOT_MODE_MASK                    SNPS3_BOOT_MODE_MASK_deprecated_instead_use_SNPS3TM_BOOTP_BOOT_MODE_MASK
  3160. //! @deprecated - use \link SNPS3TM_BOOTP_MEMSIZE_MASK SNPS3TM_BOOTP_MEMSIZE_MASK\endlink.
  3161. #define SNPS3_BOOT_MEMSIZE_MASK                 SNPS3_BOOT_MEMSIZE_MASK_deprecated_instead_use_SNPS3TM_BOOTP_MEM_CONSOLE
  3162. //! @deprecated - use \link SNPS3TM_BOOTP_BLURAY_EMU_MASK SNPS3TM_BOOTP_BLURAY_EMU_MASK\endlink.
  3163. #define SNPS3_BOOT_BD_EMU_MASK                  SNPS3_BOOT_BD_EMU_MASK_deprecated_instead_use_SNPS3TM_BOOTP_BD_EMU_OFF
  3164. //! @deprecated - use \link SNPS3TM_BOOTP_HDD_SPEED_MASK SNPS3TM_BOOTP_HDD_SPEED_MASK\endlink.
  3165. #define SNPS3_BOOT_BD_HDDSPEED_MASK             SNPS3_BOOT_BD_HDDSPEED_MASK_deprecated_instead_use_SNPS3TM_BOOTP_TRANSFER_RATE_BD
  3166. //! @deprecated - use \link SNPS3TM_BOOTP_BLURAY_EMU_SEL_MASK SNPS3TM_BOOTP_BLURAY_EMU_SEL_MASK\endlink.
  3167. #define SNPS3_BOOT_BD_EMU_USB_MASK              SNPS3_BOOT_BD_EMU_USB_MASK_deprecated_instead_use_SNPS3TM_BOOTP_BD_EMU_USB
  3168. //! @deprecated - use \link SNPS3TM_BOOTP_NIC_MASK SNPS3TM_BOOTP_NIC_MASK\endlink.
  3169. #define SNPS3_BOOT_NIC_MASK                             SNPS3_BOOT_NIC_MASK_deprecated_instead_use_SNPS3TM_BOOTP_NIC_MASK
  3170. //! @deprecated - use \link SNPS3TM_BOOTP_ALL_MASK SNPS3TM_BOOTP_ALL_MASK\endlink.
  3171. #define SNPS3_BOOT_DEFAULT_MASK                 SNPS3_BOOT_DEFAULT_MASK_deprecated_instead_use_SNPS3TM_BOOTP_ALL_MASK
  3172.  
  3173. //! @deprecated - use \link SNPS3TM_BOOTP_DEFAULT SNPS3TM_BOOTP_DEFAULT\endlink.
  3174. #define SNPS3_DEF_BOOT_PARAM                    SNPS3_DEF_BOOT_PARAM_deprecated_instead_use_SNPS3TM_BOOTP_DEFAULT
  3175. //! @deprecated - use \link SNPS3TM_BOOTP_DEBUG_MODE SNPS3TM_BOOTP_DEBUG_MODE\endlink.
  3176. #define SNPS3_BOOT_MODE_DBG                             SNPS3_BOOT_MODE_DBG_deprecated_instead_use_SNPS3TM_BOOTP_DEBUG_MODE
  3177. //! @deprecated - use \link SNPS3TM_BOOTP_SYSTEM_MODE SNPS3TM_BOOTP_SYSTEM_MODE\endlink.
  3178. #define SNPS3_BOOT_MODE_SYS                             SNPS3_BOOT_MODE_SYS_deprecated_instead_use_SNPS3TM_BOOTP_SYSTEM_MODE
  3179. //! @deprecated.
  3180. #define SNPS3_BOOT_MEMSIZE_TOOL                 SNPS3_BOOT_MEMSIZE_TOOL_deprecated_instead_use_0x00ULL
  3181. //! @deprecated - use \link SNPS3TM_BOOTP_MEM_CONSOLE SNPS3TM_BOOTP_MEM_CONSOLE\endlink.
  3182. #define SNPS3_BOOT_MEMSIZE_CONSOLE              SNPS3_BOOT_MEMSIZE_CONSOLE_deprecated_instead_use_SNPS3TM_BOOTP_MEM_CONSOLE
  3183. //! @deprecated.
  3184. #define SNPS3_BOOT_BD_EMU                               SNPS3_BOOT_BD_EMU_deprecated_instead_use_0x00ULL
  3185. //! @deprecated - use \link SNPS3TM_BOOTP_BD_EMU_OFF SNPS3TM_BOOTP_BD_EMU_OFF\endlink.
  3186. #define SNPS3_BOOT_BD_DRIVE                             SNPS3_BOOT_BD_DRIVE_deprecated_instead_use_SNPS3TM_BOOTP_BD_EMU_OFF
  3187. //! @deprecated - use \link SNPS3TM_BOOTP_TRANSFER_RATE_BD SNPS3TM_BOOTP_TRANSFER_RATE_BD\endlink.
  3188. #define SNPS3_BOOT_HDDSPEED_EMU                 SNPS3_BOOT_HDDSPEED_EMU_deprecated_instead_use_SNPS3TM_BOOTP_TRANSFER_RATE_BD
  3189. //! @deprecated.
  3190. #define SNPS3_BOOT_HDDSPEED_NATIVE              SNPS3_BOOT_HDDSPEED_NATIVE_deprecated_instead_use_0x00ULL
  3191. //! @deprecated.
  3192. #define SNPS3_BOOT_BD_EMU_DEV                   SNPS3_BOOT_BD_EMU_DEV_deprecated_instead_use_0x00ULL  
  3193. //! @deprecated - use \link SNPS3TM_BOOTP_BD_EMU_USB SNPS3TM_BOOTP_BD_EMU_USB\endlink.
  3194. #define SNPS3_BOOT_BD_EMU_USB                   SNPS3_BOOT_BD_EMU_USB_deprecated_instead_use_SNPS3TM_BOOTP_BD_EMU_USB
  3195. //! @deprecated.
  3196. #define SNPS3_BOOT_HOSTFS_DEV                   SNPS3_BOOT_HOSTFS_DEV_deprecated_instead_use_0x00ULL
  3197. //! @deprecated - use \link SNPS3TM_BOOTP_HOSTFS_TARGET SNPS3TM_BOOTP_HOSTFS_TARGET\endlink.
  3198. #define SNPS3_BOOT_HOSTFS_TARGET                SNPS3_BOOT_HOSTFS_TARGET_deprecated_instead_use_SNPS3TM_BOOTP_HOSTFS_MASK      
  3199.  
  3200.  
  3201. //////////////////////////////////////////////////////////////////////////////
  3202. ///
  3203. ///  @brief     Gets the boot parameter currently used by the OS (use SNPS3GetResetParameters()
  3204. ///             to get the parameter that will be used during the next reset).
  3205. ///
  3206. ///  @param     hTarget      Handle to a valid target.
  3207. ///  @param     puBoot          PS3 boot parameter. See SNPS3TM_BOOTP_DEFAULT to SNPS3TM_BOOTP_NIC_DUAL.
  3208. ///
  3209. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  3210. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3211. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3212. ///
  3213. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3214. ///             SN_S_OK - Successfully retrieved boot parameter.\n
  3215. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3216. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3217. ///             SN_E_BAD_PARAM - puBoot was null.\n
  3218. ///             SN_E_COMMS_ERR - Error communicating with target.
  3219. ///
  3220. //////////////////////////////////////////////////////////////////////////////
  3221.  
  3222. SNAPI SNRESULT SNPS3GetCurrentBootParameter(HTARGET hTarget, UINT64 *puBoot);
  3223.  
  3224. //////////////////////////////////////////////////////////////////////////////
  3225. ///
  3226. ///  @brief     Sets the target boot parameter.
  3227. ///
  3228. ///  @param     hTarget      Handle to a valid target.
  3229. ///  @param     uBoot        PS3 boot parameter. See SNPS3TM_BOOTP_DEFAULT to SNPS3TM_BOOTP_NIC_DUAL.
  3230. ///  @param     uBootMask    PS3 boot mask. See SNPS3TM_BOOTP_BOOT_MODE_MASK to SNPS3TM_BOOTP_ALL_MASK.
  3231. ///
  3232. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  3233. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3234. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3235. ///
  3236. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3237. ///             SN_S_OK - Successfully set boot parameter.\n
  3238. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3239. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3240. ///             SN_E_COMMS_ERR - Error communicating with target.
  3241. ///
  3242. //////////////////////////////////////////////////////////////////////////////
  3243.  
  3244. SNAPI SNRESULT SNPS3SetBootParameter(HTARGET hTarget, UINT64 uBoot, UINT64 uBootMask);
  3245.  
  3246. // @name <SystemParameters>
  3247. //@{
  3248. //! System parameter.
  3249. const UINT64 SNPS3TM_SYSTEMP_TARGET_MODEL_60GB  = 0x0001000000000000ui64;
  3250. const UINT64 SNPS3TM_SYSTEMP_TARGET_MODEL_20GB  = 0x0002000000000000ui64;
  3251. const UINT64 SNPS3TM_SYSTEMP_RELEASE_CHECK_MODE = 0x0000800000000000ui64;
  3252. //@}
  3253.  
  3254. // @name <SystemParameterMasks>
  3255. //@{
  3256. //! System parameter model mask.
  3257. const UINT64 SNPS3TM_SYSTEMP_MODEL_MASK                 = 0x00ff000000000000ui64;
  3258. //! System parameter model mask.
  3259. const UINT64 SNPS3TM_SYSTEMP_RELEASE_CHECK_MASK = 0x0000800000000000ui64;
  3260. //! System parameter mask.
  3261. const UINT64 SNPS3TM_SYSTEMP_ALL_MASK                   = SNPS3TM_SYSTEMP_MODEL_MASK | SNPS3TM_SYSTEMP_RELEASE_CHECK_MASK;
  3262. //@}
  3263.  
  3264. SNDEPRECATED("use SNPS3TM_SYSTEMP_MODEL_MASK instead")
  3265. //! @deprecated - use \link SNPS3TM_SYSTEMP_MODEL_MASK SNPS3TM_SYSTEMP_MODEL_MASK\endlink.
  3266. const UINT64 SNPS3TM_SYSTEMP_TARGET_MODEL               = 0x00ff000000000000ui64;
  3267.  
  3268. //! @deprecated - use \link SNPS3TM_SYSTEMP_MODEL_MASK SNPS3TM_SYSTEMP_MODEL_MASK\endlink.
  3269. #define  SNPS3_SYSTEM_TARGET_MODEL_MASK                 SNPS3_SYSTEM_TARGET_MODEL_MASK_deprecated_instead_use_SNPS3TM_SYSTEMP_MODEL_MASK
  3270. //! @deprecated - use \link SNPS3TM_SYSTEMP_TARGET_MODEL_60GB SNPS3TM_SYSTEMP_TARGET_MODEL_60GB\endlink.
  3271. #define  SNPS3_SYSTEM_TARGET_MODEL_60GB                 SNPS3_SYSTEM_TARGET_MODEL_60GB_deprecated_instead_use_SNPS3TM_SYSTEMP_TARGET_MODEL_60GB
  3272. //! @deprecated - use \link SNPS3TM_SYSTEMP_TARGET_MODEL_20GB SNPS3TM_SYSTEMP_TARGET_MODEL_20GB\endlink.
  3273. #define  SNPS3_SYSTEM_TARGET_MODEL_20GB                 SNPS3_SYSTEM_TARGET_MODEL_20GB_deprecated_instead_use_SNPS3TM_SYSTEMP_TARGET_MODEL_20GB
  3274.  
  3275. //////////////////////////////////////////////////////////////////////////////
  3276. ///
  3277. ///  @brief     Sets the system parameter of the given target.
  3278. ///
  3279. ///  @param     hTarget                    Handle to a valid target.
  3280. ///  @param     uSystem                    PS3 system parameter. See SNPS3TM_SYSTEMP_*.
  3281. ///  @param     uSystemMask        PS3 system mask. Typically SNPS3TM_SYSTEMP_MODEL_MASK.
  3282. ///
  3283. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  3284. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3285. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3286. ///
  3287. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3288. ///             SN_S_OK - Successfully set system parameter.\n
  3289. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3290. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3291. ///             SN_E_COMMS_ERR - Error communicating with target.
  3292. ///
  3293. //////////////////////////////////////////////////////////////////////////////
  3294.  
  3295. SNAPI SNRESULT SNPS3SetSystemParameter(HTARGET hTarget, UINT64 uSystem, UINT64 uSystemMask);
  3296.        
  3297. //////////////////////////////////////////////////////////////////////////////
  3298. ///
  3299. ///  @brief     Calls the supplied callback function for each target in the system, passing an
  3300. ///             HTARGET handle. The callback function can then call SNPS3GetTargetInfo()
  3301. ///             to retrieve relevant information for that target and store it.
  3302. ///
  3303. ///  @param     pfnCallBack    Pointer to callback function.
  3304. ///
  3305. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3306. ///             SN_S_OK - Successfully called the callbacks.\n
  3307. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3308. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3309. ///             SN_E_NO_TARGETS - There are no targets to enumerate.\n
  3310. ///             SN_E_BAD_PARAM - pfnCallBack was NULL pointer.
  3311. ///
  3312. //////////////////////////////////////////////////////////////////////////////
  3313.  
  3314. SNAPI SNRESULT SNPS3EnumerateTargets(TMAPI_EnumTargetsCallback pfnCallBack);
  3315.  
  3316. //////////////////////////////////////////////////////////////////////////////
  3317. ///
  3318. ///  @brief     Calls the supplied callback function for each target in the system, passing an
  3319. ///             HTARGET handle. The callback function can then call SNPS3GetTargetInfo()
  3320. ///             to retrieve relevant information for that target and store it. The
  3321. ///             callback function should return 0 to continue the enumeration or non-zero
  3322. ///             to cancel it.
  3323. ///
  3324. ///  @param     pfnCallBack    Pointer to callback function.
  3325. ///  @param     pArg           Parameter passed to callback, void pointer which can be cast to anything.
  3326. ///
  3327. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3328. ///             SN_S_OK - Successfully called the callbacks.\n
  3329. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3330. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3331. ///             SN_E_NO_TARGETS - There are no targets to enumerate.\n
  3332. ///             SN_E_BAD_PARAM - pfnCallBack was NULL pointer.
  3333. ///
  3334. //////////////////////////////////////////////////////////////////////////////
  3335.  
  3336. SNAPI SNRESULT SNPS3EnumerateTargetsEx(TMAPI_EnumTargetsExCallback pfnCallBack, void *pArg);
  3337.  
  3338. //////////////////////////////////////////////////////////////////////////////
  3339. ///
  3340. ///  @brief     Register a callback function which will be called when a
  3341. ///             target event occurs (for example processes/threads created/destroyed,
  3342. ///             exceptions, and so on).
  3343. ///             See SN_TGT_EVENT_* definitions for details of possible events.
  3344. ///             The callback will only be invoked when SNPS3Kick() is called.
  3345. ///
  3346. ///  @param             hTarget       Handle to a target.
  3347. ///  @param     pfnCallBack   Pointer to callback.
  3348. ///  @param             pUserData     Optional user defined data.
  3349. ///
  3350. ///  Callback must be in the form of:
  3351. ///
  3352. /// \code
  3353. ///  void Callback(
  3354. ///          HTARGET hTarget,   // Handle to target.
  3355. ///          UINT32 Type,       // SN_EVENT_TARGET.
  3356. ///          UINT32 Param,      // Reserved - will be 0.
  3357. ///          UINT32 Length,     // Length of data in event including header.
  3358. ///          SNRESULT eResult,  // Success or failure of data fetch.
  3359. ///          BYTE* Data,        // Pointer to event data. Data will start with SN_EVENT_TARGET_HDR.
  3360. ///          void* UserData);   // Optional user data.
  3361. /// \endcode
  3362. ///
  3363. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3364. ///             SN_S_OK - Successfully registered for target events.\n
  3365. ///             SN_S_REPLACED - Already registered for target events, previous callback function has been replaced.\n
  3366. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3367. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3368. ///             SN_E_BAD_PARAM - Pointer to callback function was null.
  3369. ///            
  3370. //////////////////////////////////////////////////////////////////////////////
  3371.  
  3372. SNAPI SNRESULT SNPS3RegisterTargetEventHandler(HTARGET hTarget, TMAPI_HandleEventCallback pfnCallBack, void *pUserData);
  3373.  
  3374. //////////////////////////////////////////////////////////////////////////////
  3375. ///
  3376. ///  @brief     Register a callback function which will be called when a
  3377. ///             server event occurs (e.g. target added, target deleted, default target
  3378. ///                         changed).\n
  3379. ///                             See SN_SERVER_EVENT_* definitions in APIBase.h for details of possible events.
  3380. ///                             The event type is signified by the uEvent member of the \link SN_EVENT_SERVER_HDR SN_EVENT_SERVER_HDR\endlink
  3381. ///                             passed to the callback as the Data parameter.
  3382. ///                             The callback will only be invoked when SNPS3Kick() is called.
  3383. ///
  3384. ///  @param     pfnCallBack   Pointer to callback.
  3385. ///  @param             pUserData     Optional user defined data.
  3386. ///
  3387. ///  Callback must be in the form of:
  3388. ///
  3389. /// \code
  3390. ///  void Callback(
  3391. ///          HTARGET hTarget,   // Target ID, if applicable. This will have the same value as the uTarget member of the
  3392. ///                      \link SN_EVENT_SERVER_HDR SN_EVENT_SERVER_HDR\endlink passed as the Data parameter.
  3393. ///          UINT32 Type,       // SN_EVENT_SERVER.
  3394. ///          UINT32 Param,      // Not used.
  3395. ///          UINT32 Length,     // Length of data in event including header.
  3396. ///          SNRESULT eResult,  // Success or failure of data fetch.
  3397. ///          BYTE* Data,        // Pointer to event data. Data will start with \link SN_EVENT_SERVER_HDR SN_EVENT_SERVER_HDR\endlink.
  3398. ///          void* UserData);   // Optional user data.
  3399. /// \endcode
  3400. ///
  3401. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3402. ///                             SN_S_OK - Successfully registered for server events.\n
  3403. ///                             SN_S_REPLACED - Already registered for server events, previous callback function has been replaced.\n
  3404. ///                             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3405. ///                             SN_E_BAD_PARAM - Pointer to callback function was null.
  3406. ///                            
  3407. //////////////////////////////////////////////////////////////////////////////
  3408.  
  3409. SNAPI SNRESULT SNPS3RegisterServerEventHandler(TMAPI_HandleEventCallback pfnCallBack, void *pUserData);
  3410.  
  3411. //////////////////////////////////////////////////////////////////////////////
  3412. ///
  3413. ///  @brief     Unregister the current callback function from receiving events.
  3414. ///
  3415. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3416. ///                             SN_S_OK - Successfully cancelled server events.\n
  3417. ///                             SN_S_NO_ACTION - No callback function registered.\n
  3418. ///                             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3419. ///
  3420. //////////////////////////////////////////////////////////////////////////////
  3421.  
  3422. SNAPI SNRESULT SNPS3UnRegisterServerEventHandler();
  3423.  
  3424. #define TXID_FORCE_FLAG         0xffffffff
  3425. //////////////////////////////////////////////////////////////////////////////
  3426. ///
  3427. ///  @brief     Upload the given file to the target.
  3428. ///             Note:   This only initiates the upload. To check progress, success or failure,
  3429. ///                             monitor FTP events (see SNPS3RegisterFTPEventHandler() for more information), or
  3430. ///                                             call SNPS3WaitForFileTransfer() to wait on result.
  3431. ///
  3432. ///  @param     hTarget        Handle to target.
  3433. ///  @param     pSource        Local file. UTF-8 null-terminated string.
  3434. ///  @param     pDestination   Target file. UTF-8 null-terminated string.
  3435. ///  @param             pTXID              Address of UINT32 to store transaction ID.
  3436. ///                                        Set the TXID value to TXID_FORCE_FLAG (0xffffffff) on input to force the transfer
  3437. ///                            (ie. bypass the timestamp/size check)
  3438. ///
  3439. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  3440. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3441. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3442. ///
  3443. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3444. ///             SN_S_OK - Successfully initiated file upload.\n
  3445. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3446. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3447. ///             SN_E_BAD_PARAM - pSource or pDest was NULL pointer, or contained a bad path.\n
  3448. ///             SN_E_DATA_TOO_LONG - pSource or pDest exceeded maximum path length for system (1024 for PS3, 260 for windows PC).\n
  3449. ///             SN_E_COMMS_ERR - Error communicating with target.
  3450. ///
  3451. //////////////////////////////////////////////////////////////////////////////
  3452.  
  3453. SNAPI SNRESULT SNPS3UploadFile(HTARGET hTarget, const char* pSource, const char* pDestination, UINT32* pTXID);
  3454.  
  3455. //////////////////////////////////////////////////////////////////////////////
  3456. ///
  3457. ///  @brief     Cancel a current or pending transfer to/from the target.
  3458. ///             Note: This only initiates the cancellation. To check success or failure,
  3459. ///             monitor FTP events (see SNPS3RegisterFTPEventHandler() for more information).
  3460. ///                             Alternatively, use SNPS3WaitForFileTransfer() to check the result.
  3461. ///
  3462. ///  @param     hTarget        Handle to target.
  3463. ///  @param             uTXID              Transaction ID of transfer to cancel.
  3464. ///
  3465. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  3466. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3467. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3468. ///
  3469. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3470. ///             SN_S_OK - Successfully initiated cancel of file transfer.\n
  3471. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3472. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3473. ///             SN_E_COMMS_ERR - Error communicating with target.
  3474. ///
  3475. //////////////////////////////////////////////////////////////////////////////
  3476.  
  3477. SNAPI SNRESULT SNPS3CancelFileTransfer(HTARGET hTarget, UINT32 uTXID);
  3478.  
  3479. //////////////////////////////////////////////////////////////////////////////
  3480. ///
  3481. ///  @brief     Retry the file transfer with the given ID.
  3482. ///             Note: This only initiates the transfer. To check success or failure,
  3483. ///             monitor FTP events (see SNPS3RegisterFTPEventHandler() for more information).
  3484. ///                             Alternatively, use SNPS3WaitForFileTransfer() to check the result.
  3485. ///
  3486. ///  @param     hTarget        Handle to target.
  3487. ///  @param             uTXID              Transaction ID of transfer to continue.
  3488. ///  @param     uForce             Non-zero to bypass check for modifications.
  3489. ///
  3490. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  3491. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3492. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3493. ///
  3494. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3495. ///             SN_S_OK - Successfully initiated file transfer retry.\n
  3496. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3497. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3498. ///             SN_E_COMMS_ERR - Error communicating with target.
  3499. ///
  3500. //////////////////////////////////////////////////////////////////////////////
  3501.  
  3502. SNAPI SNRESULT SNPS3RetryFileTransfer(HTARGET hTarget, UINT32 uTXID, UINT32 uForce);
  3503.  
  3504. //////////////////////////////////////////////////////////////////////////////
  3505. ///
  3506. ///  @brief     Get a directory listing.
  3507. ///             Call this function passing NULL for pDirectoryList to get the number of directory entries. Allocate
  3508. ///             a block of SNPS3DirEntry() structures and call this function again,
  3509. ///             passing in a pointer to the allocated buffer.
  3510. ///
  3511. ///  @param     pDirectory              Directory path. UTF-8 null-terminated string.
  3512. ///  @param     puCount                 [in] Size of buffer.\n
  3513. ///                             [out] Number of directory entries for which space is required,
  3514. ///                             or if buffer is big enough, number written to buffer.
  3515. ///  @param     pDirectoryList Pointer to a buffer to hold the directory list.
  3516. ///
  3517. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  3518. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3519. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3520. ///
  3521. ///  @result    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3522. ///             SN_S_OK - Successfully retrieved directory list or number of entries.\n
  3523. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3524. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3525. ///             SN_E_BAD_PARAM - pDirectory and/or puCount were NULL pointers.\n
  3526. ///             SN_E_OUT_OF_MEM - Size of pDirectoryList array given by puCount was too small.\n
  3527. ///             SN_E_COMMS_ERR - Error communicating with target.
  3528. ///
  3529. //////////////////////////////////////////////////////////////////////////////
  3530.  
  3531. SNAPI SNRESULT SNPS3GetDirectoryList(HTARGET hTarget, const char* pDirectory, UINT32* puCount, SNPS3DirEntry* pDirectoryList);
  3532.  
  3533. //////////////////////////////////////////////////////////////////////////////
  3534. ///
  3535. ///  @brief     Get a directory listing.
  3536. ///             Call this function passing NULL for pDirectoryList to get the number of directory entries. Allocate
  3537. ///             a block of SNPS3DirEntryEx() structures and call this function again,
  3538. ///             passing in a pointer to the allocated buffer.
  3539. ///
  3540. ///  @param     pDirectory              Directory path. UTF-8 null-terminated string.
  3541. ///  @param     puCount                 [in] Size of buffer.\n
  3542. ///                             [out] Number of directory entries for which space is required,
  3543. ///                             or if buffer is big enough, number written to buffer.
  3544. ///  @param     pDirectoryList  Pointer to a buffer to hold the directory list.
  3545. ///  @param             pTZ                             Pointer to structure to hold target timezone/dst settings (can be null).
  3546. ///
  3547. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  3548. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  3549. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  3550. ///
  3551. ///  @result    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3552. ///             SN_S_OK - Successfully retrieved directory list or number of entries.\n
  3553. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3554. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3555. ///             SN_E_BAD_PARAM - pDirectory and/or puCount were NULL pointers.\n
  3556. ///             SN_E_OUT_OF_MEM - Size of pDirectoryList array given by puCount was too small.\n
  3557. ///             SN_E_COMMS_ERR - Error communicating with target.
  3558. ///
  3559. //////////////////////////////////////////////////////////////////////////////
  3560.  
  3561. SNAPI SNRESULT SNPS3GetDirectoryListEx(HTARGET hTarget, const char* pDirectory, UINT32* puCount, SNPS3DirEntryEx* pDirectoryList, SNPS3TargetTimezone* pTZ);
  3562.  
  3563. //////////////////////////////////////////////////////////////////////////////
  3564. ///
  3565. ///  @brief     Create a directory on the target.
  3566. ///
  3567. ///  @param     hTarget        Handle to target.
  3568. ///  @param     pDirectory     Target directory. UTF-8 null-terminated string.
  3569. ///  @param     uMode          Access mode, used as the second parameter to CellFsMkDir (see SDK).
  3570. ///
  3571. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  3572. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3573. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3574. ///
  3575. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3576. ///             SN_S_OK - Successfully created directory.\n
  3577. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3578. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3579. ///             SN_E_BAD_PARAM - pDirectory was NULL pointer.\n
  3580. ///             SN_E_DATA_TOO_LONG - pDirectory was longer than max path length (1056).\n
  3581. ///             SN_E_FILE_ERROR - Error creating directory.\n
  3582. ///             SN_E_COMMS_ERR - Error communicating with target.
  3583. ///
  3584. //////////////////////////////////////////////////////////////////////////////
  3585.  
  3586. SNAPI SNRESULT SNPS3MakeDirectory(HTARGET hTarget, const char* pDirectory, UINT32 uMode);
  3587.  
  3588. //////////////////////////////////////////////////////////////////////////////
  3589. ///
  3590. ///  @brief     Rename a file on the target.
  3591. ///
  3592. ///  @param     hTarget        Handle to target.
  3593. ///  @param     pSource        Target file path. UTF-8 null-terminated string.
  3594. ///  @param     pDestination   New name. UTF-8 null-terminated string.
  3595. ///    
  3596. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  3597. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3598. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3599. ///
  3600. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3601. ///             SN_S_OK - Successfully renamed file.\n
  3602. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3603. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3604. ///             SN_E_BAD_PARAM - pSource and/or pDestination was NULL pointer.\n
  3605. ///             SN_E_DATA_TOO_LONG - pSource and/or pDestination was longer than max path length (1056).\n
  3606. ///             SN_E_FILE_ERROR - Error renaming file.\n
  3607. ///             SN_E_COMMS_ERR - Error communicating with target.\n
  3608. ///             SN_E_NOT_CONNECTED - Not connected to target.
  3609. ///
  3610. //////////////////////////////////////////////////////////////////////////////
  3611.  
  3612. SNAPI SNRESULT SNPS3Rename(HTARGET hTarget, const char* pSource, const char* pDestination);
  3613.  
  3614. //////////////////////////////////////////////////////////////////////////////
  3615. ///  @struct    SNPS3Protocol
  3616. ///  @brief     Structure for protocol information.  This should be treated as
  3617. ///             an opaque structure.
  3618. //////////////////////////////////////////////////////////////////////////////
  3619.  
  3620. struct SNPS3Protocol
  3621. {
  3622.         /// Protocol number.
  3623.         UINT32 uProtocol;
  3624.         /// Port number.
  3625.         UINT32 uPort;
  3626.         /// LPAR Description.
  3627.         UINT32 uLPARDesc;
  3628. };
  3629. typedef struct SNPS3Protocol SNPS3Protocol;
  3630.  
  3631. //! Default protocol priority for registering custom protocols.
  3632. const UINT32 SNPS3_DEFAULT_PROTO_PRIORITY = 0x80;
  3633.  
  3634. //////////////////////////////////////////////////////////////////////////////
  3635. ///
  3636. ///  @deprecated        Use SNPS3CustomProtocolCallbackEx (with SNPS3RegisterCustomProtocolEx).
  3637. ///  @brief                     Use SNPS3CustomProtocolCallbackEx (with SNPS3RegisterCustomProtocolEx).
  3638. ///
  3639. //////////////////////////////////////////////////////////////////////////////
  3640.  
  3641. typedef void (__stdcall *SNPS3CustomProtocolCallback)(HTARGET hTarget, BYTE* pData, UINT32 uLength, void* pUser);
  3642.  
  3643. //////////////////////////////////////////////////////////////////////////////
  3644. ///
  3645. ///  @brief     Callback function for registered protocols.
  3646. ///             There can be at most one function for each registered protocol.
  3647. ///             pData points to a temporary custom protocol data buffer of length uLength.
  3648. ///             The callback will only be invoked when SNPS3Kick is called.
  3649. ///
  3650. //////////////////////////////////////////////////////////////////////////////
  3651.  
  3652. typedef void (__stdcall *SNPS3CustomProtocolCallbackEx)(HTARGET hTarget, SNPS3Protocol protocol, BYTE* pData, UINT32 uLength, void* pUser);
  3653.  
  3654. //////////////////////////////////////////////////////////////////////////////
  3655. ///
  3656. ///  @deprecated        Use SNPS3RegisterCustomProtocolEx.
  3657. ///  @brief                     Use SNPS3RegisterCustomProtocolEx().
  3658. ///
  3659. //////////////////////////////////////////////////////////////////////////////
  3660. SNDEPRECATED("use SNPS3RegisterCustomProtocolEx instead")
  3661. SNAPI SNRESULT SNPS3RegisterCustomProtocol(HTARGET hTarget, UINT32 uProtocol, UINT32 uPort, const char* pszLPAR,
  3662.                                                                                    UINT32 uPriority, SNPS3Protocol *pProto,
  3663.                                                                                    SNPS3CustomProtocolCallback pfnCallBack, void *pUser);
  3664.  
  3665. //////////////////////////////////////////////////////////////////////////////
  3666. ///
  3667. ///  @brief     Register a custom protocol on a target, and a callback for custom protocol notifications.
  3668. ///             The callback will only be invoked when SNPS3Kick() is called.
  3669. ///
  3670. ///  @param     hTarget        Handle to target.
  3671. ///  @param     uProtocol      Protocol identifier.
  3672. ///  @param     uPort          Protocol port.
  3673. ///  @param     pszLPAR        LPAR descriptor.
  3674. ///  @param     uPriority      Protocol priority. Typically SNPS3_DEFAULT_PROTO_PRIORITY.
  3675. ///  @param     pProto         Structure into which to write the details of
  3676. ///                            the protocol.
  3677. ///  @param     pfnCallBack    Callback function to invoke when data is
  3678. ///                            received on the given protocol (one callback per protocol per target).
  3679. ///  @param     pUser          User data to be passed into the callback function.
  3680. ///
  3681. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3682. ///             SN_S_OK - Successfully registered for custom protocol notifications.\n
  3683. ///             SN_S_REPLACED - Protocol already registered on the target, previous callback function has been replaced.\n
  3684. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3685. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3686. ///             SN_E_BAD_PARAM - pszLPAR, pProto or pfnCallBack was NULL pointer.\n
  3687. ///             SN_E_PROTOCOL_ALREADY_REGISTERED - Tried to register a second protocol on a debug station.\n
  3688. ///             SN_E_COMMS_ERR - Error communicating with target.
  3689. ///
  3690. //////////////////////////////////////////////////////////////////////////////
  3691.  
  3692. SNAPI SNRESULT SNPS3RegisterCustomProtocolEx(HTARGET hTarget, UINT32 uProtocol, UINT32 uPort, const char* pszLPAR,
  3693.                                                                                    UINT32 uPriority, SNPS3Protocol *pProto,
  3694.                                                                                    SNPS3CustomProtocolCallbackEx pfnCallBack, void *pUser);
  3695.  
  3696. //////////////////////////////////////////////////////////////////////////////
  3697. ///
  3698. ///  @brief     Send data to the target using the specified protocol.
  3699. ///
  3700. ///  @param     hTarget        Handle to target.
  3701. ///  @param     pProto         Protocol information.
  3702. ///  @param     pData          Data to send.
  3703. ///  @param     uLength        Length of the data to send.
  3704. ///
  3705. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3706. ///             SN_S_OK - Successfully sent custom protocol data.\n
  3707. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3708. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3709. ///             SN_E_BAD_PARAM - pProto and/or pData was NULL pointer.\n
  3710. ///             SN_E_DATA_TOO_LONG - Data longer than max size (reference tool: 65519 bytes, debug station: 4080 bytes).\n
  3711. ///             SN_E_NOT_LISTED - Protocol not registered.\n
  3712. ///             SN_E_COMMS_ERR - Error communicating with target.
  3713. ///
  3714. //////////////////////////////////////////////////////////////////////////////
  3715.  
  3716. SNAPI SNRESULT SNPS3SendCustomProtocolData(HTARGET hTarget,
  3717.                                                                                    SNPS3Protocol* pProto, BYTE* pData, UINT32 uLength);
  3718.  
  3719. //////////////////////////////////////////////////////////////////////////////
  3720. ///
  3721. ///  @brief     Unregister a custom protocol callback.
  3722. ///             If there are other clients registered for the same protocol,
  3723. ///             the protocol will remain on the target and other clients will continue to receive notifications.
  3724. ///             Otherwise, the protocol is cleared from the target.
  3725. ///             Note that attempting to unregister an invalid protocol does not return an error code - it returns SN_S_NO_ACTION.
  3726. ///
  3727. ///  @param     hTarget        Handle to target.
  3728. ///  @param     pProto         Protocol information.
  3729. ///
  3730. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3731. ///             SN_S_OK - Successfully unregistered protocol and cleared it from the target.\n
  3732. ///             SN_S_TARGET_STILL_REGISTERED - Protocol was unregistered but not cleared from the target,
  3733. ///             because other clients are registered for it.\n
  3734. ///             SN_S_NO_ACTION - Protocol not currently registered.\n
  3735. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3736. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3737. ///             SN_E_BAD_PARAM - pProto was NULL pointer.\n
  3738. ///             SN_E_COMMS_ERR - Error communicating with target.
  3739. ///
  3740. //////////////////////////////////////////////////////////////////////////////
  3741.  
  3742. SNAPI SNRESULT SNPS3UnRegisterCustomProtocol(HTARGET hTarget, SNPS3Protocol* pProto);
  3743.  
  3744. //////////////////////////////////////////////////////////////////////////////
  3745. ///
  3746. ///  @brief     Unregister the protocol, clearing it from the target.
  3747. ///             If there are multiple clients registered for the protocol, they will
  3748. ///             be notified internally of their unsubscription.
  3749. ///
  3750. ///  @param     hTarget        Handle to target.
  3751. ///  @param     pProto         Protocol information.
  3752. ///
  3753. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3754. ///             SN_S_OK - Successfully unregistered protocol and cleared it from the target.\n
  3755. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3756. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3757. ///             SN_E_NOT_LISTED - Protocol not currently registered.\n
  3758. ///             SN_E_BAD_PARAM - pProto was NULL pointer.\n
  3759. ///             SN_E_COMMS_ERR - Error communicating with target.
  3760. ///
  3761. //////////////////////////////////////////////////////////////////////////////
  3762.  
  3763. SNAPI SNRESULT SNPS3ForceUnRegisterCustomProtocol(HTARGET hTarget, SNPS3Protocol* pProto);
  3764.  
  3765. //////////////////////////////////////////////////////////////////////////////
  3766. ///
  3767. ///  @brief     Get a count of all the synchronisation primitives owned by the given process.
  3768. ///
  3769. ///  @param     hTarget                 Handle to target.
  3770. ///  @param     uProcessID              Process ID.
  3771. ///  @param     pNumMutexes             Address of UINT32 to store the number of mutexes
  3772. ///                             (can be NULL).
  3773. ///  @param     pNumCondVars    Address of UINT32 to store the number of conditional
  3774. ///                             variables (can be NULL).
  3775. ///  @param     pNumRWLocks             Address of UINT32 to store the number of read-write
  3776. ///                             locks (can be NULL).
  3777. ///  @param     pNumLWMutexes   Address of UINT32 to store the number of light-weight
  3778. ///                             mutexes (can be NULL).
  3779. ///  @param     pNumEventQueues Address of UINT32 to store the number of event
  3780. ///                             queues (can be NULL).
  3781. ///  @param     pNumSemaphores  Address of UINT32 to store the number of semaphores
  3782. ///                             (can be NULL).
  3783. ///
  3784. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.8.0 - latest version.\n
  3785. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3786. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3787. ///
  3788. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3789. ///             SN_S_OK - Successfully retrieved synchronisation primitive counts.\n
  3790. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3791. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3792. ///             SN_E_COMMS_ERR - Error communicating with target.
  3793. ///
  3794. //////////////////////////////////////////////////////////////////////////////
  3795.  
  3796. SNAPI SNRESULT SNPS3GetSyncPrimitiveCounts(HTARGET hTarget, UINT32 uProcessID,
  3797.                                                                                    UINT32* pNumMutexes, UINT32* pNumCondVars, UINT32* pNumRWLocks,
  3798.                                                                                    UINT32* pNumLWMutexes, UINT32* pNumEventQueues, UINT32* pNumSemaphores);
  3799.  
  3800. //////////////////////////////////////////////////////////////////////////////
  3801. ///
  3802. ///  @brief     Get the list of mutexes associated with the process.
  3803. ///             Call this function passing NULL for pBuffer to get the number of mutexes. Allocate
  3804. ///             a block of size (*puCount * sizeof(UINT32)) and call this function again
  3805. ///             passing in a pointer to the allocated buffer.
  3806. ///
  3807. ///  @param     hTarget         Handle to target.
  3808. ///  @param     uProcessID      Process ID.
  3809. ///  @param     puCount         [in] Number of mutexes buffer can hold.\n
  3810. ///                                     [out] Number of mutexes for which space is required,
  3811. ///                                     or if buffer is big enough, number written to buffer.
  3812. ///  @param     pBuffer         Buffer to hold the set of mutex IDs.
  3813. ///
  3814. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.4.0 - latest version.\n
  3815. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3816. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3817. ///
  3818. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3819. ///             SN_S_OK - Successfully retrieved mutex list or number of mutexes.\n
  3820. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3821. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3822. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  3823. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  3824. ///             SN_E_COMMS_ERR - Error communicating with target.
  3825. ///
  3826. //////////////////////////////////////////////////////////////////////////////
  3827.  
  3828. SNAPI SNRESULT SNPS3GetMutexList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  3829.  
  3830. //////////////////////////////////////////////////////////////////////////////
  3831. ///  @struct    SNPS3MutexAttr
  3832. ///  @brief     Mutex attribute data.
  3833. //////////////////////////////////////////////////////////////////////////////
  3834.  
  3835. struct SNPS3MutexAttr {
  3836.         UINT32  uAttrProtocol;
  3837.         UINT32  uAttrRecursive;
  3838.         UINT32  uAttrPshared;
  3839.         UINT32  uAttrAdaptive;
  3840.         UINT64  uKey;
  3841.         UINT32  uFlags;
  3842.         char    aName[8];
  3843. };
  3844. typedef struct SNPS3MutexAttr SNPS3MutexAttr;
  3845.  
  3846. //////////////////////////////////////////////////////////////////////////////
  3847. ///  @struct    SNPS3MutexInfo
  3848. ///  @brief     Contains parameters which define a mutex.
  3849. //////////////////////////////////////////////////////////////////////////////
  3850.  
  3851. struct SNPS3MutexInfo {
  3852.         UINT32          uMutexID;
  3853.         SNPS3MutexAttr Attribute;
  3854.         UINT64          uOwnerThID;
  3855.         UINT32          uLockCounter;
  3856.         UINT32          uCondRefCounter;
  3857.         UINT32          uCondID;
  3858.         UINT32          uWaitThreadsNum;
  3859.         UINT32          uWaitAllThreadsNum;
  3860.         UINT64          aWaitThreadIDs[];
  3861. };
  3862. typedef struct SNPS3MutexInfo SNPS3MutexInfo;
  3863.  
  3864. //////////////////////////////////////////////////////////////////////////////
  3865. ///
  3866. ///  @brief     Get information about the given mutex.
  3867. ///             Call this function with pInfo = NULL to get the required buffer size.
  3868. ///             To get the mutex information, set pInfo to point to an allocated memory block of size *puBufferSize,
  3869. ///             and call the function again.
  3870. ///
  3871. ///  @param     hTarget                 Handle to target.
  3872. ///  @param     uProcessID              Process ID.
  3873. ///  @param     uMutexID                Mutex ID.
  3874. ///  @param     puBufferSize    [in] Size of buffer.\n
  3875. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  3876. ///  @param     pInfo                   Pointer to a buffer holding the information
  3877. ///                             about the mutex.
  3878. ///
  3879. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  3880. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3881. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3882. ///
  3883. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3884. ///             SN_S_OK - Successfully retrieved mutex information or required size.\n
  3885. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3886. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3887. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  3888. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  3889. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  3890. ///             SN_E_COMMS_ERR - Error communicating with target.
  3891. ///
  3892. //////////////////////////////////////////////////////////////////////////////
  3893.  
  3894. SNAPI SNRESULT SNPS3GetMutexInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uMutexID, UINT32 *puBufferSize, SNPS3MutexInfo *pInfo);
  3895.  
  3896. //////////////////////////////////////////////////////////////////////////////
  3897. ///  @struct    SNPS3CondAttr
  3898. ///  @brief     Attributes for conditional variable.
  3899. //////////////////////////////////////////////////////////////////////////////
  3900.  
  3901. struct SNPS3CondAttr
  3902. {
  3903.         UINT32  uAttrPshared;
  3904.         UINT64  uKey;
  3905.         UINT32  uFlags;
  3906.         char    aName[8];
  3907. };
  3908. typedef struct SNPS3CondAttr SNPS3CondAttr;
  3909.  
  3910. //////////////////////////////////////////////////////////////////////////////
  3911. ///  @struct    SNPS3ConditionalInfo
  3912. ///  @brief     Contains parameters which define a conditional variable.
  3913. //////////////////////////////////////////////////////////////////////////////
  3914.  
  3915. struct SNPS3ConditionalInfo
  3916. {
  3917.         UINT32            uCondID;
  3918.         SNPS3CondAttr Attribute;
  3919.         UINT32            uMutexID;
  3920.         UINT32            uWaitThreadsNum;
  3921.         UINT32            uWaitAllThreadsNum;
  3922.         UINT64            aWaitThreadIDs[];
  3923. };
  3924. typedef struct SNPS3ConditionalInfo SNPS3ConditionalInfo;
  3925.  
  3926. //////////////////////////////////////////////////////////////////////////////
  3927. ///
  3928. ///   @brief    Get the list of conditional variables associated with the given process.
  3929. ///             Call this function passing NULL for pBuffer to get the number of variables.
  3930. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  3931. ///             passing in a pointer to the allocated buffer.
  3932. ///  
  3933. ///   @param     hTarget        Handle to target.
  3934. ///   @param     uProcessID Process ID.
  3935. ///   @param     puCount    [in] Number of conditional variables buffer can hold.\n
  3936. ///                                     [out] Number of conditional variables for which space is required, or number written to buffer.
  3937. ///   @param     pBuffer    Buffer to hold the set of conditional variable IDs.
  3938. ///  
  3939. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  3940. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3941. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3942. ///
  3943. ///       @return       \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3944. ///             SN_S_OK - Successfully retrieved conditional variable list or number of conditional variables.\n
  3945. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3946. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3947. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  3948. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  3949. ///             SN_E_COMMS_ERR - Error communicating with target.
  3950. ///
  3951. //////////////////////////////////////////////////////////////////////////////
  3952.  
  3953. SNAPI SNRESULT SNPS3GetConditionalVariableList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  3954.  
  3955. //////////////////////////////////////////////////////////////////////////////
  3956. ///
  3957. ///  @brief     Get information about the given conditional variable.
  3958. ///             Call this function with pInfo = NULL to get the required buffer size.
  3959. ///             To get the conditional variable information, set pInfo to point to an allocated memory block of size
  3960. ///             *puBufferSize, and call the function again.
  3961. ///
  3962. ///  @param     hTarget                 Handle to target.
  3963. ///  @param     uProcessID              Process ID.
  3964. ///  @param     uCondVarID              Conditional variable ID.
  3965. ///  @param     puBufferSize    [in] Size of buffer provided.\n
  3966. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  3967. ///  @param     pInfo                   Buffer to hold the information about the conditional variable.
  3968. ///
  3969. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  3970. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  3971. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  3972. ///
  3973. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  3974. ///             SN_S_OK - Successfully retrieved conditional variable information or required size.\n
  3975. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  3976. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  3977. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  3978. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  3979. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  3980. ///             SN_E_COMMS_ERR - Error communicating with target.
  3981. ///
  3982. //////////////////////////////////////////////////////////////////////////////
  3983.  
  3984. SNAPI SNRESULT SNPS3GetConditionalVariableInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uCondVarID,
  3985.                                                                                            UINT32 *puBufferSize, SNPS3ConditionalInfo *pInfo);
  3986.  
  3987. //////////////////////////////////////////////////////////////////////////////
  3988. ///
  3989. ///  @brief     Get the list of read-write lock list associated with the given process.
  3990. ///             Call this function passing NULL for pBuffer to get the number of read-write locks.
  3991. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  3992. ///             passing in a pointer to the allocated buffer.
  3993. ///
  3994. ///  @param     hTarget         Handle to target.
  3995. ///  @param     uProcessID      Process ID.
  3996. ///  @param     puCount         [in] Number of IDs buffer can hold.\n
  3997. ///                                     [out] Number of read-write locks for which space is required,
  3998. ///                                     or if buffer is big enough, number written to buffer.
  3999. ///  @param     pBuffer         Buffer to hold the set of read-write lock IDs.
  4000. ///
  4001. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  4002. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4003. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4004. ///
  4005. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4006. ///             SN_S_OK - Successfully retrieved read-write lock list or number of read-write locks.\n
  4007. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4008. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4009. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  4010. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  4011. ///             SN_E_COMMS_ERR - Error communicating with target.
  4012. ///
  4013. //////////////////////////////////////////////////////////////////////////////
  4014.  
  4015. SNAPI SNRESULT SNPS3GetReadWriteLockList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  4016.  
  4017. //////////////////////////////////////////////////////////////////////////////
  4018. ///  @struct    SNPS3RWLockAttr
  4019. ///  @brief     Read/Write lock attributes.
  4020. //////////////////////////////////////////////////////////////////////////////
  4021.  
  4022. struct SNPS3RWLockAttr {
  4023.         UINT32  uAttrProtocol;
  4024.         UINT32  uAttrPshared;
  4025.         UINT64  uKey;
  4026.         UINT32  uFlags;
  4027.         char    aName[8];
  4028. };
  4029. typedef struct SNPS3RWLockAttr SNPS3RWLockAttr;
  4030.  
  4031. //////////////////////////////////////////////////////////////////////////////
  4032. ///  @struct    SNPS3RWLockInfo
  4033. ///  @brief     Contains parameters which define a read-write lock.
  4034. //////////////////////////////////////////////////////////////////////////////
  4035.  
  4036. struct SNPS3RWLockInfo {
  4037.         UINT32          uRwlockID;
  4038.         SNPS3RWLockAttr Attribute;
  4039.         UINT64          uOwnerThID;
  4040.         UINT32          uRwaitThreadsNum;
  4041.         UINT32          uRwaitAllThreadsNum;
  4042.         UINT32          uWwaitThreadsNum;
  4043.         UINT32          uWaitAllThreadsNum;  // Should be uWwaitAllThreadsNum
  4044.         UINT64          aWaitThreadIDs[];
  4045. };
  4046. typedef struct SNPS3RWLockInfo SNPS3RWLockInfo;
  4047.  
  4048. //////////////////////////////////////////////////////////////////////////////
  4049. ///
  4050. ///  @brief     Get information about the given read-write lock.
  4051. ///             Call this function with pInfo = NULL to get the required buffer size.
  4052. ///             To get the read-write lock information, set pInfo to point to an allocated memory block of size
  4053. ///             *puBufferSize, and call the function again.
  4054. ///
  4055. ///  @param     hTarget                 Handle to target.
  4056. ///  @param     uProcessID              Process ID.
  4057. ///  @param     uRWLockID               Read-Write Lock ID.
  4058. ///  @param     puBufferSize    [in] Size of buffer.\n
  4059. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  4060. ///  @param     pInfo                   Pointer to a buffer holding the information about the read-write lock.
  4061. ///
  4062. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  4063. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4064. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4065. ///
  4066. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4067. ///             SN_S_OK - Successfully retrieved read-write lock information or required size.\n
  4068. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4069. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4070. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  4071. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  4072. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  4073. ///             SN_E_COMMS_ERR - Error communicating with target.
  4074. ///
  4075. //////////////////////////////////////////////////////////////////////////////
  4076.  
  4077. SNAPI SNRESULT SNPS3GetReadWriteLockInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uRWLockID, UINT32 *puBufferSize, SNPS3RWLockInfo *pInfo);
  4078.  
  4079. //////////////////////////////////////////////////////////////////////////////
  4080. ///
  4081. ///  @brief     Get the list of light-weight mutexes associated with the process.
  4082. ///             Call this function passing NULL for pBuffer to get the number of light-weight mutexes.
  4083. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  4084. ///             passing in a pointer to the allocated buffer.
  4085. ///
  4086. ///  @param     hTarget         Handle to target.
  4087. ///  @param     uProcessID      Process ID.
  4088. ///  @param     puCount         [in] Size of buffer.\n
  4089. ///                                     [out] Number of light-weight mutexes for which space is required,
  4090. ///                                     or if buffer is big enough, number written to buffer.
  4091. ///  @param     pBuffer         Buffer to hold the set of light-weight mutex IDs.
  4092. ///
  4093. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.4.0 - latest version.\n
  4094. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4095. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4096. ///
  4097. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4098. ///             SN_S_OK - Successfully retrieved light-weight mutex list or number of light-weight mutexes.\n
  4099. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4100. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4101. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  4102. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  4103. ///             SN_E_COMMS_ERR - Error communicating with target.
  4104. ///
  4105. //////////////////////////////////////////////////////////////////////////////
  4106.  
  4107. SNAPI SNRESULT SNPS3GetLightWeightMutexList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  4108.  
  4109. //////////////////////////////////////////////////////////////////////////////
  4110. ///  @struct    SNPS3LWMutexAttr
  4111. ///  @brief     Lightweight mutex attributes.
  4112. //////////////////////////////////////////////////////////////////////////////
  4113.  
  4114. struct SNPS3LWMutexAttr {
  4115.         UINT32  uAttrProtocol;
  4116.         UINT32  uAttrRecursive;
  4117.         char    aName[8];
  4118. };
  4119. typedef struct SNPS3LWMutexAttr SNPS3LWMutexAttr;
  4120.  
  4121.  
  4122. //////////////////////////////////////////////////////////////////////////////
  4123. ///  @struct    SNPS3LWMutexInfo
  4124. ///  @brief     Contains parameters which define a light weight mutex.
  4125. //////////////////////////////////////////////////////////////////////////////
  4126.  
  4127. struct SNPS3LWMutexInfo {
  4128.         UINT32          uLwmutexID;
  4129.         SNPS3LWMutexAttr        Attribute;
  4130.         UINT64          uOwnerThID;
  4131.         UINT32          uLockCounter;
  4132.         UINT32          uWaitThreadsNum;
  4133.         UINT32          uWaitAllThreadsNum;
  4134.         UINT64          aWaitThreadIDs[];
  4135. };
  4136. typedef struct SNPS3LWMutexInfo SNPS3LWMutexInfo;
  4137.  
  4138. //////////////////////////////////////////////////////////////////////////////
  4139. ///
  4140. ///  @brief     Get information about the given light-weight mutex.
  4141. ///             Call this function with pInfo = NULL to get the required buffer size.
  4142. ///             To get the light-weight mutex information, set pInfo to point to an allocated memory block of size
  4143. ///             *puBufferSize, and call the function again.
  4144. ///
  4145. ///  @param     hTarget      Handle to target.
  4146. ///  @param     uProcessID   Process ID.
  4147. ///  @param     uLWMutexID   Light-weight mutex ID
  4148. ///  @param     puBufferSize [in] Size of the buffer.\n
  4149. ///                                      [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  4150. ///  @param     pInfo        Pointer to a buffer holding the information about
  4151. ///                          the light-weight mutex.
  4152. ///
  4153. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  4154. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4155. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4156. ///
  4157. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4158. ///             SN_S_OK - Successfully retrieved light-weight mutex information or required size.\n
  4159. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4160. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4161. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  4162. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  4163. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  4164. ///             SN_E_COMMS_ERR - Error communicating with target.
  4165. ///
  4166. //////////////////////////////////////////////////////////////////////////////
  4167.  
  4168. SNAPI SNRESULT SNPS3GetLightWeightMutexInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uLWMutexID, UINT32 *puBufferSize, SNPS3LWMutexInfo *pInfo);
  4169.  
  4170. //////////////////////////////////////////////////////////////////////////////
  4171. ///
  4172. ///  @brief     Get the list of event queues associated with the process.
  4173. ///             Call this function passing NULL for pBuffer to get the number of event queues.
  4174. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  4175. ///             passing in a pointer to the allocated buffer.
  4176. ///
  4177. ///  @param     hTarget         Handle to target.
  4178. ///  @param     uProcessID      Process ID.
  4179. ///  @param     puCount         [in] Size of buffer.\n
  4180. ///                                     [out] Number of event queues for which space is required,
  4181. ///                                     or if buffer is big enough, number written to buffer.
  4182. ///  @param     pBuffer         Buffer to hold the set of event queue IDs.
  4183. ///
  4184. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  4185. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4186. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4187. ///
  4188. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4189. ///             SN_S_OK - Successfully retrieved event queue list or number of event queues.\n
  4190. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4191. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4192. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  4193. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  4194. ///             SN_E_COMMS_ERR - Error communicating with target.
  4195. ///
  4196. //////////////////////////////////////////////////////////////////////////////
  4197.  
  4198. SNAPI SNRESULT SNPS3GetEventQueueList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  4199.  
  4200. //////////////////////////////////////////////////////////////////////////////
  4201. ///  @struct    SNPS3EventQueueAttr
  4202. ///  @brief     Event queue attributes.
  4203. //////////////////////////////////////////////////////////////////////////////
  4204.  
  4205. struct SNPS3EventQueueAttr
  4206. {
  4207.         UINT32  uAttrProtocol;
  4208.         UINT32  uType;
  4209.         char    aName[8];
  4210. };
  4211. typedef struct SNPS3EventQueueAttr SNPS3EventQueueAttr;
  4212.  
  4213.  
  4214. //////////////////////////////////////////////////////////////////////////////
  4215. ///  @struct    SNPS3SysEvent
  4216. ///  @brief     System event.
  4217. //////////////////////////////////////////////////////////////////////////////
  4218.  
  4219. struct SNPS3SysEvent
  4220. {
  4221.         UINT64  uSource;
  4222.         UINT64  uData1;
  4223.         UINT64  uData2;
  4224.         UINT64  uData3;
  4225. };
  4226. typedef struct SNPS3SysEvent SNPS3SysEvent;
  4227.  
  4228.  
  4229. //////////////////////////////////////////////////////////////////////////////
  4230. ///  @struct    SNPS3EventQueueInfo
  4231. ///  @brief     Contains parameters which define an event queue.
  4232. //////////////////////////////////////////////////////////////////////////////
  4233.  
  4234. struct SNPS3EventQueueInfo
  4235. {
  4236.         UINT32          uEventQueueID;
  4237.         SNPS3EventQueueAttr Attribute;
  4238.         UINT64          uKey;
  4239.         UINT32          uQueueSize;
  4240.         UINT32          uWaitThreadsNum;
  4241.         UINT32          uWaitAllThreadsNum;
  4242.         UINT32          uReadableEqueueNum;
  4243.         UINT32          uReadableAllEqueueNum;
  4244.         UINT64*         aWaitThreadIDs;
  4245.         SNPS3SysEvent* aEventQueueEntries;
  4246. };
  4247. typedef struct SNPS3EventQueueInfo SNPS3EventQueueInfo;
  4248.  
  4249. //////////////////////////////////////////////////////////////////////////////
  4250. ///
  4251. ///  @brief     Get information about the given event queue.
  4252. ///             Call this function with pInfo = NULL to get the required buffer size.
  4253. ///             To get the event queue information, set pInfo to point to an allocated memory block of size
  4254. ///             *puBufferSize, and call the function again.
  4255. ///
  4256. ///  @param     hTarget                 Handle to target.
  4257. ///  @param     uProcessID              Process ID.
  4258. ///  @param     uEventQueueID   Event queue ID.
  4259. ///  @param     puBufferSize    [in] Size of the buffer.\n
  4260. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  4261. ///  @param     pInfo                   Pointer to a buffer holding the information about
  4262. ///                             the event queue.
  4263. ///
  4264. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  4265. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4266. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4267. ///
  4268. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4269. ///             SN_S_OK - Successfully retrieved event queue information or required size.\n
  4270. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4271. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4272. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  4273. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  4274. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  4275. ///             SN_E_COMMS_ERR - Error communicating with target.
  4276. ///
  4277. //////////////////////////////////////////////////////////////////////////////
  4278.  
  4279. SNAPI SNRESULT SNPS3GetEventQueueInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uEventQueueID, UINT32 *puBufferSize, SNPS3EventQueueInfo *pInfo);
  4280.  
  4281. //////////////////////////////////////////////////////////////////////////////
  4282. ///
  4283. ///  @brief     Get the list of semaphores associated with the process.
  4284. ///             Call this function passing NULL for pBuffer to get the number of semaphores.
  4285. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  4286. ///             passing in a pointer to the allocated buffer.
  4287. ///
  4288. ///  @param     hTarget         Handle to target.
  4289. ///  @param     uProcessID      Process ID.
  4290. ///  @param     puCount         [in] Size of buffer.\n
  4291. ///                                     [out] Number of semaphores for which space is required,
  4292. ///                                     or if buffer is big enough, number written to buffer.
  4293. ///  @param     pBuffer         Buffer to hold the set of semaphore IDs.
  4294. ///
  4295. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  4296. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4297. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4298. ///
  4299. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4300. ///             SN_S_OK - Successfully retrieved semaphore list or number of semaphores.\n
  4301. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4302. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4303. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  4304. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  4305. ///             SN_E_COMMS_ERR - Error communicating with target.
  4306. ///
  4307. //////////////////////////////////////////////////////////////////////////////
  4308.  
  4309. SNAPI SNRESULT SNPS3GetSemaphoreList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  4310.  
  4311. //////////////////////////////////////////////////////////////////////////////
  4312. ///  @struct    SNPS3SemaphoreAttr
  4313. ///  @brief     Semaphore attributes.
  4314. //////////////////////////////////////////////////////////////////////////////
  4315.  
  4316. struct SNPS3SemaphoreAttr
  4317. {
  4318.         UINT32  uAttrProtocol;
  4319.         UINT32  uAttrPshared;
  4320.         UINT64  uKey;
  4321.         UINT32  uFlags;
  4322.         char    aName[8];
  4323. };
  4324. typedef struct SNPS3SemaphoreAttr SNPS3SemaphoreAttr;
  4325.  
  4326. //////////////////////////////////////////////////////////////////////////////
  4327. ///  @struct    SNPS3SemaphoreInfo
  4328. ///  @brief     Contains parameters which define a semaphore.
  4329. //////////////////////////////////////////////////////////////////////////////
  4330.  
  4331. struct SNPS3SemaphoreInfo
  4332. {
  4333.         UINT32          uSemaphoreID;
  4334.         SNPS3SemaphoreAttr Attribute;
  4335.         UINT32          uMaxVal;
  4336.         UINT32          uCurVal;
  4337.         UINT32          uWaitThreadsNum;
  4338.         UINT32          uWaitAllThreadsNum;
  4339.         UINT64          aWaitThreadIDs[];
  4340. };
  4341. typedef struct SNPS3SemaphoreInfo SNPS3SemaphoreInfo;
  4342.  
  4343. //////////////////////////////////////////////////////////////////////////////
  4344. ///
  4345. ///  @brief     Get information about the given semaphore.
  4346. ///             Call this function with pInfo = NULL to get the required buffer size.
  4347. ///             To get the semaphore information, set pInfo to point to an allocated memory block of size
  4348. ///             *puBufferSize, and call the function again.
  4349. ///
  4350. ///  @param     hTarget      Handle to target.
  4351. ///  @param     uProcessID   Process ID.
  4352. ///  @param     uSemaphoreID   Event queue ID.
  4353. ///  @param     puBufferSize [in] Size of the buffer.\n
  4354. ///                                      [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  4355. ///  @param     pInfo        Pointer to a buffer holding the information about
  4356. ///                          the semaphore.
  4357. ///
  4358. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.4.0 - latest version.\n
  4359. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4360. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4361. ///
  4362. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4363. ///             SN_S_OK - Successfully retrieved semaphore information or required size.\n
  4364. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4365. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4366. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  4367. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  4368. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  4369. ///             SN_E_COMMS_ERR - Error communicating with target.
  4370. ///
  4371. //////////////////////////////////////////////////////////////////////////////
  4372.  
  4373. SNAPI SNRESULT SNPS3GetSemaphoreInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uSemaphoreID, UINT32 *puBufferSize, SNPS3SemaphoreInfo *pInfo);
  4374.  
  4375. //////////////////////////////////////////////////////////////////////////////
  4376. ///
  4377. ///  @brief     Get the list of event flags associated with the given process.
  4378. ///             Call this function passing NULL for pBuffer to get the number of event flags.
  4379. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  4380. ///             passing in a pointer to the allocated buffer.
  4381. ///
  4382. ///  @param     hTarget         Handle to target.
  4383. ///  @param     uProcessID      Process ID.
  4384. ///  @param     puCount         [in] Size of buffer.\n
  4385. ///                                     [out] Number of event flags for which space is required,
  4386. ///                                     or if buffer is big enough, number written to buffer.
  4387. ///  @param     pBuffer         Buffer to hold the set of event flags.
  4388. ///
  4389. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.7.0 - latest version.\n
  4390. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.7.0 - latest version.\n
  4391. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.7.0 - latest version.
  4392. ///
  4393. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4394. ///             SN_S_OK - Successfully retrieved event flags list or number of event flags.\n
  4395. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4396. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4397. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  4398. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  4399. ///             SN_E_COMMS_ERR - Error communicating with target.
  4400. ///
  4401. //////////////////////////////////////////////////////////////////////////////
  4402.  
  4403. SNAPI SNRESULT SNPS3GetEventFlagList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  4404.  
  4405.  
  4406. //////////////////////////////////////////////////////////////////////////////
  4407. ///  @struct    SNPS3EventFlagAttr
  4408. ///  @brief     Event flag attributes.
  4409. //////////////////////////////////////////////////////////////////////////////
  4410.  
  4411. struct SNPS3EventFlagAttr
  4412. {
  4413.         UINT32  uAttrProtocol;
  4414.         UINT32  uAttrPshared;
  4415.         UINT64  uKey;
  4416.         UINT32  uFlags;
  4417.         UINT32  uType;
  4418.         char    aName[8];
  4419. };
  4420. typedef struct SNPS3EventFlagAttr SNPS3EventFlagAttr;
  4421.  
  4422. //////////////////////////////////////////////////////////////////////////////
  4423. ///  @struct    SNPS3EventFlagWaitThread
  4424. ///  @brief     Contains parameters defining a thread waiting on an event flag.
  4425. //////////////////////////////////////////////////////////////////////////////
  4426.  
  4427. struct SNPS3EventFlagWaitThread
  4428. {
  4429.         UINT64 uThreadID;
  4430.         UINT64 uBitPattern;
  4431.         UINT32 uMode;
  4432. };
  4433. typedef struct SNPS3EventFlagWaitThread SNPS3EventFlagWaitThread;
  4434.  
  4435.  
  4436. //////////////////////////////////////////////////////////////////////////////
  4437. ///  @struct    SNPS3EventFlagInfo
  4438. ///  @brief     Contains parameters which define an event flag.
  4439. //////////////////////////////////////////////////////////////////////////////
  4440.  
  4441. struct SNPS3EventFlagInfo
  4442. {
  4443.         UINT32          uEventFlagID;
  4444.         SNPS3EventFlagAttr Attribute;
  4445.         UINT64          uBitPattern;
  4446.         UINT32          uWaitThreadsNum;
  4447.         UINT32          uWaitAllThreadsNum;
  4448.         SNPS3EventFlagWaitThread aWaitThreads[];
  4449. };
  4450. typedef struct SNPS3EventFlagInfo SNPS3EventFlagInfo;
  4451.  
  4452. //////////////////////////////////////////////////////////////////////////////
  4453. ///
  4454. ///  @brief     Get information about the given event flag.
  4455. ///             Call this function with pInfo = NULL to get the required buffer size.
  4456. ///             To get the event flag information, set pInfo to point to an allocated memory block of size
  4457. ///             *puBufferSize, and call the function again.
  4458. ///
  4459. ///  @param     hTarget                 Handle to target.
  4460. ///  @param     uProcessID              Process ID.
  4461. ///  @param     uEventFlagID    Event flag ID.
  4462. ///  @param     puBufferSize    [in] Size of the buffer.\n
  4463. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  4464. ///  @param     pInfo                   Pointer to a buffer holding the information about
  4465. ///                             the event flag.
  4466. ///
  4467. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.7.0 - latest version.\n
  4468. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.7.0 - latest version.\n
  4469. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.7.0 - latest version.
  4470. ///
  4471. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4472. ///             SN_S_OK - Successfully retrieved event flag information or required size.\n
  4473. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4474. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4475. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  4476. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  4477. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  4478. ///             SN_E_COMMS_ERR - Error communicating with target.
  4479. ///
  4480. //////////////////////////////////////////////////////////////////////////////
  4481.  
  4482. SNAPI SNRESULT SNPS3GetEventFlagInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uEventFlagID, UINT32 *puBufferSize, SNPS3EventFlagInfo *pInfo);
  4483.  
  4484. #pragma pack(pop)
  4485.  
  4486.  
  4487. //////////////////////////////////////////////////////////////////////////////
  4488. ///
  4489. ///  @brief     Register a callback function which will be called when a
  4490. ///             file transfer event occurs.
  4491. ///             See \link ApiBase::SN_EVENT_FTP SN_EVENT_FTP\endlink  and
  4492. ///             \link ApiBase::TMAPI_FT_NOTIFICATION TMAPI_FT_NOTIFICATION\endlink.
  4493. ///             The callback will only be invoked when SNPS3Kick() is called.
  4494. ///
  4495. ///  @param             hTarget       Handle to a target.
  4496. ///  @param     pfnCallBack   Pointer to callback.
  4497. ///  @param             pUserData     Optional user defined data.
  4498. ///
  4499. ///  Callback must be in the form of:
  4500. ///
  4501. ///  \code
  4502. ///  void Callback(
  4503. ///          HTARGET hTarget,   // Handle to target.
  4504. ///          UINT32 Type,       // SN_EVENT_FTP.
  4505. ///          UINT32 Param,      // Reserved - will be 0.
  4506. ///          SNRESULT eResult,  // Result code.
  4507. ///          UINT32 Length,     // Length of data in event including header.
  4508. ///          BYTE* Data,        // Pointer to event data (TMAPI_FT_NOTIFICATION*).
  4509. ///          void* UserData);   // Optional user data.
  4510. ///      \endcode
  4511. ///
  4512. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4513. ///             SN_S_OK - Successfully registered event handler.\n
  4514. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4515. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4516. ///             SN_E_BAD_PARAM - pfnCallBack was NULL pointer.\n
  4517. ///             SN_S_REPLACED - Already registered for FTP events, previous callback function has been replaced.
  4518. ///
  4519. //////////////////////////////////////////////////////////////////////////////
  4520.  
  4521. SNAPI SNRESULT SNPS3RegisterFTPEventHandler(HTARGET hTarget, TMAPI_HandleEventCallback pfnCallBack, void *pUserData);
  4522.  
  4523. //////////////////////////////////////////////////////////////////////////////
  4524. ///
  4525. ///  @brief     Delete file or directory from target
  4526. ///
  4527. ///  @param     hTarget    Handle to target.
  4528. ///  @param     pPath      Path of file to delete. UTF-8 null-terminated string.
  4529. ///
  4530. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  4531. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4532. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4533. ///
  4534. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4535. ///             SN_S_OK - Successfully deleted file.\n
  4536. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4537. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4538. ///             SN_E_BAD_PARAM - pPath was NULL pointer.\n
  4539. ///             SN_E_DATA_TOO_LONG - pPath exceeding maximum path length of target (1024).\n
  4540. ///             SN_E_COMMS_ERR - Error communicating with target, or file could not be deleted either because it
  4541. ///             does not exist or due to permission restrictions.\n
  4542. ///             SN_E_FILE_ERROR - Error deleting the file.\n
  4543. ///             SN_E_TIMEOUT - Timeout occurred during the execution of the function - see SNPS3DeleteEx().\n
  4544. ///
  4545. //////////////////////////////////////////////////////////////////////////////
  4546.  
  4547. SNAPI SNRESULT SNPS3Delete(HTARGET hTarget, const char* pPath);
  4548.  
  4549. //////////////////////////////////////////////////////////////////////////////
  4550. ///
  4551. ///  @brief     Delete file or directory from target with a custom timeout. This is useful when deleting large directory
  4552. ///             structures from a single base directory where the targets default timeout may not be long
  4553. ///             enough for the target to remove all the files.
  4554. ///
  4555. ///  @param     hTarget                                 Handle to target.
  4556. ///  @param     pPath                                   Path of file to delete. UTF-8 null-terminated string.
  4557. ///  @param     nMillisecondTimeout     Millisecond timeout value.
  4558. ///
  4559. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  4560. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4561. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4562. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4563. ///             SN_S_OK - Successfully deleted file.\n
  4564. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4565. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4566. ///             SN_E_BAD_PARAM - pPath was NULL pointer.\n
  4567. ///             SN_E_DATA_TOO_LONG - pPath exceeding maximum path length of target (1024).\n
  4568. ///             SN_E_COMMS_ERR - Error communicating with target, or file could not be deleted either because it
  4569. ///             does not exist or due to permission restrictions.\n
  4570. ///             SN_E_FILE_ERROR - Error deleting the file.\n
  4571. ///             SN_E_TIMEOUT - Timeout occurred during the execution of the function.\n
  4572. ///
  4573. //////////////////////////////////////////////////////////////////////////////
  4574.  
  4575. SNAPI SNRESULT SNPS3DeleteEx(HTARGET hTarget, const char* pPath, const unsigned int nMillisecondTimeout);
  4576.  
  4577. //////////////////////////////////////////////////////////////////////////////
  4578. ///
  4579. ///  @brief     Populates the SNPS3SystemInfo() instance supplied.
  4580. ///             Which fields have been set is indicated by the mask.
  4581. ///
  4582. ///  @param     hTarget    Handle to target.
  4583. ///  @param             uReserved  Reserved data.
  4584. ///  @param     pInfo      Pointer to a structure to hold the information.
  4585. ///  @param     puMask     Mask that indicates which values have been set (see SYS_INFO_*).
  4586. ///
  4587. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  4588. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4589. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4590. ///
  4591. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4592. ///             SN_S_OK - Successfully retrieved system information.\n
  4593. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4594. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4595. ///             SN_E_BAD_PARAM - pInfo and/or puMask were NULL pointers.\n
  4596. ///             SN_E_COMMS_ERR - Error communicating with target.
  4597. ///
  4598. //////////////////////////////////////////////////////////////////////////////
  4599.  
  4600. SNAPI SNRESULT SNPS3GetSystemInfo(HTARGET hTarget, UINT32 uReserved, UINT32 *puMask, SNPS3SystemInfo *pInfo);
  4601.  
  4602. //////////////////////////////////////////////////////////////////////////////
  4603. ///
  4604. ///  @brief     Gets the extra load flags passed during an ELF load.
  4605. ///
  4606. ///  @param             hTarget                         Handle to target.
  4607. ///      @param         puExtraLoadFlags        Pointer to UINT64 where extra load flags will be stored.
  4608. ///                                     See SNPS3_XLF_ENABLE_LV2_EXCEPTION_HANDLER etc.
  4609. ///
  4610. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4611. ///             SN_S_OK - Successfully retrieved extra load flags.\n
  4612. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4613. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4614. ///             SN_E_BAD_PARAM - puExtraLoadFlags was NULL pointer.
  4615. ///
  4616. //////////////////////////////////////////////////////////////////////////////
  4617.  
  4618. SNAPI SNRESULT SNPS3GetExtraLoadFlags(HTARGET hTarget, UINT64* puExtraLoadFlags);
  4619.  
  4620. //////////////////////////////////////////////////////////////////////////////
  4621. ///
  4622. ///  @brief     Set extra load flags.
  4623. ///
  4624. ///  @param             hTarget                         Handle to target.
  4625. ///      @param         uFlags                          New flags to set. See SNPS3_XLF_ENABLE_LV2_EXCEPTION_HANDLER etc.
  4626. ///  @param             uMask                           Mask which indicates which values have been set/unset.
  4627. ///                                     Use SNPS3_XLF_ALL_FLAG_MASK for all flags.
  4628. ///
  4629. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4630. ///             SN_S_OK - Successfully set extra load flags.\n
  4631. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4632. ///             SN_E_BAD_TARGET - hTarget was invalid.
  4633. ///
  4634. //////////////////////////////////////////////////////////////////////////////
  4635.  
  4636. SNAPI SNRESULT SNPS3SetExtraLoadFlags(HTARGET hTarget, UINT64 uFlags, UINT64 uMask);
  4637.  
  4638. //////////////////////////////////////////////////////////////////////////////
  4639. ///
  4640. ///  @brief     Get the SDK version of the target from Target Manager.
  4641. ///             In 6 byte hexadecimal form, first 2 bytes
  4642. ///             are major version number, second 2 bytes are minor version number,
  4643. ///             final 2 bytes are fix version number.
  4644. ///
  4645. ///      @param         hTarget                 Handle to target.
  4646. ///      @param         puSDKVersion    Pointer to UINT64 where SDK version number will be written.
  4647. ///
  4648. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4649. ///             SN_S_OK - Successfully retrieved SDK version.\n
  4650. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4651. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4652. ///             SN_E_BAD_PARAM - puSDKVersion was NULL pointer.
  4653. ///
  4654. //////////////////////////////////////////////////////////////////////////////
  4655.  
  4656. SNAPI SNRESULT SNPS3GetSDKVersion(HTARGET hTarget, UINT64* puSDKVersion);
  4657.  
  4658. //////////////////////////////////////////////////////////////////////////////
  4659. ///
  4660. ///  @brief     Get the CP version. Read as 6 hexadecimal digits, where (from left to right): first 2 digits
  4661. ///             are major version number, second 2 digits are minor version number, final 2 digits are fix version number.
  4662. ///
  4663. ///      @param         hTarget                 Handle to target.
  4664. ///      @param         puCPVersion             Pointer to UINT64 where CP version number will be written.
  4665. ///
  4666. ///  @note      Reference tool (DECR-1000 / DECR-1000A)         : Any SDK.\n
  4667. ///
  4668. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4669. ///             SN_S_OK - Successfully retrieved CP version.\n
  4670. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4671. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4672. ///             SN_E_BAD_PARAM - puCPVersion was NULL pointer.
  4673. ///
  4674. //////////////////////////////////////////////////////////////////////////////
  4675.  
  4676. SNAPI SNRESULT SNPS3GetCPVersion(HTARGET hTarget, UINT64* puCPVersion);
  4677.  
  4678. //////////////////////////////////////////////////////////////////////////////
  4679. ///
  4680. ///  @brief     Get the list light-weight conditional variables associated with the given process.
  4681. ///             Call this function passing NULL for pBuffer to get the number of light-weight conditional variables.
  4682. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  4683. ///             passing in a pointer to the allocated buffer.
  4684. ///
  4685. ///  @param     hTarget         Handle to target.
  4686. ///  @param     uProcessID      Process ID.
  4687. ///  @param     puCount         [in] Size of buffer.\n
  4688. ///                                     [out] Number of light-weight conditional variables for which space is required,
  4689. ///                                     or if buffer is big enough, number written to buffer.
  4690. ///  @param     pBuffer         Buffer to hold the set of light-weight conditional variables.
  4691. ///
  4692. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  4693. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4694. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4695. ///
  4696. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4697. ///             SN_S_OK - Successfully retrieved light-weight conditional variables list or number of light-weight conditional variables.\n
  4698. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4699. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4700. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  4701. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount was too small.\n
  4702. ///             SN_E_COMMS_ERR - Error communicating with target.
  4703. ///
  4704. //////////////////////////////////////////////////////////////////////////////
  4705.  
  4706. SNAPI SNRESULT SNPS3GetLightWeightConditionalList(HTARGET hTarget, UINT32 uProcessID, UINT32 *puCount, UINT32 *pBuffer);
  4707.  
  4708. //////////////////////////////////////////////////////////////////////////////
  4709. ///  @struct    SNPS3LWConditionalAttr
  4710. ///  @brief     Lightweight conditional attributes.
  4711. //////////////////////////////////////////////////////////////////////////////
  4712.  
  4713. struct SNPS3LWConditionalAttr
  4714. {
  4715.         char    aName[8];
  4716. };
  4717. typedef struct SNPS3LWConditionalAttr SNPS3LWConditionalAttr;
  4718.  
  4719. //////////////////////////////////////////////////////////////////////////////
  4720. ///  @struct    SNPS3LWConditionalInfo
  4721. ///  @brief     Lightweight conditional information.
  4722. //////////////////////////////////////////////////////////////////////////////
  4723.  
  4724. struct SNPS3LWConditionalInfo
  4725. {
  4726.         UINT32                                  uLWCondID;
  4727.         SNPS3LWConditionalAttr  Attribute;
  4728.         UINT32                                  uLWMutexID;
  4729.         UINT32                                  uWaitThreadsNum;
  4730.         UINT32                                  uWaitAllThreadsNum;
  4731.         UINT64                                  aWaitThreadIDs[];
  4732. };
  4733. typedef struct SNPS3LWConditionalInfo SNPS3LWConditionalInfo;
  4734.  
  4735. //////////////////////////////////////////////////////////////////////////////
  4736. ///
  4737. ///  @brief     Get information about the given light-weight conditional variable.
  4738. ///             Call this function with pInfo = NULL to get the required buffer size.
  4739. ///             To get the light-weight conditional variable information, set pInfo to point to an allocated memory block of size
  4740. ///             *puBufferSize, and call the function again.
  4741. ///
  4742. ///  @param     hTarget      Handle to target.
  4743. ///  @param     uProcessID   Process ID.
  4744. ///  @param     uLWCondVarID Light-weight conditional variable ID.
  4745. ///  @param     puBufferSize [in] Size of the buffer.\n
  4746. ///                                      [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  4747. ///  @param     pInfo        Pointer to a buffer holding the information about
  4748. ///                          the light-weight conditional variable.
  4749. ///
  4750. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version\n
  4751. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version\n
  4752. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version
  4753. ///
  4754. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4755. ///             SN_S_OK - Successfully retrieved light-weight conditional variable information or required size.\n
  4756. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4757. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4758. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  4759. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puBufferSize was too small.\n
  4760. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  4761. ///             SN_E_COMMS_ERR - Error communicating with target.
  4762. ///
  4763. //////////////////////////////////////////////////////////////////////////////
  4764.  
  4765. SNAPI SNRESULT SNPS3GetLightWeightConditionalInfo(HTARGET hTarget, UINT32 uProcessID, UINT32 uLWCondVarID, UINT32 *puBufferSize, SNPS3LWConditionalInfo *pInfo);
  4766.  
  4767. //////////////////////////////////////////////////////////////////////////////
  4768. ///  @struct    SNPS3UserMemoryStats
  4769. ///  @brief     User memory statistics.
  4770. //////////////////////////////////////////////////////////////////////////////
  4771.  
  4772. struct SNPS3UserMemoryStats
  4773. {
  4774.         UINT32 uCreatedSharedMemorySize;
  4775.         UINT32 uAttachedSharedMemorySize;
  4776.         UINT32 uProcessLocalMemorySize;
  4777.         UINT32 uProcessLocalTextSize;
  4778.         UINT32 uPRXTextSize;
  4779.         UINT32 uPRXDataSize;
  4780.         UINT32 uMiscMemorySize;
  4781. };
  4782. typedef struct SNPS3UserMemoryStats SNPS3UserMemoryStats;
  4783.  
  4784. //////////////////////////////////////////////////////////////////////////////
  4785. ///
  4786. ///  @brief    Get the memory usage statistics for a process.
  4787. ///
  4788. ///  @param        hTarget                      Handle to target.
  4789. ///      @param    uProcessID           ID of process to get statistics for.
  4790. ///  @param        pStats                       Pointer to SNPS3UserMemoryStats() structure to receive data.
  4791. ///
  4792. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  4793. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4794. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4795. ///
  4796. ///  @return   \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4797. ///             SN_S_OK - Successfully retrieved user memory statistics.\n
  4798. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4799. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4800. ///             SN_E_BAD_PARAM - pStats was NULL pointer.\n
  4801. ///             SN_E_COMMS_ERR - Error communicating with target.
  4802. ///
  4803. //////////////////////////////////////////////////////////////////////////////
  4804.  
  4805. SNAPI SNRESULT SNPS3GetUserMemoryStats(HTARGET hTarget, UINT32 uProcessID, SNPS3UserMemoryStats* pStats);
  4806.  
  4807. //////////////////////////////////////////////////////////////////////////////
  4808. /// @enum       SyncPrimitiveType
  4809. /// @brief      Synchronisation primitive types.
  4810. //////////////////////////////////////////////////////////////////////////////
  4811. typedef enum SyncPrimitiveType {
  4812.         /// Mutex
  4813.         SPT_MUTEX,
  4814.         /// Conditional variable
  4815.         SPT_CONDITIONAL_VARIABLE,
  4816.         /// Read/write lock
  4817.         SPT_RW_LOCK,
  4818.         /// Lightweight mutex
  4819.         SPT_LW_MUTEX,
  4820.         /// Event queue
  4821.         SPT_EVENT_QUEUE,
  4822.         /// Semaphore
  4823.         SPT_SEMAPHORE,
  4824.         /// Lightweight conditional variable
  4825.         SPT_LW_CONDITIONAL_VARIABLE,
  4826.         /// Event flags
  4827.         SPT_EVENT_FLAG,
  4828.         /// Total number of sync primitive types
  4829.         SPT_NUMBER_OF_TYPES // Always the last!
  4830. } SyncPrimitiveType;
  4831.  
  4832. //////////////////////////////////////////////////////////////////////////////
  4833. ///
  4834. ///  @brief     Get a summary of the number of synchronisation primitives in use.
  4835. ///             Call this function passing NULL for puCounts to get the maximum number of counts to be written.
  4836. ///             Allocate a block of size (*puBufferSize * sizeof(UINT32)) and call this function again
  4837. ///             passing in a pointer (puCounts) to the allocated buffer.
  4838. ///
  4839. ///  @param     hTarget        Handle to target.
  4840. ///  @param     uProcessID     Process ID.
  4841. ///  @param     puBufferSize   [in] Maximum number of sync primitive counts to write to buffer.\n
  4842. ///                            [out] Number of counts written to buffer (unless puCounts is NULL, where it will be maximum possible number of counts).
  4843. ///  @param     puCounts       Address of an array of UINTs to store the
  4844. ///                            number of each kind of primitive.\n
  4845. ///                                        Values are:\n
  4846. ///                                        puCounts[0] = Mutex count.\n
  4847. ///                                        puCounts[1] = Conditional variable count.\n
  4848. ///                                        puCounts[2] = Read/Write lock count.\n
  4849. ///                                        puCounts[3] = Lightweight mutex count.\n
  4850. ///                                        puCounts[4] = Event queue count.\n
  4851. ///                                        puCounts[5] = Semaphore count.\n
  4852. ///                                        puCounts[6] = Lightweight conditional variable count.\n
  4853. ///                                        puCounts[7] = Event flag count (sdk 2.7.0 and above).\n
  4854. ///                                        SyncPrimitiveType() can be used as an index. Be aware that values always
  4855. ///                                        come in the same order, e.g if puBufferSize = 2, puCounts will always contain mutex and conditional variable counts.
  4856. ///
  4857. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.8.0 - latest version.\n
  4858. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4859. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4860. ///
  4861. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4862. ///             SN_S_OK - Successfully retrieved synchronisation primitive counts or maximum number of synchronisation primitive counts.\n
  4863. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4864. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4865. ///             SN_E_BAD_PARAM - puBufferSize was a NULL pointer.\n
  4866. ///             SN_E_COMMS_ERR - Error communicating with target.
  4867. ///    
  4868. //////////////////////////////////////////////////////////////////////////////
  4869.  
  4870. SNAPI SNRESULT SNPS3GetSyncPrimitiveCountsEx(HTARGET hTarget, UINT32 uProcessID, UINT32* puBufferSize, UINT32* puCounts);
  4871.  
  4872. //////////////////////////////////////////////////////////////////////////////
  4873. ///
  4874. ///      @brief         Sets the default elf load priority for the target.
  4875. ///
  4876. ///  @param     hTarget                 Handle to target.
  4877. ///  @param             uPriority               Priority value to set.
  4878. ///
  4879. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4880. ///             SN_S_OK - Successfully set default elf load priority.\n
  4881. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4882. ///             SN_E_BAD_TARGET - hTarget was invalid.
  4883. ///
  4884. //////////////////////////////////////////////////////////////////////////////
  4885.  
  4886. SNAPI SNRESULT SNPS3SetDefaultLoadPriority(HTARGET hTarget, UINT32 uPriority);
  4887.  
  4888. //////////////////////////////////////////////////////////////////////////////
  4889. ///
  4890. ///      @brief         Gets the default elf load priority for the target.
  4891. ///
  4892. ///  @param     hTarget                 Handle to target.
  4893. ///  @param             pPriority               Pointer to UINT32 where value will be stored.
  4894. ///
  4895. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4896. ///             SN_S_OK - Successfully retrieved default elf load priority.\n
  4897. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4898. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4899. ///             SN_E_BAD_PARAM - pPriority was NULL pointer.
  4900. ///
  4901. //////////////////////////////////////////////////////////////////////////////
  4902.  
  4903. SNAPI SNRESULT SNPS3GetDefaultLoadPriority(HTARGET hTarget, UINT32* pPriority);
  4904.  
  4905. //////////////////////////////////////////////////////////////////////////////
  4906. /// @struct     SNPS3GamePortIPAddressData
  4907. /// @brief      Contains game port information.
  4908. //////////////////////////////////////////////////////////////////////////////
  4909.  
  4910. struct SNPS3GamePortIPAddressData
  4911. {
  4912.         UINT32 uReturnValue;
  4913.         UINT32 uIPAddress;
  4914.         UINT32 uSubnetMask;
  4915.         UINT32 uBroadcastAddress;
  4916. };
  4917. typedef struct SNPS3GamePortIPAddressData SNPS3GamePortIPAddressData;
  4918.  
  4919. //! Default ethernet device.
  4920. #define SNPS3_DEVICE_ETH0       "eth0"
  4921.  
  4922. //////////////////////////////////////////////////////////////////////////////
  4923. ///
  4924. ///  @brief             Fetches the IP address data used by the game on the target.
  4925. ///             If the target returns success but a zero IP, this function would previously fail with SN_E_DECI_ERROR.
  4926. ///             This behaviour changed in 4.1.0 version, and now returns SN_S_OK with the zero IP.
  4927. ///             Note that a connection to the target is required.
  4928. ///             To retrieve the IP address/fqdn used by TM to connect to the target,
  4929. ///             refer to SNPS3GetConnectionInfo().
  4930. ///
  4931. ///  @param     hTarget                 Handle to target.
  4932. ///      @param         szDeviceName    Name of device target is connected on. Set to NULL - currently default of "eth0" is always used.
  4933. ///  @param             pData                   Pointer to SNPS3GamePortIPAddressData() structure to hold data.
  4934. ///
  4935. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.1.0 - latest version.\n
  4936. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.4.0 - latest version.\n
  4937. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4938. ///
  4939. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4940. ///             SN_S_OK - Successfully retrieved game port IP address data.\n
  4941. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4942. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4943. ///             SN_E_DECI_ERROR - Debug agent returned an error.\n
  4944. ///             SN_E_BAD_PARAM - pData was NULL pointer.\n
  4945. ///             SN_E_COMMS_ERR - Error communicating with target.
  4946. ///             SN_E_NOT_CONNECTED - Not connected to target.
  4947. ///
  4948. //////////////////////////////////////////////////////////////////////////////
  4949.  
  4950. SNAPI SNRESULT SNPS3GetGamePortIPAddrData(HTARGET hTarget, const char* szDeviceName, SNPS3GamePortIPAddressData* pData);
  4951.  
  4952. //////////////////////////////////////////////////////////////////////////////
  4953. ///
  4954. ///  @brief             If the target is in single nic mode this returns the same value as SNPS3GetGamePortIPAddrData().
  4955. ///             If the target is in dual nic mode this returns the IP address used for host file serving if file serving through the game port is
  4956. ///             selected (this IP is set via the XMB, through the Connection Settings for Debug option in debug settings).
  4957. ///             If the target returns success but a zero IP, this function would previously fail with SN_E_DECI_ERROR.
  4958. ///             This behaviour changed in 4.1.0 version, and now returns SN_S_OK with the zero IP.
  4959. ///
  4960. ///  @param     hTarget                 Handle to target.
  4961. ///      @param         szDeviceName    Name of device target is connected on. Set to NULL - currently default of "eth0" is always used.
  4962. ///  @param             pData                   Pointer to SNPS3GamePortIPAddressData() structure to hold data.
  4963. ///
  4964. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  4965. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  4966. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4967. ///
  4968. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4969. ///             SN_S_OK - Successfully retrieved game port IP address data.\n
  4970. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4971. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4972. ///             SN_E_DECI_ERROR - Debug agent returned an error.\n
  4973. ///             SN_E_BAD_PARAM - pData was NULL pointer.\n
  4974. ///             SN_E_COMMS_ERR - Error communicating with target.\n
  4975. ///             SN_E_NOT_CONNECTED - Not connected to target.
  4976. ///
  4977. //////////////////////////////////////////////////////////////////////////////
  4978.  
  4979. SNAPI SNRESULT SNPS3GetGamePortDebugIPAddrData(HTARGET hTarget, const char* szDeviceName, SNPS3GamePortIPAddressData* pData);
  4980.  
  4981. //////////////////////////////////////////////////////////////////////////////
  4982. ///
  4983. ///  @brief     Continues all threads in a specified thread group.
  4984. ///
  4985. ///  @param     hTarget                 Handle to target.
  4986. ///  @param             uProcessID              Process ID.
  4987. ///  @param             uThreadGroupID  Thread group ID.
  4988. ///
  4989. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  4990. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  4991. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  4992. ///
  4993. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  4994. ///             SN_S_OK - Successfully continued SPU thread group.\n
  4995. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  4996. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  4997. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  4998. ///             SN_E_ERROR - Internal error.\n
  4999. ///             SN_E_COMMS_ERR - Error communicating with target.
  5000. ///
  5001. //////////////////////////////////////////////////////////////////////////////
  5002.  
  5003. SNAPI SNRESULT SNPS3SPUThreadGroupContinue(HTARGET hTarget, UINT32 uProcessID, UINT64 uThreadGroupID);
  5004.  
  5005. //////////////////////////////////////////////////////////////////////////////
  5006. ///
  5007. ///  @brief     Queue the given file for download to the host.
  5008. ///             Note:   This only initiates the download. To check progress, success or failure,
  5009. ///                             monitor target events (see SNPS3RegisterFTPEventHandler() for more information).
  5010. ///                             Alternatively, use SNPS3WaitForFileTransfer() to check the result.
  5011. ///
  5012. ///  @param     hTarget        Handle to target.
  5013. ///  @param     pSource        Source path. UTF-8 null-terminated string.
  5014. ///  @param     pDest          Destination path. UTF-8 null-terminated string.
  5015. ///  @param             pTXID              Pointer to UINT32 to store transfer ID. Can be NULL.
  5016. ///
  5017. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  5018. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5019. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5020. ///
  5021. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5022. ///             SN_S_OK - Successfully initiated file download.\n
  5023. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5024. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5025. ///             SN_E_BAD_PARAM - pSource or pDest was NULL pointer or invalid path.\n
  5026. ///             SN_E_DATA_TOO_LONG - pSource or pDest exceeded maximum path length for system (1024 for PS3, 260 for windows PC).\n
  5027. ///             SN_E_COMMS_ERR - Error communicating with target.
  5028. ///
  5029. //////////////////////////////////////////////////////////////////////////////
  5030.  
  5031. SNAPI SNRESULT SNPS3DownloadFile(HTARGET hTarget, const char* pSource, const char* pDest, UINT32* pTXID);
  5032.  
  5033. //////////////////////////////////////////////////////////////////////////////
  5034. ///
  5035. ///  @brief     Queue the contents of the directory for download (does not create the containing directory).
  5036. ///             Note:   This only initiates the download. To check progress, success or failure,
  5037. ///                             monitor target events (see SNPS3RegisterFTPEventHandler() for more information).
  5038. ///                             Alternatively, use SNPS3WaitForFileTransfer() to check the result.
  5039. ///
  5040. ///  @param     hTarget        Handle to target.
  5041. ///  @param     pSource        Source directory path. UTF-8 null-terminated string.
  5042. ///  @param     pDest          Destination directory path. UTF-8 null-terminated string.
  5043. ///  @param             pLastTXID          The ID of the last file to be downloaded (to monitor in callback).
  5044. ///
  5045. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  5046. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5047. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5048. ///
  5049. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5050. ///             SN_S_OK - Successfully initiated directory contents download.\n
  5051. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5052. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5053. ///             SN_E_BAD_PARAM - One or more of pSource, pDest and pLastTXID was NULL pointer.\n
  5054. ///             SN_E_DATA_TOO_LONG - pSource or pDest exceeded maximum path length for system (1024 for PS3, 260 for windows PC).\n
  5055. ///             SN_E_COMMS_ERR - Error communicating with target.
  5056. ///            
  5057. //////////////////////////////////////////////////////////////////////////////
  5058.  
  5059. SNAPI SNRESULT SNPS3DownloadDirectory(HTARGET hTarget, const char* pSource, const char* pDest, UINT32* pLastTXID);
  5060.  
  5061. ////////////////////////////////////////////////////////////////////////////////
  5062. ///
  5063. ///  @brief             Unregister from file transfer notification events.
  5064. ///
  5065. ///  @param             hTarget                 Handle to target.
  5066. ///
  5067. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5068. ///             SN_S_OK - Successfully unregistered from file transfer events.\n
  5069. ///             SN_S_NO_ACTION - No ftp callback function registered.\n
  5070. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5071. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5072. ///
  5073. //////////////////////////////////////////////////////////////////////////////
  5074.  
  5075. SNAPI SNRESULT SNPS3CancelFTPEvents(HTARGET hTarget);
  5076.  
  5077. ////////////////////////////////////////////////////////////////////////////////
  5078. ///
  5079. ///  @brief             Gets statistics for single file on target.
  5080. ///
  5081. ///  @param             hTarget                 Handle to target.
  5082. ///  @param             pFile                   Path of file (must be full path, even if file at root). UTF-8 null-terminated string.
  5083. ///  @param             pEntry                  Pointer to structure to hold information on file.
  5084. ///
  5085. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  5086. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5087. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5088. ///
  5089. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5090. ///             SN_S_OK - Successfully retrieved file statistics.\n
  5091. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5092. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5093. ///             SN_E_BAD_PARAM - pFile or pEntry NULL pointer, or path to file invalid.\n
  5094. ///             SN_E_ERROR - File does not exist.\n
  5095. ///                             SN_E_FILE_ERROR - File does not exist.\n
  5096. ///             SN_E_COMMS_ERR - Error communicating with target.
  5097. ///
  5098. //////////////////////////////////////////////////////////////////////////////
  5099.  
  5100. SNAPI SNRESULT SNPS3StatTargetFile(HTARGET hTarget, const char* pFile, SNPS3DirEntry* pEntry);
  5101.  
  5102. ////////////////////////////////////////////////////////////////////////////////
  5103. ///
  5104. ///  @brief             Gets statistics for single file on target.
  5105. ///
  5106. ///  @param             hTarget                 Handle to target.
  5107. ///  @param             pFile                   Path of file (must be full path, even if file at root). UTF-8 null-terminated string.
  5108. ///  @param             pEntry                  Pointer to structure to hold information on file.
  5109. ///  @param             pTZ                             Pointer to structure to hold target timezone/dst settings (can be null).
  5110. ///
  5111. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  5112. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  5113. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  5114. ///
  5115. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5116. ///             SN_S_OK - Successfully retrieved file statistics.\n
  5117. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5118. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5119. ///             SN_E_BAD_PARAM - pFile or pEntry NULL pointer, or path to file invalid.\n
  5120. ///             SN_E_ERROR - File does not exist.\n
  5121. ///             SN_E_COMMS_ERR - Error communicating with target.
  5122. ///
  5123. //////////////////////////////////////////////////////////////////////////////
  5124.  
  5125. SNAPI SNRESULT SNPS3StatTargetFileEx(HTARGET hTarget, const char* pFile, SNPS3DirEntryEx* pEntry, SNPS3TargetTimezone* pTZ);
  5126.  
  5127. //////////////////////////////////////////////////////////////////////////////
  5128. ///
  5129. ///  @brief     Upload all files in a directory (uploads the containing directory).
  5130. ///             Note:   This only initiates the upload. To check progress, success or failure,
  5131. ///                             monitor target events (see SNPS3RegisterFTPEventHandler() for more information).
  5132. ///                             Alternatively, use SNPS3WaitForFileTransfer() to check the result.
  5133. ///
  5134. ///  @param     hTarget                           Handle to target.
  5135. ///  @param     pSource                           Source. UTF-8 null-terminated string.
  5136. ///  @param     pDestination          Destination. UTF-8 null-terminated string.
  5137. ///  @param             pLastTXID                         Pointer to transfer ID of last file to be uploaded.
  5138. ///                                       Set the TXID value to TXID_FORCE_FLAG (0xffffffff) on input to force the transfer
  5139. ///                                           (ie. bypass the timestamp/size check)
  5140. ///
  5141. ///  @note              Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  5142. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5143. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5144. ///
  5145. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5146. ///             SN_S_OK - Successfully initiated directory upload.\n
  5147. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5148. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5149. ///             SN_E_BAD_PARAM - One or more of pSource, pDest, pLastTXID was NULL pointer, or source and/or
  5150. ///                              destination path was too long or invalid.\n
  5151. ///             SN_E_DATA_TOO_LONG - pSource or pDest exceeded maximum path length for system (1024 for PS3, 260 for windows PC).\n
  5152. ///             SN_E_COMMS_ERR - Error communicating with target.
  5153. ///    
  5154. //////////////////////////////////////////////////////////////////////////////
  5155.  
  5156. SNAPI SNRESULT SNPS3UploadDirectory(HTARGET hTarget, const char* pSource, const char* pDestination, UINT32* pLastTXID);
  5157.  
  5158. //////////////////////////////////////////////////////////////////////////////
  5159. ///
  5160. ///  @brief     Terminate the given game process.
  5161. ///             See SDK sample in (SDK LOCATION)\\samples\\common\\gcmutil\\exit_callback.cpp for
  5162. ///             how to deal with terminate signal on target.
  5163. ///
  5164. ///  @param     hTarget        Handle to target.
  5165. ///  @param     uProcessID     Process ID.
  5166. ///  @param     uTimeout       Timeout (ms).
  5167. ///
  5168. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.2.0 - latest version.\n
  5169. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.2.0 - latest version.\n
  5170. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5171. ///
  5172. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5173. ///             SN_S_OK - Successfully terminated game process.\n
  5174. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5175. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5176. ///             SN_E_COMMS_ERR - Error communicating with target.
  5177. ///
  5178. //////////////////////////////////////////////////////////////////////////////
  5179.  
  5180. SNAPI SNRESULT SNPS3TerminateGameProcess(HTARGET hTarget, UINT32 uProcessID, UINT32 uTimeout);
  5181.  
  5182. #pragma pack(push, 1)
  5183.  
  5184. //////////////////////////////////////////////////////////////////////////////
  5185. /// @enum       SNPS3PPUThreadStatus
  5186. /// @brief      PPU thread status.
  5187. //////////////////////////////////////////////////////////////////////////////
  5188.  
  5189. struct SNPS3PPUThreadStatus
  5190. {
  5191.         UINT64 u64ThreadID;
  5192.         /// Status (see defines SNPS3_PPU_IDLE to SNPS3_PPU_DELETED)
  5193.         UINT32 uThreadStatus;
  5194. };
  5195. typedef struct SNPS3PPUThreadStatus SNPS3PPUThreadStatus;
  5196.  
  5197. //////////////////////////////////////////////////////////////////////////////
  5198. /// @struct     SNPS3SPUThreadGroupStatus
  5199. /// @brief      SPU thread group status.
  5200. //////////////////////////////////////////////////////////////////////////////
  5201.  
  5202. struct SNPS3SPUThreadGroupStatus
  5203. {
  5204.         UINT32 uThreadGroupID;
  5205.         /// State (see defines SNPS3_SPU_NOT_CONFIGURED to SNPS3_SPU_STOPPED)
  5206.         UINT32 uThreadGroupStatus;
  5207. };
  5208. typedef struct SNPS3SPUThreadGroupStatus SNPS3SPUThreadGroupStatus;
  5209.  
  5210. //////////////////////////////////////////////////////////////////////////////
  5211. /// @struct     SNPS3ProcessTreeBranch
  5212. /// @brief      Single branch of process tree (one process)     .
  5213. //////////////////////////////////////////////////////////////////////////////
  5214.  
  5215. struct SNPS3ProcessTreeBranch
  5216. {
  5217.         UINT32 uProcessID;
  5218.         /// See ESNPS3PROCESSSTATUS.
  5219.         UINT32 uProcessStatus;
  5220.         UINT32 uPPUThreadCount;
  5221.         UINT32 uSPUThreadGroupCount;
  5222.         UINT16 uProcessFlags;
  5223.         UINT16 uRawSPU;
  5224.  
  5225.         SNPS3PPUThreadStatus *aPPUThreadStatus;
  5226.         SNPS3SPUThreadGroupStatus *aSPUThreadGroupStatus;
  5227. };
  5228. typedef struct SNPS3ProcessTreeBranch SNPS3ProcessTreeBranch;
  5229.  
  5230. //////////////////////////////////////////////////////////////////////////////
  5231. ///
  5232. /// @brief              Retrieves the process tree (information on processes, their PPU and SPU threads).
  5233. ///             Call this function passing NULL for pProcessTree to get the number of processes.
  5234. ///             Allocate a block of size (*puProcessCount * sizeof(SNPS3ProcessTreeBranch)) and call this function again
  5235. ///             passing in a pointer to the allocated buffer.\n
  5236. ///             Only instances of SNPS3ProcessTreeBranch() struct are stored in buffer
  5237. ///             pProcessTree points to. Data which its members aPPUThreadStatus and aSPUThreadGroupStatus point to
  5238. ///             is stored in temporary memory and will be destroyed on next TMAPI function call.
  5239. ///             Note that this function only returns processes launched via the debug agent (for example TM/TMAPI/Debugger/Tuner).
  5240. ///             To get processes launched via XMB, use the SNPS3ProcessList() and SNPS3ProcessInfo() functions.
  5241. ///
  5242. /// @param              hTarget                 Handle to target.
  5243. /// @param              puProcessCount  [in] Number of instances of SNPS3ProcessTreeBranch() buffer can hold.\n
  5244. ///                             [out] Number of instances of SNPS3ProcessTreeBranch()
  5245. ///                                       for which space is required, or if buffer is big enough, number written to buffer.
  5246. /// @param              pProcessTree    Pointer to a buffer to hold the process tree
  5247. ///                             information (only SNPS3ProcessTreeBranch() structs stored in buffer).
  5248. ///
  5249. /// @note                Reference tool (DECR-1000 / DECR-1000A)                                                        : SDK 1.0.0 - latest version.\n
  5250. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5251. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5252. ///
  5253. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5254. ///             SN_S_OK - Successfully retrieved process tree or number of processes.\n
  5255. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5256. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5257. ///             SN_E_BAD_PARAM - puProcessCount is NULL pointer.\n
  5258. ///             SN_E_OUT_OF_MEM - Buffer pointed to by pProcessTree is too small (based on size defined in puProcessCount).\n
  5259. ///             SN_E_COMMS_ERR - Error communicating with target.
  5260. ///
  5261. //////////////////////////////////////////////////////////////////////////////
  5262.  
  5263. SNAPI SNRESULT SNPS3GetProcessTree(HTARGET hTarget, UINT32 *puProcessCount, SNPS3ProcessTreeBranch *pProcessTree);
  5264.  
  5265. ///////////////////////////////////////////////////////////////////////////////
  5266. ///
  5267. /// @brief              Get MAC address of gameport of target.
  5268. ///
  5269. /// @param              hTarget                 Handle to target.
  5270. /// @param              ppszMacAddress  Pointer to a const char* to receive the MAC address.
  5271. ///
  5272. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.1.0 - latest version.\n
  5273. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.4.0 - latest version.\n
  5274. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5275. ///
  5276. ///     @return         \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5277. ///             SN_S_OK - Successfully retrieved MAC address.\n
  5278. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5279. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5280. ///             SN_E_BAD_PARAM - ppszMacAddress was NULL pointer.\n
  5281. ///             SN_E_DECI_ERROR - Debug agent returned an error.\n
  5282. ///             SN_E_COMMS_ERR - Error communicating with target.
  5283. ///
  5284. //////////////////////////////////////////////////////////////////////////////
  5285.  
  5286. SNAPI SNRESULT SNPS3GetMacAddress(HTARGET hTarget, char **ppszMacAddress);
  5287.  
  5288. // these values must correspond to the IDs TM server uses for timeout change operation
  5289.  
  5290. //////////////////////////////////////////////////////////////////////////////
  5291. /// @enum   SNPS3_TM_TIMEOUT
  5292. /// @brief      Target manager timeout type
  5293. //////////////////////////////////////////////////////////////////////////////
  5294.  
  5295. enum SNPS3_TM_TIMEOUT
  5296. {
  5297.         /// Default timeout, this timeout will be used for all API functions which contact the target
  5298.         DEFAULT_TIMEOUT = 0,
  5299.         /// Wait between initiating reset and attempting to connect to the target
  5300.         RESET_TIMEOUT,
  5301.         /// Connect timeout, maximum amount of time spent attempting to connect (multiple connection attempts will occur in this time)
  5302.         CONNECT_TIMEOUT,
  5303.         /// Timeout for loading process on target
  5304.         LOAD_TIMEOUT,
  5305.         /// Timeout for connecting to target to get its status
  5306.         GET_STATUS_TIMEOUT,
  5307.         /// Maximum time following reset where if target is not connected reset has failed
  5308.         RECONNECT_TIMEOUT,
  5309.         /// Timeout for functions which contact the target via the game port (generally file serving)
  5310.         GAMEPORT_TIMEOUT,
  5311.         /// Timeout when processes exited using 'game exit' option in debugger
  5312.         GAMEEXIT_TIMEOUT
  5313. };
  5314.  
  5315. ///////////////////////////////////////////////////////////////////////////////
  5316. ///
  5317. /// @brief              Sets the various TM timeouts.
  5318. ///             The IDs in the pTimeoutIDs array
  5319. ///             correspond to the values in the puTimeoutValues array.\n
  5320. ///             For example, if pTimeoutIDs[2] = CONNECT_TIMEOUT, puTimeoutValues[2] will
  5321. ///             be the connect timeout value.
  5322. ///
  5323. /// @param      hTarget                 Handle to target.
  5324. /// @param              uNoTimeouts             Number of timeouts to be changed.
  5325. /// @param              pTimeoutIDs             Array of IDs of timeouts to be changed.
  5326. /// @param              puTimeoutValues Array of new values for timeouts.
  5327. ///
  5328. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5329. ///             SN_S_OK - Successfully set timeouts.\n
  5330. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5331. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5332. ///             SN_E_BAD_PARAM - pTimeoutIDs or puTimeoutValues was NULL, or invalid ID in value array (DEH cannot set RECONNECT_TIMEOUT,
  5333. ///                     DEX cannot set GAMEPORT_TIMEOUT).
  5334. ///
  5335. //////////////////////////////////////////////////////////////////////////////
  5336.  
  5337. SNAPI SNRESULT SNPS3SetTimeouts(HTARGET hTarget, UINT32 uNoTimeouts, SNPS3_TM_TIMEOUT *pTimeoutIDs, UINT32 *puTimeoutValues);
  5338.  
  5339. /////////////////////////////////////////////////////////////////////////////////
  5340. ///
  5341. /// @brief              Gets the TM timeouts.
  5342. ///             Values in auTimeoutIDs and auTimeoutValues arrays correspond.\n
  5343. ///             For example, if pTimeoutIDs[2] = CONNECT_TIMEOUT, puTimeoutValues[2] will
  5344. ///             be the connect timeout value.\n
  5345. ///             Call this function passing NULL for auTimeoutIDs or auTimeoutValues (or both) to get the number of timeout IDs.
  5346. ///             Allocate blocks of size (*puNoTimeouts * sizeof(SNPS3_TM_TIMEOUT)) and (*puNoTimeouts * sizeof(UINT32))  
  5347. ///             and call this function again passing in pointers to the allocated buffers.
  5348. ///
  5349. /// @param              hTarget                         Handle to target.
  5350. /// @param              puNoTimeouts            Pointer to UINT32 contain number of timeouts (if next params are NULL this will be set).
  5351. /// @param              auTimeoutIDs            Pointer to buffer to contain array of timeout ids.
  5352. /// @param              auTimeoutValues         Pointer to buffer to contain array of timeout values.
  5353. ///
  5354. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5355. ///             SN_S_OK - Successfully retrieved timeouts or number of timeout IDs.\n
  5356. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5357. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5358. ///             SN_E_BAD_PARAM - puNoTimeouts was NULL pointer.\n
  5359. ///             SN_E_OUT_OF_MEM - Buffers too small (based on size defined in puNoTimeouts).
  5360. ///
  5361. //////////////////////////////////////////////////////////////////////////////
  5362.  
  5363. SNAPI SNRESULT SNPS3GetTimeouts(HTARGET hTarget, UINT32 *puNoTimeouts, SNPS3_TM_TIMEOUT *auTimeoutIDs, UINT32 *auTimeoutValues);
  5364.  
  5365. /////////////////////////////////////////////////////////////////////////////////
  5366. ///
  5367. /// @brief              Gets the core dump flags of the target.
  5368. ///
  5369. /// @param              hTarget                         Handle to target.
  5370. /// @param              pu64Flags                       Pointer to UINT64 where flags will be written.
  5371. ///
  5372. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5373. ///             SN_S_OK - Successfully retrieved core dump flags.\n
  5374. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5375. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5376. ///             SN_E_BAD_PARAM - u64Flags was NULL pointer.
  5377. ///
  5378. //////////////////////////////////////////////////////////////////////////////
  5379.  
  5380. SNAPI SNRESULT SNPS3GetCoreDumpFlags(HTARGET hTarget, UINT64 *pu64Flags);
  5381.  
  5382. /// @brief      Flag to indicate storing coredump in /dev_ms.
  5383. const UINT64 SNPS3TM_CORE_DUMP_TO_DEV_MS                        = 0x01;
  5384. /// @brief      Flag to indicate storing coredump in /app_home.
  5385. const UINT64 SNPS3TM_CORE_DUMP_TO_APP_HOME                      = 0x02;
  5386. /// @brief      Flag to indicate storing coredump in /dev_usb.
  5387. const UINT64 SNPS3TM_CORE_DUMP_TO_DEV_USB                       = 0x04;
  5388. /// @brief      Flag to indicate storing coredump in /dev_hdd0.
  5389. const UINT64 SNPS3TM_CORE_DUMP_TO_DEV_HDD0                      = 0x08;
  5390. /// @brief      Flag to prevent core dumps on PPU exceptions.
  5391. const UINT64 SNPS3TM_CORE_DUMP_DISABLE_PPU_EXCEPTION_DETECTION  = 0x0080000000000000;
  5392. /// @brief      Flag to prevent core dumps on SPU exceptions.
  5393. const UINT64 SNPS3TM_CORE_DUMP_DISABLE_SPU_EXCEPTION_DETECTION  = 0x0040000000000000;
  5394. /// @brief      Flag to prevent core dumps on RSX exceptions.
  5395. const UINT64 SNPS3TM_CORE_DUMP_DISABLE_RSX_EXCEPTION_DETECTION  = 0x0020000000000000;
  5396. /// @brief      Flag to prevent core dumps on FOOT SWITCH exceptions.
  5397. const UINT64 SNPS3TM_CORE_DUMP_DISABLE_FOOT_SWITCH_DETECTION    = 0x0010000000000000;
  5398. /// @brief      Flag to prevent core dump including memory details.
  5399. const UINT64 SNPS3TM_CORE_DUMP_DISABLE_MEMORY_DUMP                              = 0xD0000000;
  5400. /// @brief      Restart process after core dump.
  5401. const UINT64 SNPS3TM_CORE_DUMP_ENABLE_RESTART_PROCESS                   = 0x8000;
  5402. /// @brief  Continue running core dump handler after coredump.
  5403. const UINT64 SNPS3TM_CORE_DUMP_ENABLE_KEEPRUNNING_HANDLER               = 0x2000;
  5404.  
  5405. /////////////////////////////////////////////////////////////////////////////////
  5406. ///    
  5407. /// @brief              Sets the core dump flags of the target.
  5408. ///
  5409. /// @param              hTarget                         Handle to target.
  5410. /// @param              u64Flags                        Flags to set. See SNPS3TM_CORE_DUMP_TO_*.
  5411. ///
  5412. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5413. ///             SN_S_OK - Successfully set core dump flags.\n
  5414. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5415. ///             SN_E_BAD_TARGET - hTarget was invalid.
  5416. ///
  5417. //////////////////////////////////////////////////////////////////////////////
  5418.  
  5419. SNAPI SNRESULT SNPS3SetCoreDumpFlags(HTARGET hTarget, UINT64 u64Flags);
  5420.  
  5421. /////////////////////////////////////////////////////////////////////////////////////
  5422. ///
  5423. /// @brief          Set connection parameters for a specific target.
  5424. ///
  5425. /// @param              hTarget                         Handle to target.
  5426. /// @param              pConnection                     Pointer to a \link TMAPI_TCPIP_CONNECT_PROP TMAPI_TCPIP_CONNECT_PROP\endlink structure containing information
  5427. ///                                     on connection.
  5428. ///
  5429. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5430. ///             SN_S_OK - Successfully set connection information.\n
  5431. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5432. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5433. ///             SN_E_BAD_PARAM          Pointer to structure was null.\n
  5434. ///             SN_E_CONNECTED          Already connected.
  5435. ///
  5436. //////////////////////////////////////////////////////////////////////////////
  5437.  
  5438. SNAPI SNRESULT SNPS3SetConnectionInfo(HTARGET hTarget, TMAPI_TCPIP_CONNECT_PROP *pConnection);
  5439.  
  5440. //////////////////////////////////////////////////////////////////////////////
  5441. ///
  5442. ///  @brief     Stops all threads in a specified SPU thread group.
  5443. ///
  5444. ///  @param     hTarget                         Handle to target.
  5445. ///  @param             uProcessID                      Process ID.
  5446. ///  @param             uThreadGroupID          Thread group ID.
  5447. ///
  5448. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5449. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5450. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5451. ///
  5452. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5453. ///             SN_S_OK - Successfully stopped SPU thread group.\n
  5454. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5455. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5456. ///             SN_E_COMMS_ERR - Error communicating with target.
  5457. ///
  5458. //////////////////////////////////////////////////////////////////////////////
  5459.  
  5460. SNAPI SNRESULT SNPS3SPUThreadGroupStop(HTARGET hTarget, UINT32 uProcessID, UINT64 uThreadGroupID);
  5461.  
  5462. /////////////////////////////////////////////////////////////////////////////////////
  5463. ///
  5464. /// @brief          Set file serving case sensitivity for PC (not target, which is always case sensitive).
  5465. ///
  5466. /// @param              hTarget                         Handle to target.
  5467. /// @param              bOn                                     True to turn case sensitivity on.
  5468. /// @param              pbOldSetting            Optional pointer to bool to receive previous case sensitivity setting. Can be NULL.
  5469. ///
  5470. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  5471. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5472. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5473. ///
  5474. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5475. ///             SN_S_OK - Successfully set file serving case-sensitivity.\n
  5476. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5477. ///             SN_E_BAD_TARGET - hTarget was invalid.
  5478. ///
  5479. //////////////////////////////////////////////////////////////////////////////
  5480.  
  5481. SNAPI SNRESULT SNPS3SetCaseSensitiveFileServing(HTARGET hTarget, BOOL bOn, BOOL *pbOldSetting);
  5482.  
  5483. /// @brief      Flag to enable file create events (cellFsOpen function).
  5484. const UINT SNPS3_FS_MASK_CREATE = (1<<0);
  5485. /// @brief      Flag to enable file close events (cellFsClose function).
  5486. const UINT SNPS3_FS_MASK_CLOSE = (1<<2);
  5487. /// @brief      Flag to enable file read events (cellFsRead function).
  5488. const UINT SNPS3_FS_MASK_READ = (1<<3);
  5489. /// @brief      Flag to enable file write events (cellFsWrite function).
  5490. const UINT SNPS3_FS_MASK_WRITE = (1<<4);
  5491. /// @brief      Flag to enable file seek events (cellFsLseek function).
  5492. const UINT SNPS3_FS_MASK_SEEK = (1<<5);
  5493. /// @brief      Flag to enable file delete events (cellFsUnlink function).
  5494. const UINT SNPS3_FS_MASK_DELETE = (1<<6);
  5495. /// @brief      Flag to enable file rename events (cellFsRename function).
  5496. const UINT SNPS3_FS_MASK_RENAME = (1<<7);
  5497. /// @brief      Flag to enable file set attribute events (cellFsChMod function).
  5498. const UINT SNPS3_FS_MASK_SETATTR = (1<<8);
  5499. /// @brief      Flag to enable file get attribute events (cellFsStat, cellFsFStat function).
  5500. const UINT SNPS3_FS_MASK_GETATTR = (1<<9);
  5501. /// @brief      Flag to enable file set time events (cellFsUtime function).
  5502. const UINT SNPS3_FS_MASK_SETTIME = (1<<10);
  5503. /// @brief      Flag to enable make directory events (cellFsMkdir function).
  5504. const UINT SNPS3_FS_MASK_MKDIR = (1<<11);
  5505. /// @brief      Flag to enable remove directory events (cellFsRmdir function).
  5506. const UINT SNPS3_FS_MASK_RMDIR = (1<<12);
  5507. /// @brief      Flag to enable directory open events (cellFsOpendir function).
  5508. const UINT SNPS3_FS_MASK_OPENDIR = (1<<13);
  5509. /// @brief      Flag to enable directory close events (cellFsClosedir function).
  5510. const UINT SNPS3_FS_MASK_CLOSEDIR = (1<<14);
  5511. /// @brief      Flag to enable directory read events (cellFsReaddir function).
  5512. const UINT SNPS3_FS_MASK_READDIR = (1<<15);
  5513. /// @brief      Flag to enable file truncate events (cellFsTruncate, cellFsFtruncate functions).
  5514. const UINT SNPS3_FS_MASK_TRUNCATE = (1<<16);
  5515. /// @brief      Flag to enable file get attribute events (cellFsFStat function).
  5516. const UINT SNPS3_FS_MASK_FGETATTR64 = (1<<17);
  5517. /// @brief      Flag to enable file get attribute events (cellFsStat function).
  5518. const UINT SNPS3_FS_MASK_GETATTR64 = (1<<18);
  5519. /// @brief      Flag to enable all file serving events.
  5520. const UINT SNPS3_FS_MASK_ALL = SNPS3_FS_MASK_CREATE | SNPS3_FS_MASK_CLOSE | SNPS3_FS_MASK_READ | SNPS3_FS_MASK_WRITE
  5521.                                                         | SNPS3_FS_MASK_SEEK | SNPS3_FS_MASK_DELETE | SNPS3_FS_MASK_RENAME | SNPS3_FS_MASK_SETATTR
  5522.                                                         | SNPS3_FS_MASK_GETATTR | SNPS3_FS_MASK_SETTIME | SNPS3_FS_MASK_MKDIR | SNPS3_FS_MASK_RMDIR
  5523.                                                         | SNPS3_FS_MASK_OPENDIR | SNPS3_FS_MASK_CLOSEDIR | SNPS3_FS_MASK_READDIR | SNPS3_FS_MASK_TRUNCATE
  5524.                                                         | SNPS3_FS_MASK_FGETATTR64 | SNPS3_FS_MASK_GETATTR64;
  5525.  
  5526. /////////////////////////////////////////////////////////////////////////////////////
  5527. ///
  5528. /// @brief          Set file serving event flags.
  5529. ///
  5530. /// @param              hTarget                               Handle to target.
  5531. /// @param              uFileServingEventFlags    See SNPS3_FS_MASK_CREATE etc.
  5532. ///
  5533. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : All SDK Versions.\n
  5534. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : All SDK Versions.\n
  5535. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : All SDK Versions.
  5536. ///
  5537. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5538. ///             SN_S_OK - Successfully set file serving event flags.\n
  5539. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5540. ///             SN_E_BAD_TARGET - hTarget was invalid.
  5541. ///
  5542. //////////////////////////////////////////////////////////////////////////////
  5543.  
  5544. SNAPI SNRESULT SNPS3SetFileServingEventFlags(HTARGET hTarget, UINT64 uFileServingEventFlags);
  5545.  
  5546. /////////////////////////////////////////////////////////////////////////////////
  5547. ///
  5548. /// @brief              Gets file serving event flags for target.
  5549. ///
  5550. /// @param              hTarget                                Handle to target.
  5551. /// @param              puFileServingEventFlags    Pointer to UINT64 to hold file serving event flags. See SNPS3_FS_MASK_CREATE etc.
  5552. ///
  5553. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : All SDK Versions.\n
  5554. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : All SDK Versions.\n
  5555. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : All SDK Versions.
  5556. ///
  5557. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5558. ///             SN_S_OK - Successfully retrieved file serving event flags.\n
  5559. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5560. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5561. ///             SN_E_BAD_PARAM - puFileServingEventFlags was NULL pointer.
  5562. ///
  5563. //////////////////////////////////////////////////////////////////////////////
  5564.  
  5565. SNAPI SNRESULT SNPS3GetFileServingEventFlags(HTARGET hTarget, UINT64 *puFileServingEventFlags);
  5566.  
  5567.  
  5568. //////////////////////////////////////////////////////////////////////////////
  5569. /// @struct     SNPS3VirtualMemoryArea
  5570. /// @brief      Virtual memory area data.
  5571. //////////////////////////////////////////////////////////////////////////////
  5572.  
  5573. struct SNPS3VirtualMemoryArea
  5574. {
  5575.                 UINT64 uAddress;                      
  5576.                 UINT64 uFlags;                        
  5577.                 UINT64 uVSize;                        
  5578.                 UINT64 uOptions;                      
  5579.                 UINT64 uPageFaultPPU;
  5580.                 UINT64 uPageFaultSPU;
  5581.                 UINT64 uPageIn;
  5582.                 UINT64 uPageOut;
  5583.                 UINT64 uPMemTotal;
  5584.                 UINT64 uPMemUsed;
  5585.                 UINT64 uTime;
  5586.                 UINT64 uPageCount;
  5587.                 UINT64 *puPages;
  5588. };
  5589. typedef struct SNPS3VirtualMemoryArea SNPS3VirtualMemoryArea;
  5590.  
  5591. /////////////////////////////////////////////////////////////////////////////////////
  5592. ///
  5593. /// @brief          Get information on virtual memory areas.
  5594. ///             Call this function with pBuffer = NULL to get the required buffer size.
  5595. ///             To get the virtual memory areas information, set pBuffer to point to an allocated memory block of size
  5596. ///             *puBufferSize, and call the function again.\n
  5597. ///             The buffer is an array of SNPS3VirtualMemoryArea() structures followed by the page data.
  5598. ///             The structures contain pointers to within the buffer where the page data is stored.
  5599. ///
  5600. /// @param              hTarget                         Handle to target.
  5601. /// @param              uPID                            ProcessID.
  5602. /// @param              bStatsOnly                      Set to true if page data is not desired.
  5603. /// @param              puAreaCount                     On success, contains number of virtual memory areas.
  5604. /// @param              puBufferSize            [in] Size of buffer.
  5605. ///                                     [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  5606. /// @param              pBuffer                         Buffer to contain virtual memory information.
  5607. ///
  5608. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.4.0 - latest version.\n
  5609. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.4.0 - latest version.\n
  5610. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5611. ///
  5612. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5613. ///             SN_S_OK - Successfully retrieved virtual memory information or required size.\n
  5614. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5615. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5616. ///             SN_E_BAD_PARAM          puAreaCount and/or puBufSize was NULL pointer.\n
  5617. ///             SN_E_OUT_OF_MEM         Size of buffer defined in puBufferSize was too small.\n
  5618. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  5619. ///             SN_E_COMMS_ERR - Error communicating with target.
  5620. ///
  5621. //////////////////////////////////////////////////////////////////////////////
  5622.  
  5623. SNAPI SNRESULT SNPS3GetVirtualMemoryInfo(HTARGET hTarget, UINT32 uPID, BOOL bStatsOnly, UINT32 *puAreaCount, UINT32 *puBufferSize, BYTE *pBuffer);
  5624.  
  5625. /////////////////////////////////////////////////////////////////////////////////////
  5626. ///
  5627. /// @brief          Flash target with the specified PS3ToolUpdater.self and PS3UPDAT.PUP.
  5628. ///
  5629. /// @param              hTarget                         Handle to target.
  5630. /// @param              pszUpdaterTool          Path to PS3ToolUpdater.self (UTF-8 null-terminated string) or NULL to use built in updater tool.
  5631. /// @param              pszFlashImage           Path to PS3UPDAT.PUP file. UTF-8 null-terminated string.
  5632. ///
  5633. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.6.0 - latest version.\n
  5634. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 1.6.0 - latest version.\n
  5635. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5636. ///
  5637. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5638. ///             SN_S_OK - Successfully flashed target.\n
  5639. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5640. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5641. ///             SN_E_BAD_PARAM - pszFlashImage was NULL or PUP incompatible with target type.\n
  5642. ///             SN_E_COMMS_ERR - Error communicating with target.
  5643. ///
  5644. //////////////////////////////////////////////////////////////////////////////
  5645.  
  5646. SNAPI SNRESULT SNPS3FlashTarget(HTARGET hTarget, const char* pszUpdaterTool, const char* pszFlashImage);
  5647.  
  5648. /////////////////////////////////////////////////////////////////////////////////////
  5649. ///
  5650. /// @brief          Set loop point in SPU thread (replaces instruction with looping instruction, effectively stalling thread).
  5651. ///             SNPS3ClearSPULoopPoint() will replace looping instruction with previously stored instruction.\n
  5652. ///             The thread group must be stopped when SPU loop points are set/cleared.
  5653. ///
  5654. /// @param              hTarget                         Handle to target.
  5655. /// @param              uProcessID                      Process ID.
  5656. /// @param              uThreadID                       SPU thread ID.
  5657. /// @param              uAddress                        Address to set loop point.
  5658. /// @param              bCurrentPC                      If equals true then address is ignored and loop point is set at current PC address.
  5659. ///
  5660. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5661. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5662. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5663. ///
  5664. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5665. ///             SN_S_OK - Successfully set SPU loop point.\n
  5666. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5667. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5668. ///             SN_E_TM_COMMS_ERR  - Error communicating with TM Server.\n
  5669. ///             SN_E_COMMS_ERR - Error communicating with target.
  5670. ///
  5671. //////////////////////////////////////////////////////////////////////////////
  5672.  
  5673. SNAPI SNRESULT SNPS3SetSPULoopPoint(HTARGET hTarget, UINT32 uProcessID, UINT64 uThreadID, UINT32 uAddress, BOOL bCurrentPC);
  5674.  
  5675. /////////////////////////////////////////////////////////////////////////////////////
  5676. ///
  5677. /// @brief          Clear loop point from SPU thread (replaces looping instruction with previously stored instruction).
  5678. ///             The thread group must be stopped when SPU loop points are set/cleared.
  5679. ///
  5680. /// @param              hTarget                         Handle to target.
  5681. /// @param              uProcessID                      Process ID.
  5682. /// @param              uThreadID                       SPU thread ID.
  5683. /// @param              uAddress                        Address to clear loop point from.
  5684. /// @param              bCurrentPC                      If equals true then address is ignored and loop point is cleared from current PC address.
  5685. ///
  5686. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5687. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5688. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5689. ///
  5690. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5691. ///             SN_S_OK - Successfully cleared SPU loop point.\n
  5692. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5693. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5694. ///             SN_E_COMMS_ERR - Error communicating with target.
  5695. ///
  5696. //////////////////////////////////////////////////////////////////////////////
  5697.  
  5698. SNAPI SNRESULT SNPS3ClearSPULoopPoint(HTARGET hTarget, UINT32 uProcessID, UINT64 uThreadID, UINT32 uAddress, BOOL bCurrentPC);
  5699.  
  5700. /////////////////////////////////////////////////////////////////////////////////////
  5701. ///
  5702. /// @brief          Trigger a core dump of the given process.
  5703. ///             When the core dump is complete, a DBG target event
  5704. ///             \link SNPS3_EVENTNOTIFY_CORE_DUMP_COMPLETE SNPS3_EVENTNOTIFY_CORE_DUMP_COMPLETE\endlink
  5705. ///             will be sent.
  5706. ///             To receive this event, register for target events using SNPS3RegisterTargetEventHandler()
  5707. ///             and call SNPS3Kick() to receive notifications.
  5708. ///
  5709. /// @param              hTarget                         Handle to target.
  5710. /// @param              uProcessID                      Process ID.
  5711. /// @param              uUserData1                      User data to be written to core dump file.
  5712. /// @param              uUserData2                      User data to be written to core dump file.
  5713. /// @param              uUserData3                      User data to be written to core dump file.
  5714. ///
  5715. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  5716. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  5717. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5718. ///
  5719. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5720. ///             SN_S_OK - Successfully triggered core dump.\n
  5721. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5722. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5723. ///             SN_E_COMMS_ERR - Error communicating with target.
  5724. ///
  5725. //////////////////////////////////////////////////////////////////////////////
  5726.  
  5727. SNAPI SNRESULT SNPS3TriggerCoreDump(HTARGET hTarget, UINT32 uProcessID, UINT64 uUserData1, UINT64 uUserData2, UINT64 uUserData3);
  5728.  
  5729. //////////////////////////////////////////////////////////////////////////////
  5730. /// @enum               SNPS3_DISPLAY_MODE
  5731. /// @brief      Display mode (used for VRAM capture).
  5732. //////////////////////////////////////////////////////////////////////////////
  5733.  
  5734. enum SNPS3_DISPLAY_MODE {
  5735.         X8R8G8B8,
  5736.         X8B8G8R8,
  5737.         R16G16B16X16
  5738. };
  5739.  
  5740. //////////////////////////////////////////////////////////////////////////////
  5741. /// @struct     SNPS3VRAMInfo
  5742. /// @brief      VRAM information.
  5743. //////////////////////////////////////////////////////////////////////////////
  5744.  
  5745. struct SNPS3VRAMInfo
  5746. {
  5747.         /// Address at which to put breakpoint in order to stop the process immediately before/after 'flip'.
  5748.         UINT64          uBPAddress;
  5749.         /// Address of a pointer that points to the image in memory.
  5750.         UINT64          uTopAddressPointer;
  5751.         /// Width of image.
  5752.         UINT32          uWidth;
  5753.         /// Height of image.
  5754.         UINT32          uHeight;
  5755.         /// Image pitch (as described in CellGCMSurface) - in bytes.
  5756.         UINT32          uPitch;
  5757.         /// Image colour settings (0 = X8R8G8B8, 1 = X8B8G8R8, 2 = R16G16B16X16).
  5758.         BYTE            colour;
  5759. };
  5760. typedef struct SNPS3VRAMInfo SNPS3VRAMInfo;
  5761.  
  5762. //////////////////////////////////////////////////////////////////////////////
  5763. ///
  5764. ///  @brief     Gets VRAM information for given process.
  5765. ///             Note that due to a hardware limitation, it is necessary to wait for
  5766. ///             at least 500ms after loading a process before calling this function, otherwise
  5767. ///             it will fail.
  5768. ///             Secondary VRAM information is optional, set pointer to NULL to ignore.
  5769. ///
  5770. ///  @param             hTarget                 Handle to target.
  5771. ///  @param             uProcessID              Process ID.
  5772. ///  @param             pPrimary                Pointer to instance of SNPS3VRAMInfo() to hold primary information.
  5773. ///  @param             pSecondary              Pointer to instance of SNPS3VRAMInfo() to hold secondary information (can be NULL).
  5774. ///
  5775. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  5776. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  5777. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5778. ///
  5779. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5780. ///             SN_S_OK - Successfully retrieved VRAM information.\n
  5781. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5782. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5783. ///             SN_E_BAD_PARAM - pPrimary was NULL.\n
  5784. ///             SN_E_COMMS_ERR - Error communicating with target.
  5785. ///
  5786. //////////////////////////////////////////////////////////////////////////////
  5787.  
  5788. SNAPI SNRESULT SNPS3GetVRAMInformation(HTARGET hTarget, UINT32 uProcessID, SNPS3VRAMInfo *pPrimary, SNPS3VRAMInfo *pSecondary);
  5789.  
  5790. //////////////////////////////////////////////////////////////////////////////
  5791. ///
  5792. ///  @brief             Set data access breakpoint.
  5793. ///             Process must be loaded with \link SNPS3_LOAD_FLAG_ENABLE_DEBUGGING SNPS3_LOAD_FLAG_ENABLE_DEBUGGING\endlink set.
  5794. ///             All PPU threads in the target process should be stopped before calling this function (see SNPS3ProcessStop()).
  5795. ///             Note: Only one data access breakpoint can be set per process.
  5796. ///
  5797. ///      @param         hTarget                 Handle to target.
  5798. ///      @param         uProcessID              Process ID.
  5799. ///      @param         uAddr                   Address of data to set breakpoint on.
  5800. ///
  5801. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5802. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5803. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5804. ///
  5805. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5806. ///             SN_S_OK - Successfully set data access breakpoint.\n
  5807. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5808. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5809. ///             SN_E_COMMS_ERR - Error communicating with target.
  5810. ///
  5811. //////////////////////////////////////////////////////////////////////////////
  5812.  
  5813. SNAPI SNRESULT SNPS3SetDABR(HTARGET hTarget, UINT32 uProcessID, UINT64 uAddr);
  5814.  
  5815. //////////////////////////////////////////////////////////////////////////////
  5816. ///
  5817. ///  @brief             Get address of current data access breakpoint.
  5818. ///             All PPU threads in the target process should be stopped before calling this function (see SNPS3ProcessStop()).
  5819. ///             Note: There will be only one data access breakpoint per process.
  5820. ///
  5821. ///      @param         hTarget                 Handle to target.
  5822. ///      @param         uProcessID              Process ID.
  5823. ///      @param         puAddr                  Pointer to UINT64 where data address will be written.
  5824. ///
  5825. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5826. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5827. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5828. ///
  5829. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5830. ///             SN_S_OK - Successfully retrieved data access breakpoint address.\n
  5831. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5832. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5833. ///             SN_E_BAD_PARAM - puAddr was NULL pointer.\n
  5834. ///             SN_E_COMMS_ERR - Error communicating with target.
  5835. ///
  5836. //////////////////////////////////////////////////////////////////////////////
  5837.  
  5838. SNAPI SNRESULT SNPS3GetDABR(HTARGET hTarget, UINT32 uProcessID, UINT64 *puAddr);
  5839.  
  5840. /////////////////////////////////////////////////////////////////////////////
  5841. ///
  5842. ///  @brief             Get further information on error, if available.
  5843. ///             pQualifier/ppszErrorString can be set to NULL if either value is not of interest.
  5844. ///
  5845. ///  @param             pQualifier              Pointer to UINT32 where last error code will be stored.
  5846. ///  @param             ppszErrorString Pointer to char pointer where address of last error message will be stored.
  5847. ///                                                             UTF-8 null-terminated string.
  5848. ///
  5849. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5850. ///             SN_S_OK - Successfully retrieved error qualifier.
  5851. ///
  5852. //////////////////////////////////////////////////////////////////////////////
  5853.  
  5854. SNAPI SNRESULT SNPS3GetErrorQualifier(UINT32 *pQualifier, char **ppszErrorString);
  5855.  
  5856. // @name <CompressionLevels>
  5857. //@{
  5858. //! Compression level for retrieving memory.
  5859. #define SNPS3_COMPRESSION_LEVEL_NONE                                    0
  5860. #define SNPS3_COMPRESSION_LEVEL_BEST_SPEED              1
  5861. #define SNPS3_COMPRESSION_LEVEL_COMPRESSION                             9
  5862. #define SNPS3_COMPRESSION_LEVEL_DEFAULT                                 (-1)
  5863. //@}
  5864.  
  5865. //////////////////////////////////////////////////////////////////////////////
  5866. ///
  5867. ///  @brief             Gets a range of memory, compressing and decompressing at start/end of communications.
  5868. ///             Address can be a maximum of 32 bits, for more use SNPS3GetMemory64Compressed().
  5869. ///
  5870. ///      @param         hTarget                 Handle to target.
  5871. ///      @param         uProcessID              Process ID.
  5872. ///  @param             uLevel                  Compression level - see SNPS3_COMPRESSION_LEVEL_* - can be value between 1 and 9 - 1 being best speed,
  5873. ///                             9 being best compression.
  5874. ///                             Default value (-1) will request a compromise between compression and speed.
  5875. ///      @param         uAddr                   Address of memory to read from.
  5876. ///  @param             uSize                   Size of data to read.
  5877. ///      @param         pBuffer                 Pointer to buffer where data will be written.
  5878. ///
  5879. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.9.0 - latest version.\n
  5880. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5881. ///
  5882. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5883. ///             SN_S_OK - Successfully retrieved memory.\n
  5884. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5885. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5886. ///             SN_E_BAD_PARAM - pBuffer was NULL pointer.\n
  5887. ///             SN_E_COMMS_ERR - Error communicating with target.
  5888. ///
  5889. //////////////////////////////////////////////////////////////////////////////
  5890.  
  5891. SNAPI SNRESULT SNPS3GetMemoryCompressed(HTARGET hTarget, UINT32 uProcessID, UINT32 uLevel, UINT32 uAddr, UINT32 uSize, BYTE* pBuffer);
  5892.  
  5893. //////////////////////////////////////////////////////////////////////////////
  5894. ///
  5895. ///  @brief             Gets a range of memory, compressing and decompressing at start/end of communications (improved speed).
  5896. ///             Address of memory to get can be up to 64 bits long.
  5897. ///
  5898. ///      @param         hTarget                 Handle to target.
  5899. ///      @param         uProcessID              Process ID.
  5900. ///  @param             uLevel                  Compression level - see SNPS3_COMPRESSION_LEVEL_* - can be value between 1 and 9 - 1 being best speed,
  5901. ///                             9 being best compression. Default value (-1) will request compromise between compression and speed.
  5902. ///      @param         uAddr                   Address of memory to read from (max 64 bits).
  5903. ///  @param             uSize                   Size of data to read.
  5904. ///      @param         pBuffer                 Pointer to buffer where data will be written.
  5905. ///
  5906. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.9.0 - latest version.\n
  5907. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5908. ///
  5909. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5910. ///             SN_S_OK - Successfully retrieved memory.\n
  5911. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5912. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5913. ///             SN_E_BAD_PARAM - pBuffer was NULL pointer.\n
  5914. ///             SN_E_COMMS_ERR - Error communicating with target.
  5915. ///
  5916. //////////////////////////////////////////////////////////////////////////////
  5917.  
  5918. SNAPI SNRESULT SNPS3GetMemory64Compressed(HTARGET hTarget, UINT32 uProcessID, UINT32 uLevel, UINT64 uAddr, UINT32 uSize, BYTE* pBuffer);
  5919.  
  5920. //////////////////////////////////////////////////////////////////////////////
  5921. ///
  5922. ///  @brief     Sets a breakpoint.
  5923. ///
  5924. ///  @param             hTarget                 Handle to a target.
  5925. ///  @param             uUnit                   Unit upon which the process runs (see \link PS3TMAPI::ESNPS3UNIT ESNPS3UNIT\endlink).
  5926. ///  @param     uProcessID              Process ID.
  5927. ///  @param     uThreadID               Thread ID.
  5928. ///  @param             uAddress                Address of the break point.
  5929. ///
  5930. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5931. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5932. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5933. ///
  5934. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5935. ///             SN_S_OK - Successfully set breakpoint.\n
  5936. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5937. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5938. ///             SN_E_BAD_UNIT - uUnit was invalid.\n
  5939. ///             SN_E_COMMS_ERR - Error communicating with target.
  5940. ///
  5941. //////////////////////////////////////////////////////////////////////////////
  5942.  
  5943. SNAPI SNRESULT SNPS3SetBreakPoint(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID, UINT64 uAddress);
  5944.  
  5945. //////////////////////////////////////////////////////////////////////////////
  5946. ///
  5947. ///  @brief     Clear a break point.
  5948. ///
  5949. ///  @param             hTarget                 Handle to a target.
  5950. ///  @param             uUnit                   Unit upon which the process runs (see \link PS3TMAPI::ESNPS3UNIT ESNPS3UNIT\endlink).
  5951. ///  @param     uProcessID              Process ID.
  5952. ///  @param     uThreadID               Thread ID.
  5953. ///  @param             uAddress                Address of the break point.
  5954. ///
  5955. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5956. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5957. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5958. ///
  5959. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5960. ///             SN_S_OK - Successfully cleared breakpoint.\n
  5961. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5962. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5963. ///             SN_E_BAD_UNIT - uUnit was invalid (see \link PS3TMAPI::ESNPS3UNIT ESNPS3UNIT\endlink).\n
  5964. ///             SN_E_COMMS_ERR - Error communicating with target.
  5965. ///
  5966. //////////////////////////////////////////////////////////////////////////////
  5967.  
  5968. SNAPI SNRESULT SNPS3ClearBreakPoint(HTARGET hTarget, UINT32 uUnit, UINT32 uProcessID, UINT64 uThreadID, UINT64 uAddress);
  5969.  
  5970. /////////////////////////////////////////////////////////////////////////////////
  5971. ///
  5972. /// @brief              List breakpoints set in process.
  5973. ///             Call this function passing NULL for au64BPAddress to get the number of breakpoints.
  5974. ///             Allocate a block of size (*puBPCount * sizeof(UINT64)) and call this function again,
  5975. ///             passing in a pointer to the allocated buffer.
  5976. ///
  5977. /// @param              hTarget                 Handle to target.
  5978. /// @param              uUnit                   Unit upon which the process runs (see \link PS3TMAPI::ESNPS3UNIT ESNPS3UNIT\endlink).
  5979. /// @param              uPID                    Process ID.
  5980. /// @param              u64TID                  Thread ID. This is only used for SPU breakpoints. If the unit is PPU then this is ignored.
  5981. /// @param              puBPCount               [in] Number of breakpoints buffer can hold.\n
  5982. ///                             [out] Number of breakpoints for which space is required, or if buffer is big enough, number written to buffer.
  5983. /// @param              au64BPAddress   Pointer to buffer to contain addresses of breakpoints.
  5984. ///
  5985. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  5986. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  5987. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  5988. ///
  5989. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  5990. ///             SN_S_OK - Successfully retrieved breakpoint list or number of breakpoints.\n
  5991. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  5992. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  5993. ///             SN_E_BAD_UNIT - uUnit was invalid (see \link PS3TMAPI::ESNPS3UNIT ESNPS3UNIT\endlink).\n
  5994. ///             SN_E_BAD_PARAM - puBPCount was a NULL pointer.\n
  5995. ///             SN_E_OUT_OF_MEM - Size of buffer defined by puBPCount was smaller than required size.\n
  5996. ///             SN_E_TM_COMMS_ERR - Error communicating with TM Server.\n
  5997. ///             SN_E_COMMS_ERR - Error communicating with target. If this return code was received when
  5998. ///                              getting SPU breakpoints, the debug agent may need to be updated.
  5999. ///
  6000. //////////////////////////////////////////////////////////////////////////////
  6001.  
  6002. SNAPI SNRESULT SNPS3GetBreakPoints(HTARGET hTarget, UINT32 uUnit, UINT32 uPID, UINT64 u64TID, UINT32 *puBPCount, UINT64 *au64BPAddress);
  6003.  
  6004. //////////////////////////////////////////////////////////////////////////////
  6005. ///  @struct    SNPS3ControlKeywordEntry
  6006. ///  @brief     Debug control keyword information. See "DEBUG_THREAD_CTRL_KEYWORD" in the DBGP specification.
  6007. //////////////////////////////////////////////////////////////////////////////
  6008.  
  6009. struct SNPS3ControlKeywordEntry
  6010. {
  6011.         UINT32 uMatchConditionFlags;
  6012.         char aKeywordString[128];
  6013.  
  6014. };
  6015. typedef struct SNPS3ControlKeywordEntry SNPS3ControlKeywordEntry;
  6016.  
  6017. //////////////////////////////////////////////////////////////////////////////
  6018. ///  @struct    SNPS3DebugThreadControlInfo
  6019. ///  @brief     Debug control keyword information. See "DEBUG_THREAD_CTRL_KEYWORD" in the DBGP specification.
  6020. //////////////////////////////////////////////////////////////////////////////
  6021.  
  6022. struct SNPS3DebugThreadControlInfo
  6023. {
  6024.         UINT64 uControlFlags;
  6025.         UINT32 uNumEntries;
  6026.         SNPS3ControlKeywordEntry arrCtrlKeywordEntry[];
  6027. };
  6028. typedef struct SNPS3DebugThreadControlInfo SNPS3DebugThreadControlInfo;
  6029.  
  6030. //////////////////////////////////////////////////////////////////////////////
  6031. ///
  6032. ///  @brief     Get a list of all the debug thread control settings.
  6033. ///             Call this function with pBuffer = NULL to get the required buffer size.
  6034. ///             To get the debug thread control settings, set pBuffer to point to an allocated memory block of size
  6035. ///             *puBufferSize, and call the function again.
  6036. ///             Buffer will contain an instance of SNPS3DebugThreadControlInfo()
  6037. ///             (buffer size is variable due to variable array arrCtrlKeywordEntry).
  6038. ///
  6039. ///  @param     hTarget                 Handle to target.
  6040. ///  @param     uProcessID              Process ID.
  6041. ///  @param     puBufferSize    [in] Size of buffer.\n
  6042. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  6043. ///  @param     pBuffer                 Pointer to the buffer.
  6044. ///
  6045. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  6046. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  6047. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6048. ///
  6049. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6050. ///             SN_S_OK - Successfully retrieved debug thread control settings or required size.\n
  6051. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6052. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6053. ///             SN_E_BAD_PARAM - puBufferSize was NULL pointer.\n
  6054. ///             SN_E_OUT_OF_MEM - Size of buffer defined in puBufferSize is too small.\n
  6055. ///             SN_E_COMMS_ERR - Error communicating with target.
  6056. ///
  6057. //////////////////////////////////////////////////////////////////////////////
  6058.  
  6059. SNAPI SNRESULT SNPS3GetDebugThreadControlInfo(HTARGET hTarget, UINT32 uProcessID, UINT32* puBufferSize, SNPS3DebugThreadControlInfo* pBuffer);
  6060.  
  6061. //////////////////////////////////////////////////////////////////////////////
  6062. ///
  6063. ///  @brief     Set the debug thread control settings for a process.
  6064. ///
  6065. ///  @param     hTarget                 Handle to target.
  6066. ///  @param     uProcessID              Process ID.
  6067. ///  @param     pInfo                   Instance of SNPS3DebugThreadControlInfo() containing new settings.
  6068. ///  @param             puMaxEntries    Pointer to UINT32 to store maximum number of control keyword entries.
  6069. ///
  6070. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.0.0 - latest version.\n
  6071. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  6072. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6073. ///
  6074. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6075. ///             SN_S_OK - Successfully set debug thread control settings.\n
  6076. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6077. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6078. ///             SN_E_BAD_PARAM - pInfo or puMaxEntries was NULL pointer.\n
  6079. ///             SN_E_COMMS_ERR - Error communicating with target.
  6080. ///
  6081. //////////////////////////////////////////////////////////////////////////////
  6082.  
  6083. SNAPI SNRESULT SNPS3SetDebugThreadControlInfo(HTARGET hTarget, UINT32 uProcessID, SNPS3DebugThreadControlInfo* pInfo, UINT32 *puMaxEntries);
  6084.  
  6085. //////////////////////////////////////////////////////////////////////////////
  6086. ///
  6087. ///  @brief     Attach to a process.
  6088. ///             Note: Currently can only attach to a PPU process (which will give access to
  6089. ///             any SPU children), thus any unit ID other than PS3_UI_CPU will cause the function to fail.
  6090. ///
  6091. ///  @param     hTarget     Handle to target.
  6092. ///  @param     uUnitID     Unit upon which the process is running (see \link PS3tmapi.h::ESNPS3UNIT ESNPS3UNIT\endlink).
  6093. ///  @param     uProcessID  Process ID.
  6094. ///
  6095. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 1.0.0 - latest version.\n
  6096. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  6097. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6098. ///
  6099. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6100. ///             SN_S_OK - Successfully attached to process.\n
  6101. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6102. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6103. ///             SN_E_BAD_UNIT - uUnit was invalid.\n
  6104. ///             SN_E_COMMS_ERR - Error communicating with target.
  6105. ///
  6106. //////////////////////////////////////////////////////////////////////////////
  6107.  
  6108. SNAPI SNRESULT SNPS3ProcessAttach(HTARGET hTarget, UINT32 uUnitID, UINT32 uProcessID);
  6109.  
  6110. //////////////////////////////////////////////////////////////////////////////
  6111. /// @struct     SNPS3MATRange
  6112. ///     @brief  Information on single range of memory access traps.
  6113. //////////////////////////////////////////////////////////////////////////////
  6114.  
  6115. struct SNPS3MATRange
  6116. {
  6117.         /// Start address of MAT range (aligned to 4k)
  6118.         UINT32 uStartAddress;
  6119.         /// Size of MAT range (aligned to 4k)
  6120.         UINT32 uSize;
  6121.         /// Byte array of MAT condition for each 4k page in range (see defines of SNPS3_MAT_COND_*)
  6122.         BYTE aPageConditions[];
  6123. };
  6124. typedef struct SNPS3MATRange SNPS3MATRange;
  6125.  
  6126. //////////////////////////////////////////////////////////////////////////////
  6127. ///
  6128. ///  @brief     Set memory access trap conditions for a process.
  6129. ///             Buffer is array of SNPS3MATRange() structures.\n
  6130. ///             Note: Page size is 4k so start address must be 4k aligned and size must be a multiple of 4k.\n
  6131. ///             Page condition array contains 1 byte per page.\n
  6132. ///             See SNPS3_MAT_COND_* defines for possible conditions.
  6133. ///             Note that a process must have been loaded with extra load flag SNPS3_XLF_ENABLE_MAT (see SNPS3SetExtraLoadFlags)
  6134. ///             set in order to use memory access traps.
  6135. ///
  6136. ///  @param     hTarget     Handle to target.
  6137. ///  @param     uProcessID  Process ID.
  6138. ///  @param             uRangeCount     Number of ranges defined in buffer.
  6139. ///  @param             uBufSize        Size of pBuf.
  6140. ///  @param             pBuf            Pointer to buffer containing conditions.
  6141. ///
  6142. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6143. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6144. ///
  6145. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6146. ///             SN_S_OK - Successfully set memory access trap conditions.\n
  6147. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6148. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6149. ///             SN_E_BAD_PARAM - pBuf was NULL pointer.\n
  6150. ///             SN_E_BAD_ALIGN - Page size or start address in MAT data not aligned correctly (4k align).\n
  6151. ///             SN_E_INSUFFICIENT_DATA - Insufficient data supplied.\n
  6152. ///             SN_E_COMMS_ERR - Error communicating with target.
  6153. ///
  6154. //////////////////////////////////////////////////////////////////////////////
  6155.  
  6156. SNAPI SNRESULT SNPS3SetMATConditions(HTARGET hTarget, UINT32 uProcessID, UINT32 uRangeCount, UINT32 uBufSize, BYTE *pBuf);
  6157.  
  6158. //////////////////////////////////////////////////////////////////////////////
  6159. ///
  6160. ///  @brief             Get list of address ranges for a process where memory access traps can be set.
  6161. ///             Buffer is array of SNPS3MATRange() structures where aPageConditions will always be empty.\n
  6162. ///             Call this function passing NULL for pBuf to get the number of address ranges.
  6163. ///             Allocate a block of size (*puRangeCount * sizeof(SNPS3MATRange)) and call this function again
  6164. ///             passing in a pointer to the allocated buffer.
  6165. ///
  6166. ///  @param     hTarget                 Handle to target.
  6167. ///  @param     uProcessID              Process ID.
  6168. ///  @param             puRangeCount    [in] Total number of ranges buffer can hold (buffer size = puRangeCount * sizeof(SNPS3MATRange)).\n
  6169. ///                             [out] Number of ranges for which space is required, or if buffer is big enough, number written to buffer.
  6170. ///      @param         pBuf                    Pointer to buffer containing range information.
  6171. ///
  6172. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6173. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6174. ///
  6175. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6176. ///             SN_S_OK - Successfully retrieved memory access trap ranges or number of ranges.\n
  6177. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6178. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6179. ///             SN_E_BAD_PARAM - puRangeCount was NULL pointer.\n
  6180. ///             SN_E_OUT_OF_MEM- Size of buffer specified in puRangeCount not large enough.\n
  6181. ///             SN_E_COMMS_ERR - Error communicating with target.
  6182. ///
  6183. //////////////////////////////////////////////////////////////////////////////
  6184.  
  6185. SNAPI SNRESULT SNPS3GetMATRanges(HTARGET hTarget, UINT32 uProcessID, UINT32 *puRangeCount, BYTE *pBuf);
  6186.  
  6187. // @name <MatConditions>
  6188. //@{
  6189. //! Memory access trap condition.
  6190. #define SNPS3_MAT_COND_TRANSPARENT  0
  6191. #define SNPS3_MAT_COND_WRITE        1
  6192. #define SNPS3_MAT_COND_READ_WRITE   2
  6193. #define SNPS3_MAT_COND_ERR          3
  6194. //@}
  6195.  
  6196. //////////////////////////////////////////////////////////////////////////////
  6197. ///
  6198. ///  @brief             Get current settings of memory access traps for specified address ranges for a process.
  6199. ///             Input buffer is array of SNPS3MATRange() structures (with empty aPageConditions arrays)
  6200. ///             specifying what memory ranges to get conditions for.\n
  6201. ///             Output buffer is also array of SNPS3MATRange() structures where aPageConditions arrays will
  6202. ///             now be filled with requested information.\n
  6203. ///             See SNPS3_MAT_COND_* defines for possible conditions.\n
  6204. ///             Call this function with pBuf = NULL to get the required buffer size.
  6205. ///             To get the memory access traps information, set pBuf to point to an allocated memory block of size
  6206. ///             *puBufferSize, and call the function again.
  6207. ///
  6208. ///  @param     hTarget                 Handle to target.
  6209. ///  @param     uProcessID              Process ID.
  6210. ///      @param         puRangeCount    [in] Number of ranges requested in pRanges buffer.\n
  6211. ///                             [out] Number of ranges successfully read.
  6212. ///  @param             pRanges                 Pointer to buffer containing ranges to get conditions for.
  6213. ///  @param             puBufSize               [in] Size of output buffer pBuf in bytes.\n
  6214. ///                             [out] Required size of buffer, or if buffer is big enough, bytes written to buffer.
  6215. ///  @param             pBuf                    Pointer to buffer to store ranges and conditions.
  6216. ///
  6217. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6218. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6219. ///
  6220. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6221. ///             SN_S_OK - Successfully retrieved memory access trap conditions or required size.\n
  6222. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6223. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6224. ///             SN_E_BAD_PARAM - One or more of puRangeCount, pRanges or puBufSize was NULL pointer.\n
  6225. ///             SN_E_OUT_OF_MEM- Size of buffer specified in puBufSize not large enough.\n
  6226. ///             SN_E_BAD_ALIGN - One or more of specified addresses/range sizes was not aligned to 4096 bytes.\n
  6227. ///             SN_E_COMMS_ERR - Error communicating with target.
  6228. ///
  6229. //////////////////////////////////////////////////////////////////////////////
  6230.  
  6231. SNAPI SNRESULT SNPS3GetMATConditions(HTARGET hTarget, UINT32 uProcessID, UINT32 *puRangeCount, BYTE *pRanges, UINT32 *puBufSize, BYTE *pBuf);
  6232.  
  6233. //////////////////////////////////////////////////////////////////////////////
  6234. ///
  6235. ///  @brief             Returns array of pointers to instances of \link SNPS3MATRange() SNPS3MATRange()\endlink within the supplied
  6236. ///             buffer pBuf.
  6237. ///             pBuf needs to be in the form returned by SNPS3GetMATConditions().
  6238. ///
  6239. ///  @param             uRangeCount             Number of ranges in buffer.
  6240. ///      @param         pBuf                    Pointer to byte buffer containing series of SNPS3MATRange() structures.
  6241. ///  @param             ppRanges                Pointer to array of SNPS3MATRange() pointers (one for each range).
  6242. ///
  6243. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6244. ///             SN_S_OK - Successfully retrieved memory access trap pointers.\n
  6245. ///             SN_E_BAD_PARAM - pBuf or ppRanges was NULL pointer.\n
  6246. ///             SN_E_COMMS_ERR - Error communicating with target.
  6247. ///
  6248. //////////////////////////////////////////////////////////////////////////////
  6249.  
  6250. SNAPI SNRESULT SNPS3GetMATRangePointers(UINT32 uRangeCount, BYTE *pBuf, SNPS3MATRange **ppRanges);
  6251.  
  6252. ////////////////////////////////////////////////////////////////////////////////////
  6253. ///
  6254. /// @brief              Shut down TM server.
  6255. ///             If the function succeeds, communication is fully closed and calling SNPS3CloseTargetComms() is not required.
  6256. ///             From SDK400, the function shuts down the TM GUI and icon tray as well.
  6257. ///
  6258. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6259. ///             SN_S_OK - Successfully shut down TM.\n
  6260. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6261. ///             SN_E_TIMEOUT - Timeout (20sec) occurred during the execution of the function - see SNPS3ExitEx().
  6262. ///
  6263. //////////////////////////////////////////////////////////////////////////////
  6264.  
  6265. SNAPI SNRESULT SNPS3Exit();
  6266.  
  6267. ////////////////////////////////////////////////////////////////////////////////////
  6268. ///
  6269. /// @brief              Shut down TM server.
  6270. ///             If the function succeeds, communication is fully closed and calling SNPS3CloseTargetComms() is not required.
  6271. ///             From SDK400, the function shuts down the TM GUI and icon tray as well.
  6272. ///
  6273. /// @param              nMillisecondTimeout     Millisecond timeout value.
  6274. ///
  6275. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6276. ///             SN_S_OK - Successfully shut down TM.\n
  6277. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6278. ///             SN_E_TIMEOUT - Timeout occurred during the execution of the function.
  6279. ///
  6280. //////////////////////////////////////////////////////////////////////////////
  6281.  
  6282. SNAPI SNRESULT SNPS3ExitEx(const UINT32 nMillisecondTimeout);
  6283.  
  6284. ////////////////////////////////////////////////////////////////////////////////////
  6285. ///
  6286. /// @brief              Save current TM settings.
  6287. ///
  6288. /// @return             \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6289. ///             SN_S_OK - Successfully saved TM settings.\n
  6290. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6291. ///
  6292. //////////////////////////////////////////////////////////////////////////////
  6293.  
  6294. SNAPI SNRESULT SNPS3SaveSettings();
  6295.  
  6296. ////////////////////////////////////////////////////////////////////////////////////
  6297. ///
  6298. /// @brief              Get raw SPU Logical IDs.
  6299. ///             Note: Will return a value for all physical SPUs, even those not allocated to RAW SPUs.
  6300. ///             These will have an ID of 0xFFFFFFFFFFFFFFFF.
  6301. ///
  6302. ///  @param     hTarget                 Handle to target.
  6303. ///  @param     uProcessID              Process ID.
  6304. ///  @param             pu64LogicalIDs  Pointer to array of 8 64 bit unsigned integers to hold IDs.
  6305. ///
  6306. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6307. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6308. ///
  6309. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6310. ///             SN_S_OK - Successfully retrieved raw SPU logical IDs.\n
  6311. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6312. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6313. ///             SN_E_BAD_PARAM - pu64LogicalIDs was NULL pointer.\n
  6314. ///             SN_E_COMMS_ERR - Error communicating with target.
  6315. ///
  6316. //////////////////////////////////////////////////////////////////////////////
  6317.  
  6318. SNAPI SNRESULT SNPS3GetRawSPULogicalIDs(HTARGET hTarget, UINT32 uProcessID, UINT64 *pu64LogicalIDs);
  6319.  
  6320. ////////////////////////////////////////////////////////////////////////////////////
  6321. ///
  6322. ///  @brief             Enable or disable footswitch notifications (disabled by default).
  6323. ///
  6324. ///  @param     hTarget                 Handle to target.
  6325. ///  @param     uEnabled                Set to 0 to disable notifications, non-zero to enable notifications.
  6326. ///
  6327. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6328. ///
  6329. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6330. ///             SN_S_OK - Successfully enabled / disabled footswitch notifications.\n
  6331. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6332. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6333. ///             SN_E_COMMS_ERR - Error communicating with target.
  6334. ///
  6335. //////////////////////////////////////////////////////////////////////////////
  6336.  
  6337. SNAPI SNRESULT SNPS3FootswitchControl(HTARGET hTarget, UINT32 uEnabled);
  6338.  
  6339. ////////////////////////////////////////////////////////////////////////////////////
  6340. ///
  6341. ///  @brief             Start a file trace for the process.
  6342. ///
  6343. ///  @param     hTarget                 Handle to target.
  6344. ///  @param     uPID                    Process ID.
  6345. ///  @param             uSize                   Size of the container that will be created for use by the file trace. 1mb is the recommended size.
  6346. ///  @param             pszFileName             Specifies the location to which the trace file will be written. UTF-8 null-terminated string.
  6347. ///
  6348. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6349. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6350. ///
  6351. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n\n
  6352. ///             SN_S_OK - Successfully started file trace.\n
  6353. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6354. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6355. ///             SN_E_BAD_PARAM - pszFileName was NULL pointer.\n
  6356. ///             SN_E_COMMS_ERR - Error communicating with target.
  6357. ///
  6358. //////////////////////////////////////////////////////////////////////////////
  6359.  
  6360. SNAPI SNRESULT SNPS3StartFileTrace(HTARGET hTarget, UINT32 uPID, UINT32 uSize, const char *pszFileName);
  6361.  
  6362. ////////////////////////////////////////////////////////////////////////////////////
  6363. ///
  6364. ///  @brief             Stop process file trace.
  6365. ///
  6366. ///  @param     hTarget                 Handle to target.
  6367. ///  @param     uPID                    Process ID.
  6368. ///
  6369. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6370. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6371. ///
  6372. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6373. ///             SN_S_OK - Successfully stopped file trace.\n
  6374. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6375. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6376. ///             SN_E_COMMS_ERR - Error communicating with target.
  6377. ///
  6378. //////////////////////////////////////////////////////////////////////////////
  6379.  
  6380. SNAPI SNRESULT SNPS3StopFileTrace(HTARGET hTarget, UINT32 uPID);
  6381.  
  6382. //! Control pad connected.
  6383. const BYTE SNPS3_PAD_STATUS_CONNECTED = 0x1;
  6384. //! Change of assigned controller port.
  6385. const BYTE SNPS3_PAD_STATUS_ASSIGN_CHANGE = 0x2;
  6386.  
  6387. //////////////////////////////////////////////////////////////////////////////
  6388. /// @struct             SNPS3PadData
  6389. ///     @brief          Pad playback data.
  6390. //////////////////////////////////////////////////////////////////////////////
  6391.  
  6392. typedef struct SNPS3PadData {
  6393.         /// First 32 bits of timestamp.
  6394.         UINT32 ulTimeHi;
  6395.         /// Second 32 bits of timestamp.
  6396.         UINT32 ulTimeLo;
  6397.         /// Reserved.
  6398.         UINT32 ulReserved0;
  6399.         /// Reserved.
  6400.         UINT32 ulReserved1;
  6401.         /// Controller port.
  6402.         UCHAR  ucPort;
  6403.         /// Status of controller port.
  6404.         UCHAR  ucPortStatus;
  6405.         /// Length of button data.
  6406.         UCHAR  ucLength;
  6407.         /// Reserved.
  6408.         UCHAR  ucReserved2;
  6409.         /// Reserved.
  6410.         UINT32 ulReserved3;
  6411.         /// Button data
  6412.         UINT16 arrButtons[24];
  6413. } SNPS3PadData;
  6414.  
  6415. ////////////////////////////////////////////////////////////////////////////////////
  6416. ///
  6417. ///  @brief             Start pad capture on the target (recording all information from the control pad).
  6418. ///             To receive control pad data, register a pad capture callback function using SNPS3RegisterPadCaptureHandler().
  6419. ///             Instances of SNPS3PadData() will be passed
  6420. ///             to the callback each time pad data is sent by the target. See SDK CTRLP spec for details.
  6421. ///             This function will fail if a pad capture has already been started on the target.
  6422. ///
  6423. ///  @param     hTarget                 Handle to target.
  6424. ///
  6425. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6426. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6427. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6428. ///
  6429. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6430. ///             SN_S_OK - Successfully started pad capture.\n
  6431. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6432. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6433. ///             SN_E_COMMS_ERR - Error communicating with target.
  6434. ///
  6435. //////////////////////////////////////////////////////////////////////////////
  6436.  
  6437. SNAPI SNRESULT SNPS3StartPadCapture(HTARGET hTarget);
  6438.  
  6439. ////////////////////////////////////////////////////////////////////////////////////
  6440. ///
  6441. ///  @brief             Stop pad capture on the target.
  6442. ///
  6443. ///  @param     hTarget                 Handle to target.
  6444. ///
  6445. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6446. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6447. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6448. ///
  6449. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6450. ///             SN_S_OK - Successfully stopped pad capture.\n
  6451. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6452. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6453. ///             SN_E_COMMS_ERR - Error communicating with target.
  6454. ///
  6455. //////////////////////////////////////////////////////////////////////////////
  6456.  
  6457. SNAPI SNRESULT SNPS3StopPadCapture(HTARGET hTarget);
  6458.  
  6459. ////////////////////////////////////////////////////////////////////////////////////
  6460. ///
  6461. ///  @brief             Start pad playback on the target.
  6462. ///             Once pad playback is started, pad capture data can be sent using SNPS3SendPadPlaybackData().
  6463. ///
  6464. ///  @param     hTarget                 Handle to target
  6465. ///
  6466. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6467. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6468. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6469. ///
  6470. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6471. ///             SN_S_OK - Successfully started pad playback.\n
  6472. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6473. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6474. ///             SN_E_COMMS_ERR - Error communicating with target.
  6475. ///
  6476. //////////////////////////////////////////////////////////////////////////////
  6477.  
  6478. SNAPI SNRESULT SNPS3StartPadPlayback(HTARGET hTarget);
  6479.  
  6480. ////////////////////////////////////////////////////////////////////////////////////
  6481. ///
  6482. ///  @brief             Stop pad playback on the target.
  6483. ///
  6484. ///  @param     hTarget                 Handle to target.
  6485. ///
  6486. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6487. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6488. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6489. ///
  6490. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6491. ///             SN_S_OK - Successfully stopped pad playback.\n
  6492. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6493. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6494. ///             SN_E_COMMS_ERR - Error communicating with target.
  6495. ///
  6496. //////////////////////////////////////////////////////////////////////////////
  6497.  
  6498. SNAPI SNRESULT SNPS3StopPadPlayback(HTARGET hTarget);
  6499.  
  6500. ////////////////////////////////////////////////////////////////////////////////////
  6501. ///
  6502. ///  @brief             Register a pad capture callback function.
  6503. ///             The callback function behaves as other TMAPI callback functions do.\n
  6504. ///             Data received by the callback will be instances of the SNPS3PadData() structure, sent
  6505. ///             each time pad data is sent by the target.\n
  6506. ///             The length field in the callback will contain the number of instances of the
  6507. ///             SNPS3PadData() structure in the buffer.\n
  6508. ///             SNPS3StartPadCapture() must have been called to receive data on the callback.
  6509. ///             The callback will only be invoked when SNPS3Kick() is called.
  6510. ///
  6511. ///  @param     hTarget                 Handle to target.
  6512. ///  @param             pfnCallBack             Pointer to callback function.
  6513. ///  @param             pUserData               Pointer to optional user data to be passed to callback function. Can be NULL.
  6514. ///
  6515. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6516. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6517. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6518. ///
  6519. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6520. ///             SN_S_OK - Successfully registered pad capture handler.\n
  6521. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6522. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6523. ///             SN_E_BAD_PARAM - pfnCallBack was NULL pointer.\n
  6524. ///             SN_S_REPLACED - Already registered for pad capture events, previous callback function has been replaced.
  6525. ///
  6526. //////////////////////////////////////////////////////////////////////////////
  6527.  
  6528. SNAPI SNRESULT SNPS3RegisterPadCaptureHandler(HTARGET hTarget, TMAPI_HandleEventCallback pfnCallBack, void *pUserData);
  6529.  
  6530. ////////////////////////////////////////////////////////////////////////////////////
  6531. ///
  6532. ///  @brief             Unregister a pad capture callback function.
  6533. ///
  6534. ///  @param     hTarget                 Handle to target.
  6535. ///
  6536. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6537. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6538. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6539. ///
  6540. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6541. ///             SN_S_OK - Successfully unregistered pad capture handler.\n
  6542. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6543. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6544. ///             SN_S_NO_ACTION - No callback function registered.
  6545. ///
  6546. //////////////////////////////////////////////////////////////////////////////
  6547.  
  6548. SNAPI SNRESULT SNPS3UnRegisterPadCaptureHandler(HTARGET hTarget);
  6549.  
  6550. ////////////////////////////////////////////////////////////////////////////////////
  6551. ///
  6552. ///  @brief             Send pad capture data to the target for playback.
  6553. ///
  6554. ///  @param     hTarget                 Handle to target.
  6555. ///  @param             pData                   Pointer to instance of SNPS3PadData() structure to send to the target.
  6556. ///
  6557. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6558. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6559. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6560. ///
  6561. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6562. ///             SN_S_OK - Successfully sent pad playback data.\n
  6563. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6564. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6565. ///             SN_E_BAD_PARAM - pData was NULL pointer\n
  6566. ///             SN_E_BUSY - Previous send command not completed.\n
  6567. ///             SN_E_COMMS_ERR - Error communicating with target.
  6568. ///
  6569. //////////////////////////////////////////////////////////////////////////////
  6570.  
  6571. SNAPI SNRESULT SNPS3SendPadPlaybackData(HTARGET hTarget, SNPS3PadData* pData);
  6572.  
  6573. /// @brief      Controller information received by target.
  6574. const UINT32 SNPS3TM_CTRLP_OK = 0x00000000;
  6575. /// @brief      Invalid packet (for example, controller information has been sent when its playback was not being processed).
  6576. const UINT32 SNPS3TM_CTRLP_EINVAL = 0x80010002;
  6577. /// @brief      Insufficient memory.
  6578. const UINT32 SNPS3TM_CTRLP_ENOMEM = 0x80010004;
  6579. /// @brief      Already playing.
  6580. const UINT32 SNPS3TM_CTRLP_EBUSY = 0x8001000a;
  6581. /// @brief      Controller disconnected.
  6582. const UINT32 SNPS3TM_CTRLP_ENODEV = 0x8001002d;
  6583.  
  6584. ////////////////////////////////////////////////////////////////////////////////////
  6585. ///
  6586. ///  @brief             Register a pad playback notification callback function to receive notifications
  6587. ///             from target when pad playback data is sent via SNPS3SendPadPlaybackData().
  6588. ///             The callback will receive a UINT32 which will be one of
  6589. ///             \link PS3TMAPI::SNPS3TM_CTRLP_OK SNPS3TM_CTRLP_OK\endlink through to
  6590. ///             \link PS3TMAPI::SNPS3TM_CTRLP_ENODEV SNPS3TM_CTRLP_ENODEV\endlink.
  6591. ///             The "Length" parameter passed to the callback is the number of UINT32s in the data,
  6592. ///             not the data length in bytes.
  6593. ///             The callback will only be invoked when SNPS3Kick() is called.
  6594. ///
  6595. ///  @param     hTarget                 Handle to target.
  6596. ///  @param             pfnCallBack             Pointer to callback function.
  6597. ///  @param             pUserData               Pointer to optional user data to be passed to callback function.
  6598. ///
  6599. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6600. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6601. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6602. ///
  6603. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6604. ///             SN_S_OK - Successfully registered pad playback handler.\n
  6605. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6606. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6607. ///             SN_E_BAD_PARAM - pfnCallBack was NULL pointer.\n
  6608. ///             SN_S_REPLACED - Already registered for pad playback events, previous callback function has been replaced.
  6609. ///
  6610. //////////////////////////////////////////////////////////////////////////////
  6611.  
  6612. SNAPI SNRESULT SNPS3RegisterPadPlaybackNotificationHandler(HTARGET hTarget, TMAPI_HandleEventCallback pfnCallBack, void *pUserData);
  6613.  
  6614. ////////////////////////////////////////////////////////////////////////////////////
  6615. ///
  6616. ///  @brief             Unregister a pad playback notification callback function.
  6617. ///
  6618. ///  @param     hTarget                 Handle to target.
  6619. ///
  6620. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6621. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6622. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6623. ///
  6624. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6625. ///             SN_S_OK - Successfully unregistered pad playback handler.\n
  6626. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6627. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6628. ///             SN_S_NO_ACTION - No callback function registered.
  6629. ///
  6630. //////////////////////////////////////////////////////////////////////////////
  6631.  
  6632. SNAPI SNRESULT SNPS3UnRegisterPadPlaybackNotificationHandler(HTARGET hTarget);
  6633.  
  6634. ////////////////////////////////////////////////////////////////////////////////////
  6635. ///
  6636. ///  @brief             Clear the TTY cache used for the SAVETTY special fileserving command.
  6637. ///
  6638. ///  @param     hTarget                 Handle to target.
  6639. ///
  6640. ///  @return    \link ApiBase::SNRESULT SNRESULT:\endlink\n
  6641. ///             SN_S_OK - Successfully cleared TTY cache.\n
  6642. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6643. ///             SN_E_BAD_TARGET - hTarget was invalid.
  6644. ///
  6645. //////////////////////////////////////////////////////////////////////////////
  6646.  
  6647. SNAPI SNRESULT SNPS3ClearTTYCache(HTARGET hTarget);
  6648.  
  6649. //////////////////////////////////////////////////////////////////////////////
  6650. ///
  6651. ///  @brief     Gets all file trace events from file created by SNPS3StartFileTrace() function.
  6652. ///             Events from file will be passed to callback registered by SNPS3RegisterFileTraceHandler().
  6653. ///
  6654. ///  @param             hTarget                 Handle to target.
  6655. ///      @param         pszPath                 Path of file trace. UTF-8 null-terminated string.
  6656. ///
  6657. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6658. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6659. ///
  6660. ///  @return    \link ApiBase::SNRESULT SNRESULT:\endlink\n
  6661. ///             SN_S_OK - Successfully retrieved file trace events.\n
  6662. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6663. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6664. ///             SN_E_BAD_PARAM - pszPath was NULL pointer, or contained invalid path.\n
  6665. ///             SN_E_FILE_ERROR - Error retrieving file trace events.
  6666. ///
  6667. //////////////////////////////////////////////////////////////////////////////
  6668.  
  6669. SNAPI SNRESULT SNPS3ProcessOfflineFileTrace(HTARGET hTarget, const char* pszPath);
  6670.  
  6671. ///////////////////////////////////////////////////////////////////////////////
  6672. ///
  6673. ///  @brief             Register file trace event handler.
  6674. ///             Trace events will be passed to handler during a file trace
  6675. ///             or after calling SNPS3ProcessOfflineFileTrace().
  6676. ///             The callback will only be invoked when SNPS3Kick() is called.
  6677. ///
  6678. ///  @param             hTarget                 Handle to target.
  6679. ///  @param             pfnCallBack             Pointer to callback function.
  6680. ///  @param             pUserData               Optional pointer to user data.
  6681. ///
  6682. ///  Callback must be in the form of:
  6683. ///
  6684. /// \code
  6685. ///  __stdcall void Callback(
  6686. ///          HTARGET hTarget,       // Handle to target.
  6687. ///          UINT32 Type,           // SN_EVENT_FILE_TRACE.
  6688. ///          UINT32 Param,          // Reserved - currently 0.
  6689. ///          SNRESULT eResult,      // Success or failure of data fetch.
  6690. ///          UINT32 Length,         // Length of data in event including header.
  6691. ///          BYTE* Data,            // Pointer to event data - SNPS3_FILE_TRACE_LOG.
  6692. ///          void* UserData);       // Optional user data.
  6693. /// \endcode
  6694. ///
  6695. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6696. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6697. ///
  6698. ///  @return    \link ApiBase::SNRESULT SNRESULT:\endlink\n
  6699. ///             SN_S_OK - Successfully registered file trace handler.\n
  6700. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6701. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6702. ///             SN_E_BAD_PARAM - pfnCallBack was NULL pointer.\n
  6703. ///             SN_S_REPLACED - Already registered for file trace events, previous callback function has been replaced.
  6704. ///
  6705. //////////////////////////////////////////////////////////////////////////////
  6706.  
  6707. SNAPI SNRESULT SNPS3RegisterFileTraceHandler(HTARGET hTarget, TMAPI_HandleEventCallback pfnCallBack, void *pUserData);
  6708.  
  6709. ///////////////////////////////////////////////////////////////////////////////
  6710. ///
  6711. ///  @brief             Unregister file trace event callback.
  6712. ///
  6713. ///  @param             hTarget                 Handle to target.
  6714. ///
  6715. ///  @note      Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6716. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6717. ///
  6718. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n\n
  6719. ///             SN_S_OK - Successfully unregistered file trace handler.\n
  6720. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6721. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6722. ///             SN_S_NO_ACTION - No callback function registered.
  6723. ///
  6724. //////////////////////////////////////////////////////////////////////////////
  6725.  
  6726. SNAPI SNRESULT SNPS3UnRegisterFileTraceHandler(HTARGET hTarget);
  6727.  
  6728. //////////////////////////////////////////////////////////////////////////////
  6729. ///
  6730. ///  @brief     Fetches a list of user processes running on the specified target.
  6731. ///             Call this function passing NULL for puBuffer to get the number of user processes.
  6732. ///             Allocate a block of size (*puCount * sizeof(UINT32)) and call this function again
  6733. ///             passing in a pointer to the allocated buffer.
  6734. ///
  6735. ///  @param     hTarget                 Handle to target.
  6736. ///  @param             puCount                 [in] Maximum number of IDs buffer can hold.\n
  6737. ///                             [out] Number of processes for which space is required,
  6738. ///                             or if buffer is big enough, number written to buffer.
  6739. ///  @param             puBuffer                Pointer to a buffer to receive the information.
  6740. ///                             As a guide, allocate a buffer of 64 * sizeof(UINT32),
  6741. ///                             passing 64 as the count.
  6742. ///
  6743. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 1.0.0 - latest version.\n
  6744. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.0.0 - latest version.\n
  6745. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6746. ///
  6747. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6748. ///             SN_S_OK - Successfully retrieved user process list or number of user processes.\n
  6749. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6750. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6751. ///             SN_E_BAD_PARAM - puCount was NULL pointer.\n
  6752. ///             SN_E_OUT_OF_MEM - Size of buffer specified in puCount (in UINT32s) smaller than required.\n
  6753. ///             SN_E_COMMS_ERR - Error communicating with target.
  6754. ///
  6755. //////////////////////////////////////////////////////////////////////////////
  6756.  
  6757. SNAPI SNRESULT SNPS3UserProcessList(HTARGET hTarget, UINT32 *puCount, UINT32 *puBuffer);
  6758.  
  6759. //////////////////////////////////////////////////////////////////////////////
  6760. /// @struct             SNPS3ScatteredWrite
  6761. ///     @brief          Details of a write (as part of a scattered write).
  6762. //////////////////////////////////////////////////////////////////////////////
  6763.  
  6764. struct SNPS3ScatteredWrite
  6765. {
  6766.         /// Address to write to.
  6767.         UINT32 uAddress;
  6768.         /// Buffer containing data to write (buffer size is passed to scattered write function)
  6769.         BYTE Data[];
  6770. };
  6771. typedef struct SNPS3ScatteredWrite SNPS3ScatteredWrite;
  6772.  
  6773. //////////////////////////////////////////////////////////////////////////////
  6774. ///
  6775. ///  @brief     Write data to each address in a list of addresses.
  6776. ///             The data written to each address may be different but the size of the data must always be the same.\n
  6777. ///             If a write fails, the command finishes and the failed address is written to *puFailedAddress,
  6778. ///             while the error code written to *puErrorCode.
  6779. ///             All writes previous to the failed write will have completed successfully.
  6780. ///
  6781. ///  @param     hTarget                 Handle to target.
  6782. ///  @param             uPID                    Process ID.
  6783. ///  @param             uNumWrites              Number of writes to send.
  6784. ///      @param         uWriteSize              Number of bytes to be written on a single write.
  6785. ///  @param             pWrites                 Pointer to series of SNPS3ScatteredWrite()
  6786. ///                             structures containing information on writes to be performed.
  6787. ///  @param             puErrorCode             Pointer to unsigned int where error code of first failed write will be written
  6788. ///                             (if there is a failure) - can be NULL.
  6789. ///  @param             puFailedAddress Pointer to unsigned int where address of first failed write will be written
  6790. ///                             (if there is a failure) - can be NULL.
  6791. ///            
  6792. ///      @note      Reference tool (DECR-1000 / DECR-1000A)                                                     : SDK 2.7.0 - latest version.\n
  6793. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.7.0 - latest version.\n
  6794. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.7.0 - latest version.
  6795. ///
  6796. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6797. ///             SN_S_OK - Successfully wrote to memory locations.\n
  6798. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6799. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6800. ///             SN_E_BAD_PARAM - pWrites was NULL pointer.\n
  6801. ///             SN_E_COMMS_ERR - Error communicating with target.
  6802. ///
  6803. //////////////////////////////////////////////////////////////////////////////
  6804.  
  6805. SNAPI SNRESULT SNPS3ProcessScatteredSetMemory(HTARGET hTarget, UINT32 uPID, UINT32 uNumWrites, UINT32 uWriteSize, SNPS3ScatteredWrite *pWrites,
  6806.                                                                                                         UINT32 *puErrorCode, UINT32 *puFailedAddress);
  6807.  
  6808. /////////////////////////////////////////////////////////////////////////////////
  6809. ///
  6810. /// @brief              Sets RSX profiling flags (note extra load flag SNPS3_XLF_ENABLE_HUD_RSX_TOOLS will need to be specified).
  6811. ///             For RSX profiling flags see SNPS3_HUD_RSX_USE_*.
  6812. ///
  6813. /// @param              hTarget                         Handle to target.
  6814. /// @param              uRSXFlags                       RSX profiling flags.
  6815. ///
  6816. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.4.0 - latest version.\n
  6817. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.4.0 - latest version.\n
  6818. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6819. ///
  6820. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6821. ///             SN_S_OK - Successfully set RSX profiling flags.\n
  6822. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6823. ///             SN_E_BAD_TARGET - hTarget was invalid.
  6824. ///
  6825. //////////////////////////////////////////////////////////////////////////////
  6826.  
  6827. SNAPI SNRESULT SNPS3SetRSXProfilingFlags(HTARGET hTarget, UINT64 uRSXFlags);
  6828.  
  6829. /////////////////////////////////////////////////////////////////////////////////
  6830. ///
  6831. /// @brief              Gets RSX profiling flags.
  6832. ///             See SNPS3_HUD_RSX_USE_*.
  6833. ///
  6834. /// @param              hTarget                         Handle to target.
  6835. /// @param              puRSXFlags                      Pointer to UINT64 to hold RSX profiling flags.
  6836. ///
  6837. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.4.0 - latest version.\n
  6838. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.4.0 - latest version.\n
  6839. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6840. ///
  6841. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6842. ///             SN_S_OK - Successfully retrieved RSX profiling flags.\n
  6843. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6844. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6845. ///             SN_E_BAD_PARAM - puRSXFlags was NULL pointer.
  6846. ///
  6847. //////////////////////////////////////////////////////////////////////////////
  6848.  
  6849. SNAPI SNRESULT SNPS3GetRSXProfilingFlags(HTARGET hTarget, UINT64 * puRSXFlags);
  6850.  
  6851. /////////////////////////////////////////////////////////////////////////////////
  6852. ///
  6853. /// @brief              Sets VRAM capture flags.
  6854. ///
  6855. /// @param              hTarget                         Handle to target.
  6856. /// @param              uVRAMFlags                      Value of VRAM capture flags. See SNPS3_ENABLE_VRAM_CAPTURE.
  6857. ///
  6858. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6859. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6860. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6861. ///
  6862. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6863. ///             SN_S_OK - Successfully set VRAM capture flags.\n
  6864. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6865. ///             SN_E_BAD_TARGET - hTarget was invalid.
  6866. ///
  6867. //////////////////////////////////////////////////////////////////////////////
  6868.  
  6869. SNAPI SNRESULT SNPS3SetVRAMCaptureFlags(HTARGET hTarget, UINT64 uVRAMFlags);
  6870.  
  6871. /////////////////////////////////////////////////////////////////////////////////
  6872. ///
  6873. /// @brief              Gets VRAM capture flags.
  6874. ///
  6875. /// @param              hTarget                         Handle to target.
  6876. /// @param              puVRAMFlags                     Pointer to UINT64 to hold VRAM capture flags. See SNPS3_ENABLE_VRAM_CAPTURE.
  6877. ///
  6878. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.5.0 - latest version.\n
  6879. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.5.0 - latest version.\n
  6880. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.6.0 - latest version.
  6881. ///
  6882. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6883. ///             SN_S_OK - Successfully retrieved VRAM capture flags.\n
  6884. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6885. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6886. ///             SN_E_BAD_PARAM - puVRAMFlags was NULL pointer.
  6887. ///
  6888. //////////////////////////////////////////////////////////////////////////////
  6889.  
  6890. SNAPI SNRESULT SNPS3GetVRAMCaptureFlags(HTARGET hTarget, UINT64 * puVRAMFlags);
  6891.  
  6892. /////////////////////////////////////////////////////////////////////////////////
  6893. ///
  6894. /// @brief              Perform VRAM capture on process. Image is saved as bitmap.
  6895. ///             Note that due to a hardware limitation, it is necessary to wait for
  6896. ///             at least 500ms after loading a process before calling this function, otherwise
  6897. ///             it will fail.
  6898. ///
  6899. /// @param              hTarget                         Handle to target.
  6900. /// @param              uPID                            Process to capture.
  6901. /// @param              pVRAMInfo                       Pointer to instance of SNPS3VRAMInfo containing parameters for capture
  6902. ///                                     (see SNPS3GetVRAMInformation to get parameters from target).
  6903. ///                                     If NULL, values will automatically be retrieved from target.
  6904. ///                                     Set the pVRAMInfo->uBPAddressBP member to zero, to not use a breakpoint.
  6905. /// @param              czpFileName                     Pointer to char array containing filename to write capture to. UTF-8 null-terminated string.
  6906. ///
  6907. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.7.0 - latest version.\n
  6908. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.7.0 - latest version.\n
  6909. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.7.0 - latest version.
  6910. ///
  6911. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6912. ///             SN_S_OK - Successfully captured VRAM.\n
  6913. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6914. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6915. ///             SN_E_BAD_PARAM - Either czpFileName was NULL pointer or display mode (color value) in pVRAMInfo incorrect.\n
  6916. ///             SN_E_OUT_OF_MEM - Not enough memory to store VRAM capture.\n
  6917. ///             SN_E_ERROR - Error reading VRAM data or saving capture file.\n
  6918. ///             SN_E_COMMS_ERR - Error communicating with target.
  6919. ///
  6920. //////////////////////////////////////////////////////////////////////////////
  6921.  
  6922. SNAPI SNRESULT SNPS3VRAMCapture(HTARGET hTarget, UINT32 uPID, SNPS3VRAMInfo *pVRAMInfo, const char *czpFileName);
  6923.  
  6924. /////////////////////////////////////////////////////////////////////////////////
  6925. ///
  6926. /// @brief              Enable VRAM capture for a target (sets VRAM capture flag to enabled and GCM debug flag on).
  6927. ///
  6928. /// @param              hTarget                         Handle to target.
  6929. ///
  6930. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 2.7.0 - latest version.\n
  6931. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 2.7.0 - latest version.\n
  6932. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 2.7.0 - latest version.
  6933. ///
  6934. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6935. ///             SN_S_OK - Successfully enabled VRAM capture.\n
  6936. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6937. ///             SN_E_BAD_TARGET - hTarget was invalid.
  6938. ///
  6939. //////////////////////////////////////////////////////////////////////////////
  6940.  
  6941. SNAPI SNRESULT SNPS3EnableVRAMCapture(HTARGET hTarget);
  6942.  
  6943. /////////////////////////////////////////////////////////////////////////////////
  6944. ///
  6945. /// @brief              Clears the exception state of a thread and causes it to exit.
  6946. ///
  6947. /// @param              hTarget                         Handle to target.
  6948. /// @param              uPID                            Process ID.
  6949. /// @param              uTID                            Thread ID.
  6950. ///
  6951. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6952. ///             SN_S_OK - Successfully cleared thread exception state.\n
  6953. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6954. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  6955. ///             SN_E_COMMS_ERR - Error communicating with target.
  6956. ///
  6957. //////////////////////////////////////////////////////////////////////////////
  6958.  
  6959. SNAPI SNRESULT SNPS3ThreadExceptionClean(HTARGET hTarget, UINT32 uPID, UINT64 uTID);
  6960.  
  6961. /////////////////////////////////////////////////////////////////////////////////
  6962. ///
  6963. /// @brief              Returns information about the specified transfer ID.
  6964. ///
  6965. /// @param              hTarget                         Handle to target.
  6966. ///     @param          uTXID                           File transfer ID.
  6967. ///     @param          pTransferList           Pointer to transfer structure to be populated.
  6968. ///
  6969. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.1.0 - latest version.\n
  6970. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.1.0 - latest version.\n
  6971. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.1.0 - latest version.
  6972. ///
  6973. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  6974. ///             SN_S_OK - Successfully retrieved file transfer information.\n
  6975. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  6976. ///             SN_E_BAD_TARGET - hTarget was invalid.
  6977. ///
  6978. //////////////////////////////////////////////////////////////////////////////
  6979.  
  6980. SNAPI SNRESULT SNPS3GetFileTransferInfo(HTARGET hTarget, const UINT32 uTXID, SNPS3Transfer *pTransferInfo);
  6981.  
  6982. /////////////////////////////////////////////////////////////////////////////////
  6983. ///
  6984. /// @brief              Returns the list of files currently being transferred to the PS3.
  6985. ///             The list returned depends on the size of pTransferList. If the data stored on the TM is greater
  6986. ///             than the size of pTransferList, pTransferList will store data for the most recently uploaded files.
  6987. ///             Call this function with pTransferList = NULL to get the buffer size (*puCount * sizeof(SNPS3Transfer))
  6988. ///             required to store the entire list.
  6989. ///
  6990. /// @param              hTarget                         Handle to target.
  6991. ///
  6992. ///     @param          puCount                         [in] Maximum number of SNPS3Transfer instances buffer can hold.\n
  6993. ///                                     [out] Total number of file entries currently stored on the TM.
  6994. ///     @param          pTransferList           Pointer to first entry in the transfer list.
  6995. ///
  6996. ///     @note   Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.1.0 - latest version.\n
  6997. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.1.0 - latest version.\n
  6998. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.1.0 - latest version.
  6999. ///
  7000. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7001. ///             SN_S_OK - Successfully retrieved file transfer list or size required for entire list.\n
  7002. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7003. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7004. ///             SN_E_BAD_PARAM - puCount was NULL pointer.
  7005. ///
  7006. //////////////////////////////////////////////////////////////////////////////
  7007.  
  7008. SNAPI SNRESULT SNPS3GetFileTransferList(HTARGET hTarget, UINT32 *puCount, SNPS3Transfer * pTransferList);
  7009.  
  7010. //////////////////////////////////////////////////////////////////////////////
  7011. ///
  7012. ///  @deprecated  Use SNPS3InstallGameEx().
  7013. ///  @brief  Use SNPS3InstallGameEx().
  7014. ///
  7015. //////////////////////////////////////////////////////////////////////////////
  7016. SNDEPRECATED("use SNPS3InstallGameEx instead")
  7017. SNAPI SNRESULT SNPS3InstallGame(HTARGET hTarget, const char *pszPath);
  7018.  
  7019. /////////////////////////////////////////////////////////////////////////////////
  7020. ///
  7021. /// @brief              Install a game on the PS3.
  7022. ///             Copies all the files located in the same directory
  7023. ///             as param.sfo to a newly created game directory on the target. The new game directory is created
  7024. ///             in dev_hdd0/game, and is named according to the title specified in PARAM.SFO.
  7025. ///             Only HDD boot games are supported. Error message 0x80028f14 will be returned
  7026. ///             (see SNPS3GetErrorQualifier()) if SNPS3InstallGameEx() is used to install game data (GD).
  7027. ///
  7028. ///             This function returns success as soon as the file transfers have been initiated.
  7029. ///             Call SNPS3WaitForFileTransfer() with puTXID as a parameter if you want to wait for the install
  7030. ///             to complete. Note that if there are no other files in the directory containing PARAM.SFO,
  7031. ///             then puTXID will be zero on return and so a call to SNPS3WaitForFileTransfer() will return SN_E_BAD_PARAM.
  7032. ///
  7033. /// @param              hTarget                         Handle to the target.
  7034. ///     @param          pszPath                         Full path to desired param.sfo file on the host. UTF-8 null-terminated string.
  7035. /// @param              pszTitleId                      The installed game title.
  7036. /// @param              pszTargetPath           The full path of the game installed on the target. UTF-8 null-terminated string.
  7037. /// @param              puTXID                          Pointer to UINT32 to store last transfer ID.
  7038. ///
  7039. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.3.0 - latest version.\n
  7040. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.3.0 - latest version.\n
  7041. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.3.0 - latest version.
  7042. ///
  7043. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7044. ///             SN_S_OK - Successfully initiated game file transfers.\n
  7045. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7046. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7047. ///             SN_E_BAD_PARAM - pszPath was NULL pointer.\n
  7048. ///             SN_E_COMMS_ERR - Error communicating with target.\n
  7049. ///             SN_E_FILE_ERROR - Error reading param.sfo - please ensure that the full path has been supplied.
  7050. ///
  7051. //////////////////////////////////////////////////////////////////////////////
  7052.  
  7053. SNAPI SNRESULT SNPS3InstallGameEx(HTARGET hTarget, const char *pszPath, char **pszTitleId, char **pszTargetPath, UINT32* puTXID);
  7054.  
  7055. /////////////////////////////////////////////////////////////////////////////////
  7056. ///
  7057. /// @brief              Install a game package (pkg file) on the PS3.
  7058. ///             Function returns when installation is 100% complete.
  7059. ///             To check the path of the installed package, call SNPS3Kick() after this function has returned.
  7060. ///             A DBG target event SNPS3_DBG_EVENT_INSTALL_PACKAGE_PATH will be received.
  7061. ///
  7062. /// @param              hTarget                         Handle to the target.
  7063. ///     @param          pszPath                         Path to desired pkg file on the host. UTF-8 null-terminated string.
  7064. ///
  7065. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.6.0 - latest version.\n
  7066. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.6.0 - latest version.\n
  7067. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.6.0 - latest version.
  7068. ///
  7069. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7070. ///             SN_S_OK - Successfully installed package.\n
  7071. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7072. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7073. ///             SN_E_BAD_PARAM - pszPkgPath was NULL pointer.\n
  7074. ///             SN_E_FILE_ERROR - pkg file does not exist or could not be opened\n
  7075. ///             SN_E_COMMS_ERR - Error communicating with target.\n
  7076. ///             SN_E_TIMEOUT - Command timed out.
  7077. ///
  7078. //////////////////////////////////////////////////////////////////////////////
  7079.  
  7080. SNAPI SNRESULT SNPS3InstallPackage(HTARGET hTarget, const char *pszPkgPath);
  7081.  
  7082. /////////////////////////////////////////////////////////////////////////////////
  7083. ///
  7084. /// @brief              Waits until a file transfer given by a transfer id has been processed.
  7085. ///             Check pFTValue on return for status.
  7086. ///             If the timeout value is 0, the function will return SN_E_TIMEOUT immediately and
  7087. ///             pFTValue will signal the file transfer status.
  7088. ///             If this function is called and the file transfer is pending or in progress,
  7089. ///             SNPS3Kick() is called internally - therefore if you have registered an FTP
  7090. ///             event handler via SNPS3RegisterFTPEventHandler(), then your callback may be
  7091. ///             called during execution of SNPS3WaitForFileTransfer().
  7092. ///
  7093. /// @param              hTarget                         Handle to the target.
  7094. /// @param              uTXID                           The transfer ID.
  7095. /// @param              pFTValue                        Pointer to the file transfer status. Can be NULL, except when a timeout of zero is specified.
  7096. /// @param              nMillisecondTimeout     Millisecond timeout value.
  7097. ///
  7098. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.3.0 - latest version.\n
  7099. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.3.0 - latest version.\n
  7100. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.3.0 - latest version.
  7101. ///
  7102. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7103. ///             SN_S_OK - Function executed successfully. Check the pFTValue parameter for more details of the file transfer status.\n
  7104. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7105. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7106. ///             SN_E_BAD_PARAM - Zero timeout was specified and pFTValue was NULL.\n
  7107. ///             SN_E_TIMEOUT - Timed out.
  7108. ///
  7109. //////////////////////////////////////////////////////////////////////////////
  7110.  
  7111. SNAPI SNRESULT SNPS3WaitForFileTransfer(HTARGET hTarget, const UINT32 uTXID, TMAPI_FT_NOTIFY *pFTValue, const UINT32 nMillisecondTimeout);
  7112.  
  7113. /////////////////////////////////////////////////////////////////////////////////
  7114. ///
  7115. /// @brief              Clear the file transfer list, based on status.
  7116. ///
  7117. /// @param              hTarget                         Handle to the target.
  7118. /// @param              filter                          Transfer status to clear. See SNPS3Transfer().
  7119. ///                                 Use 0xffffffff to clear all.
  7120. ///
  7121. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  7122. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  7123. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  7124. ///
  7125. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7126. ///             SN_S_OK - Function executed successfully.\n
  7127. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7128. ///             SN_E_BAD_TARGET - hTarget was invalid.
  7129. ///
  7130. //////////////////////////////////////////////////////////////////////////////
  7131.  
  7132. SNAPI SNRESULT SNPS3RemoveTransferItemsByStatus(HTARGET hTarget, UINT32 filter);
  7133.  
  7134. /////////////////////////////////////////////////////////////////////////////////
  7135. ///
  7136. /// @brief              Uninstall a game from the target.
  7137. ///
  7138. /// @param              hTarget                         Handle to the target.
  7139. ///     @param          pszTitleId                      Title of game directory to be removed (as per corresponding param.sfo file).
  7140. ///
  7141. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.3.0 - latest version.\n
  7142. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.3.0 - latest version.\n
  7143. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.3.0 - latest version.
  7144. ///
  7145. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7146. ///             SN_S_OK - Successfully uninstalled game.\n
  7147. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7148. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7149. ///             SN_E_BAD_PARAM - pszTitleId was NULL pointer.\n
  7150. ///             SN_E_COMMS_ERR - Error communicating with target.
  7151. ///
  7152. //////////////////////////////////////////////////////////////////////////////
  7153.  
  7154. SNAPI SNRESULT SNPS3UninstallGame(HTARGET hTarget, const char *pszTitleId);
  7155.  
  7156. // @name <ChModFilePermissions>
  7157. //@{
  7158. //! ReadWrite permissions - used with SNPS3CHMod.
  7159. const UINT32 SNPS3_FILE_PERMISSION_RW_USR       = 384;
  7160. //! ReadOnly permissions - used with SNPS3CHMod.
  7161. const UINT32 SNPS3_FILE_PERMISSION_R_USR        = 256;
  7162. //@}
  7163.  
  7164. /////////////////////////////////////////////////////////////////////////////////
  7165. ///
  7166. /// @brief              Sets the read/write/execute permissions for a file on the target.
  7167. ///
  7168. /// @param              hTarget                         Handle to the target.
  7169. ///     @param          pszFilePath                     Full file path. UTF-8 null-terminated string.
  7170. ///     @param          uMode                           See \link SNPS3_FILE_PERMISSION_RW_USR SNPS3_FILE_PERMISSION_RW_USR\endlink and
  7171. ///                                     \link SNPS3_FILE_PERMISSION_R_USR SNPS3_FILE_PERMISSION_R_USR\endlink.
  7172. ///
  7173. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  7174. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  7175. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  7176. ///
  7177. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7178. ///             SN_S_OK - Successfully set file permissions.\n
  7179. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7180. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7181. ///             SN_E_BAD_PARAM - pszFilePath was NULL pointer.\n
  7182. ///             SN_E_NOT_SUPPORTED_IN_SDK_VERSION - Not supported by current SDK version. Please update the SDK.\n
  7183. ///             SN_E_DATA_TOO_LONG - pszFilePath exceeded maximum path length for system (1024 for PS3).\n
  7184. ///             SN_E_FILE_ERROR - Failed to set permissions on file.\n
  7185. ///             SN_E_COMMS_ERR - Error communicating with target.
  7186. ///
  7187. //////////////////////////////////////////////////////////////////////////////
  7188.  
  7189. SNAPI SNRESULT SNPS3CHMod(HTARGET hTarget, const char *pszFilePath, UINT32 uMode);
  7190.  
  7191. /////////////////////////////////////////////////////////////////////////////////
  7192. ///
  7193. /// @brief              Sets access and modified times for a file on the PS3.
  7194. ///             Times are specified in Unix (time_t / UTC) time.
  7195. ///
  7196. /// @param              hTarget                         Handle to the target.
  7197. ///     @param          pszFilePath                     Full file path. UTF-8 null-terminated string.
  7198. ///     @param          uActTimeT                       New access time (time_t / UTC).
  7199. ///     @param          uModTimeT                       New modified time (time_t / UTC).
  7200. ///
  7201. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  7202. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  7203. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  7204. ///
  7205. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7206. ///             SN_S_OK - Successfully set file times.\n
  7207. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7208. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7209. ///             SN_E_BAD_PARAM - pszFilePath was NULL pointer.\n
  7210. ///             SN_E_NOT_SUPPORTED_IN_SDK_VERSION - Not supported by current SDK version. Please update the SDK.\n
  7211. ///             SN_E_DATA_TOO_LONG - pszFilePath exceeded maximum path length for system (1024 for PS3).\n
  7212. ///             SN_E_FILE_ERROR - Failed to set file time.\n
  7213. ///             SN_E_COMMS_ERR - Error communicating with target.
  7214. ///
  7215. //////////////////////////////////////////////////////////////////////////////
  7216.  
  7217. SNAPI SNRESULT SNPS3SetFileTime(HTARGET hTarget, const char *pszFilePath, UINT64 uActTimeT, UINT64 uModTimeT);
  7218.  
  7219. /////////////////////////////////////////////////////////////////////////////////
  7220. ///
  7221. /// @brief              Retrieve the available free size on a PS3 file system.
  7222. ///
  7223. /// @param              hTarget                         Handle to the target.
  7224. ///     @param          fileSystemDir           File system directory. Supported value is "/dev_hdd0/"
  7225. ///     @param          pBlockSize                      Size of a block.
  7226. ///     @param          pFreeBlockCount         Number of free block available.
  7227. ///
  7228. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  7229. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  7230. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  7231. ///
  7232. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7233. ///             SN_S_OK - Successfully get free size.\n
  7234. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7235. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7236. ///             SN_E_BAD_PARAM - pszFilePath was invalid.\n
  7237. ///             SN_E_DATA_TOO_LONG - pszFilePath exceeded maximum path length for system (1024 for PS3).\n
  7238. ///             SN_E_FILE_ERROR - Failed to retrieve the available size.\n
  7239. ///             SN_E_COMMS_ERR - Error communicating with target.
  7240. ///
  7241. //////////////////////////////////////////////////////////////////////////////
  7242.  
  7243. SNAPI SNRESULT SNPS3FSGetFreeSize(HTARGET hTarget, const char *fileSystemDir, UINT32* pBlockSize, UINT64* pFreeBlockCount);
  7244.  
  7245. /////////////////////////////////////////////////////////////////////////////////
  7246. ///
  7247. /// @brief              Retrieves the current XMB settings.
  7248. ///             If the supplied buffer is not large enough,
  7249. ///             settings will be truncated. To get required size for all XMB settings, set pSettings to
  7250. ///             NULL and call the function. On return, puSize will then contain the required size.
  7251. ///
  7252. /// @param              hTarget                         Handle to the target.
  7253. ///     @param          pSettings                       String to contain XMB settings. See table below.
  7254. ///     @param          puSize                          Size of pSettings. If pSettings is NULL, this will be set to the required size.
  7255. ///     @param          bUpdateCache            If set to TRUE, updates internal cache from target, otherwise the last saved XMB settings will be used.
  7256. ///
  7257. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  7258. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  7259. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  7260. ///
  7261. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7262. ///             SN_S_OK - Successfully retrieved XMB settings.\n
  7263. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7264. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7265. ///             SN_E_BAD_PARAM - puSize was NULL pointer.
  7266. ///             SN_E_COMMS_ERR - Error communicating with target.
  7267. ///
  7268. ///     @details        pSettings will contain a zero-terminated string that will be in the following format: key1=value1,key2=value2, and so on. Possible values are:\n\n
  7269. ///             <table>
  7270. ///                     <tr>
  7271. ///                             <th>Key</th>
  7272. ///                             <th>Setting in XMB</th>
  7273. ///                             <th>Possible Values</th>
  7274. ///                     </tr>
  7275. ///                     <tr>
  7276. ///                             <td>version</td>
  7277. ///                             <td>N/A</td>
  7278. ///                             <td>1 (current version)</td>
  7279. ///                     </tr>
  7280. ///                     <tr>
  7281. ///                             <td>System/fakeFreeSpace</td>
  7282. ///                             <td>[Debug Settings] >\n[Fake Free Space]</td>
  7283. ///                             <td>0: Off, 1: On, 2: On (Ignored in NP Trophy)</td>
  7284. ///                     </tr>
  7285. ///                     <tr>
  7286. ///                             <td>System/fakeLimitSize</td>
  7287. ///                             <td>[Debug Settings] >\n[Fake Limit Size]</td>
  7288. ///                             <td>A positive integer value</td>
  7289. ///                     </tr>
  7290. ///                     <tr>
  7291. ///                             <td>System/updateServerUrl</td>
  7292. ///                             <td>[Debug Settings] >\n[Update Server URL]</td>
  7293. ///                             <td>A string value</td>
  7294. ///                     </tr>
  7295. ///                     <tr>
  7296. ///                             <td>System/wolDex</td>
  7297. ///                             <td>[Debug Settings] >\n[Wake On LAN]</td>
  7298. ///                             <td>0: Off, 1: On</td>
  7299. ///                     </tr>
  7300. ///                     <tr>
  7301. ///                             <td>System/dispHddSpace</td>
  7302. ///                             <td>[Debug Settings] >\n[Display HDD Free Space]</td>
  7303. ///                             <td>0: Off, 1: On</td>
  7304. ///                     </tr>
  7305. ///                     <tr>
  7306. ///                             <td>System/powerOnReset</td>
  7307. ///                             <td>[Debug Settings] >\n[PowerOnReset]</td>
  7308. ///                             <td>0: Off, 1: On</td>
  7309. ///                     </tr>
  7310. ///                     <tr>
  7311. ///                             <td>System/nickname</td>
  7312. ///                             <td>[System Settings] >\n[System Name]</td>
  7313. ///                             <td>A string value (up to 31 characters including NULL character)</td>
  7314. ///                     </tr>
  7315. ///                     <tr>
  7316. ///                             <td>System/fakeSavedataOwner</td>
  7317. ///                             <td>[Debug Settings] >\n[Fake Save Data Owner]</td>
  7318. ///                             <td>0: Off, 1: On</td>
  7319. ///                     </tr>
  7320. ///                     <tr>
  7321. ///                             <td>System/matEnable</td>
  7322. ///                             <td>[Debug Settings] >\n[Memory Access Trap]</td>
  7323. ///                             <td>0: Off, 1: On</td>
  7324. ///                     </tr>
  7325. ///                     <tr>
  7326. ///                             <td>System/debugGameType</td>
  7327. ///                             <td>[Debug Settings] >\n[Game Type (Debugger)]</td>
  7328. ///                             <td>0: Disc Boot Game, 1: HDD Boot Game, 2: Patch, 3: PARAM.SFO</td>
  7329. ///                     </tr>
  7330. ///                     <tr>
  7331. ///                             <td>System/debugBootPath</td>
  7332. ///                             <td>[Debug Settings] >\n[GameContentUtil Boot Path (Debugger)]</td>
  7333. ///                             <td>0: For Development, 1: For Release</td>
  7334. ///                     </tr>
  7335. ///                     <tr>
  7336. ///                             <td>System/debugDirName</td>
  7337. ///                             <td>[Debug Settings] >\n[GameContentUtil Debug Path (Debugger)]</td>
  7338. ///                             <td>A string value (up to 31 characters including NULL character, alpha-numeric characters only)</td>
  7339. ///                     </tr>
  7340. ///                     <tr>
  7341. ///                             <td>System/appHomeBootPath</td>
  7342. ///                             <td>[Debug Settings] >\n[GameContentUtil Boot Path (/app_home/PS3_GAME/)]</td>
  7343. ///                             <td>0: For Development, 1: For Release</td>
  7344. ///                     </tr>
  7345. ///                     <tr>
  7346. ///                             <td>System/disable15Timeout</td>
  7347. ///                             <td>[Debug Settings] >\n[Disable ExitGame Timeout]</td>
  7348. ///                             <td>0: Off, 1: On</td>
  7349. ///                     </tr>
  7350. ///                     <tr>
  7351. ///                             <td>System/buttonAssign</td>
  7352. ///                             <td>[Debug Settings] >\n[O Button Behavior]</td>
  7353. ///                             <td>0: Enter, 1: Back</td>
  7354. ///                     </tr>
  7355. ///                     <tr>
  7356. ///                             <td>System.tmp/fakeOtherRegion</td>
  7357. ///                             <td>[Debug Settings] >\n[Fake Other Region]</td>
  7358. ///                             <td>0: Off, 1: On</td>
  7359. ///                     </tr>
  7360. ///                     <tr>
  7361. ///                             <td>System.tmp/dispMsgDialogUtilErrorcode</td>
  7362. ///                             <td>[Debug Settings] >\n[MsgDialogUtil Displace Errorcode]</td>
  7363. ///                             <td>0: Off, 1: On</td>
  7364. ///                     </tr>
  7365. ///                     <tr>
  7366. ///                             <td>Display/gameResolution</td>
  7367. ///                             <td>[Debug Settings] >\n[Game Output Resolution (Debugger)]</td>
  7368. ///                             <td>0: 480 (4:3)<br />1: 480 (16:9)<br />2: 576 (4:3)<br />3: 576 (16:9)<br />4: 720<br />5: 960 x 1080<br />6: 1280 x 1080<br />7: 1440 x 1080<br />8: 1600 x 1080<br />9: 1920 x 1080</td>
  7369. ///                     </tr>
  7370. ///                     <tr>
  7371. ///                             <td>Display/hdcp</td>
  7372. ///                             <td>[Debug Settings] >\n[HDCP]</td>
  7373. ///                             <td>0: Off, 1: On</td>
  7374. ///                     </tr>
  7375. ///                     <tr>
  7376. ///                             <td>Sound/gameSound</td>
  7377. ///                             <td>[Debug Settings] >\n[Game Output Sound (Debugger)]</td>
  7378. ///                             <td>0: Maximum Number of Channels Set on [Sound Settings] >\n[Audio Output Settings]<br />1: 2 ch<br />2: 2 ch (Downmix: 5.1 ch -> 2 ch)<br />3: 2 ch (Downmix: 7.1 ch -> 2 ch)<br />4: 5.1 ch<br />5: 5.1 ch (Downmix: 7.1 ch -> 5.1 ch)<br />6: 7.1 ch<br />7: Dolby Digital<br />8: Dolby Digital (Downmix: 7.1 ch -> 5.1 ch)<br />9: DTS<br />10: DTS (Downmix: 7.1 ch -> 5.1 ch)</td>
  7379. ///                     </tr>
  7380. ///                     <tr>
  7381. ///                             <td>Network/device</td>
  7382. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nSelect a connection method</td>
  7383. ///                             <td>0: Wired</td>
  7384. ///                     </tr>
  7385. ///                     <tr>
  7386. ///                             <td>Network/etherMode</td>
  7387. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nSpeed and Duplex</td>
  7388. ///                             <td>0: Auto-Detect<br />1: 10BASE-T Half-Duplex<br />2: 10BASE-T Full-Duplex<br />3: 100BASE-TX Half-Duplex<br />4: 100BASE-TX Full-Duplex<br />5: 1000BASE-T Half-Duplex<br />6: 1000BASE-T Full-Duplex</td>
  7389. ///                     </tr>
  7390. ///                     <tr>
  7391. ///                             <td>Network/howToSetupIp</td>
  7392. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nIP Address Setting</td>
  7393. ///                             <td>0: Automatic, 1: Manual, 2: PPPoE</td>
  7394. ///                     </tr>
  7395. ///                     <tr>
  7396. ///                             <td>Network/dhcpHostName</td>
  7397. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nDHCP Host Name</td>
  7398. ///                             <td>A string value (up to 255 characters including the NULL character)</td>
  7399. ///                     </tr>
  7400. ///                     <tr>
  7401. ///                             <td>Network/authName</td>
  7402. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nPPPoE User Name</td>
  7403. ///                             <td>A string value (up to 127 characters including the NULL character)</td>
  7404. ///                     </tr>
  7405. ///                     <tr>
  7406. ///                             <td>Network/authKey</td>
  7407. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nPPPoE Password</td>
  7408. ///                             <td>A string value (up to 127 characters including the NULL character)</td>
  7409. ///                     </tr>
  7410. ///                     <tr>
  7411. ///                             <td>Network/ipAddress</td>
  7412. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nIP Address</td>
  7413. ///                             <td>A string value (up to 17 characters including the NULL character) of the format XXX.XXX.XXX.XXX where XXX is a numerical value from 0-255</td>
  7414. ///                     </tr>
  7415. ///                     <tr>
  7416. ///                             <td>Network/netmask</td>
  7417. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nSubnet Mask</td>
  7418. ///                             <td>A string value (up to 17 characters including the NULL character) of the format XXX.XXX.XXX.XXX where XXX is a numerical value from 0-255</td>
  7419. ///                     </tr>
  7420. ///                     <tr>
  7421. ///                             <td>Network/defaultRoute</td>
  7422. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nDefault Router</td>
  7423. ///                             <td>A string value (up to 17 characters including the NULL character) of the format XXX.XXX.XXX.XXX where XXX is a numerical value from 0-255</td>
  7424. ///                     </tr>
  7425. ///                     <tr>
  7426. ///                             <td>Network/dnsFlag</td>
  7427. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nDNS Setting</td>
  7428. ///                             <td>0: Automatic, 1: Manual</td>
  7429. ///                     </tr>
  7430. ///                     <tr>
  7431. ///                             <td>Network/primaryDns</td>
  7432. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nPrimary DNS</td>
  7433. ///                             <td>A string value (up to 17 characters including the NULL character) of the format XXX.XXX.XXX.XXX where XXX is a numerical value from 0-255</td>
  7434. ///                     </tr>
  7435. ///                     <tr>
  7436. ///                             <td>Network/secondaryDns</td>
  7437. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nSecondary DNS</td>
  7438. ///                             <td>A string value (up to 17 characters including the NULL character) of the format XXX.XXX.XXX.XXX where XXX is a numerical value from 0-255</td>
  7439. ///                     </tr>
  7440. ///                     <tr>
  7441. ///                             <td>Network/httpProxyFlag</td>
  7442. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nProxy Server</td>
  7443. ///                             <td>0: Do Not Use, 1: Use</td>
  7444. ///                     </tr>
  7445. ///                     <tr>
  7446. ///                             <td>Network/httpProxyServer</td>
  7447. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nProxy Server > Address</td>
  7448. ///                             <td>A string value (up to 255 characters including the NULL character)</td>
  7449. ///                     </tr>
  7450. ///                     <tr>
  7451. ///                             <td>Network/httpProxyPort</td>
  7452. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nProxy Server > Port Number</td>
  7453. ///                             <td>A numerical value from 0-65535</td>
  7454. ///                     </tr>
  7455. ///                     <tr>
  7456. ///                             <td>Network/mtu</td>
  7457. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nMTU</td>
  7458. ///                             <td>A numerical value from 576-1500</td>
  7459. ///                     </tr>
  7460. ///                     <tr>
  7461. ///                             <td>Network/upnpFlag</td>
  7462. ///                             <td>[Network Settings] >\n[Internet Connection Settings] >\nUPnP</td>
  7463. ///                             <td>0: Disable, 1: Enable</td>
  7464. ///                     </tr>
  7465. ///                     <tr>
  7466. ///                             <td>Network/emulationType</td>
  7467. ///                             <td>[Debug Settings] >\n[Network Emulation Settings]</td>
  7468. ///                             <td>0: Off, 1: Option 1, 2: Options 2, 3: Option 3</td>
  7469. ///                     </tr>
  7470. ///                     <tr>
  7471. ///                             <td>Network/adhocSsidPrefix</td>
  7472. ///                             <td>[Debug Settings] >\n[Adhoc SSID Prefix]</td>
  7473. ///                             <td>A string value consisting of a 3-character prefix</td>
  7474. ///                     </tr>
  7475. ///                     <tr>
  7476. ///                             <td>Network.eth2/howToSetupIp</td>
  7477. ///                             <td>[Debug Settings] >\n[Connection Settings for Debug (Dual Settings)]</td>
  7478. ///                             <td>0: Automatic, 1: Manual</td>
  7479. ///                     </tr>
  7480. ///                     <tr>
  7481. ///                             <td>Network.eth2/dhcpHostName</td>
  7482. ///                             <td>[Debug Settings] >\n[Connection Settings for Debug (Dual Settings)] >\nDHCP Host Name</td>
  7483. ///                             <td>A string value (up to 255 characters including the NULL character)</td>
  7484. ///                     </tr>
  7485. ///                     <tr>
  7486. ///                             <td>Network.eth2/ipAddress</td>
  7487. ///                             <td>[Debug Settings] >\n[Connection Settings for Debug (Dual Settings)] >\nIP Address</td>
  7488. ///                             <td>A string value (up to 17 characters including the NULL character) of the format XXX.XXX.XXX.XXX where XXX is a numerical value from 0-255</td>
  7489. ///                     </tr>
  7490. ///                     <tr>
  7491. ///                             <td>Network.eth2/netmask</td>
  7492. ///                             <td>[Debug Settings] >\n[Connection Settings for Debug (Dual Settings)] >\nSubnet Mask</td>
  7493. ///                             <td>A string value (up to 17 characters including the NULL character) of the format XXX.XXX.XXX.XXX where XXX is a numerical value from 0-255</td>
  7494. ///                     </tr>
  7495. ///                     <tr>
  7496. ///                             <td>Music/gameBgmPlayback</td>
  7497. ///                             <td>[Debug Settings] >\n[BGM Player (Debugger)]</td>
  7498. ///                             <td>0: Off, 1: On</td>
  7499. ///                     </tr>
  7500. ///                     <tr>
  7501. ///                             <td>Music/dummyBgmPlayer</td>
  7502. ///                             <td>[Debug Settings] >\n[Dummy BGM Player Debug]</td>
  7503. ///                             <td>0: Off, 1: On</td>
  7504. ///                     </tr>
  7505. ///                     <tr>
  7506. ///                             <td>np/debug</td>
  7507. ///                             <td>[Debug Settings] >\n[NP Debug]</td>
  7508. ///                             <td>0: Off, 1: On</td>
  7509. ///                     </tr>
  7510. ///                     <tr>
  7511. ///                             <td>np/debugDrmError</td>
  7512. ///                             <td>[Debug Settings] >\n[NPDRM Debug]</td>
  7513. ///                             <td>0: Off, 1: On</td>
  7514. ///                     </tr>
  7515. ///                     <tr>
  7516. ///                             <td>np/debugDrmClock</td>
  7517. ///                             <td>[Debug Settings] >\n[NPDRM Clock Debug]</td>
  7518. ///                             <td>0: Off, 1: On</td>
  7519. ///                     </tr>
  7520. ///                     <tr>
  7521. ///                             <td>np/titleId</td>
  7522. ///                             <td>[Debug Settings] >\n[Service ID]</td>
  7523. ///                             <td>A string value (up to 36 characters)</td>
  7524. ///                     </tr>
  7525. ///                     <tr>
  7526. ///                             <td>np/env</td>
  7527. ///                             <td>[Debug Settings] >\n[NP Environment]</td>
  7528. ///                             <td>A string value (up to 8 characters)</td>
  7529. ///                     </tr>
  7530. ///                     <tr>
  7531. ///                             <td>np/npAdClockDiff</td>
  7532. ///                             <td>[Debug Settings] >\n[PlayStation&reg;Store Ad Clock]</td>
  7533. ///                             <td>0: Off, values >0: the time difference</td>
  7534. ///                     </tr>
  7535. ///                     <tr>
  7536. ///                             <td>np/gameUpdateImposeTest</td>
  7537. ///                             <td>[Debug Settings] >\n[Game Update Impose Test]</td>
  7538. ///                             <td>0: Off, 1: On</td>
  7539. ///                     </tr>
  7540. ///                     <tr>
  7541. ///                             <td>np/dummyInGameXMB</td>
  7542. ///                             <td>[Debug Settings] >\n[Dummy XMB&trade; (in game) Debug]</td>
  7543. ///                             <td>0: Off, 1: On</td>
  7544. ///                     </tr>
  7545. ///                     <tr>
  7546. ///                             <td>Device/ieee802.11</td>
  7547. ///                             <td>[Debug Settings] >\n[WLAN Device]</td>
  7548. ///                             <td>0: Off, 1: On</td>
  7549. ///                     </tr>
  7550. ///                     <tr>
  7551. ///                             <td>Upload/debug</td>
  7552. ///                             <td>[Debug Settings] >\n[Video UploadDebug]</td>
  7553. ///                             <td>0: Off, 1: On</td>
  7554. ///                     </tr>
  7555. ///                     <tr>
  7556. ///                             <td>libad/adServerUrl</td>
  7557. ///                             <td>[Debug Settings] >\n[MediatedServices: Mediator URL]</td>
  7558. ///                             <td>A string value (up to 1023 characters)</td>
  7559. ///                     </tr>
  7560. ///                     <tr>
  7561. ///                             <td>libad/adCatalogVersion</td>
  7562. ///                             <td>[Debug Settings] >\n[MediatedServices: Provider Data]</td>
  7563. ///                             <td>A string value (up to 1023 characters)</td>
  7564. ///                     </tr>
  7565. ///                     <tr>
  7566. ///                             <td>libad/adEnableNotification</td>
  7567. ///                             <td>[Debug Settings] >\n[MediatedServices: Notifications]</td>
  7568. ///                             <td>0: Off, 1: On</td>
  7569. ///                     </tr>
  7570. ///             </table>
  7571. ///
  7572. //////////////////////////////////////////////////////////////////////////////
  7573.  
  7574. SNAPI SNRESULT SNPS3GetXMBSettings(HTARGET hTarget, char *pSettings, UINT *puSize, BOOL bUpdateCache);
  7575.  
  7576. /////////////////////////////////////////////////////////////////////////////////
  7577. ///
  7578. /// @brief              Sets the target's current XMB settings.
  7579. ///             Note: This function uses the windows temporary directory. The Windows function GetTempPath() is used
  7580. ///             to retrieve the path to the windows temp directory. If case-sensitive file serving is turned on
  7581. ///             (via SNPS3SetCaseSensitiveFileServing()) and the string returned by GetTempPath() does not case-sensitive-match
  7582. ///             the actual folder in windows, then SNPS3SetXMBSettings() will fail.
  7583. ///             GetTempPath() first checks the TMP system environment variable for the temp path.
  7584. ///             An example of the failure described above is if TMP has the value C:\\Windows\\TEMP and your actual folder is C:\\Windows\\Temp.
  7585. ///
  7586. /// @param              hTarget                         Handle to target.
  7587. ///     @param          pSettings                       String containing the new XMB settings.
  7588. ///                                     The settings should be in the following format: key1=value1,key2=value2, and so on.
  7589. ///                                 For a list of possible values, see SNPS3GetXMBSettings().
  7590. ///  @param             bResetAfter                     Indicates whether or not to reset target after applying settings.
  7591. ///
  7592. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  7593. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  7594. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  7595. ///
  7596. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7597. ///             SN_S_OK - Successfully set XMB settings.\n
  7598. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7599. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7600. ///             SN_E_BAD_PARAM - Failed to set XMB settings.
  7601. ///             SN_E_COMMS_ERR - Error communicating with target.
  7602. ///
  7603. //////////////////////////////////////////////////////////////////////////////
  7604.  
  7605. SNAPI SNRESULT SNPS3SetXMBSettings(HTARGET hTarget, const char *pSettings, BOOL bResetAfter);
  7606.  
  7607. /////////////////////////////////////////////////////////////////////////////////
  7608. ///
  7609. /// @brief              Enables/disables XMB settings for target.
  7610. ///             Note that SNPS3SetXMBSettings() automatically enables XMB settings, so it overrides the
  7611. ///             value set by SNPS3EnableXMBSettings().
  7612. ///
  7613. /// @param              hTarget                         Handle to target.
  7614. /// @param              bEnabled                        Non-zero to enable, zero to disable.
  7615. ///
  7616. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  7617. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  7618. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  7619. ///
  7620. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7621. ///             SN_S_OK - Successfully enabled/disabled XMB settings.\n
  7622. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7623. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7624. ///             SN_E_COMMS_ERR - Error communicating with target.
  7625. ///             SN_E_FILE_ERR - Error deleting XMB settings file (in the case of disabling XMB settings).
  7626. ///
  7627. //////////////////////////////////////////////////////////////////////////////
  7628.  
  7629. SNAPI SNRESULT SNPS3EnableXMBSettings(HTARGET hTarget, BOOL bEnable);
  7630.  
  7631. /////////////////////////////////////////////////////////////////////////////////
  7632. ///
  7633. /// @brief              Sets the target's custom PARAM.SFO path.
  7634. ///             To use this PARAM.SFO when loading a process via SNPS3ProcessLoad(), the debug flags parameter
  7635. ///             must be set appropriately.
  7636. ///             Set the SNPS3_PROCESS_LOAD_FLAG_PARAMSFO_USECUSTOMDIR flag and clear the
  7637. ///             SNPS3_PROCESS_LOAD_FLAG_PARAMSFO_USEELFDIR flag.
  7638. ///
  7639. /// @param              hTarget                         Handle to target.
  7640. ///     @param          paramSfoPath            Custom PARAM.SFO directory path. UTF-8 null-terminated string.
  7641. ///
  7642. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7643. ///             SN_S_OK - Successfully set custom PARAM.SFO path.\n
  7644. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7645. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7646. ///             SN_E_BAD_PARAM - paramSfoPath was null pointer.\n
  7647. ///             SN_E_COMMS_ERR - Error communicating with target.
  7648. ///
  7649. //////////////////////////////////////////////////////////////////////////////
  7650.  
  7651. SNAPI SNRESULT SNPS3SetCustomParamSFOMappingDirectory(HTARGET hTarget, const char *pParamSfoPath);
  7652.  
  7653.  
  7654. /////////////////////////////////////////////////////////////////////////////////
  7655. ///
  7656. /// @brief              Formats the target's HDD.
  7657. ///
  7658. /// @param              hTarget                         Handle to target.
  7659. /// @param              initRegistry            Set it to 1 if you also want to clear the registry
  7660. ///
  7661. /// @note       Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  7662. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  7663. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  7664. ///
  7665. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7666. ///             SN_S_OK - Successfully formatted HDD.\n
  7667. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7668. ///             SN_E_TARGET_IS_POWERED_OFF - Target is powered off. Power on the target first.\n
  7669. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  7670. ///             SN_E_COMMS_ERR - Error communicating with target.
  7671. ///
  7672. //////////////////////////////////////////////////////////////////////////////
  7673.  
  7674. SNAPI SNRESULT SNPS3FormatHDD(HTARGET hTarget, UINT32 initRegistry);
  7675.  
  7676.  
  7677. /////////////////////////////////////////////////////////////////////////////////
  7678. ///
  7679. /// @brief              Sets the TM server logging category.
  7680. ///
  7681. /// @param              categories                  Logging category.
  7682. ///                                (See \link ApiBase::TMAPI_LOG_CATEGORY TMAPI_LOG_CATEGORY\endlink).
  7683. ///
  7684. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7685. ///             SN_S_OK - Successfully get the server logging category.\n
  7686. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7687. ///             SN_E_COMMS_ERR - Error communicating with target.
  7688. ///
  7689. //////////////////////////////////////////////////////////////////////////////
  7690.  
  7691. SNAPI SNRESULT SNPS3SetLogOptions(TMAPI_LOG_CATEGORY categories);
  7692.  
  7693. /////////////////////////////////////////////////////////////////////////////////
  7694. ///
  7695. /// @brief              Gets the TM server logging category.
  7696. ///
  7697. /// @param              categories                  Logging category.
  7698. ///                                (See \link ApiBase::TMAPI_LOG_CATEGORY TMAPI_LOG_CATEGORY\endlink).
  7699. ///
  7700. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7701. ///             SN_S_OK - Successfully set the server logging category.\n
  7702. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  7703. ///             SN_E_COMMS_ERR - Error communicating with target.
  7704. ///
  7705. //////////////////////////////////////////////////////////////////////////////
  7706.  
  7707. SNAPI SNRESULT SNPS3GetLogOptions(TMAPI_LOG_CATEGORY* categories);
  7708.  
  7709. /////////////////////////////////////////////////////////////////////////////////
  7710. ///
  7711. /// @brief              Enables/disables the internal kick flag.
  7712. ///             Set this flag to allow callbacks to be processed during calls to
  7713. ///             PS3 API function calls. This flag is off by default, in which case
  7714. //                              SNPS3Kick() must be called in order for user callbacks to be invoked.
  7715. ///
  7716. /// @param              bEnable              Non-zero to enable, zero to disable.
  7717. ///
  7718. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7719. ///             SN_S_OK - Successfully set the internal kick flag.\n
  7720. ///             SN_S_NO_ACTION - Internal kick already enabled or disabled.\n
  7721. ///
  7722. //////////////////////////////////////////////////////////////////////////////
  7723.  
  7724. SNAPI SNRESULT SNPS3EnableInternalKick(BOOL bEnable);
  7725.  
  7726. /////////////////////////////////////////////////////////////////////////////////
  7727. ///
  7728. /// @brief              Registers an idle worker callback.
  7729. ///
  7730. /// @param              pData   A pointer to user data that is passed to the idle worker callback.
  7731. /// @param              pfnIdleWorkerCallback   Pointer to callback.
  7732. ///
  7733. /// @details    An idle worker callback can be registered for applications that require work to
  7734. ///                             to be performed during PS3API function calls. This is useful for GUI applications that
  7735. ///                             require their messages to be pumped to prevent an unresponsive GUI during time consuming PS3API function calls.
  7736. ///
  7737. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7738. ///             SN_S_OK - Successfully registered the idle worker callback.\n
  7739. ///                             SN_S_REPLACED - Callback function already registered and has been replaced.\n
  7740. ///             SN_E_BAD_PARAM - Invalid pointer to idle worker callback function.\n
  7741. ///
  7742. //////////////////////////////////////////////////////////////////////////////
  7743.  
  7744. SNAPI SNRESULT SNPS3RegisterIdleWorker(TMAPI_IdleWorker pfnIdleWorkerCallback, void* pData);
  7745.  
  7746. //////////////////////////////////////////////////////////////////////////////
  7747. ///
  7748. ///  @brief     Unregister the current idle worker callback.
  7749. ///
  7750. ///  @return    \link ApiBase::SNRESULT SNRESULT\endlink:\n
  7751. ///             SN_S_OK - Successfully unregistered the idle worker callback.\n
  7752. ///             SN_S_NO_ACTION - No idle worker callback function registered.\n
  7753. ///
  7754. //////////////////////////////////////////////////////////////////////////////
  7755.  
  7756. SNAPI SNRESULT SNPS3UnRegisterIdleWorker();
  7757.  
  7758. //////////////////////////////////////////////////////////////////////////////
  7759. /// @enum               SNPS3_FILE_TRACE_TYPE
  7760. ///     @brief          Type of file trace data to be used in conjunction with SNPS3_FILE_TRACE_LOG_TYPE_*.
  7761. //////////////////////////////////////////////////////////////////////////////
  7762.  
  7763. enum SNPS3_FILE_TRACE_TYPE {
  7764.  
  7765.         // @name <Type1FileTraceData>
  7766.         //@{
  7767.         //! Type 1.
  7768.         SNPS3_FT_GET_BLOCK_SIZE = 1,
  7769.         SNPS3_FT_STAT,
  7770.         SNPS3_FT_WIDGET_STAT,
  7771.         SNPS3_FT_UNLINK,
  7772.         SNPS3_FT_WIDGET_UNLINK,
  7773.         SNPS3_FT_RMDIR,
  7774.         SNPS3_FT_WIDGET_RMDIR,
  7775.         //@}
  7776.  
  7777.         // @name <Type2FileTraceData>
  7778.         //@{
  7779.         //! Type 2.
  7780.         SNPS3_FT_RENAME = 14,
  7781.         SNPS3_FT_WIDGET_RENAME,
  7782.         //@}
  7783.  
  7784.         // @name <Type3FileTraceData>
  7785.         //@{
  7786.         //! Type 3.
  7787.         SNPS3_FT_TRUNCATE = 18,
  7788.         SNPS3_FT_TRUNCATE_NO_ALLOC,
  7789.         SNPS3_FT_TRUNCATE2,
  7790.         SNPS3_FT_TRUNCATE2_NO_INIT,
  7791.         //@}
  7792.  
  7793.         // @name <Type4FileTraceData>
  7794.         //@{
  7795.         //! Type 4.
  7796.         SNPS3_FT_OPENDIR = 24,
  7797.         SNPS3_FT_WIDGET_OPENDIR,
  7798.         SNPS3_FT_CHMOD,
  7799.         SNPS3_FT_MKDIR,
  7800.         //@}
  7801.  
  7802.         // @name <Type6FileTraceData>
  7803.         //@{
  7804.         //! Type 6.
  7805.         SNPS3_FT_UTIME = 29,
  7806.         //@}
  7807.  
  7808.         // @name <Type8FileTraceData>
  7809.         //@{
  7810.         //! Type 8.
  7811.         SNPS3_FT_OPEN = 33,
  7812.         SNPS3_FT_WIDGET_OPEN,
  7813.         //@}
  7814.  
  7815.         // @name <Type9FileTraceData>
  7816.         //@{
  7817.         //! Type 9.
  7818.         SNPS3_FT_CLOSE = 35,
  7819.         SNPS3_FT_CLOSEDIR,
  7820.         SNPS3_FT_FSYNC,
  7821.         SNPS3_FT_READDIR,
  7822.         SNPS3_FT_FSTAT,
  7823.         SNPS3_FT_FGET_BLOCK_SIZE,
  7824.         //@}
  7825.  
  7826.         // @name <Type10FileTraceData>
  7827.         //@{
  7828.         //! Type 10.
  7829.         SNPS3_FT_READ = 47,
  7830.         SNPS3_FT_WRITE,
  7831.         SNPS3_FT_GET_DIR_ENTRIES,
  7832.         //@}
  7833.  
  7834.         // @name <Type11FileTraceData>
  7835.         //@{
  7836.         //! Type 11.
  7837.         SNPS3_FT_READ_OFFSET = 50,
  7838.         SNPS3_FT_WRITE_OFFSET,
  7839.         //@}
  7840.  
  7841.         // @name <Type12FileTraceData>
  7842.         //@{
  7843.         //! Type 12.
  7844.         SNPS3_FT_FTRUNCATE = 52,
  7845.         SNPS3_FT_FTRUNCATE_NO_ALLOC,
  7846.         //@}
  7847.  
  7848.         // @name <Type13FileTraceData>
  7849.         //@{
  7850.         //! Type 13.
  7851.         SNPS3_FT_LSEEK = 56,
  7852.         //@}
  7853.  
  7854.         // @name <Type14FileTraceData>
  7855.         //@{
  7856.         //! Type 14.
  7857.         SNPS3_FT_SET_IO_BUFFER = 57,
  7858.         //@}
  7859.  
  7860.         //! Special marker
  7861.         SNPS3_FT_OFFLINE_END = 9999,
  7862. };
  7863.  
  7864. //////////////////////////////////////////////////////////////////////////////
  7865. /// @struct             SNPS3_FILE_TRACE_LOG
  7866. /// @brief              Contains file trace notification data.
  7867. //////////////////////////////////////////////////////////////////////////////
  7868.  
  7869. struct SNPS3_FILE_TRACE_LOG
  7870. {
  7871.         UINT64 ulSerialID;
  7872.         UINT32 ulAPIType;
  7873.         UINT32 ulStatus;
  7874.         UINT32 ulProcessID;
  7875.         UINT32 ulThreadID;
  7876.         UINT64 ulTimeBaseStartOfTrace;
  7877.         UINT64 ulTimeBase;
  7878.         UINT32 ulBackTraceLength;
  7879.         //  BYTE arrBackTrace[];
  7880.         //      BYTE arrData[];
  7881. };
  7882.  
  7883. // @name <FileTraceNotificationStatuses>
  7884. //@{
  7885. //! File trace notification status value.
  7886. const UINT32 SNPS3_FILE_TRACE_STATUS_PROCESSED  = 0;
  7887. const UINT32 SNPS3_FILE_TRACE_STATUS_RECEIVED   = 1;
  7888. const UINT32 SNPS3_FILE_TRACE_STATUS_WAITING    = 2;
  7889. const UINT32 SNPS3_FILE_TRACE_STATUS_PROCESSING = 3;
  7890. const UINT32 SNPS3_FILE_TRACE_STATUS_SUSPENDED  = 4;
  7891. const UINT32 SNPS3_FILE_TRACE_STATUS_FINISHED   = 5;
  7892. //@}
  7893.  
  7894. //////////////////////////////////////////////////////////////////////////////
  7895. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_1
  7896. /// @brief              Contains file trace notification data for type 1 log entries.
  7897. ///                             If ulPathLength is greater than zero, path is a UTF-8 null-terminated string.
  7898. //////////////////////////////////////////////////////////////////////////////
  7899.  
  7900. struct SNPS3_FILE_TRACE_LOG_TYPE_1
  7901. {
  7902.         UINT32 ulPathLength;
  7903.         //  char szPath[];
  7904. };
  7905.  
  7906. // @name <FileTraceLogsType1>
  7907. //@{
  7908. //! Type 1 file trace log type.
  7909. typedef SNPS3_FILE_TRACE_LOG_TYPE_1 SNPS3_FT_LOG_GET_BLOCK_SIZE;
  7910. typedef SNPS3_FILE_TRACE_LOG_TYPE_1 SNPS3_FT_LOG_STAT;
  7911. typedef SNPS3_FILE_TRACE_LOG_TYPE_1 SNPS3_FT_LOG_WIDGET_STAT;
  7912. typedef SNPS3_FILE_TRACE_LOG_TYPE_1 SNPS3_FT_LOG_UNLINK;
  7913. typedef SNPS3_FILE_TRACE_LOG_TYPE_1 SNPS3_FT_LOG_WIDGET_UNLINK;
  7914. typedef SNPS3_FILE_TRACE_LOG_TYPE_1 SNPS3_FT_LOG_RMDIR;
  7915. typedef SNPS3_FILE_TRACE_LOG_TYPE_1 SNPS3_FT_LOG_WIDGET_RMDIR;
  7916. //@}
  7917.  
  7918. //////////////////////////////////////////////////////////////////////////////
  7919. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_2
  7920. /// @brief              Contains file trace notification data for type 2 log entries.
  7921. ///                             If a given path length is greater than zero, path is a UTF-8 null-terminated string.
  7922. //////////////////////////////////////////////////////////////////////////////
  7923.  
  7924. struct SNPS3_FILE_TRACE_LOG_TYPE_2
  7925. {
  7926.         UINT32 ulPathLength1;
  7927.         UINT32 ulPathLength2;
  7928.         //  char szPath1[];
  7929.         //  char szPath2[];
  7930. };
  7931.  
  7932. // @name <FileTraceLogsType2>
  7933. //@{
  7934. //! Type 2 file trace log type.
  7935. typedef SNPS3_FILE_TRACE_LOG_TYPE_2 SNPS3_FT_LOG_RENAME;
  7936. typedef SNPS3_FILE_TRACE_LOG_TYPE_2 SNPS3_FT_LOG_WIDGET_RENAME;
  7937. //@}
  7938.  
  7939. //////////////////////////////////////////////////////////////////////////////
  7940. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_3
  7941. /// @brief              Contains file trace notification data for type 3 log entries.
  7942. ///                             If ulPathLength is greater than zero, path is a UTF-8 null-terminated string.
  7943. //////////////////////////////////////////////////////////////////////////////
  7944.  
  7945. struct SNPS3_FILE_TRACE_LOG_TYPE_3
  7946. {
  7947.         UINT64 ulArg;
  7948.         UINT32 ulPathLength;
  7949.         //  char szPath[];
  7950. };
  7951.  
  7952. // @name <FileTraceLogsType3>
  7953. //@{
  7954. //! Type 3 file trace log type.
  7955. typedef SNPS3_FILE_TRACE_LOG_TYPE_3 SNPS3_FT_LOG_TRUNCATE;
  7956. typedef SNPS3_FILE_TRACE_LOG_TYPE_3 SNPS3_FT_LOG_TRUNCATE_NO_ALLOC;
  7957. typedef SNPS3_FILE_TRACE_LOG_TYPE_3 SNPS3_FT_LOG_TRUNCATE2;
  7958. typedef SNPS3_FILE_TRACE_LOG_TYPE_3 SNPS3_FT_LOG_TRUNCATE2_NO_INIT;
  7959. //@}
  7960.  
  7961. //////////////////////////////////////////////////////////////////////////////
  7962. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_4
  7963. /// @brief              Contains file trace notification data for type 4 log entries.
  7964. ///                             If ulPathLength is greater than zero, path is a UTF-8 null-terminated string.
  7965. //////////////////////////////////////////////////////////////////////////////
  7966.  
  7967. struct SNPS3_FILE_TRACE_LOG_TYPE_4
  7968. {
  7969.         UINT32 ulMode;
  7970.         UINT32 ulPathLength;
  7971.         //  char szPath[];
  7972. };
  7973.  
  7974. // @name <FileTraceLogsType4>
  7975. //@{
  7976. //! Type 4 file trace log type.
  7977. typedef SNPS3_FILE_TRACE_LOG_TYPE_4 SNPS3_FT_LOG_OPENDIR;
  7978. typedef SNPS3_FILE_TRACE_LOG_TYPE_4 SNPS3_FT_LOG_WIDGET_OPENDIR;
  7979. typedef SNPS3_FILE_TRACE_LOG_TYPE_4 SNPS3_FT_LOG_CHMOD;
  7980. typedef SNPS3_FILE_TRACE_LOG_TYPE_4 SNPS3_FT_LOG_MKDIR;
  7981. //@}
  7982.  
  7983. //////////////////////////////////////////////////////////////////////////////
  7984. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_6
  7985. /// @brief              Contains file trace notification data for type 6 log entries.
  7986. ///                             If ulPathLength is greater than zero, path is a UTF-8 null-terminated string.
  7987. //////////////////////////////////////////////////////////////////////////////
  7988.  
  7989. struct SNPS3_FILE_TRACE_LOG_TYPE_6
  7990. {
  7991.         UINT64 ulArg1;
  7992.         UINT64 ulArg2;
  7993.         UINT32 ulPathLength;
  7994.         //  char szPath[];
  7995. };
  7996.  
  7997. // @name <FileTraceLogsType6>
  7998. //@{
  7999. //! Type 6 file trace log type.
  8000. typedef SNPS3_FILE_TRACE_LOG_TYPE_6 SNPS3_FT_LOG_UTIME;
  8001. //@}
  8002.  
  8003. //////////////////////////////////////////////////////////////////////////////
  8004. /// @struct             SNPS3_FT_STAT
  8005. ///     @brief          Contains file stat notification data.
  8006. //////////////////////////////////////////////////////////////////////////////
  8007.  
  8008. struct SNPS3_FT_STAT
  8009. {
  8010.         UINT32 st_mode;
  8011.         INT32 st_uid;
  8012.         INT32 st_gid;
  8013.         __time64_t st_atime;
  8014.         __time64_t st_mtime;
  8015.         __time64_t st_ctime;
  8016.         UINT64 st_size;
  8017.         UINT64 st_block_size;
  8018. };
  8019.  
  8020. //////////////////////////////////////////////////////////////////////////////
  8021. /// @struct             SNPS3_FT_PROCESS_INFO
  8022. ///     @brief          Contains file process notification data.
  8023. //////////////////////////////////////////////////////////////////////////////
  8024.  
  8025. struct SNPS3_FT_PROCESS_INFO
  8026. {
  8027.         UINT64 ulVFSID;
  8028.         UINT64 ulFD;
  8029. };
  8030.  
  8031. //////////////////////////////////////////////////////////////////////////////
  8032. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_8
  8033. /// @brief              Contains file trace notification data for type 8 log entries.
  8034. ///                             If ulPathLength is greater than zero, path is a UTF-8 null-terminated string.
  8035. //////////////////////////////////////////////////////////////////////////////
  8036.  
  8037. struct SNPS3_FILE_TRACE_LOG_TYPE_8
  8038. {
  8039.         SNPS3_FT_PROCESS_INFO ProcessInfo;
  8040.         UINT32 ulArg1;
  8041.         UINT32 ulArg2;
  8042.         UINT32 ulArg3;
  8043.         UINT32 ulArg4;
  8044.         UINT32 ulVArgLength;
  8045.         UINT32 ulPathLength;
  8046.         //  BYTE arrVArg[];
  8047.         //      char szPath[];
  8048. };
  8049.  
  8050. // @name <FileTraceLogsType8>
  8051. //@{
  8052. //! Type 8 file trace log type.
  8053. typedef SNPS3_FILE_TRACE_LOG_TYPE_8 SNPS3_FT_LOG_OPEN;
  8054. typedef SNPS3_FILE_TRACE_LOG_TYPE_8 SNPS3_FT_LOG_WIDGET_OPEN;
  8055. //@}
  8056.  
  8057. //////////////////////////////////////////////////////////////////////////////
  8058. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_9
  8059. /// @brief              Contains file trace notification data for type 9 log entries.
  8060. //////////////////////////////////////////////////////////////////////////////
  8061.  
  8062. struct SNPS3_FILE_TRACE_LOG_TYPE_9
  8063. {
  8064.         SNPS3_FT_PROCESS_INFO ProcessInfo;
  8065. };
  8066.  
  8067. // @name <FileTraceLogsType9>
  8068. //@{
  8069. //! Type 9 file trace log type.
  8070. typedef SNPS3_FILE_TRACE_LOG_TYPE_9 SNPS3_FT_LOG_CLOSE;
  8071. typedef SNPS3_FILE_TRACE_LOG_TYPE_9 SNPS3_FT_LOG_CLOSEDIR;
  8072. typedef SNPS3_FILE_TRACE_LOG_TYPE_9 SNPS3_FT_LOG_FSYNC;
  8073. typedef SNPS3_FILE_TRACE_LOG_TYPE_9 SNPS3_FT_LOG_READDIR;
  8074. typedef SNPS3_FILE_TRACE_LOG_TYPE_9 SNPS3_FT_LOG_FSTAT;
  8075. typedef SNPS3_FILE_TRACE_LOG_TYPE_9 SNPS3_FT_LOG_FGET_BLOCK_SIZE;
  8076. //@}
  8077.  
  8078. //////////////////////////////////////////////////////////////////////////////
  8079. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_10
  8080. /// @brief              Contains file trace notification data for type 10 log entries.
  8081. //////////////////////////////////////////////////////////////////////////////
  8082.  
  8083. struct SNPS3_FILE_TRACE_LOG_TYPE_10
  8084. {
  8085.         SNPS3_FT_PROCESS_INFO ProcessInfo;
  8086.         UINT32 ulSize;
  8087.         UINT64 ulAddress;
  8088.         UINT32 ulTxSize;
  8089. };
  8090.  
  8091. // @name <FileTraceLogsType10>
  8092. //@{
  8093. //! Type 10 file trace log type.
  8094. typedef SNPS3_FILE_TRACE_LOG_TYPE_10 SNPS3_FT_LOG_READ;
  8095. typedef SNPS3_FILE_TRACE_LOG_TYPE_10 SNPS3_FT_LOG_WRITE;
  8096. typedef SNPS3_FILE_TRACE_LOG_TYPE_10 SNPS3_FT_LOG_GET_DIR_ENTRIES;
  8097. //@}
  8098.  
  8099. //////////////////////////////////////////////////////////////////////////////
  8100. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_11
  8101. /// @brief              Contains file trace notification data for type 11 log entries.
  8102. //////////////////////////////////////////////////////////////////////////////
  8103.  
  8104. struct SNPS3_FILE_TRACE_LOG_TYPE_11
  8105. {
  8106.         SNPS3_FT_PROCESS_INFO ProcessInfo;
  8107.         UINT32 ulSize;
  8108.         UINT64 ulAddress;
  8109.         UINT64 ulOffset;
  8110.         UINT32 ulTxSize;
  8111. };
  8112.  
  8113. // @name <FileTraceLogsType11>
  8114. //@{
  8115. //! Type 11 file trace log type.
  8116. typedef SNPS3_FILE_TRACE_LOG_TYPE_11 SNPS3_FT_LOG_READ_OFFSET;
  8117. typedef SNPS3_FILE_TRACE_LOG_TYPE_11 SNPS3_FT_LOG_WRITE_OFFSET;
  8118. //@}
  8119.  
  8120. //////////////////////////////////////////////////////////////////////////////
  8121. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_12
  8122. /// @brief              Contains file trace notification data for type 12 log entries.
  8123. //////////////////////////////////////////////////////////////////////////////
  8124.  
  8125. struct SNPS3_FILE_TRACE_LOG_TYPE_12
  8126. {
  8127.         SNPS3_FT_PROCESS_INFO ProcessInfo;
  8128.         UINT64 ulTargetSize;
  8129. };
  8130.  
  8131. // @name <FileTraceLogsType12>
  8132. //@{
  8133. //! Type 12 file trace log type.
  8134. typedef SNPS3_FILE_TRACE_LOG_TYPE_12 SNPS3_FT_LOG_FTRUNCATE;
  8135. typedef SNPS3_FILE_TRACE_LOG_TYPE_12 SNPS3_FT_LOG_FTRUNCATE_NO_ALLOC;
  8136. //@}
  8137.  
  8138. //////////////////////////////////////////////////////////////////////////////
  8139. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_13
  8140. /// @brief              Contains file trace notification data for type 13 log entries.
  8141. //////////////////////////////////////////////////////////////////////////////
  8142.  
  8143. struct SNPS3_FILE_TRACE_LOG_TYPE_13
  8144. {
  8145.         SNPS3_FT_PROCESS_INFO ProcessInfo;
  8146.         UINT32 ulSize;
  8147.         UINT64 ulOffset;
  8148.         UINT64 ulCurPos;
  8149. };
  8150.  
  8151. // @name <FileTraceLogsType13>
  8152. //@{
  8153. //! Type 13 file trace log type.
  8154. typedef SNPS3_FILE_TRACE_LOG_TYPE_13 SNPS3_FT_LOG_LSEEK;
  8155. //@}
  8156.  
  8157. //////////////////////////////////////////////////////////////////////////////
  8158. /// @struct             SNPS3_FILE_TRACE_LOG_TYPE_14
  8159. /// @brief              Contains file trace notification data for type 14 log entries.
  8160. //////////////////////////////////////////////////////////////////////////////
  8161.  
  8162. struct SNPS3_FILE_TRACE_LOG_TYPE_14
  8163. {
  8164.         SNPS3_FT_PROCESS_INFO ProcessInfo;
  8165.         UINT32 ulMaxSize;
  8166.         UINT32 ulPage;
  8167.         UINT32 ulContainerID;
  8168. };
  8169.  
  8170. // @name <FileTraceLogsType14>
  8171. //@{
  8172. //! Type 14 file trace log type.
  8173. typedef SNPS3_FILE_TRACE_LOG_TYPE_14 SNPS3_FT_LOG_SET_IO_BUFFER;
  8174. //@}
  8175.  
  8176. /////////////////////////////////////////////////////////////////////////////////
  8177. ///
  8178. /// @brief              Transfer an image file to the target's BD emulator.
  8179. ///
  8180. /// @param              hTarget                                 Handle to target.
  8181. /// @param              pszSourceFileName               Disk image path. UTF-8 null-terminated string.
  8182. /// @param              pszDestinationDevice    Destination BD emulator device  ("/dev_bdemu/0" .. "/dev_bdemu/3")
  8183. /// @param              puTransferId    Pointer to a variable which receives the transfer id of the image (see SNPS3WaitForFileTransfer)
  8184. ///
  8185. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 4.1.0 - latest version.\n
  8186. ///                             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 4.1.0 - latest version.\n
  8187. ///                             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 4.1.0 - latest version.
  8188. ///        
  8189. /// @details Monitor FTP,and TARGET events (see SNPS3RegisterFTPEventHandler(), SNPS3RegisterTargetEventHandler and SN_TGT_BD_ISOTRANSFER_FINISHED for more information).
  8190. ///
  8191. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8192. ///             SN_S_OK - Successfully formatted HDD.\n
  8193. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8194. ///             SN_E_TARGET_IS_POWERED_OFF - Target is powered off. Power on the target first.\n
  8195. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  8196. ///                             SN_E_NOT_SUPPORTED_IN_SDK_VERSION - The system software does not support the operation. (Upgrade may be necessary)
  8197. ///             SN_E_BAD_PARAM - pszSourceFileName, or pszDestinationDevice is NULL or invalid\n
  8198. ///             SN_E_COMMS_ERR - Error communicating with target.
  8199. ///
  8200. //////////////////////////////////////////////////////////////////////////////
  8201.  
  8202. SNAPI SNRESULT SNPS3BDTransferImage(HTARGET hTarget, const char* pszSourceFileName, const char* pszDestinationDevice, UINT32* puTransferId);
  8203.  
  8204. /////////////////////////////////////////////////////////////////////////////////
  8205. ///
  8206. /// @brief              Inserts the specified disc image into the BD emulator
  8207. ///
  8208. /// @param              hTarget                 Handle to target.
  8209. /// @param              pszDeviceName   BD emulator device ("/dev_bdemu/0" .. "/dev_bdemu/3")
  8210. ///
  8211. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 4.1.0 - latest version.\n
  8212. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 4.1.0 - latest version.\n
  8213. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 4.1.0 - latest version.
  8214. ///
  8215. /// @details    It is possible to monitor TARGET events to detect changes made by other clients using SN_TGT_BD_MOUNTED.
  8216. ///
  8217. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8218. ///             SN_S_OK - Successfully formatted HDD.\n
  8219. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8220. ///             SN_E_TARGET_IS_POWERED_OFF - Target is powered off. Power on the target first.\n
  8221. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  8222. ///                             SN_E_NOT_SUPPORTED_IN_SDK_VERSION - The system software does not support the operation. (Upgrade may be necessary)
  8223. ///             SN_E_BAD_PARAM - pszDeviceName is NULL or invalid\n
  8224. ///             SN_E_COMMS_ERR - Error communicating with target.
  8225. ///
  8226. //////////////////////////////////////////////////////////////////////////////
  8227.  
  8228. SNAPI SNRESULT SNPS3BDInsert(HTARGET hTarget, const char* pszDeviceName);
  8229.  
  8230. /////////////////////////////////////////////////////////////////////////////////
  8231. ///
  8232. /// @brief              Ejects the current disc image
  8233. ///
  8234. /// @param              hTarget                 Handle to target.
  8235. /// @param              pszDeviceName   BD emulator device ("/dev_bdemu")
  8236. ///
  8237. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 4.1.0 - latest version.\n
  8238. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 4.1.0 - latest version.\n
  8239. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 4.1.0 - latest version.
  8240. ///
  8241. /// @details    It is possible to monitor TARGET events to detect changes made by other clients using SN_TGT_BD_UNMOUNTED.
  8242. ///
  8243. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8244. ///             SN_S_OK - Successfully formatted HDD.\n
  8245. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8246. ///             SN_E_TARGET_IS_POWERED_OFF - Target is powered off. Power on the target first.\n
  8247. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  8248. ///             SN_E_BAD_PARAM - pszDeviceName is NULL or invalid\n
  8249. ///                             SN_E_NOT_SUPPORTED_IN_SDK_VERSION - The system software does not support the operation. (Upgrade may be necessary)
  8250. ///             SN_E_COMMS_ERR - Error communicating with target.
  8251. ///
  8252. //////////////////////////////////////////////////////////////////////////////
  8253.  
  8254.  
  8255. SNAPI SNRESULT SNPS3BDEject(HTARGET hTarget, const char* pszDeviceName);
  8256.  
  8257. /////////////////////////////////////////////////////////////////////////////////
  8258. ///
  8259. /// @brief              Formats the BD emulator's storage device
  8260. ///
  8261. /// @param              hTarget                 Handle to target.
  8262. /// @param              uFormatMode             Format mode (SNPS3_BD_FORMAT_TYPE_NORMAL or SNPS3_BD_FORMAT_QUICK)
  8263. /// @param              pszDeviceName   BD emulator device ("/dev_bdemu")
  8264. ///
  8265. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 4.1.0 - latest version.\n
  8266. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 4.1.0 - latest version.\n
  8267. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 4.1.0 - latest version.
  8268. ///
  8269. /// @details    Monitor TARGET events (see SNPS3RegisterTargetEventHandler and SN_TGT_BD_FORMAT_FINISHED for more information).
  8270. ///
  8271. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8272. ///             SN_S_OK - Successfully formatted HDD.\n
  8273. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8274. ///             SN_E_TARGET_IS_POWERED_OFF - Target is powered off. Power on the target first.\n
  8275. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  8276. ///                             SN_E_NOT_SUPPORTED_IN_SDK_VERSION - The system software does not support the operation. (Upgrade may be necessary)
  8277. ///             SN_E_BAD_PARAM - pszDeviceName is NULL or invalid\n
  8278. ///             SN_E_COMMS_ERR - Error communicating with target.
  8279. ///
  8280. //////////////////////////////////////////////////////////////////////////////
  8281.  
  8282. SNAPI SNRESULT SNPS3BDFormat(HTARGET hTarget, const char* pszDeviceName, UINT32 uFormatMode);
  8283.  
  8284. // @name <BDFormatMode>
  8285. //@{
  8286. const UINT32 SNPS3_BD_FORMAT_TYPE_NORMAL = 0;
  8287. const UINT32 SNPS3_BD_FORMAT_TYPE_QUICK = 1;
  8288. //@}
  8289.  
  8290. //////////////////////////////////////////////////////////////////////////////
  8291. /// @struct             SNPS3_BD_QUERY_DATA
  8292. /// @brief              Contains information of a BD emulator device
  8293. //////////////////////////////////////////////////////////////////////////////
  8294.  
  8295. struct SNPS3_BD_QUERY_DATA
  8296. {
  8297.         UINT32 bdemu_data_size;
  8298.         /// 4
  8299.         UCHAR bdemu_total_entry;
  8300.         /// [0-3] Index of Mounted device
  8301.         UCHAR bdemu_selected_index;
  8302.         /// [0-3] Index of the Device the data belongs to
  8303.         UCHAR image_index;
  8304.         /// 0:INVAL, 1:BDSL, 2:BDDL, 3:DVDSL, 4:DVDDL
  8305.         UCHAR image_type;
  8306.         /// Null terminated UTF-8 string
  8307.         char image_file_name[128];                    
  8308.         UINT64 image_file_size;
  8309.         /// Null terminated string
  8310.         char image_product_code[32];
  8311.         /// Null terminated string
  8312.         char image_producer[32];
  8313.         /// Null terminated string
  8314.         char image_author[32];
  8315.         /// YYYYMMDD (Not null terminated!)
  8316.         char image_date[8];
  8317.         /// Layer 0 information
  8318.         UINT32 image_sector_layer0;
  8319.         /// Layer 1 information (0 for XXXSL discs)
  8320.         UINT32 image_sector_layer1;
  8321.         /// Null terminated string
  8322.         char image_memorandum[32];
  8323. };
  8324.  
  8325. /////////////////////////////////////////////////////////////////////////////////
  8326. ///
  8327. /// @brief              Get information from the  BD emulator
  8328. ///
  8329. /// @param              hTarget                 Handle to target.
  8330. /// @param              pszDeviceName   BD emulator device (/dev_bdemu/0 etc...)
  8331. ///
  8332. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 4.1.0 - latest version.\n
  8333. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 4.1.0 - latest version.\n
  8334. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 4.1.0 - latest version.
  8335. ///
  8336. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8337. ///             SN_S_OK - Successful query.\n
  8338. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8339. ///             SN_E_TARGET_IS_POWERED_OFF - Target is powered off. Power on the target first.\n
  8340. ///             SN_E_BAD_TARGET - hTarget was invalid.\n
  8341. ///                             SN_E_NOT_SUPPORTED_IN_SDK_VERSION - The system software does not support the operation. (Upgrade may be necessary)
  8342. ///             SN_E_BAD_PARAM - pszDeviceName is NULL or invalid\n
  8343. ///             SN_E_COMMS_ERR - Error communicating with target.
  8344. ///
  8345. //////////////////////////////////////////////////////////////////////////////
  8346.  
  8347. SNAPI SNRESULT SNPS3BDQuery(HTARGET hTarget, const char* pszDeviceName, SNPS3_BD_QUERY_DATA * pData);
  8348.  
  8349. #pragma pack(pop)
  8350. #pragma warning(default : 4200)         // nonstandard extension used : zero-sized array in struct/union
  8351.  
  8352. /////////////////////////////////////////////////////////////////////////////////
  8353. ///
  8354. /// @brief              Search for targets in the specified IP range
  8355. ///
  8356. /// @param              szIpAddressFrom Start of the IP address range
  8357. /// @param              szIpAddressTo   End of IP address range
  8358. /// @param              pfnCallback             Pointer to a callback function which receives search results. Callback has to be thread safe. End of search is indicated by passing NULL in szName.
  8359. /// @param              pUserData               Any user specified data to be used in the callback function
  8360. /// @param              nPort                   Port to scan, automatic (-1) is recommended
  8361. ///
  8362. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  8363. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  8364. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  8365. ///
  8366. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8367. ///             SN_S_OK - Search started successfully\n
  8368. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8369. ///             SN_E_BAD_PARAM - szIpAddressFrom or szIpAddressTo is NULL or invalid\n
  8370. ///             SN_E_BUSY - Search is already in progress.\n
  8371. ///
  8372. //////////////////////////////////////////////////////////////////////////////
  8373. SNAPI   SNRESULT SNPS3SearchForTargets(const char* szIpAddressFrom, const char* szIpAddressTo, TMAPI_SearchTargetsCallback pfnCallback, void* pUserData, int nPort);
  8374.  
  8375. /////////////////////////////////////////////////////////////////////////////////
  8376. ///
  8377. /// @brief              Stop searching for targets.
  8378. ///                             Calling this function during a search causes NULL to be passed as the szName parameter to the user callback
  8379. ///                             (see \link TMAPI_SearchTargetsCallback TMAPI_SearchTargetsCallback \endlink), signifying that the search has ended.
  8380. ///
  8381. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  8382. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  8383. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  8384. ///
  8385. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8386. ///             SN_S_OK - Success\n
  8387. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8388. ///
  8389. //////////////////////////////////////////////////////////////////////////////
  8390. SNAPI   SNRESULT SNPS3StopSearchForTargets();
  8391.  
  8392. /////////////////////////////////////////////////////////////////////////////////
  8393. ///
  8394. /// @brief              Returns SN_E_BUSY if a search is already in progress
  8395. ///
  8396. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.7.0 - latest version.\n
  8397. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.7.0 - latest version.\n
  8398. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.7.0 - latest version.
  8399. ///
  8400. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8401. ///             SN_S_OK - No search is in progress\n
  8402. ///             SN_E_BUSY - Search is in progress\n
  8403. ///
  8404. //////////////////////////////////////////////////////////////////////////////
  8405. SNAPI   SNRESULT SNPS3IsScanning();
  8406.  
  8407.  
  8408. //////////////////////////////////////////////////////////////////////////////
  8409. /// @enum       SNPS3_DISPLAYSETTINGS_MONITORTYPE
  8410. ///     @brief  Monitor types for SetDisplaySettings
  8411. //////////////////////////////////////////////////////////////////////////////
  8412. enum SNPS3_DISPLAYSETTINGS_MONITORTYPE
  8413. {
  8414.         MONITORTYPE_480i = 1,
  8415.         MONITORTYPE_576i,
  8416.         MONITORTYPE_480p,
  8417.         MONITORTYPE_576p,
  8418.         MONITORTYPE_1080i_480p,
  8419.         MONITORTYPE_1080i_576p,
  8420.         MONITORTYPE_1080i_720p_480p,
  8421.         MONITORTYPE_1080i_720p_576p,
  8422.         MONITORTYPE_1080p_720p_480p,
  8423.         MONITORTYPE_1080p_720p_576p,
  8424.         MONITORTYPE_WXGA,
  8425.         MONITORTYPE_SXGA_WXGA,
  8426.         MONITORTYPE_WUXGA_SXGA_WXGA,
  8427.         MONITORTYPE_3D_1080p_720p_480p,
  8428.         MONITORTYPE_3D_1080p_720p_576p
  8429. };
  8430.  
  8431. //////////////////////////////////////////////////////////////////////////////
  8432. /// @enum       SNPS3_DISPLAYSETTINGS_STARTUPRESOLUTION
  8433. ///     @brief  Startup resolutions for SetDisplaySettings
  8434. //////////////////////////////////////////////////////////////////////////////
  8435. enum SNPS3_DISPLAYSETTINGS_STARTUPRESOLUTION
  8436. {
  8437.         RES_1080 = 1,
  8438.         RES_720 = 2,
  8439.         RES_480 = 4,
  8440.         RES_576,
  8441.         RES_1600x1080,
  8442.         RES_1440x1080,
  8443.         RES_1280x1080,
  8444.         RES_960x1080
  8445. };
  8446.  
  8447. //////////////////////////////////////////////////////////////////////////////
  8448. /// @enum       SNPS3_DISPLAYSETTINGS_CONNECTORTYPE
  8449. ///     @brief  Connector types for SetDisplaySettings
  8450. //////////////////////////////////////////////////////////////////////////////
  8451. enum SNPS3_DISPLAYSETTINGS_CONNECTORTYPE
  8452. {
  8453.         CONNECTOR_HDMI = 1,
  8454.         CONNECTOR_COMPONENT_D,
  8455.         CONNECTOR_COMPOSITE_SVIDEO,
  8456.         CONNECTOR_AVMULTI_SCART,
  8457.         CONNECTOR_AVMULTI_SCART_RGB,
  8458.         CONNECTOR_VGA_DSUB
  8459. };
  8460.  
  8461. /////////////////////////////////////////////////////////////////////////////////
  8462. ///
  8463. /// @brief              Helper function to check the display settings validity
  8464. ///
  8465. /// @param              uMonitorType    Monitor type (see \link PS3TMAPI::SNPS3_DISPLAYSETTINGS_MONITORTYPE\endlink).
  8466. /// @param              uStartupResolution      Startup resolution (see \link PS3TMAPI::SNPS3_DISPLAYSETTINGS_STARTUPRESOLUTION\endlink).
  8467. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8468. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8469. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8470. ///
  8471. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8472. ///             SN_S_OK - Success\n
  8473. ///                             SN_E_BAD_PARAM - Problem with the provided settings  
  8474. //////////////////////////////////////////////////////////////////////////////
  8475. SNAPI SNRESULT SNPS3IsValidResolution(UINT32 uMonitorType, UINT32 uStartupResolution);
  8476.  
  8477. /////////////////////////////////////////////////////////////////////////////////
  8478. ///
  8479. /// @brief              Set the display settings of the target
  8480. ///
  8481. /// @param              hTarget Target
  8482. /// @param              szExecutable    Path to a custom setmonitor.self. Can be NULL or empty, that case the builtin will be used
  8483. /// @param              uMonitorType    Monitor type (see \link PS3TMAPI::SNPS3_DISPLAYSETTINGS_MONITORTYPE\endlink).
  8484. /// @param              uConnectorType  Connector type (see \link PS3TMAPI::SNPS3_DISPLAYSETTINGS_CONNECTORTYPE\endlink).
  8485. /// @param              uStartupResolution      Startup resolution (see \link PS3TMAPI::SNPS3_DISPLAYSETTINGS_STARTUPRESOLUTION\endlink).
  8486. /// @param              bHDCP   High-bandwidth Digital Content Protection
  8487. /// @param              bResetAfter     Reset the target after the command
  8488. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8489. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8490. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8491. ///
  8492. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8493. ///             SN_S_OK - Success\n
  8494. ///             SN_E_BUSY - Target is busy\n
  8495. ///                             SN_E_BAD_PARAM - Problem with the provided settings  
  8496. //////////////////////////////////////////////////////////////////////////////
  8497. SNAPI SNRESULT SNPS3SetDisplaySettings(HTARGET hTarget, const char* szExecutable, UINT32 uMonitorType, UINT32 uConnectorType, UINT32 uStartupResolution, bool bHDCP, bool bResetAfter);
  8498.  
  8499. /////////////////////////////////////////////////////////////////////////////////
  8500. ///
  8501. /// @brief              Map the Playstation3 file system
  8502. ///
  8503. /// @param              driveLetter     The drive letter used to map the Playstation3 file system.
  8504. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8505. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8506. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8507. ///
  8508. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8509. ///             SN_S_OK - Success\n
  8510. ///                             SN_S_NO_ACTION - File System is already mapped to the same drive letter
  8511. //////////////////////////////////////////////////////////////////////////////
  8512. SNAPI SNRESULT SNPS3MapFileSystem(char driveLetter);
  8513.  
  8514. /////////////////////////////////////////////////////////////////////////////////
  8515. ///
  8516. /// @brief              Unmap the Playstation3 file system
  8517. ///
  8518. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8519. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8520. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8521. ///
  8522. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8523. ///             SN_S_OK - Success\n
  8524. ///                             SN_S_NO_ACTION - FileSystem was not mapped
  8525. //////////////////////////////////////////////////////////////////////////////
  8526. SNAPI SNRESULT SNPS3UnmapFileSystem();
  8527.  
  8528. /////////////////////////////////////////////////////////////////////////////////
  8529. ///
  8530. /// @brief              Return the Playstation3 file system drive letter
  8531. ///
  8532. /// @param              driveLetter     The drive letter the Playstation3 file system is mapped to.
  8533. ///                             Value is 0 if the file system is not mapped.
  8534. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8535. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8536. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8537. ///
  8538. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8539. ///             SN_S_OK - Success\n
  8540. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8541. //////////////////////////////////////////////////////////////////////////////
  8542. SNAPI SNRESULT SNPS3GetFileSystem(char* driveLetter);
  8543.  
  8544. /////////////////////////////////////////////////////////////////////////////////
  8545. ///
  8546. /// @brief              Import the target settings from a file (Server settings only)
  8547. ///
  8548. /// @details    Imports server settings only. Reset parameters etc are not included
  8549. ///
  8550. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8551. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8552. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8553. ///
  8554. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8555. ///             SN_S_OK - Success\n
  8556. ///                             SN_E_BAD_PARAM - FileName is NULL or empty
  8557. ///                             SN_E_FILE_ERROR - Failed to open or load the file
  8558. //////////////////////////////////////////////////////////////////////////////
  8559. SNAPI SNRESULT SNPS3ImportTargetSettings(HTARGET hTarget, const char* szFileName);
  8560.  
  8561. /////////////////////////////////////////////////////////////////////////////////
  8562. ///
  8563. /// @brief              Export the target settings to a file (Server settings only)
  8564. ///
  8565. /// @details    Exports server settings only. Reset parameters etc are not included
  8566. ///
  8567. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8568. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8569. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8570. ///
  8571. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8572. ///             SN_S_OK - Success\n
  8573. ///                             SN_E_BAD_PARAM - FileName is NULL or empty  
  8574. ///                             SN_E_FILE_ERROR - Failed to open or save the file
  8575. //////////////////////////////////////////////////////////////////////////////
  8576. SNAPI SNRESULT SNPS3ExportTargetSettings(HTARGET hTarget, const char* szFileName);
  8577.  
  8578. /////////////////////////////////////////////////////////////////////////////////
  8579. ///
  8580. /// @brief              Extract data from param.sfo file
  8581. ///
  8582. /// @details    Extracts game parameter from a param.sfo file. Supported keys are
  8583. ///             "TITLE_ID", "TITLE", "VERSION" and "CATEGORY"
  8584. ///
  8585. ///  @param             szFileName              Path to param.sfo file.
  8586. ///  @param             szKey                   Type of data to read ("TITLE_ID", "TITLE", ...)
  8587. ///  @param             puBufferSize    [in] Maximum number of bytes buffer can hold.\n
  8588. ///                             [out] Number of bytes for which space is required,
  8589. ///                             or if buffer is big enough, number written to buffer.
  8590. ///  @param             pBuffer                 Pointer to buffer where data will be written.
  8591. ///
  8592. /// @note               Reference tool (DECR-1000 / DECR-1000A)                                                 : SDK 3.4.0 - latest version.\n
  8593. ///             Debugging station (DECHA00J / DECHA00A / DECHJ00J / DECHJ00A)   : SDK 3.4.0 - latest version.\n
  8594. ///             Reference tool (DECR-1400J / DECR-1400A)                                                : SDK 3.4.0 - latest version.
  8595. ///
  8596. ///      @return        \link ApiBase::SNRESULT SNRESULT\endlink:\n
  8597. ///             SN_S_OK - Success\n
  8598. ///             SN_E_DLL_NOT_INITIALISED - Comms not initialised. Call SNPS3InitTargetComms() first.\n
  8599. ///                             SN_E_BAD_PARAM - szFileName/szKey is NULL or empty  
  8600. ///             SN_E_OUT_OF_MEM - Number of bytes in bufferSize is too small.\n
  8601. ///                             SN_E_FILE_ERROR - Failed to retreive the data, use SNPS3GetErrorQualifier to get error details
  8602. ///                                                             - Qualifier ENOEXEC means the file is not a valid param.sfo file
  8603. ///                                                             - Qualifier EILSEQ means the key was not found inside the param.sfo file
  8604. //////////////////////////////////////////////////////////////////////////////
  8605. SNAPI SNRESULT SNPS3ExtractGameParameter(const char* szFileName, const char* szKey, UINT32* puBufferSize, BYTE* pBuffer);
  8606.  
  8607. #ifdef __cplusplus
  8608. }
  8609. #endif
  8610.  
  8611. #endif // #ifndef PS3TMAPI_H_INC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement