Move from ptrace to junction branching and make kernel multithreaded

This commit is a huge step in the direction of better performance, as we move from ptrace to junction branching and have kernel call overhead similar to that of a native kernel call! In addition, this sets the base for the kernel to go fully multi-threaded. However, the kernel is currently not thread-safe and therefore this commit currently causes a crash.
This commit is contained in:
◱ PixelyIon
2020-01-07 08:06:08 +05:30
committed by ◱ PixelyIon
parent b84859d352
commit 970dde8c27
28 changed files with 1296 additions and 822 deletions

View File

@ -7,7 +7,6 @@
#include "kernel/types/KProcess.h"
#include "kernel/types/KThread.h"
#include "services/serviceman.h"
#include "nce.h"
#include "gpu.h"
namespace skyline::kernel {
@ -20,7 +19,6 @@ namespace skyline::kernel {
public:
std::shared_ptr<type::KProcess> process; //!< The KProcess object for the emulator, representing the guest process
std::shared_ptr<type::KThread> thisThread; //!< The corresponding KThread object of the thread that's called an SVC
service::ServiceManager serviceManager; //!< This manages all of the service functions
/**
@ -39,11 +37,12 @@ namespace skyline::kernel {
/**
* @brief Creates a new process
* @param address The address of the initial function
* @param entry The entry point for the new process
* @param argument The argument for the initial function
* @param stackSize The size of the main stack
* @return An instance of the KProcess of the created process
*/
std::shared_ptr<type::KProcess> CreateProcess(u64 address, size_t stackSize);
std::shared_ptr<type::KProcess> CreateProcess(u64 entry, u64 argument, size_t stackSize);
/**
* @brief Kill a particular thread