diff options
Diffstat (limited to 'src/core/hle/service/pcie/pcie.cpp')
| -rw-r--r-- | src/core/hle/service/pcie/pcie.cpp | 90 |
1 files changed, 46 insertions, 44 deletions
diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp index f9aaa2d3b8..d162881ecf 100644 --- a/src/core/hle/service/pcie/pcie.cpp +++ b/src/core/hle/service/pcie/pcie.cpp @@ -15,62 +15,64 @@ namespace Service::PCIe { class ISession final : public ServiceFramework<ISession> { public: - explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {} + explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "QueryFunctions"}, + {1, nullptr, "AcquireFunction"}, + {2, nullptr, "ReleaseFunction"}, + {3, nullptr, "GetFunctionState"}, + {4, nullptr, "GetBarProfile"}, + {5, nullptr, "ReadConfig"}, + {6, nullptr, "WriteConfig"}, + {7, nullptr, "ReadBarRegion"}, + {8, nullptr, "WriteBarRegion"}, + {9, nullptr, "FindCapability"}, + {10, nullptr, "FindExtendedCapability"}, + {11, nullptr, "MapDma"}, + {12, nullptr, "UnmapDma"}, + {13, nullptr, "UnmapDmaBusAddress"}, + {14, nullptr, "GetDmaBusAddress"}, + {15, nullptr, "GetDmaBusAddressRange"}, + {16, nullptr, "SetDmaEnable"}, + {17, nullptr, "AcquireIrq"}, + {18, nullptr, "ReleaseIrq"}, + {19, nullptr, "SetIrqEnable"}, + {20, nullptr, "GetIrqEvent"}, + {21, nullptr, "SetAspmEnable"}, + {22, nullptr, "SetResetUponResumeEnable"}, + {23, nullptr, "ResetFunction"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "QueryFunctions"}, - FunctionInfo{1, nullptr, "AcquireFunction"}, - FunctionInfo{2, nullptr, "ReleaseFunction"}, - FunctionInfo{3, nullptr, "GetFunctionState"}, - FunctionInfo{4, nullptr, "GetBarProfile"}, - FunctionInfo{5, nullptr, "ReadConfig"}, - FunctionInfo{6, nullptr, "WriteConfig"}, - FunctionInfo{7, nullptr, "ReadBarRegion"}, - FunctionInfo{8, nullptr, "WriteBarRegion"}, - FunctionInfo{9, nullptr, "FindCapability"}, - FunctionInfo{10, nullptr, "FindExtendedCapability"}, - FunctionInfo{11, nullptr, "MapDma"}, - FunctionInfo{12, nullptr, "UnmapDma"}, - FunctionInfo{13, nullptr, "UnmapDmaBusAddress"}, - FunctionInfo{14, nullptr, "GetDmaBusAddress"}, - FunctionInfo{15, nullptr, "GetDmaBusAddressRange"}, - FunctionInfo{16, nullptr, "SetDmaEnable"}, - FunctionInfo{17, nullptr, "AcquireIrq"}, - FunctionInfo{18, nullptr, "ReleaseIrq"}, - FunctionInfo{19, nullptr, "SetIrqEnable"}, - FunctionInfo{20, nullptr, "GetIrqEvent"}, - FunctionInfo{21, nullptr, "SetAspmEnable"}, - FunctionInfo{22, nullptr, "SetResetUponResumeEnable"}, - FunctionInfo{23, nullptr, "ResetFunction"} - ); - std::optional<FunctionInfoBase> FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class PCIE final : public ServiceFramework<PCIE> { public: - explicit PCIE(Core::System& system_) : ServiceFramework{system_, "pcie"} {} + explicit PCIE(Core::System& system_) : ServiceFramework{system_, "pcie"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "RegisterClassDriver"}, + {1, nullptr, "QueryFunctionsUnregistered"}, + }; + // clang-format on - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "RegisterClassDriver"}, - FunctionInfo{1, nullptr, "QueryFunctionsUnregistered"} - ); - std::optional<FunctionInfoBase> FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + RegisterHandlers(functions); } }; class PCIE_LOG final : public ServiceFramework<PCIE_LOG> { public: - explicit PCIE_LOG(Core::System& system_) : ServiceFramework{system_, "pcie:log"} {} - - static constexpr auto functions = CreateStaticMap( - FunctionInfo{0, nullptr, "GetLoggedState"}, - FunctionInfo{1, nullptr, "GetLoggedStateEvent"} - ); - std::optional<FunctionInfoBase> FindRequest(u32 key) override { - return HandlerTableGenerateWithFind(key, functions); + explicit PCIE_LOG(Core::System& system_) : ServiceFramework{system_, "pcie:log"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetLoggedState"}, + {1, nullptr, "GetLoggedStateEvent"}, + }; + // clang-format on + RegisterHandlers(functions); } }; |
