Serialize some more kernel objects

This commit is contained in:
Hamish Milne
2019-12-22 23:37:17 +00:00
committed by zhupengfei
parent 8c81500dee
commit 4f95575d41
15 changed files with 66 additions and 12 deletions

View File

@ -3,14 +3,17 @@
// Refer to the license.txt file included.
#include "common/assert.h"
#include "common/archives.h"
#include "core/hle/kernel/errors.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/semaphore.h"
#include "core/hle/kernel/thread.h"
SERIALIZE_EXPORT_IMPL(Kernel::Semaphore)
namespace Kernel {
Semaphore::Semaphore(KernelSystem& kernel) : WaitObject(kernel) {}
Semaphore::Semaphore() : WaitObject() {}
Semaphore::~Semaphore() {}
ResultVal<std::shared_ptr<Semaphore>> KernelSystem::CreateSemaphore(s32 initial_count,
@ -20,7 +23,7 @@ ResultVal<std::shared_ptr<Semaphore>> KernelSystem::CreateSemaphore(s32 initial_
if (initial_count > max_count)
return ERR_INVALID_COMBINATION_KERNEL;
auto semaphore{std::make_shared<Semaphore>(*this)};
auto semaphore{std::make_shared<Semaphore>()};
// When the semaphore is created, some slots are reserved for other threads,
// and the rest is reserved for the caller thread