Loaders: Don't automatically set the current process every time we load an application.

The loaders will now just create a Kernel::Process, construct it and return it to the caller, which is responsible for setting it as the current process and configuring the global page table.
This commit is contained in:
Subv 2017-09-26 18:17:47 -05:00
parent 3165466b66
commit 7f48aa8d25
8 changed files with 40 additions and 37 deletions

View file

@ -13,10 +13,12 @@
#include <boost/optional.hpp>
#include "common/common_types.h"
#include "common/file_util.h"
#include "core/hle/kernel/kernel.h"
namespace Kernel {
struct AddressMapping;
}
class Process;
} // namespace Kernel
////////////////////////////////////////////////////////////////////////////////////////////////////
// Loader namespace
@ -92,10 +94,11 @@ public:
virtual FileType GetFileType() = 0;
/**
* Load the application
* @return ResultStatus result of function
* Load the application and return the created Process instance
* @param process The newly created process.
* @return The status result of the operation.
*/
virtual ResultStatus Load() = 0;
virtual ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) = 0;
/**
* Loads the system mode that this application needs.
@ -206,4 +209,4 @@ extern const std::initializer_list<Kernel::AddressMapping> default_address_mappi
*/
std::unique_ptr<AppLoader> GetLoader(const std::string& filename);
} // namespace
} // namespace Loader