aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/program_metadata.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-06-05 00:20:26 -0400
committerZach Hilman <zachhilman@gmail.com>2019-06-05 00:20:26 -0400
commit04a69eb6c702633f9430ed1ad49a5a68646ae254 (patch)
tree46d9d027a0e8cfc1bf5851f753df3d287db23807 /src/core/file_sys/program_metadata.cpp
parent8662c6d579e5de85cbb4d4a07e695be3dbd44f45 (diff)
program_metadata: Add function to load meta from raw parameters
Needed for KIP loading as KIPs do not have an NPDM but do have the essential parts of the data within.
Diffstat (limited to 'src/core/file_sys/program_metadata.cpp')
-rw-r--r--src/core/file_sys/program_metadata.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp
index d863253f88..eb76174c5b 100644
--- a/src/core/file_sys/program_metadata.cpp
+++ b/src/core/file_sys/program_metadata.cpp
@@ -51,6 +51,21 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) {
return Loader::ResultStatus::Success;
}
+void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space,
+ u8 main_thread_prio, u8 main_thread_core,
+ u32 main_thread_stack_size, u64 title_id,
+ u64 filesystem_permissions,
+ KernelCapabilityDescriptors capabilities) {
+ npdm_header.has_64_bit_instructions.Assign(is_64_bit);
+ npdm_header.address_space_type.Assign(address_space);
+ npdm_header.main_thread_priority = main_thread_prio;
+ npdm_header.main_thread_cpu = main_thread_core;
+ npdm_header.main_stack_size = main_thread_stack_size;
+ aci_header.title_id = title_id;
+ aci_file_access.permissions = filesystem_permissions;
+ aci_kernel_capabilities = std ::move(capabilities);
+}
+
bool ProgramMetadata::Is64BitProgram() const {
return npdm_header.has_64_bit_instructions;
}