core: Port all current usages of Event to Readable/WritableEvent
This commit is contained in:
parent
a56fc84e7a
commit
ff610103b5
29 changed files with 287 additions and 164 deletions
|
@ -6,7 +6,9 @@
|
|||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/readable_event.h"
|
||||
#include "core/hle/kernel/writable_event.h"
|
||||
#include "core/hle/service/nvdrv/interface.h"
|
||||
#include "core/hle/service/nvdrv/nvdrv.h"
|
||||
|
||||
|
@ -69,7 +71,9 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushCopyObjects(query_event);
|
||||
|
||||
const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent("NVDRV::query_event")};
|
||||
rb.PushCopyObjects(event->second);
|
||||
rb.Push<u32>(0);
|
||||
}
|
||||
|
||||
|
@ -127,7 +131,8 @@ NVDRV::NVDRV(std::shared_ptr<Module> nvdrv, const char* name)
|
|||
RegisterHandlers(functions);
|
||||
|
||||
auto& kernel = Core::System::GetInstance().Kernel();
|
||||
query_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "NVDRV::query_event");
|
||||
query_event = Kernel::WritableEvent::CreateRegisteredEventPair(
|
||||
kernel, Kernel::ResetType::OneShot, "NVDRV::query_event");
|
||||
}
|
||||
|
||||
NVDRV::~NVDRV() = default;
|
||||
|
|
|
@ -5,10 +5,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/service/nvdrv/nvdrv.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Kernel {
|
||||
class WritableEvent;
|
||||
}
|
||||
|
||||
namespace Service::Nvidia {
|
||||
|
||||
class NVDRV final : public ServiceFramework<NVDRV> {
|
||||
|
@ -31,7 +34,7 @@ private:
|
|||
|
||||
u64 pid{};
|
||||
|
||||
Kernel::SharedPtr<Kernel::Event> query_event;
|
||||
Kernel::SharedPtr<Kernel::WritableEvent> query_event;
|
||||
};
|
||||
|
||||
} // namespace Service::Nvidia
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue