citra-emu
/
citra-canary
Archived
1
0
Fork 0

service/fs: Migrate logging macros (#3866)

* service/fs: Migrate logging macros

* service/fs: Fix clang format
This commit is contained in:
NarcolepticK 2018-06-22 06:33:30 -04:00 committed by Weiyi Wang
parent 1449f8e725
commit a42287587e
2 changed files with 108 additions and 107 deletions

View File

@ -73,13 +73,12 @@ void File::Read(Kernel::HLERequestContext& ctx) {
u64 offset = rp.Pop<u64>();
u32 length = rp.Pop<u32>();
auto& buffer = rp.PopMappedBuffer();
LOG_TRACE(Service_FS, "Read %s: offset=0x%" PRIx64 " length=0x%08X", GetName().c_str(), offset,
length);
NGLOG_TRACE(Service_FS, "Read {}: offset=0x{:x} length=0x{:08X}", GetName(), offset, length);
const FileSessionSlot* file = GetSessionData(ctx.Session());
if (file->subfile && length > file->size) {
LOG_WARNING(Service_FS, "Trying to read beyond the subfile size, truncating");
NGLOG_WARNING(Service_FS, "Trying to read beyond the subfile size, truncating");
length = file->size;
}
@ -87,10 +86,9 @@ void File::Read(Kernel::HLERequestContext& ctx) {
offset += file->offset;
if (offset + length > backend->GetSize()) {
LOG_ERROR(Service_FS,
"Reading from out of bounds offset=0x%" PRIx64
" length=0x%08X file_size=0x%" PRIx64,
offset, length, backend->GetSize());
NGLOG_ERROR(Service_FS,
"Reading from out of bounds offset=0x{:x} length=0x{:08X} file_size=0x{:x}",
offset, length, backend->GetSize());
}
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
@ -121,8 +119,8 @@ void File::Write(Kernel::HLERequestContext& ctx) {
u32 length = rp.Pop<u32>();
u32 flush = rp.Pop<u32>();
auto& buffer = rp.PopMappedBuffer();
LOG_TRACE(Service_FS, "Write %s: offset=0x%" PRIx64 " length=%d, flush=0x%x", GetName().c_str(),
offset, length, flush);
NGLOG_TRACE(Service_FS, "Write {}: offset=0x{:x} length={}, flush=0x{:x}", GetName(), offset,
length, flush);
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
@ -183,8 +181,8 @@ void File::Close(Kernel::HLERequestContext& ctx) {
// TODO(Subv): Only close the backend if this client is the only one left.
if (connected_sessions.size() > 1)
LOG_WARNING(Service_FS, "Closing File backend but %zu clients still connected",
connected_sessions.size());
NGLOG_WARNING(Service_FS, "Closing File backend but {} clients still connected",
connected_sessions.size());
backend->Close();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -228,7 +226,7 @@ void File::GetPriority(Kernel::HLERequestContext& ctx) {
}
void File::OpenLinkFile(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile %s", GetName().c_str());
NGLOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile {}", GetName());
using Kernel::ClientSession;
using Kernel::ServerSession;
using Kernel::SharedPtr;
@ -329,7 +327,7 @@ void Directory::Read(Kernel::HLERequestContext& ctx) {
u32 count = rp.Pop<u32>();
auto& buffer = rp.PopMappedBuffer();
std::vector<FileSys::Entry> entries(count);
LOG_TRACE(Service_FS, "Read %s: count=%u", GetName().c_str(), count);
NGLOG_TRACE(Service_FS, "Read {}: count={}", GetName(), count);
// Number of entries actually read
u32 read = backend->Read(static_cast<u32>(entries.size()), entries.data());
buffer.Write(entries.data(), 0, read * sizeof(FileSys::Entry));
@ -342,7 +340,7 @@ void Directory::Read(Kernel::HLERequestContext& ctx) {
void Directory::Close(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0802, 0, 0);
LOG_TRACE(Service_FS, "Close %s", GetName().c_str());
NGLOG_TRACE(Service_FS, "Close {}", GetName());
backend->Close();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -372,7 +370,7 @@ static ArchiveBackend* GetArchive(ArchiveHandle handle) {
}
ResultVal<ArchiveHandle> OpenArchive(ArchiveIdCode id_code, FileSys::Path& archive_path) {
LOG_TRACE(Service_FS, "Opening archive with id code 0x%08X", id_code);
NGLOG_TRACE(Service_FS, "Opening archive with id code 0x{:08X}", id_code);
auto itr = id_code_map.find(id_code);
if (itr == id_code_map.end()) {
@ -406,8 +404,8 @@ ResultCode RegisterArchiveType(std::unique_ptr<FileSys::ArchiveFactory>&& factor
ASSERT_MSG(inserted, "Tried to register more than one archive with same id code");
auto& archive = result.first->second;
LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(),
static_cast<u32>(id_code));
NGLOG_DEBUG(Service_FS, "Registered archive {} with id code 0x{:08X}", archive->GetName(),
static_cast<u32>(id_code));
return RESULT_SUCCESS;
}
@ -578,7 +576,7 @@ ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) {
} else if (media_type == MediaType::SDMC) {
media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX);
} else {
LOG_ERROR(Service_FS, "Unsupported media type %u", static_cast<u32>(media_type));
NGLOG_ERROR(Service_FS, "Unsupported media type {}", static_cast<u32>(media_type));
return ResultCode(-1); // TODO(Subv): Find the right error code
}
@ -625,15 +623,14 @@ void RegisterArchiveTypes() {
if (sdmc_factory->Initialize())
RegisterArchiveType(std::move(sdmc_factory), ArchiveIdCode::SDMC);
else
LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path %s",
sdmc_directory.c_str());
NGLOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path {}", sdmc_directory);
auto sdmcwo_factory = std::make_unique<FileSys::ArchiveFactory_SDMCWriteOnly>(sdmc_directory);
if (sdmcwo_factory->Initialize())
RegisterArchiveType(std::move(sdmcwo_factory), ArchiveIdCode::SDMCWriteOnly);
else
LOG_ERROR(Service_FS, "Can't instantiate SDMCWriteOnly archive with path %s",
sdmc_directory.c_str());
NGLOG_ERROR(Service_FS, "Can't instantiate SDMCWriteOnly archive with path {}",
sdmc_directory);
// Create the SaveData archive
auto sd_savedata_source = std::make_shared<FileSys::ArchiveSource_SDSaveData>(sdmc_directory);
@ -653,16 +650,16 @@ void RegisterArchiveTypes() {
if (extsavedata_factory->Initialize())
RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData);
else
LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path %s",
extsavedata_factory->GetMountPoint().c_str());
NGLOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path {}",
extsavedata_factory->GetMountPoint());
auto sharedextsavedata_factory =
std::make_unique<FileSys::ArchiveFactory_ExtSaveData>(nand_directory, true);
if (sharedextsavedata_factory->Initialize())
RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData);
else
LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path %s",
sharedextsavedata_factory->GetMountPoint().c_str());
NGLOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path {}",
sharedextsavedata_factory->GetMountPoint());
// Create the NCCH archive, basically a small variation of the RomFS archive
auto savedatacheck_factory = std::make_unique<FileSys::ArchiveFactory_NCCH>();
@ -679,8 +676,9 @@ void RegisterArchiveTypes() {
void RegisterSelfNCCH(Loader::AppLoader& app_loader) {
auto itr = id_code_map.find(ArchiveIdCode::SelfNCCH);
if (itr == id_code_map.end()) {
LOG_ERROR(Service_FS,
"Could not register a new NCCH because the SelfNCCH archive hasn't been created");
NGLOG_ERROR(
Service_FS,
"Could not register a new NCCH because the SelfNCCH archive hasn't been created");
return;
}

View File

@ -54,8 +54,8 @@ void FS_USER::OpenFile(Kernel::HLERequestContext& ctx) {
ASSERT(filename.size() == filename_size);
FileSys::Path file_path(filename_type, filename);
LOG_DEBUG(Service_FS, "path=%s, mode=%u attrs=%u", file_path.DebugStr().c_str(), mode.hex,
attributes);
NGLOG_DEBUG(Service_FS, "path={}, mode={} attrs={}", file_path.DebugStr(), mode.hex,
attributes);
ResultVal<std::shared_ptr<File>> file_res =
OpenFileFromArchive(archive_handle, file_path, mode);
@ -66,7 +66,7 @@ void FS_USER::OpenFile(Kernel::HLERequestContext& ctx) {
rb.PushMoveObjects(file->Connect());
} else {
rb.PushMoveObjects<Kernel::Object>(nullptr);
LOG_ERROR(Service_FS, "failed to get a handle for file %s", file_path.DebugStr().c_str());
NGLOG_ERROR(Service_FS, "failed to get a handle for file {}", file_path.DebugStr());
}
}
@ -88,17 +88,18 @@ void FS_USER::OpenFileDirectly(Kernel::HLERequestContext& ctx) {
FileSys::Path archive_path(archivename_type, archivename);
FileSys::Path file_path(filename_type, filename);
LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s file_path=%s, mode=%u attributes=%u",
static_cast<u32>(archive_id), archive_path.DebugStr().c_str(),
file_path.DebugStr().c_str(), mode.hex, attributes);
NGLOG_DEBUG(Service_FS,
"archive_id=0x{:08X} archive_path={} file_path={}, mode={} attributes={}",
static_cast<u32>(archive_id), archive_path.DebugStr(), file_path.DebugStr(),
mode.hex, attributes);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
ResultVal<ArchiveHandle> archive_handle = Service::FS::OpenArchive(archive_id, archive_path);
if (archive_handle.Failed()) {
LOG_ERROR(Service_FS,
"Failed to get a handle for archive archive_id=0x%08X archive_path=%s",
static_cast<u32>(archive_id), archive_path.DebugStr().c_str());
NGLOG_ERROR(Service_FS,
"Failed to get a handle for archive archive_id=0x{:08X} archive_path={}",
static_cast<u32>(archive_id), archive_path.DebugStr());
rb.Push(archive_handle.Code());
rb.PushMoveObjects<Kernel::Object>(nullptr);
return;
@ -113,8 +114,8 @@ void FS_USER::OpenFileDirectly(Kernel::HLERequestContext& ctx) {
rb.PushMoveObjects(file->Connect());
} else {
rb.PushMoveObjects<Kernel::Object>(nullptr);
LOG_ERROR(Service_FS, "failed to get a handle for file %s mode=%u attributes=%u",
file_path.DebugStr().c_str(), mode.hex, attributes);
NGLOG_ERROR(Service_FS, "failed to get a handle for file {} mode={} attributes={}",
file_path.DebugStr(), mode.hex, attributes);
}
}
@ -129,8 +130,8 @@ void FS_USER::DeleteFile(Kernel::HLERequestContext& ctx) {
FileSys::Path file_path(filename_type, filename);
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(filename_type), filename_size,
file_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast<u32>(filename_type),
filename_size, file_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(DeleteFileFromArchive(archive_handle, file_path));
@ -154,11 +155,10 @@ void FS_USER::RenameFile(Kernel::HLERequestContext& ctx) {
FileSys::Path src_file_path(src_filename_type, src_filename);
FileSys::Path dest_file_path(dest_filename_type, dest_filename);
LOG_DEBUG(Service_FS,
"src_type=%u src_size=%u src_data=%s dest_type=%u dest_size=%u dest_data=%s",
static_cast<u32>(src_filename_type), src_filename_size,
src_file_path.DebugStr().c_str(), static_cast<u32>(dest_filename_type),
dest_filename_size, dest_file_path.DebugStr().c_str());
NGLOG_DEBUG(
Service_FS, "src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}",
static_cast<u32>(src_filename_type), src_filename_size, src_file_path.DebugStr(),
static_cast<u32>(dest_filename_type), dest_filename_size, dest_file_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle,
@ -177,8 +177,8 @@ void FS_USER::DeleteDirectory(Kernel::HLERequestContext& ctx) {
FileSys::Path dir_path(dirname_type, dirname);
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(DeleteDirectoryFromArchive(archive_handle, dir_path));
@ -196,8 +196,8 @@ void FS_USER::DeleteDirectoryRecursively(Kernel::HLERequestContext& ctx) {
FileSys::Path dir_path(dirname_type, dirname);
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(DeleteDirectoryRecursivelyFromArchive(archive_handle, dir_path));
@ -217,8 +217,8 @@ void FS_USER::CreateFile(Kernel::HLERequestContext& ctx) {
FileSys::Path file_path(filename_type, filename);
LOG_DEBUG(Service_FS, "type=%u attributes=%u size=%" PRIx64 " data=%s",
static_cast<u32>(filename_type), attributes, file_size, file_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "type={} attributes={} size={:x} data={}",
static_cast<u32>(filename_type), attributes, file_size, file_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(CreateFileInArchive(archive_handle, file_path, file_size));
@ -235,8 +235,8 @@ void FS_USER::CreateDirectory(Kernel::HLERequestContext& ctx) {
ASSERT(dirname.size() == dirname_size);
FileSys::Path dir_path(dirname_type, dirname);
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(CreateDirectoryFromArchive(archive_handle, dir_path));
@ -259,10 +259,10 @@ void FS_USER::RenameDirectory(Kernel::HLERequestContext& ctx) {
FileSys::Path src_dir_path(src_dirname_type, src_dirname);
FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname);
LOG_DEBUG(
Service_FS, "src_type=%u src_size=%u src_data=%s dest_type=%u dest_size=%u dest_data=%s",
static_cast<u32>(src_dirname_type), src_dirname_size, src_dir_path.DebugStr().c_str(),
static_cast<u32>(dest_dirname_type), dest_dirname_size, dest_dir_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS,
"src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}",
static_cast<u32>(src_dirname_type), src_dirname_size, src_dir_path.DebugStr(),
static_cast<u32>(dest_dirname_type), dest_dirname_size, dest_dir_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, dest_archive_handle,
@ -279,8 +279,8 @@ void FS_USER::OpenDirectory(Kernel::HLERequestContext& ctx) {
FileSys::Path dir_path(dirname_type, dirname);
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
ResultVal<std::shared_ptr<Directory>> dir_res =
@ -292,8 +292,8 @@ void FS_USER::OpenDirectory(Kernel::HLERequestContext& ctx) {
directory->ClientConnected(std::get<SharedPtr<ServerSession>>(sessions));
rb.PushMoveObjects(std::get<SharedPtr<ClientSession>>(sessions));
} else {
LOG_ERROR(Service_FS, "failed to get a handle for directory type=%u size=%u data=%s",
static_cast<u32>(dirname_type), dirname_size, dir_path.DebugStr().c_str());
NGLOG_ERROR(Service_FS, "failed to get a handle for directory type={} size={} data={}",
static_cast<u32>(dirname_type), dirname_size, dir_path.DebugStr());
rb.PushMoveObjects<Kernel::Object>(nullptr);
}
}
@ -307,8 +307,8 @@ void FS_USER::OpenArchive(Kernel::HLERequestContext& ctx) {
ASSERT(archivename.size() == archivename_size);
FileSys::Path archive_path(archivename_type, archivename);
LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s", static_cast<u32>(archive_id),
archive_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "archive_id=0x{:08X} archive_path={}", static_cast<u32>(archive_id),
archive_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(3, 0);
ResultVal<ArchiveHandle> handle = Service::FS::OpenArchive(archive_id, archive_path);
@ -317,9 +317,9 @@ void FS_USER::OpenArchive(Kernel::HLERequestContext& ctx) {
rb.PushRaw(*handle);
} else {
rb.Push<u64>(0);
LOG_ERROR(Service_FS,
"failed to get a handle for archive archive_id=0x%08X archive_path=%s",
static_cast<u32>(archive_id), archive_path.DebugStr().c_str());
NGLOG_ERROR(Service_FS,
"failed to get a handle for archive archive_id=0x{:08X} archive_path={}",
static_cast<u32>(archive_id), archive_path.DebugStr());
}
}
@ -344,11 +344,11 @@ void FS_USER::IsSdmcWriteable(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS);
// If the SD isn't enabled, it can't be writeable...else, stubbed true
rb.Push(Settings::values.use_virtual_sd);
LOG_DEBUG(Service_FS, " (STUBBED)");
NGLOG_DEBUG(Service_FS, " (STUBBED)");
}
void FS_USER::FormatSaveData(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED)");
NGLOG_WARNING(Service_FS, "(STUBBED)");
IPC::RequestParser rp(ctx, 0x84C, 9, 2);
auto archive_id = rp.PopEnum<FS::ArchiveIdCode>();
@ -364,19 +364,19 @@ void FS_USER::FormatSaveData(Kernel::HLERequestContext& ctx) {
ASSERT(archivename.size() == archivename_size);
FileSys::Path archive_path(archivename_type, archivename);
LOG_DEBUG(Service_FS, "archive_path=%s", archive_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "archive_path={}", archive_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
if (archive_id != FS::ArchiveIdCode::SaveData) {
LOG_ERROR(Service_FS, "tried to format an archive different than SaveData, %u",
static_cast<u32>(archive_id));
NGLOG_ERROR(Service_FS, "tried to format an archive different than SaveData, {}",
static_cast<u32>(archive_id));
rb.Push(FileSys::ERROR_INVALID_PATH);
return;
}
if (archive_path.GetType() != FileSys::LowPathType::Empty) {
// TODO(Subv): Implement formatting the SaveData of other games
LOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported");
NGLOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported");
rb.Push(UnimplementedFunction(ErrorModule::FS));
return;
}
@ -408,7 +408,7 @@ void FS_USER::FormatThisUserSaveData(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(FormatArchive(ArchiveIdCode::SaveData, format_info));
LOG_TRACE(Service_FS, "called");
NGLOG_TRACE(Service_FS, "called");
}
void FS_USER::GetFreeBytes(Kernel::HLERequestContext& ctx) {
@ -438,10 +438,10 @@ void FS_USER::CreateExtSaveData(Kernel::HLERequestContext& ctx) {
u32 icon_size = rp.Pop<u32>();
auto icon_buffer = rp.PopMappedBuffer();
LOG_WARNING(Service_FS,
"(STUBBED) savedata_high=%08X savedata_low=%08X unknown=%08X "
"files=%08X directories=%08X size_limit=%016" PRIx64 " icon_size=%08X",
save_high, save_low, unknown, directories, files, size_limit, icon_size);
NGLOG_WARNING(Service_FS,
"(STUBBED) savedata_high={:08X} savedata_low={:08X} unknown={:08X} "
"files={:08X} directories={:08X} size_limit={:016x} icon_size={:08X}",
save_high, save_low, unknown, directories, files, size_limit, icon_size);
std::vector<u8> icon(icon_size);
icon_buffer.Read(icon.data(), 0, icon_size);
@ -464,8 +464,9 @@ void FS_USER::DeleteExtSaveData(Kernel::HLERequestContext& ctx) {
u32 save_high = rp.Pop<u32>();
u32 unknown = rp.Pop<u32>(); // TODO(Subv): Figure out what this is
LOG_WARNING(Service_FS, "(STUBBED) save_low=%08X save_high=%08X media_type=%08X unknown=%08X",
save_low, save_high, static_cast<u32>(media_type), unknown);
NGLOG_WARNING(Service_FS,
"(STUBBED) save_low={:08X} save_high={:08X} media_type={:08X} unknown={:08X}",
save_low, save_high, static_cast<u32>(media_type), unknown);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(Service::FS::DeleteExtSaveData(media_type, save_high, save_low));
@ -476,7 +477,7 @@ void FS_USER::CardSlotIsInserted(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
rb.Push(RESULT_SUCCESS);
rb.Push(false);
LOG_WARNING(Service_FS, "(STUBBED) called");
NGLOG_WARNING(Service_FS, "(STUBBED) called");
}
void FS_USER::DeleteSystemSaveData(Kernel::HLERequestContext& ctx) {
@ -500,11 +501,12 @@ void FS_USER::CreateSystemSaveData(Kernel::HLERequestContext& ctx) {
u32 file_buckets = rp.Pop<u32>();
bool duplicate = rp.Pop<bool>();
LOG_WARNING(Service_FS,
"(STUBBED) savedata_high=%08X savedata_low=%08X total_size=%08X block_size=%08X "
"directories=%u files=%u directory_buckets=%u file_buckets=%u duplicate=%d",
savedata_high, savedata_low, total_size, block_size, directories, files,
directory_buckets, file_buckets, duplicate);
NGLOG_WARNING(
Service_FS,
"(STUBBED) savedata_high={:08X} savedata_low={:08X} total_size={:08X} block_size={:08X} "
"directories={} files={} directory_buckets={} file_buckets={} duplicate={}",
savedata_high, savedata_low, total_size, block_size, directories, files, directory_buckets,
file_buckets, duplicate);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(Service::FS::CreateSystemSaveData(savedata_high, savedata_low));
@ -521,11 +523,11 @@ void FS_USER::CreateLegacySystemSaveData(Kernel::HLERequestContext& ctx) {
u32 file_buckets = rp.Pop<u32>();
bool duplicate = rp.Pop<bool>();
LOG_WARNING(Service_FS,
"(STUBBED) savedata_id=%08X total_size=%08X block_size=%08X directories=%u "
"files=%u directory_buckets=%u file_buckets=%u duplicate=%d",
savedata_id, total_size, block_size, directories, files, directory_buckets,
file_buckets, duplicate);
NGLOG_WARNING(Service_FS,
"(STUBBED) savedata_id={:08X} total_size={:08X} block_size={:08X} directories={} "
"files={} directory_buckets={} file_buckets={} duplicate={}",
savedata_id, total_size, block_size, directories, files, directory_buckets,
file_buckets, duplicate);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
// With this command, the SystemSaveData always has save_high = 0 (Always created in the NAND)
@ -537,7 +539,7 @@ void FS_USER::InitializeWithSdkVersion(Kernel::HLERequestContext& ctx) {
const u32 version = rp.Pop<u32>();
rp.PopPID();
LOG_WARNING(Service_FS, "(STUBBED) called, version: 0x%08X", version);
NGLOG_WARNING(Service_FS, "(STUBBED) called, version: 0x{:08X}", version);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS);
@ -551,28 +553,28 @@ void FS_USER::SetPriority(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_FS, "called priority=0x%X", priority);
NGLOG_DEBUG(Service_FS, "called priority=0x{:X}", priority);
}
void FS_USER::GetPriority(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x863, 0, 0);
if (priority == -1) {
LOG_INFO(Service_FS, "priority was not set, priority=0x%X", priority);
NGLOG_INFO(Service_FS, "priority was not set, priority=0x{:X}", priority);
}
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
rb.Push(RESULT_SUCCESS);
rb.Push(priority);
LOG_DEBUG(Service_FS, "called priority=0x%X", priority);
NGLOG_DEBUG(Service_FS, "called priority=0x{:X}", priority);
}
void FS_USER::GetArchiveResource(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x849, 1, 0);
u32 system_media_type = rp.Pop<u32>();
LOG_WARNING(Service_FS, "(STUBBED) called Media type=0x%08X", system_media_type);
NGLOG_WARNING(Service_FS, "(STUBBED) called Media type=0x{:08X}", system_media_type);
IPC::RequestBuilder rb = rp.MakeBuilder(5, 0);
rb.Push(RESULT_SUCCESS);
@ -592,14 +594,14 @@ void FS_USER::GetFormatInfo(Kernel::HLERequestContext& ctx) {
FileSys::Path archive_path(archivename_type, archivename);
LOG_DEBUG(Service_FS, "archive_path=%s", archive_path.DebugStr().c_str());
NGLOG_DEBUG(Service_FS, "archive_path={}", archive_path.DebugStr());
IPC::RequestBuilder rb = rp.MakeBuilder(5, 0);
auto format_info = GetArchiveFormatInfo(archive_id, archive_path);
rb.Push(format_info.Code());
if (format_info.Failed()) {
LOG_ERROR(Service_FS, "Failed to retrieve the format info");
NGLOG_ERROR(Service_FS, "Failed to retrieve the format info");
rb.Skip(4, true);
return;
}
@ -615,7 +617,7 @@ void FS_USER::GetProgramLaunchInfo(Kernel::HLERequestContext& ctx) {
u32 process_id = rp.Pop<u32>();
LOG_DEBUG(Service_FS, "process_id=%u", process_id);
NGLOG_DEBUG(Service_FS, "process_id={}", process_id);
// TODO(Subv): The real FS service manages its own process list and only checks the processes
// that were registered with the 'fs:REG' service.
@ -647,7 +649,7 @@ void FS_USER::GetProgramLaunchInfo(Kernel::HLERequestContext& ctx) {
void FS_USER::GetNumSeeds(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x87D, 0, 0);
LOG_WARNING(Service_FS, "(STUBBED) called");
NGLOG_WARNING(Service_FS, "(STUBBED) called");
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
@ -664,10 +666,10 @@ void FS_USER::SetSaveDataSecureValue(Kernel::HLERequestContext& ctx) {
// TODO: Generate and Save the Secure Value
LOG_WARNING(Service_FS,
"(STUBBED) called, value=0x%016" PRIx64 " secure_value_slot=0x%08X "
"unqiue_id=0x%08X title_variation=0x%02X",
value, secure_value_slot, unique_id, title_variation);
NGLOG_WARNING(Service_FS,
"(STUBBED) called, value=0x{:016x} secure_value_slot=0x{:08X} "
"unqiue_id=0x{:08X} title_variation=0x{:02X}",
value, secure_value_slot, unique_id, title_variation);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -681,9 +683,10 @@ void FS_USER::GetSaveDataSecureValue(Kernel::HLERequestContext& ctx) {
u32 unique_id = rp.Pop<u32>();
u8 title_variation = rp.Pop<u8>();
LOG_WARNING(Service_FS,
"(STUBBED) called secure_value_slot=0x%08X unqiue_id=0x%08X title_variation=0x%02X",
secure_value_slot, unique_id, title_variation);
NGLOG_WARNING(
Service_FS,
"(STUBBED) called secure_value_slot=0x{:08X} unqiue_id=0x{:08X} title_variation=0x{:02X}",
secure_value_slot, unique_id, title_variation);
IPC::RequestBuilder rb = rp.MakeBuilder(4, 0);