strat: no longer materially constrained by sm session limit

This commit is contained in:
Michael Scire 2021-04-13 23:58:10 -07:00
parent 997e4dd665
commit 2e1a93f1d1
37 changed files with 215 additions and 333 deletions

View file

@ -20,6 +20,10 @@
namespace ams::sm {
/* Initialization. */
Result Initialize();
Result Finalize();
/* Ordinary SM API. */
Result GetService(Service *out, ServiceName name);
Result RegisterService(Handle *out, ServiceName name, size_t max_sessions, bool is_light);
@ -29,17 +33,4 @@ namespace ams::sm {
Result HasService(bool *out, ServiceName name);
Result WaitService(ServiceName name);
/* Scoped session access. */
namespace impl {
void DoWithSessionImpl(void (*Invoker)(void *), void *Function);
}
template<typename F>
NX_CONSTEXPR void DoWithSession(F f) {
auto invoker = +[](void *func) { (*(F *)func)(); };
impl::DoWithSessionImpl(invoker, &f);
}
}