erpt: reimplement the sysmodule (#875)

* erpt: reimplement the sysmodule

* fatal: update for latest bindings

* erpt: amend logic for culling orphan attachments
This commit is contained in:
SciresM 2020-04-13 17:07:37 -07:00 committed by GitHub
parent eca5ac01b8
commit 79b9e07ee9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
117 changed files with 6716 additions and 59 deletions

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours.hpp>
#include <stratosphere/psc/psc_types.hpp>
#include <stratosphere/psc/psc_pm_module_id.hpp>
namespace ams::psc::sf {
class IPmModule : public ams::sf::IServiceObject {
protected:
enum class CommandId {
Initialize = 0,
GetRequest = 1,
Acknowledge = 2,
Finalize = 3,
AcknowledgeEx = 4,
};
public:
/* Actual commands. */
virtual Result Initialize(ams::sf::OutCopyHandle out, psc::PmModuleId module_id, const ams::sf::InBuffer &child_list) = 0;
virtual Result GetRequest(ams::sf::Out<PmState> out_state, ams::sf::Out<PmFlagSet> out_flags) = 0;
virtual Result Acknowledge() = 0;
virtual Result Finalize() = 0;
virtual Result AcknowledgeEx(PmState state) = 0;
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MAKE_SERVICE_COMMAND_META(Initialize),
MAKE_SERVICE_COMMAND_META(GetRequest),
MAKE_SERVICE_COMMAND_META(Acknowledge),
MAKE_SERVICE_COMMAND_META(Finalize),
MAKE_SERVICE_COMMAND_META(AcknowledgeEx, hos::Version_600), /* TODO: This is really 5.1.0... */
};
};
}

View file

@ -0,0 +1,37 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours.hpp>
#include <stratosphere/psc/sf/psc_sf_i_pm_module.hpp>
namespace ams::psc::sf {
class IPmService : public ams::sf::IServiceObject {
protected:
enum class CommandId {
Initialize = 0,
};
public:
/* Actual commands. */
virtual Result Initialize(ams::sf::Out<std::shared_ptr<psc::sf::IPmModule>> out) = 0;
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MAKE_SERVICE_COMMAND_META(Initialize),
};
};
}