From 2abe11ee1ef98ecda34c25be413cebecd03a8853 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Thu, 23 Aug 2018 18:23:21 +0200 Subject: [PATCH] Fix compile errors --- src/core/loader/3dsx.cpp | 20 ++++++++++---------- src/core/loader/ncch.cpp | 22 ++++++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index ecdfb7eafc..b206a94e7f 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp @@ -219,19 +219,19 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, // Create the CodeSet SharedPtr code_set = CodeSet::Create("", 0); - code_set->code.offset = loadinfo.seg_ptrs[0] - program_image.data(); - code_set->code.addr = loadinfo.seg_addrs[0]; - code_set->code.size = loadinfo.seg_sizes[0]; + code_set->CodeSegment().offset = loadinfo.seg_ptrs[0] - program_image.data(); + code_set->CodeSegment().addr = loadinfo.seg_addrs[0]; + code_set->CodeSegment().size = loadinfo.seg_sizes[0]; - code_set->rodata.offset = loadinfo.seg_ptrs[1] - program_image.data(); - code_set->rodata.addr = loadinfo.seg_addrs[1]; - code_set->rodata.size = loadinfo.seg_sizes[1]; + code_set->RODataSegment().offset = loadinfo.seg_ptrs[1] - program_image.data(); + code_set->RODataSegment().addr = loadinfo.seg_addrs[1]; + code_set->RODataSegment().size = loadinfo.seg_sizes[1]; - code_set->data.offset = loadinfo.seg_ptrs[2] - program_image.data(); - code_set->data.addr = loadinfo.seg_addrs[2]; - code_set->data.size = loadinfo.seg_sizes[2]; + code_set->DataSegment().offset = loadinfo.seg_ptrs[2] - program_image.data(); + code_set->DataSegment().addr = loadinfo.seg_addrs[2]; + code_set->DataSegment().size = loadinfo.seg_sizes[2]; - code_set->entrypoint = code_set->code.addr; + code_set->entrypoint = code_set->CodeSegment().addr; code_set->memory = std::make_shared>(std::move(program_image)); LOG_DEBUG(Loader, "code size: {:#X}", loadinfo.seg_sizes[0]); diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index afe93321e1..fdb147a648 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -76,14 +76,15 @@ ResultStatus AppLoader_NCCH::LoadExec(Kernel::SharedPtr& proces SharedPtr codeset = CodeSet::Create(process_name, program_id); - codeset->code.offset = 0; - codeset->code.addr = overlay_ncch->exheader_header.codeset_info.text.address; - codeset->code.size = + codeset->CodeSegment().offset = 0; + codeset->CodeSegment().addr = overlay_ncch->exheader_header.codeset_info.text.address; + codeset->CodeSegment().size = overlay_ncch->exheader_header.codeset_info.text.num_max_pages * Memory::PAGE_SIZE; - codeset->rodata.offset = codeset->code.offset + codeset->code.size; - codeset->rodata.addr = overlay_ncch->exheader_header.codeset_info.ro.address; - codeset->rodata.size = + codeset->RODataSegment().offset = + codeset->CodeSegment().offset + codeset->CodeSegment().size; + codeset->RODataSegment().addr = overlay_ncch->exheader_header.codeset_info.ro.address; + codeset->RODataSegment().size = overlay_ncch->exheader_header.codeset_info.ro.num_max_pages * Memory::PAGE_SIZE; // TODO(yuriks): Not sure if the bss size is added to the page-aligned .data size or just @@ -91,13 +92,14 @@ ResultStatus AppLoader_NCCH::LoadExec(Kernel::SharedPtr& proces u32 bss_page_size = (overlay_ncch->exheader_header.codeset_info.bss_size + 0xFFF) & ~0xFFF; code.resize(code.size() + bss_page_size, 0); - codeset->data.offset = codeset->rodata.offset + codeset->rodata.size; - codeset->data.addr = overlay_ncch->exheader_header.codeset_info.data.address; - codeset->data.size = + codeset->DataSegment().offset = + codeset->RODataSegment().offset + codeset->RODataSegment().size; + codeset->DataSegment().addr = overlay_ncch->exheader_header.codeset_info.data.address; + codeset->DataSegment().size = overlay_ncch->exheader_header.codeset_info.data.num_max_pages * Memory::PAGE_SIZE + bss_page_size; - codeset->entrypoint = codeset->code.addr; + codeset->entrypoint = codeset->CodeSegment().addr; codeset->memory = std::make_shared>(std::move(code)); process = Kernel::Process::Create(std::move(codeset));