summaryrefslogtreecommitdiff
path: root/src/core/loader/loader.h
diff options
context:
space:
mode:
authorGravatar bunnei2017-10-09 23:56:20 -0400
committerGravatar bunnei2017-10-09 23:56:20 -0400
commitb1d5db1cf60344b6b081c9d03cb6ccc3264326cd (patch)
treefde377c4ba3c0f92c032e6f5ec8627aae37270ef /src/core/loader/loader.h
parentloader: Various improvements for NSO/NRO loaders. (diff)
parentMerge pull request #2996 from MerryMage/split-travis (diff)
downloadyuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.gz
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.xz
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.zip
Merge remote-tracking branch 'upstream/master' into nx
# Conflicts: # src/core/CMakeLists.txt # src/core/arm/dynarmic/arm_dynarmic.cpp # src/core/arm/dyncom/arm_dyncom.cpp # src/core/hle/kernel/process.cpp # src/core/hle/kernel/thread.cpp # src/core/hle/kernel/thread.h # src/core/hle/kernel/vm_manager.cpp # src/core/loader/3dsx.cpp # src/core/loader/elf.cpp # src/core/loader/ncch.cpp # src/core/memory.cpp # src/core/memory.h # src/core/memory_setup.h
Diffstat (limited to 'src/core/loader/loader.h')
-rw-r--r--src/core/loader/loader.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index ac26f31fa..311785d05 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -13,10 +13,12 @@
13#include <boost/optional.hpp> 13#include <boost/optional.hpp>
14#include "common/common_types.h" 14#include "common/common_types.h"
15#include "common/file_util.h" 15#include "common/file_util.h"
16#include "core/hle/kernel/kernel.h"
16 17
17namespace Kernel { 18namespace Kernel {
18struct AddressMapping; 19struct AddressMapping;
19} 20class Process;
21} // namespace Kernel
20 22
21//////////////////////////////////////////////////////////////////////////////////////////////////// 23////////////////////////////////////////////////////////////////////////////////////////////////////
22// Loader namespace 24// Loader namespace
@@ -94,10 +96,11 @@ public:
94 virtual FileType GetFileType() = 0; 96 virtual FileType GetFileType() = 0;
95 97
96 /** 98 /**
97 * Load the application 99 * Load the application and return the created Process instance
98 * @return ResultStatus result of function 100 * @param process The newly created process.
101 * @return The status result of the operation.
99 */ 102 */
100 virtual ResultStatus Load() = 0; 103 virtual ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) = 0;
101 104
102 /** 105 /**
103 * Loads the system mode that this application needs. 106 * Loads the system mode that this application needs.
@@ -168,6 +171,28 @@ public:
168 return ResultStatus::ErrorNotImplemented; 171 return ResultStatus::ErrorNotImplemented;
169 } 172 }
170 173
174 /**
175 * Get the update RomFS of the application
176 * Since the RomFS can be huge, we return a file reference instead of copying to a buffer
177 * @param romfs_file The file containing the RomFS
178 * @param offset The offset the romfs begins on
179 * @param size The size of the romfs
180 * @return ResultStatus result of function
181 */
182 virtual ResultStatus ReadUpdateRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
183 u64& size) {
184 return ResultStatus::ErrorNotImplemented;
185 }
186
187 /**
188 * Get the title of the application
189 * @param title Reference to store the application title into
190 * @return ResultStatus result of function
191 */
192 virtual ResultStatus ReadTitle(std::string& title) {
193 return ResultStatus::ErrorNotImplemented;
194 }
195
171protected: 196protected:
172 FileUtil::IOFile file; 197 FileUtil::IOFile file;
173 bool is_loaded = false; 198 bool is_loaded = false;
@@ -186,4 +211,4 @@ extern const std::initializer_list<Kernel::AddressMapping> default_address_mappi
186 */ 211 */
187std::unique_ptr<AppLoader> GetLoader(const std::string& filename); 212std::unique_ptr<AppLoader> GetLoader(const std::string& filename);
188 213
189} // namespace 214} // namespace Loader