sf: add new debug-interface-id in cmif out header

This commit is contained in:
Michael Scire
2022-03-22 05:19:18 -07:00
parent 41e2c24101
commit 36ab24f93a
100 changed files with 381 additions and 146 deletions

View File

@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere.hpp>
#include "usb_remote_ds_root_service.hpp"
#include "usb_remote_ds_root_session.hpp"
#include "usb_remote_ds_service.hpp"
#include "impl/usb_util.hpp"
@@ -48,9 +48,9 @@ namespace ams::usb {
using ObjectFactory = sf::ObjectFactory<Allocator::Policy>;
if (hos::GetVersion() >= hos::Version_11_0_0) {
m_root_service = ObjectFactory::CreateSharedEmplaced<ds::IDsRootService, RemoteDsRootService>(std::addressof(m_allocator), srv, std::addressof(m_allocator));
m_root_session = ObjectFactory::CreateSharedEmplaced<ds::IDsRootSession, RemoteDsRootSession>(std::addressof(m_allocator), srv, std::addressof(m_allocator));
R_TRY(m_root_service->GetService(std::addressof(m_ds_service)));
R_TRY(m_root_session->GetService(std::addressof(m_ds_service)));
} else {
m_ds_service = ObjectFactory::CreateSharedEmplaced<ds::IDsService, RemoteDsService>(std::addressof(m_allocator), srv, std::addressof(m_allocator));
}
@@ -102,7 +102,7 @@ namespace ams::usb {
/* Destroy interface objects. */
m_ds_service = nullptr;
m_root_service = nullptr;
m_root_session = nullptr;
return ResultSuccess();
}

View File

@@ -14,13 +14,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere.hpp>
#include "usb_remote_ds_root_service.hpp"
#include "usb_remote_ds_root_session.hpp"
#include "usb_remote_ds_service.hpp"
namespace ams::usb {
#if defined(ATMOSPHERE_OS_HORIZON)
Result RemoteDsRootService::GetService(sf::Out<sf::SharedPointer<usb::ds::IDsService>> out) {
Result RemoteDsRootSession::GetService(sf::Out<sf::SharedPointer<usb::ds::IDsService>> out) {
Service srv;
serviceAssumeDomain(std::addressof(m_srv));

View File

@@ -19,7 +19,7 @@
namespace ams::usb {
#if defined(ATMOSPHERE_OS_HORIZON)
class RemoteDsRootService {
class RemoteDsRootSession {
private:
using Allocator = sf::ExpHeapAllocator;
using ObjectFactory = sf::ObjectFactory<Allocator::Policy>;
@@ -27,12 +27,12 @@ namespace ams::usb {
Service m_srv;
Allocator *m_allocator;
public:
RemoteDsRootService(Service &srv, sf::ExpHeapAllocator *allocator) : m_srv(srv), m_allocator(allocator) { /* ... */ }
virtual ~RemoteDsRootService() { serviceClose(std::addressof(m_srv)); }
RemoteDsRootSession(Service &srv, sf::ExpHeapAllocator *allocator) : m_srv(srv), m_allocator(allocator) { /* ... */ }
virtual ~RemoteDsRootSession() { serviceClose(std::addressof(m_srv)); }
public:
Result GetService(sf::Out<sf::SharedPointer<usb::ds::IDsService>> out);
};
static_assert(ds::IsIDsRootService<RemoteDsRootService>);
static_assert(ds::IsIDsRootSession<RemoteDsRootSession>);
#endif
}