fs_user.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #include "common/common.h"
  5. #include "common/file_util.h"
  6. #include "common/scope_exit.h"
  7. #include "common/string_util.h"
  8. #include "core/hle/result.h"
  9. #include "core/hle/service/fs/archive.h"
  10. #include "core/hle/service/fs/fs_user.h"
  11. #include "core/settings.h"
  12. ////////////////////////////////////////////////////////////////////////////////////////////////////
  13. // Namespace FS_User
  14. namespace Service {
  15. namespace FS {
  16. static ArchiveHandle MakeArchiveHandle(u32 low_word, u32 high_word) {
  17. return (u64)low_word | ((u64)high_word << 32);
  18. }
  19. static void Initialize(Service::Interface* self) {
  20. u32* cmd_buff = Kernel::GetCommandBuffer();
  21. // TODO(Link Mauve): check the behavior when cmd_buff[1] isn't 32, as per
  22. // http://3dbrew.org/wiki/FS:Initialize#Request
  23. cmd_buff[1] = RESULT_SUCCESS.raw;
  24. LOG_DEBUG(Service_FS, "called");
  25. }
  26. /**
  27. * FS_User::OpenFile service function
  28. * Inputs:
  29. * 1 : Transaction
  30. * 2 : Archive handle lower word
  31. * 3 : Archive handle upper word
  32. * 4 : Low path type
  33. * 5 : Low path size
  34. * 6 : Open flags
  35. * 7 : Attributes
  36. * 8 : (LowPathSize << 14) | 2
  37. * 9 : Low path data pointer
  38. * Outputs:
  39. * 1 : Result of function, 0 on success, otherwise error code
  40. * 3 : File handle
  41. */
  42. static void OpenFile(Service::Interface* self) {
  43. u32* cmd_buff = Kernel::GetCommandBuffer();
  44. ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
  45. auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
  46. u32 filename_size = cmd_buff[5];
  47. FileSys::Mode mode; mode.hex = cmd_buff[6];
  48. u32 attributes = cmd_buff[7]; // TODO(Link Mauve): do something with those attributes.
  49. u32 filename_ptr = cmd_buff[9];
  50. FileSys::Path file_path(filename_type, filename_size, filename_ptr);
  51. LOG_DEBUG(Service_FS, "path=%s, mode=%d attrs=%u", file_path.DebugStr().c_str(), mode.hex, attributes);
  52. ResultVal<Handle> handle = OpenFileFromArchive(archive_handle, file_path, mode);
  53. cmd_buff[1] = handle.Code().raw;
  54. if (handle.Succeeded()) {
  55. cmd_buff[3] = *handle;
  56. } else {
  57. cmd_buff[3] = 0;
  58. LOG_ERROR(Service_FS, "failed to get a handle for file %s", file_path.DebugStr().c_str());
  59. }
  60. }
  61. /**
  62. * FS_User::OpenFileDirectly service function
  63. * Inputs:
  64. * 1 : Transaction
  65. * 2 : Archive ID
  66. * 3 : Archive low path type
  67. * 4 : Archive low path size
  68. * 5 : File low path type
  69. * 6 : File low path size
  70. * 7 : Flags
  71. * 8 : Attributes
  72. * 9 : (ArchiveLowPathSize << 14) | 0x802
  73. * 10 : Archive low path
  74. * 11 : (FileLowPathSize << 14) | 2
  75. * 12 : File low path
  76. * Outputs:
  77. * 1 : Result of function, 0 on success, otherwise error code
  78. * 3 : File handle
  79. */
  80. static void OpenFileDirectly(Service::Interface* self) {
  81. u32* cmd_buff = Kernel::GetCommandBuffer();
  82. auto archive_id = static_cast<FS::ArchiveIdCode>(cmd_buff[2]);
  83. auto archivename_type = static_cast<FileSys::LowPathType>(cmd_buff[3]);
  84. u32 archivename_size = cmd_buff[4];
  85. auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[5]);
  86. u32 filename_size = cmd_buff[6];
  87. FileSys::Mode mode; mode.hex = cmd_buff[7];
  88. u32 attributes = cmd_buff[8]; // TODO(Link Mauve): do something with those attributes.
  89. u32 archivename_ptr = cmd_buff[10];
  90. u32 filename_ptr = cmd_buff[12];
  91. FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr);
  92. FileSys::Path file_path(filename_type, filename_size, filename_ptr);
  93. LOG_DEBUG(Service_FS, "archive_path=%s file_path=%s, mode=%u attributes=%d",
  94. archive_path.DebugStr().c_str(), file_path.DebugStr().c_str(), mode.hex, attributes);
  95. if (archive_path.GetType() != FileSys::Empty) {
  96. LOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported");
  97. cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw;
  98. cmd_buff[3] = 0;
  99. return;
  100. }
  101. ResultVal<ArchiveHandle> archive_handle = OpenArchive(archive_id);
  102. if (archive_handle.Failed()) {
  103. LOG_ERROR(Service_FS, "failed to get a handle for archive");
  104. cmd_buff[1] = archive_handle.Code().raw;
  105. cmd_buff[3] = 0;
  106. return;
  107. }
  108. SCOPE_EXIT({ CloseArchive(*archive_handle); });
  109. ResultVal<Handle> handle = OpenFileFromArchive(*archive_handle, file_path, mode);
  110. cmd_buff[1] = handle.Code().raw;
  111. if (handle.Succeeded()) {
  112. cmd_buff[3] = *handle;
  113. } else {
  114. cmd_buff[3] = 0;
  115. LOG_ERROR(Service_FS, "failed to get a handle for file %s", file_path.DebugStr().c_str());
  116. }
  117. }
  118. /*
  119. * FS_User::DeleteFile service function
  120. * Inputs:
  121. * 2 : Archive handle lower word
  122. * 3 : Archive handle upper word
  123. * 4 : File path string type
  124. * 5 : File path string size
  125. * 7 : File path string data
  126. * Outputs:
  127. * 1 : Result of function, 0 on success, otherwise error code
  128. */
  129. static void DeleteFile(Service::Interface* self) {
  130. u32* cmd_buff = Kernel::GetCommandBuffer();
  131. ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
  132. auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
  133. u32 filename_size = cmd_buff[5];
  134. u32 filename_ptr = cmd_buff[7];
  135. FileSys::Path file_path(filename_type, filename_size, filename_ptr);
  136. LOG_DEBUG(Service_FS, "type=%d size=%d data=%s",
  137. filename_type, filename_size, file_path.DebugStr().c_str());
  138. cmd_buff[1] = DeleteFileFromArchive(archive_handle, file_path).raw;
  139. }
  140. /*
  141. * FS_User::RenameFile service function
  142. * Inputs:
  143. * 2 : Source archive handle lower word
  144. * 3 : Source archive handle upper word
  145. * 4 : Source file path type
  146. * 5 : Source file path size
  147. * 6 : Dest archive handle lower word
  148. * 7 : Dest archive handle upper word
  149. * 8 : Dest file path type
  150. * 9 : Dest file path size
  151. * 11: Source file path string data
  152. * 13: Dest file path string
  153. * Outputs:
  154. * 1 : Result of function, 0 on success, otherwise error code
  155. */
  156. static void RenameFile(Service::Interface* self) {
  157. u32* cmd_buff = Kernel::GetCommandBuffer();
  158. ArchiveHandle src_archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
  159. auto src_filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
  160. u32 src_filename_size = cmd_buff[5];
  161. ArchiveHandle dest_archive_handle = MakeArchiveHandle(cmd_buff[6], cmd_buff[7]);;
  162. auto dest_filename_type = static_cast<FileSys::LowPathType>(cmd_buff[8]);
  163. u32 dest_filename_size = cmd_buff[9];
  164. u32 src_filename_ptr = cmd_buff[11];
  165. u32 dest_filename_ptr = cmd_buff[13];
  166. FileSys::Path src_file_path(src_filename_type, src_filename_size, src_filename_ptr);
  167. FileSys::Path dest_file_path(dest_filename_type, dest_filename_size, dest_filename_ptr);
  168. LOG_DEBUG(Service_FS, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s",
  169. src_filename_type, src_filename_size, src_file_path.DebugStr().c_str(),
  170. dest_filename_type, dest_filename_size, dest_file_path.DebugStr().c_str());
  171. cmd_buff[1] = RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, dest_file_path).raw;
  172. }
  173. /*
  174. * FS_User::DeleteDirectory service function
  175. * Inputs:
  176. * 2 : Archive handle lower word
  177. * 3 : Archive handle upper word
  178. * 4 : Directory path string type
  179. * 5 : Directory path string size
  180. * 7 : Directory path string data
  181. * Outputs:
  182. * 1 : Result of function, 0 on success, otherwise error code
  183. */
  184. static void DeleteDirectory(Service::Interface* self) {
  185. u32* cmd_buff = Kernel::GetCommandBuffer();
  186. ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
  187. auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
  188. u32 dirname_size = cmd_buff[5];
  189. u32 dirname_ptr = cmd_buff[7];
  190. FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
  191. LOG_DEBUG(Service_FS, "type=%d size=%d data=%s",
  192. dirname_type, dirname_size, dir_path.DebugStr().c_str());
  193. cmd_buff[1] = DeleteDirectoryFromArchive(archive_handle, dir_path).raw;
  194. }
  195. /*
  196. * FS_User::CreateDirectory service function
  197. * Inputs:
  198. * 2 : Archive handle lower word
  199. * 3 : Archive handle upper word
  200. * 4 : Directory path string type
  201. * 5 : Directory path string size
  202. * 8 : Directory path string data
  203. * Outputs:
  204. * 1 : Result of function, 0 on success, otherwise error code
  205. */
  206. static void CreateDirectory(Service::Interface* self) {
  207. u32* cmd_buff = Kernel::GetCommandBuffer();
  208. ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
  209. auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
  210. u32 dirname_size = cmd_buff[5];
  211. u32 dirname_ptr = cmd_buff[8];
  212. FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
  213. LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str());
  214. cmd_buff[1] = CreateDirectoryFromArchive(archive_handle, dir_path).raw;
  215. }
  216. /*
  217. * FS_User::RenameDirectory service function
  218. * Inputs:
  219. * 2 : Source archive handle lower word
  220. * 3 : Source archive handle upper word
  221. * 4 : Source dir path type
  222. * 5 : Source dir path size
  223. * 6 : Dest archive handle lower word
  224. * 7 : Dest archive handle upper word
  225. * 8 : Dest dir path type
  226. * 9 : Dest dir path size
  227. * 11: Source dir path string data
  228. * 13: Dest dir path string
  229. * Outputs:
  230. * 1 : Result of function, 0 on success, otherwise error code
  231. */
  232. static void RenameDirectory(Service::Interface* self) {
  233. u32* cmd_buff = Kernel::GetCommandBuffer();
  234. ArchiveHandle src_archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
  235. auto src_dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
  236. u32 src_dirname_size = cmd_buff[5];
  237. ArchiveHandle dest_archive_handle = MakeArchiveHandle(cmd_buff[6], cmd_buff[7]);
  238. auto dest_dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[8]);
  239. u32 dest_dirname_size = cmd_buff[9];
  240. u32 src_dirname_ptr = cmd_buff[11];
  241. u32 dest_dirname_ptr = cmd_buff[13];
  242. FileSys::Path src_dir_path(src_dirname_type, src_dirname_size, src_dirname_ptr);
  243. FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname_size, dest_dirname_ptr);
  244. LOG_DEBUG(Service_FS, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s",
  245. src_dirname_type, src_dirname_size, src_dir_path.DebugStr().c_str(),
  246. dest_dirname_type, dest_dirname_size, dest_dir_path.DebugStr().c_str());
  247. cmd_buff[1] = RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, dest_archive_handle, dest_dir_path).raw;
  248. }
  249. /**
  250. * FS_User::OpenDirectory service function
  251. * Inputs:
  252. * 1 : Archive handle low word
  253. * 2 : Archive handle high word
  254. * 3 : Low path type
  255. * 4 : Low path size
  256. * 7 : (LowPathSize << 14) | 2
  257. * 8 : Low path data pointer
  258. * Outputs:
  259. * 1 : Result of function, 0 on success, otherwise error code
  260. * 3 : Directory handle
  261. */
  262. static void OpenDirectory(Service::Interface* self) {
  263. u32* cmd_buff = Kernel::GetCommandBuffer();
  264. ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[1], cmd_buff[2]);
  265. auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[3]);
  266. u32 dirname_size = cmd_buff[4];
  267. u32 dirname_ptr = cmd_buff[6];
  268. FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
  269. LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str());
  270. ResultVal<Handle> handle = OpenDirectoryFromArchive(archive_handle, dir_path);
  271. cmd_buff[1] = handle.Code().raw;
  272. if (handle.Succeeded()) {
  273. cmd_buff[3] = *handle;
  274. } else {
  275. LOG_ERROR(Service_FS, "failed to get a handle for directory");
  276. }
  277. }
  278. /**
  279. * FS_User::OpenArchive service function
  280. * Inputs:
  281. * 1 : Archive ID
  282. * 2 : Archive low path type
  283. * 3 : Archive low path size
  284. * 4 : (LowPathSize << 14) | 2
  285. * 5 : Archive low path
  286. * Outputs:
  287. * 1 : Result of function, 0 on success, otherwise error code
  288. * 2 : Archive handle lower word (unused)
  289. * 3 : Archive handle upper word (same as file handle)
  290. */
  291. static void OpenArchive(Service::Interface* self) {
  292. u32* cmd_buff = Kernel::GetCommandBuffer();
  293. auto archive_id = static_cast<FS::ArchiveIdCode>(cmd_buff[1]);
  294. auto archivename_type = static_cast<FileSys::LowPathType>(cmd_buff[2]);
  295. u32 archivename_size = cmd_buff[3];
  296. u32 archivename_ptr = cmd_buff[5];
  297. FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr);
  298. LOG_DEBUG(Service_FS, "archive_path=%s", archive_path.DebugStr().c_str());
  299. if (archive_path.GetType() != FileSys::Empty) {
  300. LOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported");
  301. cmd_buff[1] = UnimplementedFunction(ErrorModule::FS).raw;
  302. return;
  303. }
  304. ResultVal<ArchiveHandle> handle = OpenArchive(archive_id);
  305. cmd_buff[1] = handle.Code().raw;
  306. if (handle.Succeeded()) {
  307. cmd_buff[2] = *handle & 0xFFFFFFFF;
  308. cmd_buff[3] = (*handle >> 32) & 0xFFFFFFFF;
  309. } else {
  310. cmd_buff[2] = cmd_buff[3] = 0;
  311. LOG_ERROR(Service_FS, "failed to get a handle for archive");
  312. }
  313. }
  314. /**
  315. * FS_User::CloseArchive service function
  316. * Inputs:
  317. * 0 : 0x080E0080
  318. * 1 : Archive handle low word
  319. * 2 : Archive handle high word
  320. * Outputs:
  321. * 0 : ??? TODO(yuriks): Verify return header
  322. * 1 : Result of function, 0 on success, otherwise error code
  323. */
  324. static void CloseArchive(Service::Interface* self) {
  325. u32* cmd_buff = Kernel::GetCommandBuffer();
  326. ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[1], cmd_buff[2]);
  327. cmd_buff[1] = CloseArchive(archive_handle).raw;
  328. }
  329. /*
  330. * FS_User::IsSdmcDetected service function
  331. * Outputs:
  332. * 1 : Result of function, 0 on success, otherwise error code
  333. * 2 : Whether the Sdmc could be detected
  334. */
  335. static void IsSdmcDetected(Service::Interface* self) {
  336. u32* cmd_buff = Kernel::GetCommandBuffer();
  337. cmd_buff[1] = 0;
  338. cmd_buff[2] = Settings::values.use_virtual_sd ? 1 : 0;
  339. LOG_DEBUG(Service_FS, "called");
  340. }
  341. /**
  342. * FS_User::FormatSaveData service function
  343. * Inputs:
  344. * Outputs:
  345. * 1 : Result of function, 0 on success, otherwise error code
  346. */
  347. static void FormatSaveData(Service::Interface* self) {
  348. u32* cmd_buff = Kernel::GetCommandBuffer();
  349. LOG_DEBUG(Service_FS, "(STUBBED)");
  350. // TODO(Subv): Find out what the inputs and outputs of this function are
  351. cmd_buff[1] = FormatSaveData().raw;
  352. }
  353. /**
  354. * FS_User::FormatThisUserSaveData service function
  355. * Inputs:
  356. * Outputs:
  357. * 1 : Result of function, 0 on success, otherwise error code
  358. */
  359. static void FormatThisUserSaveData(Service::Interface* self) {
  360. u32* cmd_buff = Kernel::GetCommandBuffer();
  361. LOG_DEBUG(Service_FS, "(STUBBED)");
  362. // TODO(Subv): Find out what the inputs and outputs of this function are
  363. cmd_buff[1] = FormatSaveData().raw;
  364. }
  365. const FSUserInterface::FunctionInfo FunctionTable[] = {
  366. {0x000100C6, nullptr, "Dummy1"},
  367. {0x040100C4, nullptr, "Control"},
  368. {0x08010002, Initialize, "Initialize"},
  369. {0x080201C2, OpenFile, "OpenFile"},
  370. {0x08030204, OpenFileDirectly, "OpenFileDirectly"},
  371. {0x08040142, DeleteFile, "DeleteFile"},
  372. {0x08050244, RenameFile, "RenameFile"},
  373. {0x08060142, DeleteDirectory, "DeleteDirectory"},
  374. {0x08070142, nullptr, "DeleteDirectoryRecursively"},
  375. {0x08080202, nullptr, "CreateFile"},
  376. {0x08090182, CreateDirectory, "CreateDirectory"},
  377. {0x080A0244, RenameDirectory, "RenameDirectory"},
  378. {0x080B0102, OpenDirectory, "OpenDirectory"},
  379. {0x080C00C2, OpenArchive, "OpenArchive"},
  380. {0x080D0144, nullptr, "ControlArchive"},
  381. {0x080E0080, CloseArchive, "CloseArchive"},
  382. {0x080F0180, FormatThisUserSaveData,"FormatThisUserSaveData"},
  383. {0x08100200, nullptr, "CreateSystemSaveData"},
  384. {0x08110040, nullptr, "DeleteSystemSaveData"},
  385. {0x08120080, nullptr, "GetFreeBytes"},
  386. {0x08130000, nullptr, "GetCardType"},
  387. {0x08140000, nullptr, "GetSdmcArchiveResource"},
  388. {0x08150000, nullptr, "GetNandArchiveResource"},
  389. {0x08160000, nullptr, "GetSdmcFatfsErro"},
  390. {0x08170000, IsSdmcDetected, "IsSdmcDetected"},
  391. {0x08180000, nullptr, "IsSdmcWritable"},
  392. {0x08190042, nullptr, "GetSdmcCid"},
  393. {0x081A0042, nullptr, "GetNandCid"},
  394. {0x081B0000, nullptr, "GetSdmcSpeedInfo"},
  395. {0x081C0000, nullptr, "GetNandSpeedInfo"},
  396. {0x081D0042, nullptr, "GetSdmcLog"},
  397. {0x081E0042, nullptr, "GetNandLog"},
  398. {0x081F0000, nullptr, "ClearSdmcLog"},
  399. {0x08200000, nullptr, "ClearNandLog"},
  400. {0x08210000, nullptr, "CardSlotIsInserted"},
  401. {0x08220000, nullptr, "CardSlotPowerOn"},
  402. {0x08230000, nullptr, "CardSlotPowerOff"},
  403. {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"},
  404. {0x08250040, nullptr, "CardNorDirectCommand"},
  405. {0x08260080, nullptr, "CardNorDirectCommandWithAddress"},
  406. {0x08270082, nullptr, "CardNorDirectRead"},
  407. {0x082800C2, nullptr, "CardNorDirectReadWithAddress"},
  408. {0x08290082, nullptr, "CardNorDirectWrite"},
  409. {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"},
  410. {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"},
  411. {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"},
  412. {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"},
  413. {0x082E0040, nullptr, "GetProductInfo"},
  414. {0x082F0040, nullptr, "GetProgramLaunchInfo"},
  415. {0x08300182, nullptr, "CreateExtSaveData"},
  416. {0x08310180, nullptr, "CreateSharedExtSaveData"},
  417. {0x08320102, nullptr, "ReadExtSaveDataIcon"},
  418. {0x08330082, nullptr, "EnumerateExtSaveData"},
  419. {0x08340082, nullptr, "EnumerateSharedExtSaveData"},
  420. {0x08350080, nullptr, "DeleteExtSaveData"},
  421. {0x08360080, nullptr, "DeleteSharedExtSaveData"},
  422. {0x08370040, nullptr, "SetCardSpiBaudRate"},
  423. {0x08380040, nullptr, "SetCardSpiBusMode"},
  424. {0x08390000, nullptr, "SendInitializeInfoTo9"},
  425. {0x083A0100, nullptr, "GetSpecialContentIndex"},
  426. {0x083B00C2, nullptr, "GetLegacyRomHeader"},
  427. {0x083C00C2, nullptr, "GetLegacyBannerData"},
  428. {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"},
  429. {0x083E00C2, nullptr, "QueryTotalQuotaSize"},
  430. {0x083F00C0, nullptr, "GetExtDataBlockSize"},
  431. {0x08400040, nullptr, "AbnegateAccessRight"},
  432. {0x08410000, nullptr, "DeleteSdmcRoot"},
  433. {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"},
  434. {0x08430000, nullptr, "InitializeCtrFileSystem"},
  435. {0x08440000, nullptr, "CreateSeed"},
  436. {0x084500C2, nullptr, "GetFormatInfo"},
  437. {0x08460102, nullptr, "GetLegacyRomHeader2"},
  438. {0x08470180, nullptr, "FormatCtrCardUserSaveData"},
  439. {0x08480042, nullptr, "GetSdmcCtrRootPath"},
  440. {0x08490040, nullptr, "GetArchiveResource"},
  441. {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"},
  442. {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"},
  443. {0x084C0242, FormatSaveData, "FormatSaveData"},
  444. {0x084D0102, nullptr, "GetLegacySubBannerData"},
  445. {0x084E0342, nullptr, "UpdateSha256Context"},
  446. {0x084F0102, nullptr, "ReadSpecialFile"},
  447. {0x08500040, nullptr, "GetSpecialFileSize"},
  448. {0x08580000, nullptr, "GetMovableSedHashedKeyYRandomData"},
  449. {0x08610042, nullptr, "InitializeWithSdkVersion"},
  450. {0x08620040, nullptr, "SetPriority"},
  451. {0x08630000, nullptr, "GetPriority"},
  452. };
  453. ////////////////////////////////////////////////////////////////////////////////////////////////////
  454. // Interface class
  455. FSUserInterface::FSUserInterface() {
  456. Register(FunctionTable, ARRAY_SIZE(FunctionTable));
  457. }
  458. FSUserInterface::~FSUserInterface() {
  459. }
  460. } // namespace FS
  461. } // namespace Service