diff options
author | James Rowe <jroweboy@gmail.com> | 2018-07-02 18:13:26 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-07-03 03:45:47 +0200 |
commit | 638956aa81de255bf4bbd4e69a717eabf4ceadb9 (patch) | |
tree | 5783dda790575e047fa757d8c56e11f3fffe7646 /src/core/loader | |
parent | Merge pull request #608 from Subv/depth (diff) | |
download | yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.gz yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.bz2 yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.lz yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.xz yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.zst yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.zip |
Diffstat (limited to 'src/core/loader')
-rw-r--r-- | src/core/loader/deconstructed_rom_directory.cpp | 8 | ||||
-rw-r--r-- | src/core/loader/elf.cpp | 16 | ||||
-rw-r--r-- | src/core/loader/linker.cpp | 4 | ||||
-rw-r--r-- | src/core/loader/loader.cpp | 8 | ||||
-rw-r--r-- | src/core/loader/nca.cpp | 14 | ||||
-rw-r--r-- | src/core/loader/nso.cpp | 4 |
6 files changed, 27 insertions, 27 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index b01b2caf6..eb7feb617 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp @@ -132,7 +132,7 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load( const VAddr load_addr = next_load_addr; next_load_addr = AppLoader_NSO::LoadModule(path, load_addr); if (next_load_addr) { - NGLOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", module, load_addr); + LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", module, load_addr); } else { next_load_addr = load_addr; } @@ -163,7 +163,7 @@ ResultStatus AppLoader_DeconstructedRomDirectory::ReadRomFS( std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset, u64& size) { if (filepath_romfs.empty()) { - NGLOG_DEBUG(Loader, "No RomFS available"); + LOG_DEBUG(Loader, "No RomFS available"); return ResultStatus::ErrorNotUsed; } @@ -176,8 +176,8 @@ ResultStatus AppLoader_DeconstructedRomDirectory::ReadRomFS( offset = 0; size = romfs_file->GetSize(); - NGLOG_DEBUG(Loader, "RomFS offset: 0x{:016X}", offset); - NGLOG_DEBUG(Loader, "RomFS size: 0x{:016X}", size); + LOG_DEBUG(Loader, "RomFS offset: 0x{:016X}", offset); + LOG_DEBUG(Loader, "RomFS size: 0x{:016X}", size); // Reset read pointer file.Seek(0, SEEK_SET); diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index e42d3a870..c984ef852 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -273,18 +273,18 @@ const char* ElfReader::GetSectionName(int section) const { } SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) { - NGLOG_DEBUG(Loader, "String section: {}", header->e_shstrndx); + LOG_DEBUG(Loader, "String section: {}", header->e_shstrndx); // Should we relocate? relocate = (header->e_type != ET_EXEC); if (relocate) { - NGLOG_DEBUG(Loader, "Relocatable module"); + LOG_DEBUG(Loader, "Relocatable module"); entryPoint += vaddr; } else { - NGLOG_DEBUG(Loader, "Prerelocated executable"); + LOG_DEBUG(Loader, "Prerelocated executable"); } - NGLOG_DEBUG(Loader, "{} segments:", header->e_phnum); + LOG_DEBUG(Loader, "{} segments:", header->e_phnum); // First pass : Get the bits into RAM u32 base_addr = relocate ? vaddr : 0; @@ -304,7 +304,7 @@ SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) { for (unsigned int i = 0; i < header->e_phnum; ++i) { Elf32_Phdr* p = &segments[i]; - NGLOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type, + LOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type, p->p_vaddr, p->p_filesz, p->p_memsz); if (p->p_type == PT_LOAD) { @@ -317,13 +317,13 @@ SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) { } else if (permission_flags == (PF_R | PF_W)) { codeset_segment = &codeset->data; } else { - NGLOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i, + LOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i, p->p_flags); continue; } if (codeset_segment->size != 0) { - NGLOG_ERROR(Loader, + LOG_ERROR(Loader, "ELF has more than one segment of the same type. Skipping extra " "segment (id {})", i); @@ -345,7 +345,7 @@ SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) { codeset->entrypoint = base_addr + header->e_entry; codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image)); - NGLOG_DEBUG(Loader, "Done loading."); + LOG_DEBUG(Loader, "Done loading."); return codeset; } diff --git a/src/core/loader/linker.cpp b/src/core/loader/linker.cpp index c7be5f265..769516b6f 100644 --- a/src/core/loader/linker.cpp +++ b/src/core/loader/linker.cpp @@ -84,7 +84,7 @@ void Linker::WriteRelocations(std::vector<u8>& program_image, const std::vector< } break; default: - NGLOG_CRITICAL(Loader, "Unknown relocation type: {}", static_cast<int>(rela.type)); + LOG_CRITICAL(Loader, "Unknown relocation type: {}", static_cast<int>(rela.type)); break; } } @@ -141,7 +141,7 @@ void Linker::ResolveImports() { if (search != exports.end()) { Memory::Write64(import.second.ea, search->second + import.second.addend); } else { - NGLOG_ERROR(Loader, "Unresolved import: {}", import.first); + LOG_ERROR(Loader, "Unresolved import: {}", import.first); } } } diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index 20cc0bac0..8831d8e83 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -43,7 +43,7 @@ FileType IdentifyFile(FileUtil::IOFile& file, const std::string& filepath) { FileType IdentifyFile(const std::string& file_name) { FileUtil::IOFile file(file_name, "rb"); if (!file.IsOpen()) { - NGLOG_ERROR(Loader, "Failed to load file {}", file_name); + LOG_ERROR(Loader, "Failed to load file {}", file_name); return FileType::Unknown; } @@ -126,7 +126,7 @@ static std::unique_ptr<AppLoader> GetFileLoader(FileUtil::IOFile&& file, FileTyp std::unique_ptr<AppLoader> GetLoader(const std::string& filename) { FileUtil::IOFile file(filename, "rb"); if (!file.IsOpen()) { - NGLOG_ERROR(Loader, "Failed to load file {}", filename); + LOG_ERROR(Loader, "Failed to load file {}", filename); return nullptr; } @@ -137,12 +137,12 @@ std::unique_ptr<AppLoader> GetLoader(const std::string& filename) { FileType filename_type = GuessFromExtension(filename_extension); if (type != filename_type) { - NGLOG_WARNING(Loader, "File {} has a different type than its extension.", filename); + LOG_WARNING(Loader, "File {} has a different type than its extension.", filename); if (FileType::Unknown == type) type = filename_type; } - NGLOG_DEBUG(Loader, "Loading file {} as {}...", filename, GetFileTypeString(type)); + LOG_DEBUG(Loader, "Loading file {} as {}...", filename, GetFileTypeString(type)); return GetFileLoader(std::move(file), type, filename_filename, filename); } diff --git a/src/core/loader/nca.cpp b/src/core/loader/nca.cpp index 067945d46..da064f8e3 100644 --- a/src/core/loader/nca.cpp +++ b/src/core/loader/nca.cpp @@ -123,7 +123,7 @@ ResultStatus Nca::Load(FileUtil::IOFile&& in_file, std::string in_path) { file.Seek(0, SEEK_SET); std::array<u8, sizeof(NcaHeader)> header_array{}; if (sizeof(NcaHeader) != file.ReadBytes(header_array.data(), sizeof(NcaHeader))) - NGLOG_CRITICAL(Loader, "File reader errored out during header read."); + LOG_CRITICAL(Loader, "File reader errored out during header read."); NcaHeader header{}; std::memcpy(&header, header_array.data(), sizeof(NcaHeader)); @@ -140,7 +140,7 @@ ResultStatus Nca::Load(FileUtil::IOFile&& in_file, std::string in_path) { std::array<u8, sizeof(NcaSectionHeaderBlock)> array{}; if (sizeof(NcaSectionHeaderBlock) != file.ReadBytes(array.data(), sizeof(NcaSectionHeaderBlock))) - NGLOG_CRITICAL(Loader, "File reader errored out during header read."); + LOG_CRITICAL(Loader, "File reader errored out during header read."); NcaSectionHeaderBlock block{}; std::memcpy(&block, array.data(), sizeof(NcaSectionHeaderBlock)); @@ -154,7 +154,7 @@ ResultStatus Nca::Load(FileUtil::IOFile&& in_file, std::string in_path) { // Seek back to beginning of this section. file.Seek(SECTION_HEADER_OFFSET + i * SECTION_HEADER_SIZE, SEEK_SET); if (sizeof(Pfs0Superblock) != file.ReadBytes(&sb, sizeof(Pfs0Superblock))) - NGLOG_CRITICAL(Loader, "File reader errored out during header read."); + LOG_CRITICAL(Loader, "File reader errored out during header read."); u64 offset = (static_cast<u64>(header.section_tables[i].media_offset) * MEDIA_OFFSET_MULTIPLIER) + @@ -258,7 +258,7 @@ ResultStatus AppLoader_NCA::Load(Kernel::SharedPtr<Kernel::Process>& process) { const VAddr load_addr = next_load_addr; next_load_addr = AppLoader_NSO::LoadModule(module, nca->GetExeFsFile(module), load_addr); if (next_load_addr) { - NGLOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", module, load_addr); + LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", module, load_addr); } else { next_load_addr = load_addr; } @@ -283,7 +283,7 @@ ResultStatus AppLoader_NCA::Load(Kernel::SharedPtr<Kernel::Process>& process) { ResultStatus AppLoader_NCA::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset, u64& size) { if (nca->GetRomFsSize() == 0) { - NGLOG_DEBUG(Loader, "No RomFS available"); + LOG_DEBUG(Loader, "No RomFS available"); return ResultStatus::ErrorNotUsed; } @@ -292,8 +292,8 @@ ResultStatus AppLoader_NCA::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_f offset = nca->GetRomFsOffset(); size = nca->GetRomFsSize(); - NGLOG_DEBUG(Loader, "RomFS offset: 0x{:016X}", offset); - NGLOG_DEBUG(Loader, "RomFS size: 0x{:016X}", size); + LOG_DEBUG(Loader, "RomFS offset: 0x{:016X}", offset); + LOG_DEBUG(Loader, "RomFS size: 0x{:016X}", size); return ResultStatus::Success; } diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 845ed7e90..7f84e4b1b 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -87,7 +87,7 @@ static std::vector<u8> ReadSegment(FileUtil::IOFile& file, const NsoSegmentHeade file.Seek(header.offset, SEEK_SET); if (compressed_size != file.ReadBytes(compressed_data.data(), compressed_size)) { - NGLOG_CRITICAL(Loader, "Failed to read {} NSO LZ4 compressed bytes", compressed_size); + LOG_CRITICAL(Loader, "Failed to read {} NSO LZ4 compressed bytes", compressed_size); return {}; } @@ -215,7 +215,7 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) { // Load module LoadModule(filepath, Memory::PROCESS_IMAGE_VADDR); - NGLOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", filepath, Memory::PROCESS_IMAGE_VADDR); + LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", filepath, Memory::PROCESS_IMAGE_VADDR); process->svc_access_mask.set(); process->address_mappings = default_address_mappings; |