Revert "[hle] constexpr handler dispatch maps, introduce version gating (#4480)" (#4532)

This reverts commit 218c6705d9.

- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md).
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4532
Reviewed-by: lizzie <lizzie@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
PavelBARABANOV
2026-10-15 08:45:15 +02:00
committed by crueter
parent 14da4482a4
commit e255c20db4
588 changed files with 14723 additions and 12534 deletions
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -278,7 +278,7 @@ NvResult nvhost_gpu::AllocateObjectContext(IoctlAllocObjCtx& params) {
params.flags = allowed_mask;
}
s32_le ctx_class_number_index =
s32_le ctx_class_number_index =
GetObjectContextClassNumberIndex(static_cast<CtxClasses>(params.class_num));
if (ctx_class_number_index < 0) {
LOG_ERROR(Service_NVDRV, "Invalid class number for object context: {:#x}",
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+34 -40
View File
@@ -50,61 +50,55 @@ class NVGEM_C final : public ServiceFramework<NVGEM_C> {
public:
explicit NVGEM_C(Core::System& system_)
: ServiceFramework{system_, "nvgem:c"}
{}
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
{
static const FunctionInfo functions[] = {
{0, nullptr, "Initialize"},
{1, nullptr, "GetEventHandle"},
{2, nullptr, "ControlNotification"},
{3, nullptr, "SetNotificationPerm"},
{4, nullptr, "SetCoreDumpPerm"},
{5, nullptr, "GetAruid"},
{6, nullptr, "Reset"},
{7, nullptr, "GetAruid2"},
};
RegisterHandlers(functions);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, nullptr, "Initialize"},
FunctionInfo{1, nullptr, "GetEventHandle"},
FunctionInfo{2, nullptr, "ControlNotification"},
FunctionInfo{3, nullptr, "SetNotificationPerm"},
FunctionInfo{4, nullptr, "SetCoreDumpPerm"},
FunctionInfo{5, nullptr, "GetAruid"},
FunctionInfo{6, nullptr, "Reset"},
FunctionInfo{7, nullptr, "GetAruid2"}
);
};
class NVGEM_CD final : public ServiceFramework<NVGEM_CD> {
public:
explicit NVGEM_CD(Core::System& system_)
: ServiceFramework{system_, "nvgem:cd"}
{}
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
{
static const FunctionInfo functions[] = {
{0, nullptr, "Initialize"},
{1, nullptr, "GetAruid"},
{2, nullptr, "ReadNextBlock"},
{3, nullptr, "GetNextBlockSize"},
{4, nullptr, "ReadNextBlock2"},
};
RegisterHandlers(functions);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, nullptr, "Initialize"},
FunctionInfo{1, nullptr, "GetAruid"},
FunctionInfo{2, nullptr, "ReadNextBlock"},
FunctionInfo{3, nullptr, "GetNextBlockSize"},
FunctionInfo{4, nullptr, "ReadNextBlock2"}
);
};
class NVDBG_D final : public ServiceFramework<NVDBG_D> {
public:
explicit NVDBG_D(Core::System& system_)
: ServiceFramework{system_, "nvdbg:d"}
{}
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
{
static const FunctionInfo functions[] = {
{0, nullptr, "Open"},
{1, nullptr, "Ioctl"},
{2, nullptr, "Close"},
{4, nullptr, "QueryEvent"},
{9, nullptr, "DumpStatus"},
{10, nullptr, "InitializeDevtools"},
{11, nullptr, "Ioctl2"},
{12, nullptr, "Ioctl3"},
{13, nullptr, "SetConfiguration"},
};
RegisterHandlers(functions);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, nullptr, "Open"},
FunctionInfo{1, nullptr, "Ioctl"},
FunctionInfo{2, nullptr, "Close"},
FunctionInfo{4, nullptr, "QueryEvent"},
FunctionInfo{9, nullptr, "DumpStatus"},
FunctionInfo{10, nullptr, "InitializeDevtools"},
FunctionInfo{11, nullptr, "Ioctl2"},
FunctionInfo{12, nullptr, "Ioctl3"},
FunctionInfo{13, nullptr, "SetConfiguration"}
);
};
void LoopProcess(Core::System& system) {
@@ -245,6 +245,24 @@ void NVDRV::DumpGraphicsMemoryInfo(HLERequestContext& ctx) {
NVDRV::NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* name)
: ServiceFramework{system_, name}, nvdrv{std::move(nvdrv_)} {
static const FunctionInfo functions[] = {
{0, &NVDRV::Open, "Open"},
{1, &NVDRV::Ioctl1, "Ioctl"},
{2, &NVDRV::Close, "Close"},
{3, &NVDRV::Initialize, "Initialize"},
{4, &NVDRV::QueryEvent, "QueryEvent"},
{5, nullptr, "MapSharedMem"},
{6, &NVDRV::GetStatus, "GetStatus"},
{7, nullptr, "SetAruidForTest"},
{8, &NVDRV::SetAruid, "SetAruid"},
{9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"},
{10, nullptr, "InitializeDevtools"},
{11, &NVDRV::Ioctl2, "Ioctl2"},
{12, &NVDRV::Ioctl3, "Ioctl3"},
{13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled,
"SetGraphicsFirmwareMemoryMarginEnabled"},
};
RegisterHandlers(functions);
}
NVDRV::~NVDRV() {
+1 -20
View File
@@ -38,27 +38,8 @@ private:
void ServiceError(HLERequestContext& ctx, NvResult result);
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, &NVDRV::Open, "Open"},
FunctionInfo{1, &NVDRV::Ioctl1, "Ioctl"},
FunctionInfo{2, &NVDRV::Close, "Close"},
FunctionInfo{3, &NVDRV::Initialize, "Initialize"},
FunctionInfo{4, &NVDRV::QueryEvent, "QueryEvent"},
FunctionInfo{5, nullptr, "MapSharedMem"},
FunctionInfo{6, &NVDRV::GetStatus, "GetStatus"},
FunctionInfo{7, nullptr, "SetAruidForTest"},
FunctionInfo{8, &NVDRV::SetAruid, "SetAruid"},
FunctionInfo{9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"},
FunctionInfo{10, nullptr, "InitializeDevtools"},
FunctionInfo{11, &NVDRV::Ioctl2, "Ioctl2"},
FunctionInfo{12, &NVDRV::Ioctl3, "Ioctl3"},
FunctionInfo{13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled,
"SetGraphicsFirmwareMemoryMarginEnabled"}
);
std::shared_ptr<Module> nvdrv;
u64 pid{};
bool is_initialized{};
NvCore::SessionId session_id{};
+5
View File
@@ -11,6 +11,11 @@
namespace Service::Nvidia {
NVMEMP::NVMEMP(Core::System& system_) : ServiceFramework{system_, "nvmemp"} {
static const FunctionInfo functions[] = {
{0, &NVMEMP::Open, "Open"},
{1, &NVMEMP::GetAruid, "GetAruid"},
};
RegisterHandlers(functions);
}
NVMEMP::~NVMEMP() = default;
-8
View File
@@ -22,14 +22,6 @@ public:
private:
void Open(HLERequestContext& ctx);
void GetAruid(HLERequestContext& ctx);
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, &NVMEMP::Open, "Open"},
FunctionInfo{1, &NVMEMP::GetAruid, "GetAruid"}
);
};
} // namespace Service::Nvidia