10 #include "../kernel/svc.h"
11 #include "../sf/service.h"
12 #include "../sf/tipc.h"
23 __builtin_memcpy(&ret, &name,
sizeof(
u64));
54 unsigned len = __builtin_strlen(name);
55 #define __COPY_CHAR(_n) \
56 if (len > _n) name_encoded.name[_n] = name[_n]
57 __COPY_CHAR(0); __COPY_CHAR(1); __COPY_CHAR(2); __COPY_CHAR(3);
58 __COPY_CHAR(4); __COPY_CHAR(5); __COPY_CHAR(6); __COPY_CHAR(7);
Result smRegisterServiceCmif(Handle *handle_out, SmServiceName name, bool is_light, s32 max_sessions)
Same as smRegisterService, but always using cmif serialization.
static SmServiceName smEncodeName(const char *name)
Encodes a service name string as a SmServiceName structure.
Definition: sm.h:51
static u64 smServiceNameToU64(SmServiceName name)
Converts a service name into a 64-bit integer.
Definition: sm.h:20
Handle smGetServiceOverride(SmServiceName name)
Retrieves an overriden service in the homebrew environment.
void smAddOverrideHandle(SmServiceName name, Handle handle)
Overrides a service with a custom IPC service handle.
Result smGetServiceOriginal(Handle *handle_out, SmServiceName name)
Requests a service from SM, as an IPC session handle directly.
static SmServiceName smServiceNameFromU64(u64 name)
Converts a 64-bit integer into a service name.
Definition: sm.h:28
Result smUnregisterServiceTipc(SmServiceName name)
Same as smUnregisterService, but always using tipc serialization.
Result smRegisterService(Handle *handle_out, SmServiceName name, bool is_light, s32 max_sessions)
Creates and registers a new service within SM.
Result smRegisterServiceTipc(Handle *handle_out, SmServiceName name, bool is_light, s32 max_sessions)
Same as smRegisterService, but always using tipc serialization.
Service * smGetServiceSession(void)
Gets the Service session used to communicate with SM.
Result smInitialize(void)
Initializes SM.
static bool smServiceNamesAreEqual(SmServiceName a, SmServiceName b)
Checks whether two service names are equal.
Definition: sm.h:41
Result smDetachClientTipc(void)
Same as smDetachClient, but always using tipc serialization.
void smExit(void)
Uninitializes SM.
Result smUnregisterServiceCmif(SmServiceName name)
Same as smUnregisterService, but always using cmif serialization.
static Result smGetService(Service *service_out, const char *name)
Requests a service from SM.
Definition: sm.h:99
Result smGetServiceWrapper(Service *service_out, SmServiceName name)
Requests a service from SM, allowing overrides.
Result smDetachClient(void)
Detaches the current SM session.
Result smDetachClientCmif(void)
Same as smDetachClient, but always using cmif serialization.
TipcService * smGetServiceSessionTipc(void)
Gets the TipcService session used to communicate with SM.
Result smUnregisterService(SmServiceName name)
Unregisters a previously registered service in SM.
Service object structure.
Definition: service.h:14
Structure representing a service name (null terminated, remaining characters set to zero).
Definition: sm.h:15
tipc Service object structure
Definition: tipc.h:18
#define NX_INLINE
Flags a function as (always) inline.
Definition: types.h:86
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u32 Handle
Kernel object handle.
Definition: types.h:43
u32 Result
Function error code result type.
Definition: types.h:44
#define NX_CONSTEXPR
Flags a function as constexpr in C++14 and above; or as (always) inline otherwise.
Definition: types.h:92
int32_t s32
32-bit signed integer.
Definition: types.h:27