Kernel: pass Kernel ref in Event

This commit is contained in:
Weiyi Wang
2018-10-11 15:48:16 -04:00
parent 734be98966
commit eec11a94cb
33 changed files with 104 additions and 80 deletions

View File

@@ -14,7 +14,7 @@ void InstallInterfaces(Core::System& system) {
auto& service_manager = system.ServiceManager();
std::make_shared<NIM_AOC>()->InstallAsService(service_manager);
std::make_shared<NIM_S>()->InstallAsService(service_manager);
std::make_shared<NIM_U>()->InstallAsService(service_manager);
std::make_shared<NIM_U>(system)->InstallAsService(service_manager);
}
} // namespace Service::NIM

View File

@@ -2,13 +2,14 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/event.h"
#include "core/hle/service/nim/nim_u.h"
namespace Service::NIM {
NIM_U::NIM_U() : ServiceFramework("nim:u", 2) {
NIM_U::NIM_U(Core::System& system) : ServiceFramework("nim:u", 2) {
const FunctionInfo functions[] = {
{0x00010000, nullptr, "StartSysUpdate"},
{0x00020000, nullptr, "GetUpdateDownloadProgress"},
@@ -20,7 +21,7 @@ NIM_U::NIM_U() : ServiceFramework("nim:u", 2) {
};
RegisterHandlers(functions);
nim_system_update_event =
Kernel::Event::Create(Kernel::ResetType::OneShot, "NIM System Update Event");
system.Kernel().CreateEvent(Kernel::ResetType::OneShot, "NIM System Update Event");
}
NIM_U::~NIM_U() = default;

View File

@@ -6,11 +6,15 @@
#include "core/hle/service/service.h"
namespace Core {
class System;
}
namespace Service::NIM {
class NIM_U final : public ServiceFramework<NIM_U> {
public:
NIM_U();
explicit NIM_U(Core::System& system);
~NIM_U();
private: