Use load_construct_data for kernel objects

This commit is contained in:
Hamish Milne 2019-12-27 18:52:33 +00:00 committed by zhupengfei
parent 3ed8d95866
commit 6917eaf53b
35 changed files with 158 additions and 113 deletions

View file

@ -4,6 +4,7 @@
#include <cinttypes>
#include <unordered_map>
#include "common/archives.h"
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/core.h"
@ -13,17 +14,19 @@
#include "core/hle/kernel/timer.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::Timer)
namespace Kernel {
Timer::Timer() : kernel(Core::Global<KernelSystem>()), timer_manager(Core::Global<KernelSystem>().GetTimerManager()) {}
Timer::Timer(KernelSystem& kernel)
: WaitObject(kernel), kernel(kernel), timer_manager(kernel.GetTimerManager()) {}
Timer::~Timer() {
Cancel();
timer_manager.timer_callback_table.erase(callback_id);
}
std::shared_ptr<Timer> KernelSystem::CreateTimer(ResetType reset_type, std::string name) {
auto timer{std::make_shared<Timer>()};
timer->Init(*this);
auto timer{std::make_shared<Timer>(*this)};
timer->reset_type = reset_type;
timer->signaled = false;