mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-14 08:40:48 -04:00
nvnflinger: convert to process
This commit is contained in:
@@ -42,7 +42,7 @@ void EventInterface::FreeEvent(Kernel::KEvent* event) {
|
||||
module.service_context.CloseEvent(event);
|
||||
}
|
||||
|
||||
void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) {
|
||||
void LoopProcess(Core::System& system) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
auto module = std::make_shared<Module>(system);
|
||||
const auto NvdrvInterfaceFactoryForApplication = [&, module] {
|
||||
@@ -62,7 +62,6 @@ void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) {
|
||||
server_manager->RegisterNamedService("nvdrv:s", NvdrvInterfaceFactoryForSysmodules);
|
||||
server_manager->RegisterNamedService("nvdrv:t", NvdrvInterfaceFactoryForTesting);
|
||||
server_manager->RegisterNamedService("nvmemp", std::make_shared<NVMEMP>(system));
|
||||
nvnflinger.SetNVDrvInstance(module);
|
||||
ServerManager::RunServer(std::move(server_manager));
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,6 @@ private:
|
||||
std::unordered_map<std::string, std::function<FilesContainerType::iterator(DeviceFD)>> builders;
|
||||
};
|
||||
|
||||
void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system);
|
||||
void LoopProcess(Core::System& system);
|
||||
|
||||
} // namespace Service::Nvidia
|
||||
|
||||
@@ -263,8 +263,10 @@ NVDRV::NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char*
|
||||
}
|
||||
|
||||
NVDRV::~NVDRV() {
|
||||
auto& container = nvdrv->GetContainer();
|
||||
container.CloseSession(session_id);
|
||||
if (is_initialized) {
|
||||
auto& container = nvdrv->GetContainer();
|
||||
container.CloseSession(session_id);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Service::Nvidia
|
||||
|
||||
@@ -16,6 +16,10 @@ public:
|
||||
explicit NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* name);
|
||||
~NVDRV() override;
|
||||
|
||||
std::shared_ptr<Module> GetModule() const {
|
||||
return nvdrv;
|
||||
}
|
||||
|
||||
private:
|
||||
void Open(HLERequestContext& ctx);
|
||||
void Ioctl1(HLERequestContext& ctx);
|
||||
|
||||
Reference in New Issue
Block a user