summaryrefslogtreecommitdiff
path: root/src/core/loader
diff options
context:
space:
mode:
authorGravatar bunnei2018-12-27 11:15:34 -0500
committerGravatar GitHub2018-12-27 11:15:34 -0500
commit795335af0f37ce25da3c3ca8eeab62c50f87d366 (patch)
tree48bde2f34a4e9c87dc96f83bfbeeeee96b72b9e6 /src/core/loader
parentMerge pull request #1892 from Tinob/master (diff)
parentkernel/process: Hook up the process capability parser to the process itself (diff)
downloadyuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar.gz
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar.xz
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.zip
Merge pull request #1928 from lioncash/caps
kernel: Handle kernel capability descriptors
Diffstat (limited to 'src/core/loader')
-rw-r--r--src/core/loader/deconstructed_rom_directory.cpp5
-rw-r--r--src/core/loader/loader.cpp4
-rw-r--r--src/core/loader/loader.h2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp
index ac04d72d7..07aa7a1cd 100644
--- a/src/core/loader/deconstructed_rom_directory.cpp
+++ b/src/core/loader/deconstructed_rom_directory.cpp
@@ -129,7 +129,10 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load(Kernel::Process& process)
129 return ResultStatus::Error32BitISA; 129 return ResultStatus::Error32BitISA;
130 } 130 }
131 131
132 process.LoadFromMetadata(metadata); 132 if (process.LoadFromMetadata(metadata).IsError()) {
133 return ResultStatus::ErrorUnableToParseKernelMetadata;
134 }
135
133 const FileSys::PatchManager pm(metadata.GetTitleID()); 136 const FileSys::PatchManager pm(metadata.GetTitleID());
134 137
135 // Load NSO modules 138 // Load NSO modules
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 9cd0b0ccd..d8cc30959 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -93,7 +93,7 @@ std::string GetFileTypeString(FileType type) {
93 return "unknown"; 93 return "unknown";
94} 94}
95 95
96constexpr std::array<const char*, 60> RESULT_MESSAGES{ 96constexpr std::array<const char*, 62> RESULT_MESSAGES{
97 "The operation completed successfully.", 97 "The operation completed successfully.",
98 "The loader requested to load is already loaded.", 98 "The loader requested to load is already loaded.",
99 "The operation is not implemented.", 99 "The operation is not implemented.",
@@ -103,6 +103,7 @@ constexpr std::array<const char*, 60> RESULT_MESSAGES{
103 "The NPDM has a bad ACI header,", 103 "The NPDM has a bad ACI header,",
104 "The NPDM file has a bad file access control.", 104 "The NPDM file has a bad file access control.",
105 "The NPDM has a bad file access header.", 105 "The NPDM has a bad file access header.",
106 "The NPDM has bad kernel capability descriptors.",
106 "The PFS/HFS partition has a bad header.", 107 "The PFS/HFS partition has a bad header.",
107 "The PFS/HFS partition has incorrect size as determined by the header.", 108 "The PFS/HFS partition has incorrect size as determined by the header.",
108 "The NCA file has a bad header.", 109 "The NCA file has a bad header.",
@@ -125,6 +126,7 @@ constexpr std::array<const char*, 60> RESULT_MESSAGES{
125 "The file could not be found or does not exist.", 126 "The file could not be found or does not exist.",
126 "The game is missing a program metadata file (main.npdm).", 127 "The game is missing a program metadata file (main.npdm).",
127 "The game uses the currently-unimplemented 32-bit architecture.", 128 "The game uses the currently-unimplemented 32-bit architecture.",
129 "Unable to completely parse the kernel metadata when loading the emulated process",
128 "The RomFS could not be found.", 130 "The RomFS could not be found.",
129 "The ELF file has incorrect size as determined by the header.", 131 "The ELF file has incorrect size as determined by the header.",
130 "There was a general error loading the NRO into emulated memory.", 132 "There was a general error loading the NRO into emulated memory.",
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index cfd67adc0..30eacd803 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -71,6 +71,7 @@ enum class ResultStatus : u16 {
71 ErrorBadACIHeader, 71 ErrorBadACIHeader,
72 ErrorBadFileAccessControl, 72 ErrorBadFileAccessControl,
73 ErrorBadFileAccessHeader, 73 ErrorBadFileAccessHeader,
74 ErrorBadKernelCapabilityDescriptors,
74 ErrorBadPFSHeader, 75 ErrorBadPFSHeader,
75 ErrorIncorrectPFSFileSize, 76 ErrorIncorrectPFSFileSize,
76 ErrorBadNCAHeader, 77 ErrorBadNCAHeader,
@@ -93,6 +94,7 @@ enum class ResultStatus : u16 {
93 ErrorNullFile, 94 ErrorNullFile,
94 ErrorMissingNPDM, 95 ErrorMissingNPDM,
95 Error32BitISA, 96 Error32BitISA,
97 ErrorUnableToParseKernelMetadata,
96 ErrorNoRomFS, 98 ErrorNoRomFS,
97 ErrorIncorrectELFFileSize, 99 ErrorIncorrectELFFileSize,
98 ErrorLoadingNRO, 100 ErrorLoadingNRO,