hle/service: Default constructors and destructors in the cpp file where applicable

When a destructor isn't defaulted into a cpp file, it can cause the use
of forward declarations to seemingly fail to compile for non-obvious
reasons. It also allows inlining of the construction/destruction logic
all over the place where a constructor or destructor is invoked, which
can lead to code bloat. This isn't so much a worry here, given the
services won't be created and destroyed frequently.

The cause of the above mentioned non-obvious errors can be demonstrated
as follows:

------- Demonstrative example, if you know how the described error happens, skip forwards -------

Assume we have the following in the header, which we'll call "thing.h":

\#include <memory>

// Forward declaration. For example purposes, assume the definition
// of Object is in some header named "object.h"
class Object;

class Thing {
public:
    // assume no constructors or destructors are specified here,
    // or the constructors/destructors are defined as:
    //
    // Thing() = default;
    // ~Thing() = default;
    //

    // ... Some interface member functions would be defined here

private:
    std::shared_ptr<Object> obj;
};

If this header is included in a cpp file, (which we'll call "main.cpp"),
this will result in a compilation error, because even though no
destructor is specified, the destructor will still need to be generated by
the compiler because std::shared_ptr's destructor is *not* trivial (in
other words, it does something other than nothing), as std::shared_ptr's
destructor needs to do two things:

1. Decrement the shared reference count of the object being pointed to,
   and if the reference count decrements to zero,

2. Free the Object instance's memory (aka deallocate the memory it's
   pointing to).

And so the compiler generates the code for the destructor doing this inside main.cpp.

Now, keep in mind, the Object forward declaration is not a complete type. All it
does is tell the compiler "a type named Object exists" and allows us to
use the name in certain situations to avoid a header dependency. So the
compiler needs to generate destruction code for Object, but the compiler
doesn't know *how* to destruct it. A forward declaration doesn't tell
the compiler anything about Object's constructor or destructor. So, the
compiler will issue an error in this case because it's undefined
behavior to try and deallocate (or construct) an incomplete type and
std::shared_ptr and std::unique_ptr make sure this isn't the case
internally.

Now, if we had defaulted the destructor in "thing.cpp", where we also
include "object.h", this would never be an issue, as the destructor
would only have its code generated in one place, and it would be in a
place where the full class definition of Object would be visible to the
compiler.

---------------------- End example ----------------------------

Given these service classes are more than certainly going to change in
the future, this defaults the constructors and destructors into the
relevant cpp files to make the construction and destruction of all of
the services consistent and unlikely to run into cases where forward
declarations are indirectly causing compilation errors. It also has the
plus of avoiding the need to rebuild several services if destruction
logic changes, since it would only be necessary to recompile the single
cpp file.
This commit is contained in:
Lioncash 2018-09-10 21:20:52 -04:00
parent 3bac3051fc
commit 6ac955a0b4
148 changed files with 291 additions and 45 deletions

View file

@ -18,4 +18,6 @@ ACC_AA::ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p
RegisterHandlers(functions); RegisterHandlers(functions);
} }
ACC_AA::~ACC_AA() = default;
} // namespace Service::Account } // namespace Service::Account

View file

@ -12,6 +12,7 @@ class ACC_AA final : public Module::Interface {
public: public:
explicit ACC_AA(std::shared_ptr<Module> module, explicit ACC_AA(std::shared_ptr<Module> module,
std::shared_ptr<ProfileManager> profile_manager); std::shared_ptr<ProfileManager> profile_manager);
~ACC_AA() override;
}; };
} // namespace Service::Account } // namespace Service::Account

View file

@ -51,4 +51,6 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p
RegisterHandlers(functions); RegisterHandlers(functions);
} }
ACC_SU::~ACC_SU() = default;
} // namespace Service::Account } // namespace Service::Account

View file

@ -13,6 +13,7 @@ class ACC_SU final : public Module::Interface {
public: public:
explicit ACC_SU(std::shared_ptr<Module> module, explicit ACC_SU(std::shared_ptr<Module> module,
std::shared_ptr<ProfileManager> profile_manager); std::shared_ptr<ProfileManager> profile_manager);
~ACC_SU() override;
}; };
} // namespace Account } // namespace Account

View file

@ -31,4 +31,6 @@ ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p
RegisterHandlers(functions); RegisterHandlers(functions);
} }
ACC_U0::~ACC_U0() = default;
} // namespace Service::Account } // namespace Service::Account

View file

@ -12,6 +12,7 @@ class ACC_U0 final : public Module::Interface {
public: public:
explicit ACC_U0(std::shared_ptr<Module> module, explicit ACC_U0(std::shared_ptr<Module> module,
std::shared_ptr<ProfileManager> profile_manager); std::shared_ptr<ProfileManager> profile_manager);
~ACC_U0() override;
}; };
} // namespace Service::Account } // namespace Service::Account

View file

@ -38,4 +38,6 @@ ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p
RegisterHandlers(functions); RegisterHandlers(functions);
} }
ACC_U1::~ACC_U1() = default;
} // namespace Service::Account } // namespace Service::Account

View file

@ -12,6 +12,7 @@ class ACC_U1 final : public Module::Interface {
public: public:
explicit ACC_U1(std::shared_ptr<Module> module, explicit ACC_U1(std::shared_ptr<Module> module,
std::shared_ptr<ProfileManager> profile_manager); std::shared_ptr<ProfileManager> profile_manager);
~ACC_U1() override;
}; };
} // namespace Service::Account } // namespace Service::Account

View file

