libnx v4.9.0
|
Service manager (sm) IPC wrapper. More...
Go to the source code of this file.
Data Structures | |
struct | SmServiceName |
Structure representing a service name (null terminated, remaining characters set to zero). More... | |
Macros | |
#define | __COPY_CHAR(_n) if (len > _n) name_encoded.name[_n] = name[_n] |
Functions | |
static u64 | smServiceNameToU64 (SmServiceName name) |
Converts a service name into a 64-bit integer. | |
static SmServiceName | smServiceNameFromU64 (u64 name) |
Converts a 64-bit integer into a service name. | |
static bool | smServiceNamesAreEqual (SmServiceName a, SmServiceName b) |
Checks whether two service names are equal. | |
static SmServiceName | smEncodeName (const char *name) |
Encodes a service name string as a SmServiceName structure. | |
Result | smInitialize (void) |
Initializes SM. | |
void | smExit (void) |
Uninitializes SM. | |
Result | smGetServiceWrapper (Service *service_out, SmServiceName name) |
Requests a service from SM, allowing overrides. | |
Result | smGetServiceOriginal (Handle *handle_out, SmServiceName name) |
Requests a service from SM, as an IPC session handle directly. | |
static Result | smGetService (Service *service_out, const char *name) |
Requests a service from SM. | |
Handle | smGetServiceOverride (SmServiceName name) |
Retrieves an overriden service in the homebrew environment. | |
Result | smRegisterService (Handle *handle_out, SmServiceName name, bool is_light, s32 max_sessions) |
Creates and registers a new service within SM. | |
Result | smRegisterServiceCmif (Handle *handle_out, SmServiceName name, bool is_light, s32 max_sessions) |
Same as smRegisterService, but always using cmif serialization. | |
Result | smRegisterServiceTipc (Handle *handle_out, SmServiceName name, bool is_light, s32 max_sessions) |
Same as smRegisterService, but always using tipc serialization. | |
Result | smUnregisterService (SmServiceName name) |
Unregisters a previously registered service in SM. | |
Result | smUnregisterServiceCmif (SmServiceName name) |
Same as smUnregisterService, but always using cmif serialization. | |
Result | smUnregisterServiceTipc (SmServiceName name) |
Same as smUnregisterService, but always using tipc serialization. | |
Result | smDetachClient (void) |
Detaches the current SM session. | |
Result | smDetachClientCmif (void) |
Same as smDetachClient, but always using cmif serialization. | |
Result | smDetachClientTipc (void) |
Same as smDetachClient, but always using tipc serialization. | |
Service * | smGetServiceSession (void) |
Gets the Service session used to communicate with SM. | |
TipcService * | smGetServiceSessionTipc (void) |
Gets the TipcService session used to communicate with SM. | |
void | smAddOverrideHandle (SmServiceName name, Handle handle) |
Overrides a service with a custom IPC service handle. | |
Service manager (sm) IPC wrapper.
void smAddOverrideHandle | ( | SmServiceName | name, |
Handle | handle | ||
) |
Overrides a service with a custom IPC service handle.
[in] | name | Name of the service. |
[in] | handle | IPC session handle. |
Result smDetachClient | ( | void | ) |
Detaches the current SM session.
|
inlinestatic |
Encodes a service name string as a SmServiceName structure.
[in] | name | Name of the service. |
void smExit | ( | void | ) |
Uninitializes SM.
Requests a service from SM.
[out] | service_out | Service structure which will be filled in. |
[in] | name | Name of the service to request (as a string). |
Result smGetServiceOriginal | ( | Handle * | handle_out, |
SmServiceName | name | ||
) |
Requests a service from SM, as an IPC session handle directly.
[out] | handle_out | Variable containing IPC session handle. |
[in] | name | Name of the service to request. |
Handle smGetServiceOverride | ( | SmServiceName | name | ) |
Retrieves an overriden service in the homebrew environment.
[in] | name | Name of the service to request. |
Service * smGetServiceSession | ( | void | ) |
Gets the Service session used to communicate with SM.
TipcService * smGetServiceSessionTipc | ( | void | ) |
Gets the TipcService session used to communicate with SM.
Result smGetServiceWrapper | ( | Service * | service_out, |
SmServiceName | name | ||
) |
Requests a service from SM, allowing overrides.
[out] | service_out | Service structure which will be filled in. |
[in] | name | Name of the service to request. |
Result smInitialize | ( | void | ) |
Initializes SM.
Result smRegisterService | ( | Handle * | handle_out, |
SmServiceName | name, | ||
bool | is_light, | ||
s32 | max_sessions | ||
) |
Creates and registers a new service within SM.
[out] | handle_out | Variable containing IPC port handle. |
[in] | name | Name of the service. |
[in] | is_light | "Is light" |
[in] | max_sessions | Maximum number of concurrent sessions that the service will accept. |
|
inlinestatic |
Checks whether two service names are equal.
[in] | a | First name. |
[in] | b | Second name. |
Result smUnregisterService | ( | SmServiceName | name | ) |
Unregisters a previously registered service in SM.
[in] | name | Name of the service. |