@ -29,6 +29,8 @@ ProfileManager::ProfileManager() {
OpenUser(user_uuid); OpenUser(user_uuid);
} }
ProfileManager::~ProfileManager() = default;
/// After a users creation it needs to be "registered" to the system. AddToProfiles handles the /// After a users creation it needs to be "registered" to the system. AddToProfiles handles the
/// internal management of the users profiles /// internal management of the users profiles
boost::optional<size_t> ProfileManager::AddToProfiles(const ProfileInfo& user) { boost::optional<size_t> ProfileManager::AddToProfiles(const ProfileInfo& user) {

View file

@ -82,6 +82,8 @@ static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase is an invalid size");
class ProfileManager { class ProfileManager {
public: public:
ProfileManager(); // TODO(ogniK): Load from system save ProfileManager(); // TODO(ogniK): Load from system save
~ProfileManager();
ResultCode AddUser(const ProfileInfo& user); ResultCode AddUser(const ProfileInfo& user);
ResultCode CreateNewUser(UUID uuid, const ProfileUsername& username); ResultCode CreateNewUser(UUID uuid, const ProfileUsername& username);
ResultCode CreateNewUser(UUID uuid, const std::string& username); ResultCode CreateNewUser(UUID uuid, const std::string& username);

View file

@ -35,6 +35,8 @@ IWindowController::IWindowController() : ServiceFramework("IWindowController") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IWindowController::~IWindowController() = default;
void IWindowController::GetAppletResourceUserId(Kernel::HLERequestContext& ctx) { void IWindowController::GetAppletResourceUserId(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_AM, "(STUBBED) called"); LOG_WARNING(Service_AM, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
@ -61,6 +63,8 @@ IAudioController::IAudioController() : ServiceFramework("IAudioController") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IAudioController::~IAudioController() = default;
void IAudioController::SetExpectedMasterVolume(Kernel::HLERequestContext& ctx) { void IAudioController::SetExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_AM, "(STUBBED) called"); LOG_WARNING(Service_AM, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
@ -116,7 +120,10 @@ IDisplayController::IDisplayController() : ServiceFramework("IDisplayController"
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IDisplayController::~IDisplayController() = default;
IDebugFunctions::IDebugFunctions() : ServiceFramework("IDebugFunctions") {} IDebugFunctions::IDebugFunctions() : ServiceFramework("IDebugFunctions") {}
IDebugFunctions::~IDebugFunctions() = default;
ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger) ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
: ServiceFramework("ISelfController"), nvflinger(std::move(nvflinger)) { : ServiceFramework("ISelfController"), nvflinger(std::move(nvflinger)) {
@ -165,6 +172,8 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger
Kernel::Event::Create(kernel, Kernel::ResetType::Sticky, "ISelfController:LaunchableEvent"); Kernel::Event::Create(kernel, Kernel::ResetType::Sticky, "ISelfController:LaunchableEvent");
} }
ISelfController::~ISelfController() = default;
void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) { void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
// Takes 3 input u8s with each field located immediately after the previous u8, these are // Takes 3 input u8s with each field located immediately after the previous u8, these are
// bool flags. No output. // bool flags. No output.
@ -337,6 +346,8 @@ ICommonStateGetter::ICommonStateGetter() : ServiceFramework("ICommonStateGetter"
event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "ICommonStateGetter:Event"); event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "ICommonStateGetter:Event");
} }
ICommonStateGetter::~ICommonStateGetter() = default;
void ICommonStateGetter::GetBootMode(Kernel::HLERequestContext& ctx) { void ICommonStateGetter::GetBootMode(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -573,6 +584,8 @@ ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryApple
RegisterHandlers(functions); RegisterHandlers(functions);
} }
ILibraryAppletCreator::~ILibraryAppletCreator() = default;
void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) { void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@ -638,6 +651,8 @@ IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationF
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IApplicationFunctions::~IApplicationFunctions() = default;
void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
constexpr std::array<u8, 0x88> data{{ constexpr std::array<u8, 0x88> data{{
0xca, 0x97, 0x94, 0xc7, // Magic 0xca, 0x97, 0x94, 0xc7, // Magic
@ -760,6 +775,8 @@ IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions"
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IHomeMenuFunctions::~IHomeMenuFunctions() = default;
void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx) { void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -783,6 +800,8 @@ IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStat
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IGlobalStateController::~IGlobalStateController() = default;
IApplicationCreator::IApplicationCreator() : ServiceFramework("IApplicationCreator") { IApplicationCreator::IApplicationCreator() : ServiceFramework("IApplicationCreator") {
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
{0, nullptr, "CreateApplication"}, {0, nullptr, "CreateApplication"},
@ -793,6 +812,8 @@ IApplicationCreator::IApplicationCreator() : ServiceFramework("IApplicationCreat
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IApplicationCreator::~IApplicationCreator() = default;
IProcessWindingController::IProcessWindingController() IProcessWindingController::IProcessWindingController()
: ServiceFramework("IProcessWindingController") { : ServiceFramework("IProcessWindingController") {
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
@ -807,4 +828,6 @@ IProcessWindingController::IProcessWindingController()
}; };
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IProcessWindingController::~IProcessWindingController() = default;
} // namespace Service::AM } // namespace Service::AM

View file

@ -42,6 +42,7 @@ enum SystemLanguage {
class IWindowController final : public ServiceFramework<IWindowController> { class IWindowController final : public ServiceFramework<IWindowController> {
public: public:
IWindowController(); IWindowController();
~IWindowController() override;
private: private:
void GetAppletResourceUserId(Kernel::HLERequestContext& ctx); void GetAppletResourceUserId(Kernel::HLERequestContext& ctx);
@ -51,6 +52,7 @@ private:
class IAudioController final : public ServiceFramework<IAudioController> { class IAudioController final : public ServiceFramework<IAudioController> {
public: public:
IAudioController(); IAudioController();
~IAudioController() override;
private: private:
void SetExpectedMasterVolume(Kernel::HLERequestContext& ctx); void SetExpectedMasterVolume(Kernel::HLERequestContext& ctx);
@ -63,16 +65,19 @@ private:
class IDisplayController final : public ServiceFramework<IDisplayController> { class IDisplayController final : public ServiceFramework<IDisplayController> {
public: public:
IDisplayController(); IDisplayController();
~IDisplayController() override;
}; };
class IDebugFunctions final : public ServiceFramework<IDebugFunctions> { class IDebugFunctions final : public ServiceFramework<IDebugFunctions> {
public: public:
IDebugFunctions(); IDebugFunctions();
~IDebugFunctions() override;
}; };
class ISelfController final : public ServiceFramework<ISelfController> { class ISelfController final : public ServiceFramework<ISelfController> {
public: public:
explicit ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger); explicit ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
~ISelfController() override;
private: private:
void SetFocusHandlingMode(Kernel::HLERequestContext& ctx); void SetFocusHandlingMode(Kernel::HLERequestContext& ctx);
@ -98,6 +103,7 @@ private:
class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
public: public:
ICommonStateGetter(); ICommonStateGetter();
~ICommonStateGetter() override;
private: private:
enum class FocusState : u8 { enum class FocusState : u8 {
@ -124,6 +130,7 @@ private:
class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> { class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
public: public:
ILibraryAppletCreator(); ILibraryAppletCreator();
~ILibraryAppletCreator() override;
private: private:
void CreateLibraryApplet(Kernel::HLERequestContext& ctx); void CreateLibraryApplet(Kernel::HLERequestContext& ctx);
@ -133,6 +140,7 @@ private:
class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {
public: public:
IApplicationFunctions(); IApplicationFunctions();
~IApplicationFunctions() override;
private: private:
void PopLaunchParameter(Kernel::HLERequestContext& ctx); void PopLaunchParameter(Kernel::HLERequestContext& ctx);
@ -150,6 +158,7 @@ private:
class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> { class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
public: public:
IHomeMenuFunctions(); IHomeMenuFunctions();
~IHomeMenuFunctions() override;
private: private:
void RequestToGetForeground(Kernel::HLERequestContext& ctx); void RequestToGetForeground(Kernel::HLERequestContext& ctx);
@ -158,16 +167,19 @@ private:
class IGlobalStateController final : public ServiceFramework<IGlobalStateController> { class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {
public: public:
IGlobalStateController(); IGlobalStateController();
~IGlobalStateController() override;
}; };
class IApplicationCreator final : public ServiceFramework<IApplicationCreator> { class IApplicationCreator final : public ServiceFramework<IApplicationCreator> {
public: public:
IApplicationCreator(); IApplicationCreator();
~IApplicationCreator() override;
}; };
class IProcessWindingController final : public ServiceFramework<IProcessWindingController> { class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
public: public:
IProcessWindingController(); IProcessWindingController();
~IProcessWindingController() override;
}; };
/// Registers all AM services with the specified service manager. /// Registers all AM services with the specified service manager.

View file

@ -222,4 +222,6 @@ AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AppletAE::~AppletAE() = default;
} // namespace Service::AM } // namespace Service::AM

View file

@ -18,7 +18,7 @@ namespace AM {
class AppletAE final : public ServiceFramework<AppletAE> { class AppletAE final : public ServiceFramework<AppletAE> {
public: public:
explicit AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger); explicit AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
~AppletAE() = default; ~AppletAE() override;
private: private:
void OpenSystemAppletProxy(Kernel::HLERequestContext& ctx); void OpenSystemAppletProxy(Kernel::HLERequestContext& ctx);

View file

@ -103,4 +103,6 @@ AppletOE::AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AppletOE::~AppletOE() = default;
} // namespace Service::AM } // namespace Service::AM

View file

@ -18,7 +18,7 @@ namespace AM {
class AppletOE final : public ServiceFramework<AppletOE> { class AppletOE final : public ServiceFramework<AppletOE> {
public: public:
explicit AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger); explicit AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
~AppletOE() = default; ~AppletOE() override;
private: private:
void OpenApplicationProxy(Kernel::HLERequestContext& ctx); void OpenApplicationProxy(Kernel::HLERequestContext& ctx);

View file

@ -21,4 +21,6 @@ IdleSys::IdleSys() : ServiceFramework{"idle:sys"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IdleSys::~IdleSys() = default;
} // namespace Service::AM } // namespace Service::AM

View file

@ -11,6 +11,7 @@ namespace Service::AM {
class IdleSys final : public ServiceFramework<IdleSys> { class IdleSys final : public ServiceFramework<IdleSys> {
public: public:
explicit IdleSys(); explicit IdleSys();
~IdleSys() override;
}; };
} // namespace Service::AM } // namespace Service::AM

View file

@ -39,4 +39,6 @@ OMM::OMM() : ServiceFramework{"omm"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
OMM::~OMM() = default;
} // namespace Service::AM } // namespace Service::AM

View file

@ -11,6 +11,7 @@ namespace Service::AM {
class OMM final : public ServiceFramework<OMM> { class OMM final : public ServiceFramework<OMM> {
public: public:
explicit OMM(); explicit OMM();
~OMM() override;
}; };
} // namespace Service::AM } // namespace Service::AM

View file

@ -27,4 +27,6 @@ SPSM::SPSM() : ServiceFramework{"spsm"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
SPSM::~SPSM() = default;
} // namespace Service::AM } // namespace Service::AM

View file

@ -11,6 +11,7 @@ namespace Service::AM {
class SPSM final : public ServiceFramework<SPSM> { class SPSM final : public ServiceFramework<SPSM> {
public: public:
explicit SPSM(); explicit SPSM();
~SPSM() override;
}; };
} // namespace Service::AM } // namespace Service::AM

View file

@ -23,6 +23,8 @@ AOC_U::AOC_U() : ServiceFramework("aoc:u") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AOC_U::~AOC_U() = default;
void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) { void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);

View file

@ -11,7 +11,7 @@ namespace Service::AOC {
class AOC_U final : public ServiceFramework<AOC_U> { class AOC_U final : public ServiceFramework<AOC_U> {
public: public:
AOC_U(); AOC_U();
~AOC_U() = default; ~AOC_U() override;
private: private:
void CountAddOnContent(Kernel::HLERequestContext& ctx); void CountAddOnContent(Kernel::HLERequestContext& ctx);

View file

@ -9,6 +9,9 @@
namespace Service::APM { namespace Service::APM {
Module::Module() = default;
Module::~Module() = default;
void InstallInterfaces(SM::ServiceManager& service_manager) { void InstallInterfaces(SM::ServiceManager& service_manager) {
auto module_ = std::make_shared<Module>(); auto module_ = std::make_shared<Module>();
std::make_shared<APM>(module_, "apm")->InstallAsService(service_manager); std::make_shared<APM>(module_, "apm")->InstallAsService(service_manager);

View file

@ -15,8 +15,8 @@ enum class PerformanceMode : u8 {
class Module final { class Module final {
public: public:
Module() = default; Module();
~Module() = default; ~Module();
}; };
/// Registers all AM services with the specified service manager. /// Registers all AM services with the specified service manager.

View file

@ -70,6 +70,8 @@ APM::APM(std::shared_ptr<Module> apm, const char* name)
RegisterHandlers(functions); RegisterHandlers(functions);
} }
APM::~APM() = default;
void APM::OpenSession(Kernel::HLERequestContext& ctx) { void APM::OpenSession(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -93,6 +95,8 @@ APM_Sys::APM_Sys() : ServiceFramework{"apm:sys"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
APM_Sys::~APM_Sys() = default;
void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) { void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);

View file

@ -11,7 +11,7 @@ namespace Service::APM {
class APM final : public ServiceFramework<APM> { class APM final : public ServiceFramework<APM> {
public: public:
explicit APM(std::shared_ptr<Module> apm, const char* name); explicit APM(std::shared_ptr<Module> apm, const char* name);
~APM() = default; ~APM() override;
private: private:
void OpenSession(Kernel::HLERequestContext& ctx); void OpenSession(Kernel::HLERequestContext& ctx);
@ -22,6 +22,7 @@ private:
class APM_Sys final : public ServiceFramework<APM_Sys> { class APM_Sys final : public ServiceFramework<APM_Sys> {
public: public:
explicit APM_Sys(); explicit APM_Sys();
~APM_Sys() override;
private: private:
void GetPerformanceEvent(Kernel::HLERequestContext& ctx); void GetPerformanceEvent(Kernel::HLERequestContext& ctx);

View file

@ -42,4 +42,6 @@ AudCtl::AudCtl() : ServiceFramework{"audctl"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudCtl::~AudCtl() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -11,6 +11,7 @@ namespace Service::Audio {
class AudCtl final : public ServiceFramework<AudCtl> { class AudCtl final : public ServiceFramework<AudCtl> {
public: public:
explicit AudCtl(); explicit AudCtl();
~AudCtl() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -17,4 +17,6 @@ AudDbg::AudDbg(const char* name) : ServiceFramework{name} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudDbg::~AudDbg() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -11,6 +11,7 @@ namespace Service::Audio {
class AudDbg final : public ServiceFramework<AudDbg> { class AudDbg final : public ServiceFramework<AudDbg> {
public: public:
explicit AudDbg(const char* name); explicit AudDbg(const char* name);
~AudDbg() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -19,4 +19,6 @@ AudInA::AudInA() : ServiceFramework{"audin:a"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudInA::~AudInA() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -11,6 +11,7 @@ namespace Service::Audio {
class AudInA final : public ServiceFramework<AudInA> { class AudInA final : public ServiceFramework<AudInA> {
public: public:
explicit AudInA(); explicit AudInA();
~AudInA() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -41,4 +41,6 @@ AudInU::AudInU() : ServiceFramework("audin:u") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudInU::~AudInU() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -15,7 +15,7 @@ namespace Service::Audio {
class AudInU final : public ServiceFramework<AudInU> { class AudInU final : public ServiceFramework<AudInU> {
public: public:
explicit AudInU(); explicit AudInU();
~AudInU() = default; ~AudInU() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -21,4 +21,6 @@ AudOutA::AudOutA() : ServiceFramework{"audout:a"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudOutA::~AudOutA() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -11,6 +11,7 @@ namespace Service::Audio {
class AudOutA final : public ServiceFramework<AudOutA> { class AudOutA final : public ServiceFramework<AudOutA> {
public: public:
explicit AudOutA(); explicit AudOutA();
~AudOutA() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -218,4 +218,6 @@ AudOutU::AudOutU() : ServiceFramework("audout:u") {
audio_core = std::make_unique<AudioCore::AudioOut>(); audio_core = std::make_unique<AudioCore::AudioOut>();
} }
AudOutU::~AudOutU() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -30,7 +30,7 @@ class IAudioOut;
class AudOutU final : public ServiceFramework<AudOutU> { class AudOutU final : public ServiceFramework<AudOutU> {
public: public:
AudOutU(); AudOutU();
~AudOutU() = default; ~AudOutU() override;
private: private:
std::shared_ptr<IAudioOut> audio_out_interface; std::shared_ptr<IAudioOut> audio_out_interface;

View file

@ -17,4 +17,6 @@ AudRecA::AudRecA() : ServiceFramework{"audrec:a"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudRecA::~AudRecA() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -11,6 +11,7 @@ namespace Service::Audio {
class AudRecA final : public ServiceFramework<AudRecA> { class AudRecA final : public ServiceFramework<AudRecA> {
public: public:
explicit AudRecA(); explicit AudRecA();
~AudRecA() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -36,4 +36,6 @@ AudRecU::AudRecU() : ServiceFramework("audrec:u") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudRecU::~AudRecU() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -15,7 +15,7 @@ namespace Service::Audio {
class AudRecU final : public ServiceFramework<AudRecU> { class AudRecU final : public ServiceFramework<AudRecU> {
public: public:
explicit AudRecU(); explicit AudRecU();
~AudRecU() = default; ~AudRecU() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -23,4 +23,6 @@ AudRenA::AudRenA() : ServiceFramework{"audren:a"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudRenA::~AudRenA() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -11,6 +11,7 @@ namespace Service::Audio {
class AudRenA final : public ServiceFramework<AudRenA> { class AudRenA final : public ServiceFramework<AudRenA> {
public: public:
explicit AudRenA(); explicit AudRenA();
~AudRenA() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -198,6 +198,8 @@ AudRenU::AudRenU() : ServiceFramework("audren:u") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
AudRenU::~AudRenU() = default;
void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) { void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
auto params = rp.PopRaw<AudioCore::AudioRendererParameter>(); auto params = rp.PopRaw<AudioCore::AudioRendererParameter>();

View file

@ -16,7 +16,7 @@ namespace Service::Audio {
class AudRenU final : public ServiceFramework<AudRenU> { class AudRenU final : public ServiceFramework<AudRenU> {
public: public:
explicit AudRenU(); explicit AudRenU();
~AudRenU() = default; ~AudRenU() override;
private: private:
void OpenAudioRenderer(Kernel::HLERequestContext& ctx); void OpenAudioRenderer(Kernel::HLERequestContext& ctx);

View file

@ -28,4 +28,6 @@ CodecCtl::CodecCtl() : ServiceFramework("codecctl") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
CodecCtl::~CodecCtl() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -15,7 +15,7 @@ namespace Service::Audio {
class CodecCtl final : public ServiceFramework<CodecCtl> { class CodecCtl final : public ServiceFramework<CodecCtl> {
public: public:
explicit CodecCtl(); explicit CodecCtl();
~CodecCtl() = default; ~CodecCtl() override;
}; };
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -151,4 +151,6 @@ HwOpus::HwOpus() : ServiceFramework("hwopus") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
HwOpus::~HwOpus() = default;
} // namespace Service::Audio } // namespace Service::Audio

View file

@ -11,7 +11,7 @@ namespace Service::Audio {
class HwOpus final : public ServiceFramework<HwOpus> { class HwOpus final : public ServiceFramework<HwOpus> {
public: public:
explicit HwOpus(); explicit HwOpus();
~HwOpus() = default; ~HwOpus() override;
private: private:
void OpenOpusDecoder(Kernel::HLERequestContext& ctx); void OpenOpusDecoder(Kernel::HLERequestContext& ctx);

View file

@ -13,4 +13,6 @@ BCAT::BCAT(std::shared_ptr<Module> module, const char* name)
}; };
RegisterHandlers(functions); RegisterHandlers(functions);
} }
BCAT::~BCAT() = default;
} // namespace Service::BCAT } // namespace Service::BCAT

View file

@ -11,6 +11,7 @@ namespace Service::BCAT {
class BCAT final : public Module::Interface { class BCAT final : public Module::Interface {
public: public:
explicit BCAT(std::shared_ptr<Module> module, const char* name); explicit BCAT(std::shared_ptr<Module> module, const char* name);
~BCAT() override;
}; };
} // namespace Service::BCAT } // namespace Service::BCAT

View file

@ -42,6 +42,8 @@ void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
: ServiceFramework(name), module(std::move(module)) {} : ServiceFramework(name), module(std::move(module)) {}
Module::Interface::~Interface() = default;
void InstallInterfaces(SM::ServiceManager& service_manager) { void InstallInterfaces(SM::ServiceManager& service_manager) {
auto module = std::make_shared<Module>(); auto module = std::make_shared<Module>();
std::make_shared<BCAT>(module, "bcat:a")->InstallAsService(service_manager); std::make_shared<BCAT>(module, "bcat:a")->InstallAsService(service_manager);

View file

@ -13,6 +13,7 @@ public:
class Interface : public ServiceFramework<Interface> { class Interface : public ServiceFramework<Interface> {
public: public:
explicit Interface(std::shared_ptr<Module> module, const char* name); explicit Interface(std::shared_ptr<Module> module, const char* name);
~Interface() override;
void CreateBcatService(Kernel::HLERequestContext& ctx); void CreateBcatService(Kernel::HLERequestContext& ctx);

View file

@ -13,6 +13,8 @@ namespace Service::Fatal {
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
: ServiceFramework(name), module(std::move(module)) {} : ServiceFramework(name), module(std::move(module)) {}
Module::Interface::~Interface() = default;
void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) { void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx); IPC::RequestParser rp(ctx);
u32 error_code = rp.Pop<u32>(); u32 error_code = rp.Pop<u32>();

View file

@ -13,6 +13,7 @@ public:
class Interface : public ServiceFramework<Interface> { class Interface : public ServiceFramework<Interface> {
public: public:
explicit Interface(std::shared_ptr<Module> module, const char* name); explicit Interface(std::shared_ptr<Module> module, const char* name);
~Interface() override;
void ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx); void ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx);
void ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx); void ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx);

View file

@ -9,4 +9,6 @@ namespace Service::Fatal {
Fatal_P::Fatal_P(std::shared_ptr<Module> module) Fatal_P::Fatal_P(std::shared_ptr<Module> module)
: Module::Interface(std::move(module), "fatal:p") {} : Module::Interface(std::move(module), "fatal:p") {}
Fatal_P::~Fatal_P() = default;
} // namespace Service::Fatal } // namespace Service::Fatal

View file

@ -11,6 +11,7 @@ namespace Service::Fatal {
class Fatal_P final : public Module::Interface { class Fatal_P final : public Module::Interface {
public: public:
explicit Fatal_P(std::shared_ptr<Module> module); explicit Fatal_P(std::shared_ptr<Module> module);
~Fatal_P() override;
}; };
} // namespace Service::Fatal } // namespace Service::Fatal

View file

@ -15,4 +15,6 @@ Fatal_U::Fatal_U(std::shared_ptr<Module> module) : Module::Interface(std::move(m
RegisterHandlers(functions); RegisterHandlers(functions);
} }
Fatal_U::~Fatal_U() = default;
} // namespace Service::Fatal } // namespace Service::Fatal

View file

@ -11,6 +11,7 @@ namespace Service::Fatal {
class Fatal_U final : public Module::Interface { class Fatal_U final : public Module::Interface {
public: public:
explicit Fatal_U(std::shared_ptr<Module> module); explicit Fatal_U(std::shared_ptr<Module> module);
~Fatal_U() override;
}; };
} // namespace Service::Fatal } // namespace Service::Fatal

View file

@ -40,6 +40,8 @@ static FileSys::VirtualDir GetDirectoryRelativeWrapped(FileSys::VirtualDir base,
VfsDirectoryServiceWrapper::VfsDirectoryServiceWrapper(FileSys::VirtualDir backing_) VfsDirectoryServiceWrapper::VfsDirectoryServiceWrapper(FileSys::VirtualDir backing_)
: backing(std::move(backing_)) {} : backing(std::move(backing_)) {}
VfsDirectoryServiceWrapper::~VfsDirectoryServiceWrapper() = default;
std::string VfsDirectoryServiceWrapper::GetName() const { std::string VfsDirectoryServiceWrapper::GetName() const {
return backing->GetName(); return backing->GetName();
} }

View file

@ -64,6 +64,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager, const FileSys::Virtu
class VfsDirectoryServiceWrapper { class VfsDirectoryServiceWrapper {
public: public:
explicit VfsDirectoryServiceWrapper(FileSys::VirtualDir backing); explicit VfsDirectoryServiceWrapper(FileSys::VirtualDir backing);
~VfsDirectoryServiceWrapper();
/** /**
* Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.) * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.)

View file

@ -19,4 +19,6 @@ FSP_LDR::FSP_LDR() : ServiceFramework{"fsp:ldr"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
FSP_LDR::~FSP_LDR() = default;
} // namespace Service::FileSystem } // namespace Service::FileSystem

View file

@ -11,6 +11,7 @@ namespace Service::FileSystem {
class FSP_LDR final : public ServiceFramework<FSP_LDR> { class FSP_LDR final : public ServiceFramework<FSP_LDR> {
public: public:
explicit FSP_LDR(); explicit FSP_LDR();
~FSP_LDR() override;
}; };
} // namespace Service::FileSystem } // namespace Service::FileSystem

View file

@ -20,4 +20,6 @@ FSP_PR::FSP_PR() : ServiceFramework{"fsp:pr"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
FSP_PR::~FSP_PR() = default;
} // namespace Service::FileSystem } // namespace Service::FileSystem

View file

@ -11,6 +11,7 @@ namespace Service::FileSystem {
class FSP_PR final : public ServiceFramework<FSP_PR> { class FSP_PR final : public ServiceFramework<FSP_PR> {
public: public:
explicit FSP_PR(); explicit FSP_PR();
~FSP_PR() override;
}; };
} // namespace Service::FileSystem } // namespace Service::FileSystem

View file

@ -520,6 +520,8 @@ FSP_SRV::FSP_SRV() : ServiceFramework("fsp-srv") {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
FSP_SRV::~FSP_SRV() = default;
void FSP_SRV::Initialize(Kernel::HLERequestContext& ctx) { void FSP_SRV::Initialize(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED) called"); LOG_WARNING(Service_FS, "(STUBBED) called");

View file

@ -16,7 +16,7 @@ namespace Service::FileSystem {
class FSP_SRV final : public ServiceFramework<FSP_SRV> { class FSP_SRV final : public ServiceFramework<FSP_SRV> {
public: public:
explicit FSP_SRV(); explicit FSP_SRV();
~FSP_SRV() = default; ~FSP_SRV() override;
private: private:
void Initialize(Kernel::HLERequestContext& ctx); void Initialize(Kernel::HLERequestContext& ctx);

View file

@ -118,6 +118,8 @@ void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
: ServiceFramework(name), module(std::move(module)) {} : ServiceFramework(name), module(std::move(module)) {}
Module::Interface::~Interface() = default;
void InstallInterfaces(SM::ServiceManager& service_manager) { void InstallInterfaces(SM::ServiceManager& service_manager) {
auto module = std::make_shared<Module>(); auto module = std::make_shared<Module>();
std::make_shared<Friend>(module, "friend:a")->InstallAsService(service_manager); std::make_shared<Friend>(module, "friend:a")->InstallAsService(service_manager);

View file

@ -13,6 +13,7 @@ public:
class Interface : public ServiceFramework<Interface> { class Interface : public ServiceFramework<Interface> {
public: public:
explicit Interface(std::shared_ptr<Module> module, const char* name); explicit Interface(std::shared_ptr<Module> module, const char* name);
~Interface() override;
void CreateFriendService(Kernel::HLERequestContext& ctx); void CreateFriendService(Kernel::HLERequestContext& ctx);

View file

@ -16,4 +16,6 @@ Friend::Friend(std::shared_ptr<Module> module, const char* name)
RegisterHandlers(functions); RegisterHandlers(functions);
} }
Friend::~Friend() = default;
} // namespace Service::Friend } // namespace Service::Friend

View file

@ -11,6 +11,7 @@ namespace Service::Friend {
class Friend final : public Module::Interface { class Friend final : public Module::Interface {
public: public:
explicit Friend(std::shared_ptr<Module> module, const char* name); explicit Friend(std::shared_ptr<Module> module, const char* name);
~Friend() override;
}; };
} // namespace Service::Friend } // namespace Service::Friend

View file

@ -33,6 +33,8 @@ IRS::IRS() : ServiceFramework{"irs"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IRS::~IRS() = default;
IRS_SYS::IRS_SYS() : ServiceFramework{"irs:sys"} { IRS_SYS::IRS_SYS() : ServiceFramework{"irs:sys"} {
// clang-format off // clang-format off
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
@ -46,4 +48,6 @@ IRS_SYS::IRS_SYS() : ServiceFramework{"irs:sys"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
IRS_SYS::~IRS_SYS() = default;
} // namespace Service::HID } // namespace Service::HID

View file

@ -11,11 +11,13 @@ namespace Service::HID {
class IRS final : public ServiceFramework<IRS> { class IRS final : public ServiceFramework<IRS> {
public: public:
explicit IRS(); explicit IRS();
~IRS() override;
}; };
class IRS_SYS final : public ServiceFramework<IRS_SYS> { class IRS_SYS final : public ServiceFramework<IRS_SYS> {
public: public:
explicit IRS_SYS(); explicit IRS_SYS();
~IRS_SYS() override;
}; };
} // namespace Service::HID } // namespace Service::HID

View file

@ -34,4 +34,6 @@ XCD_SYS::XCD_SYS() : ServiceFramework{"xcd:sys"} {
RegisterHandlers(functions); RegisterHandlers(functions);
} }
XCD_SYS::~XCD_SYS() = default;
} // namespace Service::HID } // namespace Service::HID

View file

@ -11,6 +11,7 @@ namespace Service::HID {
class XCD_SYS final : public ServiceFramework<XCD_SYS> { class XCD_SYS final : public ServiceFramework<XCD_SYS> {
public: public:
explicit XCD_SYS(); explicit XCD_SYS();
~XCD_SYS() override;
}; };
} // namespace Service::HID } // namespace Service::HID

View file

@ -14,6 +14,8 @@ namespace Service::NFP {
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
: ServiceFramework(name), module(std::move(module)) {} : ServiceFramework(name), module(std::move(module)) {}
Module::Interface::~Interface() = default;
class IUser final : public ServiceFramework<IUser> { class IUser final : public ServiceFramework<IUser> {
public: public:
IUser() : ServiceFramework("IUser") { IUser() : ServiceFramework("IUser") {

View file

@ -13,6 +13,7 @@ public:
class Interface : public ServiceFramework<Interface> { class Interface : public ServiceFramework<Interface> {
public: public:
explicit Interface(std::shared_ptr<Module> module, const char* name); explicit Interface(std::shared_ptr<Module> module, const char* name);
~Interface() override;
void CreateUserInterface(Kernel::HLERequestContext& ctx); void CreateUserInterface(Kernel::HLERequestContext& ctx);

View file

@ -14,4 +14,6 @@ NFP_User::NFP_User(std::shared_ptr<Module> module)
RegisterHandlers(functions); RegisterHandlers(functions);
} }
NFP_User::~NFP_User() = default;
} // namespace Service::NFP } // namespace Service::NFP

View file

@ -11,6 +11,7 @@ namespace Service::NFP {
class NFP_User final : public Module::Interface { class NFP_User final : public Module::Interface {
public: public:
explicit NFP_User(std::shared_ptr<Module> module); explicit NFP_User(std::shared_ptr<Module> module);
~NFP_User() override;
}; };
} // namespace Service::NFP } // namespace Service::NFP

View file

@ -247,6 +247,8 @@ PL_U::PL_U() : ServiceFramework("pl:u") {
} }
} }
PL_U::~PL_U() = default;
void PL_U::RequestLoad(Kernel::HLERequestContext& ctx) { void PL_U::RequestLoad(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const u32 shared_font_type{rp.Pop<u32>()}; const u32 shared_font_type{rp.Pop<u32>()};

View file

@ -13,7 +13,7 @@ namespace Service::NS {
class PL_U final : public ServiceFramework<PL_U> { class PL_U final : public ServiceFramework<PL_U> {
public: public:
PL_U(); PL_U();
~PL_U() = default; ~PL_U() override;
private: private:
void RequestLoad(Kernel::HLERequestContext& ctx); void RequestLoad(Kernel::HLERequestContext& ctx);

View file

@ -13,6 +13,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvdisp_disp0::nvdisp_disp0(std::shared_ptr<nvmap> nvmap_dev) : nvmap_dev(std::move(nvmap_dev)) {}
nvdisp_disp0 ::~nvdisp_disp0() = default;
u32 nvdisp_disp0::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvdisp_disp0::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
UNIMPLEMENTED_MSG("Unimplemented ioctl"); UNIMPLEMENTED_MSG("Unimplemented ioctl");
return 0; return 0;

View file

@ -17,8 +17,8 @@ class nvmap;
class nvdisp_disp0 final : public nvdevice { class nvdisp_disp0 final : public nvdevice {
public: public:
explicit nvdisp_disp0(std::shared_ptr<nvmap> nvmap_dev) : nvmap_dev(std::move(nvmap_dev)) {} explicit nvdisp_disp0(std::shared_ptr<nvmap> nvmap_dev);
~nvdisp_disp0() = default; ~nvdisp_disp0();
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

View file

@ -3,6 +3,8 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <cstring> #include <cstring>
#include <utility>
#include "common/assert.h" #include "common/assert.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/core.h" #include "core/core.h"
@ -14,6 +16,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvhost_as_gpu::nvhost_as_gpu(std::shared_ptr<nvmap> nvmap_dev) : nvmap_dev(std::move(nvmap_dev)) {}
nvhost_as_gpu::~nvhost_as_gpu() = default;
u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());

View file

@ -6,7 +6,6 @@
#include <memory> #include <memory>
#include <unordered_map> #include <unordered_map>
#include <utility>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/swap.h" #include "common/swap.h"
@ -18,8 +17,8 @@ class nvmap;
class nvhost_as_gpu final : public nvdevice { class nvhost_as_gpu final : public nvdevice {
public: public:
explicit nvhost_as_gpu(std::shared_ptr<nvmap> nvmap_dev) : nvmap_dev(std::move(nvmap_dev)) {} explicit nvhost_as_gpu(std::shared_ptr<nvmap> nvmap_dev);
~nvhost_as_gpu() override = default; ~nvhost_as_gpu() override;
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

View file

@ -11,6 +11,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvhost_ctrl::nvhost_ctrl() = default;
nvhost_ctrl::~nvhost_ctrl() = default;
u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());

View file

@ -13,8 +13,8 @@ namespace Service::Nvidia::Devices {
class nvhost_ctrl final : public nvdevice { class nvhost_ctrl final : public nvdevice {
public: public:
nvhost_ctrl() = default; nvhost_ctrl();
~nvhost_ctrl() override = default; ~nvhost_ctrl() override;
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

View file

@ -9,6 +9,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvhost_ctrl_gpu::nvhost_ctrl_gpu() = default;
nvhost_ctrl_gpu::~nvhost_ctrl_gpu() = default;
u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());

View file

@ -13,8 +13,8 @@ namespace Service::Nvidia::Devices {
class nvhost_ctrl_gpu final : public nvdevice { class nvhost_ctrl_gpu final : public nvdevice {
public: public:
nvhost_ctrl_gpu() = default; nvhost_ctrl_gpu();
~nvhost_ctrl_gpu() override = default; ~nvhost_ctrl_gpu() override;
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

View file

@ -14,6 +14,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvhost_gpu::nvhost_gpu(std::shared_ptr<nvmap> nvmap_dev) : nvmap_dev(std::move(nvmap_dev)) {}
nvhost_gpu::~nvhost_gpu() = default;
u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());

View file

@ -20,8 +20,8 @@ constexpr u32 NVGPU_IOCTL_CHANNEL_KICKOFF_PB(0x1b);
class nvhost_gpu final : public nvdevice { class nvhost_gpu final : public nvdevice {
public: public:
explicit nvhost_gpu(std::shared_ptr<nvmap> nvmap_dev) : nvmap_dev(std::move(nvmap_dev)) {} explicit nvhost_gpu(std::shared_ptr<nvmap> nvmap_dev);
~nvhost_gpu() override = default; ~nvhost_gpu() override;
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

View file

@ -10,6 +10,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvhost_nvdec::nvhost_nvdec() = default;
nvhost_nvdec::~nvhost_nvdec() = default;
u32 nvhost_nvdec::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_nvdec::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());

View file

@ -13,8 +13,8 @@ namespace Service::Nvidia::Devices {
class nvhost_nvdec final : public nvdevice { class nvhost_nvdec final : public nvdevice {
public: public:
nvhost_nvdec() = default; nvhost_nvdec();
~nvhost_nvdec() override = default; ~nvhost_nvdec() override;
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

View file

@ -10,6 +10,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvhost_nvjpg::nvhost_nvjpg() = default;
nvhost_nvjpg::~nvhost_nvjpg() = default;
u32 nvhost_nvjpg::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_nvjpg::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());

View file

@ -13,8 +13,8 @@ namespace Service::Nvidia::Devices {
class nvhost_nvjpg final : public nvdevice { class nvhost_nvjpg final : public nvdevice {
public: public:
nvhost_nvjpg() = default; nvhost_nvjpg();
~nvhost_nvjpg() override = default; ~nvhost_nvjpg() override;
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

View file

@ -10,6 +10,9 @@
namespace Service::Nvidia::Devices { namespace Service::Nvidia::Devices {
nvhost_vic::nvhost_vic() = default;
nvhost_vic::~nvhost_vic() = default;
u32 nvhost_vic::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { u32 nvhost_vic::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}",
command.raw, input.size(), output.size()); command.raw, input.size(), output.size());

View file

@ -13,8 +13,8 @@ namespace Service::Nvidia::Devices {
class nvhost_vic final : public nvdevice { class nvhost_vic final : public nvdevice {
public: public:
nvhost_vic() = default; nvhost_vic();
~nvhost_vic() override = default; ~nvhost_vic() override;
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;

Some files were not shown because too many files have changed in this diff Show more