mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-27 07:12:40 +02:00
Add a bunch of GetServiceSession functions (#305)
* Add a bunch of GetServiceSession functions
This commit is contained in:
parent
40d7e0de51
commit
da4c060278
@ -33,7 +33,7 @@ typedef struct
|
||||
|
||||
Result accountInitialize(void);
|
||||
void accountExit(void);
|
||||
Service* accountGetService(void);
|
||||
Service* accountGetServiceSession(void);
|
||||
|
||||
/// Get the total number of user profiles
|
||||
Result accountGetUserCount(s32* user_count);
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
/// CpuBoostMode. With \ref appletSetCpuBoostMode, only values 0/1 are available. This allows using higher clock rates.
|
||||
typedef enum {
|
||||
@ -16,6 +17,7 @@ typedef enum {
|
||||
|
||||
Result apmInitialize(void);
|
||||
void apmExit(void);
|
||||
Service* apmGetServiceSession(void);
|
||||
|
||||
Result apmSetPerformanceConfiguration(u32 PerformanceMode, u32 PerformanceConfiguration);
|
||||
Result apmGetPerformanceConfiguration(u32 PerformanceMode, u32 *PerformanceConfiguration);
|
||||
|
@ -7,9 +7,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "../audio/audio.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
Result auddevInitialize(void);
|
||||
void auddevExit(void);
|
||||
Service* auddevGetServiceSession(void);
|
||||
|
||||
Result auddevListAudioDeviceName(AudioDeviceName *DeviceNames, s32 max_names, s32 *total_names);
|
||||
Result auddevSetAudioDeviceOutputVolume(const AudioDeviceName *DeviceName, float volume);
|
||||
|
@ -7,6 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../audio/audio.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define AUDREN_CONSTEXPR constexpr
|
||||
@ -321,6 +322,7 @@ AUDREN_CONSTEXPR size_t audrenGetOutputParamSize(const AudioRendererConfig* conf
|
||||
|
||||
Result audrenInitialize(const AudioRendererConfig* config);
|
||||
void audrenExit(void);
|
||||
Service* audrenGetServiceSession(void);
|
||||
void audrenWaitFrame(void);
|
||||
Result audrenGetState(u32* out_state);
|
||||
Result audrenRequestUpdateAudioRenderer(const void* in_param_buf, size_t in_param_buf_size, void* out_param_buf, size_t out_param_buf_size, void* perf_buf, size_t perf_buf_size);
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
typedef enum {
|
||||
BpcSleepButtonState_Held = 0,
|
||||
@ -14,6 +15,7 @@ typedef enum {
|
||||
|
||||
Result bpcInitialize(void);
|
||||
void bpcExit(void);
|
||||
Service* bpcGetServiceSession(void);
|
||||
|
||||
Result bpcShutdownSystem(void);
|
||||
Result bpcRebootSystem(void);
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "../types.h"
|
||||
#include "../kernel/tmem.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
/// Configuration structure for bsdInitalize
|
||||
typedef struct {
|
||||
@ -37,6 +38,7 @@ const BsdInitConfig *bsdGetDefaultInitConfig(void);
|
||||
Result bsdInitialize(const BsdInitConfig *config);
|
||||
/// Deinitialize the BSD service.
|
||||
void bsdExit(void);
|
||||
Service* bsdGetServiceSession(void);
|
||||
|
||||
/// Creates a socket.
|
||||
int bsdSocket(int domain, int type, int protocol);
|
||||
|
@ -12,6 +12,7 @@
|
||||
/// Initialize caps:sc. Only available on 2.0.0+.
|
||||
Result capsscInitialize(void);
|
||||
void capsscExit(void);
|
||||
Service* capsscGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief This takes a screenshot, with the screenshot being written into the output buffer.
|
||||
|
@ -12,6 +12,7 @@
|
||||
/// Initialize caps:su. Only available on 4.0.0+.
|
||||
Result capssuInitialize(void);
|
||||
void capssuExit(void);
|
||||
Service* capssuGetServiceSession(void);
|
||||
|
||||
/// Same as \ref capssuSaveScreenShotEx0, except this uses an all-zero CapsScreenShotAttribute where the first u32 is set to attr_val. attr_val can be zero.
|
||||
Result capssuSaveScreenShot(const void* buffer, size_t size, u32 unk, u32 attr_val, CapsApplicationAlbumEntry *out);
|
||||
|
@ -15,6 +15,7 @@ typedef struct {
|
||||
|
||||
Result clkrstInitialize(void);
|
||||
void clkrstExit(void);
|
||||
Service* clkrstGetServiceSession(void);
|
||||
|
||||
/// Opens a ClkrstSession for the requested PcvModuleId, unk is set to 3 in official sysmodules.
|
||||
Result clkrstOpenSession(ClkrstSession* session_out, PcvModuleId module_id, u32 unk);
|
||||
|
@ -6,8 +6,10 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
Result csrngInitialize(void);
|
||||
void csrngExit(void);
|
||||
Service* csrngGetServiceSession(void);
|
||||
|
||||
Result csrngGetRandomBytes(void *out, size_t out_size);
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
Result fsldrInitialize(void);
|
||||
void fsldrExit(void);
|
||||
Service* fsldrGetServiceSession(void);
|
||||
|
||||
Result fsldrOpenCodeFileSystem(u64 tid, const char *path, FsFileSystem* out);
|
||||
Result fsldrIsArchivedProgram(u64 pid, bool *out);
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
Result fsprInitialize(void);
|
||||
void fsprExit(void);
|
||||
Service* fsprGetServiceSession(void);
|
||||
|
||||
Result fsprRegisterProgram(u64 pid, u64 titleID, FsStorageId storageID, const void *fs_access_header, size_t fah_size, const void *fs_access_control, size_t fac_size);
|
||||
Result fsprUnregisterProgram(u64 pid);
|
||||
|
@ -30,6 +30,7 @@ typedef enum {
|
||||
|
||||
Result gpioInitialize(void);
|
||||
void gpioExit(void);
|
||||
Service* gpioGetServiceSession(void);
|
||||
|
||||
Result gpioOpenSession(GpioPadSession *out, GpioPadName name);
|
||||
|
||||
|
@ -656,7 +656,7 @@ Result hidInitialize(void);
|
||||
void hidExit(void);
|
||||
void hidReset(void);
|
||||
|
||||
Service* hidGetSessionService(void);
|
||||
Service* hidGetServiceSession(void);
|
||||
void* hidGetSharedmemAddr(void);
|
||||
|
||||
void hidSetControllerLayout(HidControllerID id, HidControllerLayoutType layoutType);
|
||||
|
@ -78,6 +78,7 @@ typedef struct {
|
||||
|
||||
Result hiddbgInitialize(void);
|
||||
void hiddbgExit(void);
|
||||
Service* hiddbgGetServiceSession(void);
|
||||
|
||||
/// Writes the input RGB colors to the spi-flash for the specified controller (offset 0x6050 size 0x6). See hidsys.h for UniquePadId. Only available with [3.0.0+].
|
||||
Result hiddbgUpdateControllerColor(u32 colorBody, u32 colorButtons, u64 UniquePadId);
|
||||
|
@ -34,6 +34,7 @@ typedef struct {
|
||||
|
||||
Result hidsysInitialize(void);
|
||||
void hidsysExit(void);
|
||||
Service* hidsysGetServiceSession(void);
|
||||
|
||||
Result hidsysEnableAppletToGetInput(bool enable);
|
||||
|
||||
|
@ -57,6 +57,7 @@ typedef enum {
|
||||
|
||||
Result i2cInitialize(void);
|
||||
void i2cExit(void);
|
||||
Service* i2cGetServiceSession(void);
|
||||
|
||||
Result i2cOpenSession(I2cSession *out, I2cDevice dev);
|
||||
|
||||
|
@ -55,7 +55,7 @@ Result irsInitialize(void);
|
||||
/// Exit irs.
|
||||
void irsExit(void);
|
||||
|
||||
Service* irsGetSessionService(void);
|
||||
Service* irsGetServiceSession(void);
|
||||
void* irsGetSharedmemAddr(void);
|
||||
|
||||
/// (De)activate the IR sensor, this is automatically used by \ref irsExit. Must be called after irsInitialize() to activate the IR sensor.
|
||||
|
@ -6,9 +6,11 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
Result lblInitialize(void);
|
||||
void lblExit(void);
|
||||
Service* lblGetServiceSession(void);
|
||||
|
||||
Result lblSwitchBacklightOn(u64 fade_time);
|
||||
Result lblSwitchBacklightOff(u64 fade_time);
|
||||
|
@ -19,6 +19,7 @@ typedef struct {
|
||||
|
||||
Result lrInitialize(void);
|
||||
void lrExit(void);
|
||||
Service* lrGetServiceSession(void);
|
||||
|
||||
Result lrOpenLocationResolver(FsStorageId storage, LrLocationResolver* out);
|
||||
Result lrOpenRegisteredLocationResolver(LrRegisteredLocationResolver* out);
|
||||
|
@ -76,6 +76,7 @@ typedef struct {
|
||||
|
||||
Result ncmInitialize(void);
|
||||
void ncmExit(void);
|
||||
Service* ncmGetServiceSession(void);
|
||||
|
||||
Result ncmOpenContentStorage(FsStorageId storage, NcmContentStorage* out);
|
||||
Result ncmOpenContentMetaDatabase(FsStorageId storage, NcmContentMetaDatabase* out);
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
typedef enum {
|
||||
PcvModule_CpuBus = 0,
|
||||
@ -192,6 +193,7 @@ typedef enum {
|
||||
|
||||
Result pcvInitialize(void);
|
||||
void pcvExit(void);
|
||||
Service* pcvGetServiceSession(void);
|
||||
|
||||
Result pcvGetModuleId(PcvModuleId *module_id, PcvModule module);
|
||||
|
||||
|
@ -161,6 +161,7 @@ typedef struct {
|
||||
|
||||
Result pdmqryInitialize(void);
|
||||
void pdmqryExit(void);
|
||||
Service* pdmqueryGetServiceSession(void);
|
||||
|
||||
/**
|
||||
* @brief Gets a list of \ref PdmApplicationEvent.
|
||||
|
@ -27,6 +27,7 @@ typedef struct {
|
||||
|
||||
Result plInitialize(void);
|
||||
void plExit(void);
|
||||
Service* plGetServiceSession(void);
|
||||
void* plGetSharedmemAddr(void);
|
||||
|
||||
///< Gets a specific shared-font via SharedFontType, see \ref PlSharedFontType.
|
||||
|
@ -26,6 +26,7 @@ typedef struct {
|
||||
|
||||
Result pscInitialize(void);
|
||||
void pscExit(void);
|
||||
Service* pscGetServiceSession(void);
|
||||
|
||||
Result pscGetPmModule(PscPmModule *out, u16 module_id, const u16 *dependencies, size_t dependency_count, bool autoclear);
|
||||
|
||||
|
@ -30,6 +30,7 @@ typedef struct {
|
||||
|
||||
Result psmInitialize(void);
|
||||
void psmExit(void);
|
||||
Service* psmGetServiceSession(void);
|
||||
|
||||
Result psmGetBatteryChargePercentage(u32 *out);
|
||||
Result psmGetChargerType(ChargerType *out);
|
||||
|
@ -11,12 +11,15 @@
|
||||
|
||||
Result ldrRoInitialize(void);
|
||||
void ldrRoExit(void);
|
||||
Service* ldrRoGetServiceSession(void);
|
||||
|
||||
Result ro1Initialize(void);
|
||||
void ro1Exit(void);
|
||||
Service* ro1GetServiceSession(void);
|
||||
|
||||
Result roDmntInitialize(void);
|
||||
void roDmntExit(void);
|
||||
Service* roDmntGetServiceSession(void);
|
||||
|
||||
Result ldrRoLoadNro(u64* out_address, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size);
|
||||
Result ldrRoUnloadNro(u64 nro_address);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#pragma once
|
||||
#include "../result.h"
|
||||
#include "../kernel/event.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
#define SET_MAX_NAME_SIZE 0x48
|
||||
#define SET_MAX_NICKNAME_SIZE 0x80
|
||||
@ -86,6 +87,7 @@ typedef struct {
|
||||
|
||||
Result setInitialize(void);
|
||||
void setExit(void);
|
||||
Service* setGetServiceSession(void);
|
||||
|
||||
/// Converts LanguageCode to Language.
|
||||
Result setMakeLanguage(u64 LanguageCode, s32 *Language);
|
||||
@ -114,6 +116,7 @@ Result setGetRegionCode(SetRegion *out);
|
||||
|
||||
Result setsysInitialize(void);
|
||||
void setsysExit(void);
|
||||
Service* setsysGetServiceSession(void);
|
||||
|
||||
/// Gets the current system theme.
|
||||
Result setsysGetColorSetId(ColorSetId *out);
|
||||
|
@ -36,21 +36,27 @@ typedef enum {
|
||||
|
||||
Result splInitialize(void);
|
||||
void splExit(void);
|
||||
Service* splGetServiceSession(void);
|
||||
|
||||
Result splCryptoInitialize(void);
|
||||
void splCryptoExit(void);
|
||||
Service* splCryptoGetServiceSession(void);
|
||||
|
||||
Result splSslInitialize(void);
|
||||
void splSslExit(void);
|
||||
Service* splSslGetServiceSession(void);
|
||||
|
||||
Result splEsInitialize(void);
|
||||
void splEsExit(void);
|
||||
Service* splEsGetServiceSession(void);
|
||||
|
||||
Result splFsInitialize(void);
|
||||
void splFsExit(void);
|
||||
Service* splFsGetServiceSession(void);
|
||||
|
||||
Result splManuInitialize(void);
|
||||
void splManuExit(void);
|
||||
Service* splManuGetServiceSession(void);
|
||||
|
||||
Result splGetConfig(SplConfigItem config_item, u64 *out_config);
|
||||
Result splUserExpMod(const void *input, const void *modulus, const void *exp, size_t exp_size, void *dst);
|
||||
|
@ -6,9 +6,11 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../services/sm.h"
|
||||
|
||||
Result spsmInitialize(void);
|
||||
void spsmExit(void);
|
||||
Service* spsmGetServiceSession(void);
|
||||
|
||||
Result spsmShutdown(bool reboot);
|
||||
Result spsmPutErrorState(void);
|
||||
|
@ -46,7 +46,7 @@ typedef struct {
|
||||
Result timeInitialize(void);
|
||||
void timeExit(void);
|
||||
|
||||
Service* timeGetSessionService(void);
|
||||
Service* timeGetServiceSession(void);
|
||||
|
||||
Result timeGetCurrentTime(TimeType type, u64 *timestamp);
|
||||
|
||||
|
@ -64,6 +64,7 @@ typedef enum {
|
||||
Result usbDsInitialize(void);
|
||||
/// Closes the usb:ds session. Any interfaces/endpoints which are left open are automatically closed, since otherwise usb-sysmodule won't fully reset usb:ds to defaults.
|
||||
void usbDsExit(void);
|
||||
Service* usbDsGetServiceSession(void);
|
||||
|
||||
/// Helpers
|
||||
Result usbDsWaitReady(u64 timeout);
|
||||
|
@ -104,6 +104,7 @@ typedef struct {
|
||||
/// Initialize/exit usb:hs.
|
||||
Result usbHsInitialize(void);
|
||||
void usbHsExit(void);
|
||||
Service* usbHsGetServiceSession(void);
|
||||
|
||||
/// Returns the Event loaded during init with autoclear=false.
|
||||
/// Signaled when a device was removed.
|
||||
|
@ -18,6 +18,7 @@ typedef enum {
|
||||
|
||||
Result wlaninfInitialize(void);
|
||||
void wlaninfExit(void);
|
||||
Service* wlaninfGetServiceSession(void);
|
||||
|
||||
Result wlaninfGetState(WlanInfState* out);
|
||||
|
||||
|
@ -30,7 +30,7 @@ void accountExit(void)
|
||||
serviceClose(&g_accSrv);
|
||||
}
|
||||
|
||||
Service* accountGetService(void) {
|
||||
Service* accountGetServiceSession(void) {
|
||||
return &g_accSrv;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,10 @@ void apmExit(void)
|
||||
}
|
||||
}
|
||||
|
||||
Service* apmGetServiceSession(void) {
|
||||
return &g_apmSrv;
|
||||
}
|
||||
|
||||
static Result _apmGetSession(Service* srv, Service* srv_out, u64 cmd_id) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -47,6 +47,10 @@ void auddevExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* auddevGetServiceSession(void) {
|
||||
return &g_auddevIAudioDevice;
|
||||
}
|
||||
|
||||
static Result _auddevGetAudioDeviceService(Service* srv, Service* out_srv, u64 aruid) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -129,6 +129,10 @@ void audrenExit(void)
|
||||
tmemClose(&g_audrenWorkBuf);
|
||||
}
|
||||
|
||||
Service* audrenGetServiceSession(void) {
|
||||
return &g_audrenIAudioRenderer;
|
||||
}
|
||||
|
||||
void audrenWaitFrame(void)
|
||||
{
|
||||
eventWait(&g_audrenEvent, U64_MAX);
|
||||
|
@ -29,6 +29,10 @@ void bpcExit(void)
|
||||
serviceClose(&g_bpcSrv);
|
||||
}
|
||||
|
||||
Service* bpcGetServiceSession(void) {
|
||||
return &g_bpcSrv;
|
||||
}
|
||||
|
||||
Result bpcShutdownSystem(void)
|
||||
{
|
||||
IpcCommand c;
|
||||
|
@ -277,6 +277,10 @@ void bsdExit(void) {
|
||||
tmemClose(&g_bsdTmem);
|
||||
}
|
||||
|
||||
Service* bsdGetServiceSession(void) {
|
||||
return &g_bsdSrv;
|
||||
}
|
||||
|
||||
int bsdSocket(int domain, int type, int protocol) {
|
||||
return _bsdSocketCreationCommand(2, domain, type, protocol);
|
||||
}
|
||||
|
@ -33,6 +33,10 @@ void capsscExit(void) {
|
||||
serviceClose(&g_capsscSrv);
|
||||
}
|
||||
|
||||
Service* capsscGetServiceSession(void) {
|
||||
return &g_capsscSrv;
|
||||
}
|
||||
|
||||
Result capsscCaptureScreenshot(void* buf, size_t size, u32 inval, u64 width, u64 height, s64 buffer_count, s64 buffer_index, u64 timeout) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -35,6 +35,10 @@ void capssuExit(void) {
|
||||
serviceClose(&g_capssuSrv);
|
||||
}
|
||||
|
||||
Service* capssuGetServiceSession(void) {
|
||||
return &g_capssuSrv;
|
||||
}
|
||||
|
||||
static Result _capssuSaveScreenShotEx0(const void* buffer, size_t size, CapsScreenShotAttribute *attr, u32 unk, CapsApplicationAlbumEntry *out) {
|
||||
u64 AppletResourceUserId = 0;
|
||||
appletGetAppletResourceUserId(&AppletResourceUserId);
|
||||
|
@ -37,6 +37,10 @@ void clkrstExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* clkrstGetServiceSession(void) {
|
||||
return &g_clkrstSrv;
|
||||
}
|
||||
|
||||
Result clkrstOpenSession(ClkrstSession* session_out, PcvModuleId module_id, u32 unk) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -25,6 +25,10 @@ void csrngExit(void) {
|
||||
serviceClose(&g_csrngSrv);
|
||||
}
|
||||
|
||||
Service* csrngGetServiceSession(void) {
|
||||
return &g_csrngSrv;
|
||||
}
|
||||
|
||||
Result csrngGetRandomBytes(void *out, size_t out_size) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -39,6 +39,10 @@ void fsldrExit(void) {
|
||||
serviceClose(&g_fsldrSrv);
|
||||
}
|
||||
|
||||
Service* fsldrGetServiceSession(void) {
|
||||
return &g_fsldrSrv;
|
||||
}
|
||||
|
||||
Result fsldrOpenCodeFileSystem(u64 tid, const char *path, FsFileSystem* out) {
|
||||
char send_path[FS_MAX_PATH+1] = {0};
|
||||
IpcCommand c;
|
||||
|
@ -39,6 +39,10 @@ void fsprExit(void) {
|
||||
serviceClose(&g_fsprSrv);
|
||||
}
|
||||
|
||||
Service* fsprGetServiceSession(void) {
|
||||
return &g_fsprSrv;
|
||||
}
|
||||
|
||||
Result fsprRegisterProgram(u64 pid, u64 titleID, FsStorageId storageID, const void *fs_access_header, size_t fah_size, const void *fs_access_control, size_t fac_size) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -29,6 +29,10 @@ void gpioExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* gpioGetServiceSession(void) {
|
||||
return &g_gpioSrv;
|
||||
}
|
||||
|
||||
Result gpioOpenSession(GpioPadSession *out, GpioPadName name) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -167,7 +167,7 @@ void hidReset(void)
|
||||
rwlockWriteUnlock(&g_hidLock);
|
||||
}
|
||||
|
||||
Service* hidGetSessionService(void) {
|
||||
Service* hidGetServiceSession(void) {
|
||||
return &g_hidSrv;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,10 @@ void hiddbgExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* hiddbgGetServiceSession(void) {
|
||||
return &g_hiddbgSrv;
|
||||
}
|
||||
|
||||
static Result _hiddbgCmdNoIO(u64 cmd_id) {
|
||||
Result rc;
|
||||
|
||||
|
@ -38,6 +38,10 @@ void hidsysExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* hidsysGetServiceSession(void) {
|
||||
return &g_hidsysSrv;
|
||||
}
|
||||
|
||||
Result hidsysEnableAppletToGetInput(bool enable) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -33,6 +33,10 @@ void i2cExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* i2cGetServiceSession(void) {
|
||||
return &g_i2cSrv;
|
||||
}
|
||||
|
||||
Result i2cOpenSession(I2cSession *out, I2cDevice dev) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -135,7 +135,7 @@ static void _IrsCameraEntryFree(IrsCameraEntry *entry) {
|
||||
memset(entry, 0, sizeof(IrsCameraEntry));
|
||||
}
|
||||
|
||||
Service* irsGetSessionService(void) {
|
||||
Service* irsGetServiceSession(void) {
|
||||
return &g_irsSrv;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,10 @@ void lblExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* lblGetServiceSession(void) {
|
||||
return &g_lblSrv;
|
||||
}
|
||||
|
||||
static Result _lblCmdNoIO(u64 cmd_id) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -27,6 +27,10 @@ void lrExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* lrGetServiceSession(void) {
|
||||
return &g_managerSrv;
|
||||
}
|
||||
|
||||
Result lrOpenLocationResolver(FsStorageId storage, LrLocationResolver* out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -20,6 +20,10 @@ void ncmExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* ncmGetServiceSession(void) {
|
||||
return &g_ncmSrv;
|
||||
}
|
||||
|
||||
Result ncmOpenContentStorage(FsStorageId storage, NcmContentStorage* out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -30,6 +30,10 @@ void pcvExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* pcvGetServiceSession(void) {
|
||||
return &g_pcvSrv;
|
||||
}
|
||||
|
||||
Result pcvGetModuleId(PcvModuleId *module_id, PcvModule module) {
|
||||
static const PcvModuleId s_moduleIdMap[PcvModule_Count] = {
|
||||
PcvModuleId_CpuBus, PcvModuleId_GPU, PcvModuleId_I2S1, PcvModuleId_I2S2,
|
||||
|
@ -29,6 +29,10 @@ void pdmqryExit(void) {
|
||||
serviceClose(&g_pdmqrySrv);
|
||||
}
|
||||
|
||||
Service* pdmqryGetServiceSession(void) {
|
||||
return &g_pdmqrySrv;
|
||||
}
|
||||
|
||||
static Result _pdmqryQueryEvent(u64 cmd_id, u32 entryindex, void* events, size_t entrysize, s32 count, s32 *total_out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -53,6 +53,10 @@ void plExit(void)
|
||||
}
|
||||
}
|
||||
|
||||
Service* plGetServiceSession(void) {
|
||||
return &g_plSrv;
|
||||
}
|
||||
|
||||
void* plGetSharedmemAddr(void) {
|
||||
return shmemGetAddr(&g_plSharedmem);
|
||||
}
|
||||
|
@ -45,6 +45,10 @@ void pscExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* pscGetServiceSession(void) {
|
||||
return &g_pscSrv;
|
||||
}
|
||||
|
||||
Result pscGetPmModule(PscPmModule *out, u16 module_id, const u16 *dependencies, size_t dependency_count, bool autoclear) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -37,6 +37,10 @@ void psmExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* psmGetServiceSession(void) {
|
||||
return &g_psmSrv;
|
||||
}
|
||||
|
||||
static Result _psmGetOutU32(u64 cmd_id, u32 *out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -37,6 +37,10 @@ void ldrRoExit(void) {
|
||||
serviceClose(&g_roSrv);
|
||||
}
|
||||
|
||||
Service* ldrRoGetServiceSession(void) {
|
||||
return &g_roSrv;
|
||||
}
|
||||
|
||||
Result ro1Initialize(void) {
|
||||
if (hosversionBefore(7,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
@ -59,6 +63,10 @@ void ro1Exit(void) {
|
||||
serviceClose(&g_ro1Srv);
|
||||
}
|
||||
|
||||
Service* ro1GetServiceSession(void) {
|
||||
return &g_ro1Srv;
|
||||
}
|
||||
|
||||
Result roDmntInitialize(void) {
|
||||
if (hosversionBefore(3,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
@ -75,6 +83,10 @@ void roDmntExit(void) {
|
||||
serviceClose(&g_dmntSrv);
|
||||
}
|
||||
|
||||
Service* roDmntGetServiceSession(void) {
|
||||
return &g_dmntSrv;
|
||||
}
|
||||
|
||||
Result _rosrvInitialize(Service* srv) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -45,6 +45,10 @@ void setExit(void)
|
||||
}
|
||||
}
|
||||
|
||||
Service* setGetServiceSession(void) {
|
||||
return &g_setSrv;
|
||||
}
|
||||
|
||||
Result setsysInitialize(void)
|
||||
{
|
||||
atomicIncrement64(&g_refCntSys);
|
||||
@ -62,6 +66,10 @@ void setsysExit(void)
|
||||
}
|
||||
}
|
||||
|
||||
Service* setsysGetSessionService(void) {
|
||||
return &g_setsysSrv;
|
||||
}
|
||||
|
||||
static Result setInitializeLanguageCodesCache(void) {
|
||||
if (g_setLanguageCodesInitialized) return 0;
|
||||
Result rc = 0;
|
||||
|
@ -18,6 +18,8 @@ static Service* _splGetRsaSrv(void);
|
||||
|
||||
static Service* _splGetEsSrv(void);
|
||||
static Service* _splGetFsSrv(void);
|
||||
static Service* _splGetSslSrv(void);
|
||||
static Service* _splGetManuSrv(void);
|
||||
|
||||
Service* _splGetGeneralSrv(void) {
|
||||
if (hosversionBefore(4,0,0)) {
|
||||
@ -71,6 +73,14 @@ Service* _splGetFsSrv(void) {
|
||||
return hosversionAtLeast(4,0,0) ? &g_splFsSrv : &g_splSrv;
|
||||
}
|
||||
|
||||
Service* _splGetSslSrv(void) {
|
||||
return hosversionAtLeast(4,0,0) ? &g_splSslSrv : &g_splSrv;
|
||||
}
|
||||
|
||||
Service* _splGetManuSrv(void) {
|
||||
return hosversionAtLeast(4,0,0) ? &g_splManuSrv : &g_splSrv;
|
||||
}
|
||||
|
||||
/* There are like six services, so these helpers will initialize/exit the relevant services. */
|
||||
static Result _splSrvInitialize(Service* srv, u64 *refcnt, const char *name) {
|
||||
atomicIncrement64(refcnt);
|
||||
@ -94,6 +104,10 @@ void splExit(void) {
|
||||
return _splSrvExit(&g_splSrv, &g_splRefCnt);
|
||||
}
|
||||
|
||||
Service* splGetServiceSession(void) {
|
||||
return _splGetGeneralSrv();
|
||||
}
|
||||
|
||||
Result splCryptoInitialize(void) {
|
||||
if (hosversionAtLeast(4,0,0)) {
|
||||
return _splSrvInitialize(&g_splCryptoSrv, &g_splCryptoRefCnt, "spl:mig");
|
||||
@ -110,6 +124,10 @@ void splCryptoExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* splCryptoGetServiceSession(void) {
|
||||
return _splGetCryptoSrv();
|
||||
}
|
||||
|
||||
Result splSslInitialize(void) {
|
||||
if (hosversionAtLeast(4,0,0)) {
|
||||
return _splSrvInitialize(&g_splSslSrv, &g_splSslRefCnt, "spl:ssl");
|
||||
@ -126,6 +144,10 @@ void splSslExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* splSslGetServiceSession(void) {
|
||||
return _splGetSslSrv();
|
||||
}
|
||||
|
||||
Result splEsInitialize(void) {
|
||||
if (hosversionAtLeast(4,0,0)) {
|
||||
return _splSrvInitialize(&g_splEsSrv, &g_splEsRefCnt, "spl:es");
|
||||
@ -142,6 +164,10 @@ void splEsExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* splEsGetServiceSession(void) {
|
||||
return _splGetEsSrv();
|
||||
}
|
||||
|
||||
Result splFsInitialize(void) {
|
||||
if (hosversionAtLeast(4,0,0)) {
|
||||
return _splSrvInitialize(&g_splFsSrv, &g_splFsRefCnt, "spl:fs");
|
||||
@ -158,6 +184,10 @@ void splFsExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* splFsGetServiceSession(void) {
|
||||
return _splGetFsSrv();
|
||||
}
|
||||
|
||||
Result splManuInitialize(void) {
|
||||
return _splSrvInitialize(&g_splManuSrv, &g_splManuRefCnt, "spl:manu");
|
||||
}
|
||||
@ -166,6 +196,10 @@ void splManuExit(void) {
|
||||
return _splSrvExit(&g_splManuSrv, &g_splManuRefCnt);
|
||||
}
|
||||
|
||||
Service* splManuGetServiceSession(void) {
|
||||
return _splGetManuSrv();
|
||||
}
|
||||
|
||||
|
||||
/* SPL IGeneralService functionality. */
|
||||
Result splGetConfig(SplConfigItem config_item, u64 *out_config) {
|
||||
|
@ -29,6 +29,10 @@ void spsmExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* spsmGetServiceSession(void) {
|
||||
return &g_spsmSrv;
|
||||
}
|
||||
|
||||
Result spsmShutdown(bool reboot) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
@ -60,7 +60,7 @@ void timeExit(void)
|
||||
}
|
||||
}
|
||||
|
||||
Service* timeGetSessionService(void) {
|
||||
Service* timeGetServiceSession(void) {
|
||||
return &g_timeSrv;
|
||||
}
|
||||
|
||||
|
@ -78,6 +78,10 @@ void usbDsExit(void)
|
||||
serviceClose(&g_usbDsSrv);
|
||||
}
|
||||
|
||||
Service* usbDsGetServiceSession(void) {
|
||||
return &g_usbDsSrv;
|
||||
}
|
||||
|
||||
Event* usbDsGetStateChangeEvent(void)
|
||||
{
|
||||
return &g_usbDsStateChangeEvent;
|
||||
|
@ -52,6 +52,10 @@ void usbHsExit(void) {
|
||||
serviceClose(&g_usbHsSrv);
|
||||
}
|
||||
|
||||
Service* usbHsGetServiceSession(void) {
|
||||
return &g_usbHsSrv;
|
||||
}
|
||||
|
||||
Event* usbHsGetInterfaceStateChangeEvent(void) {
|
||||
return &g_usbHsInterfaceStateChangeEvent;
|
||||
}
|
||||
|
@ -36,6 +36,10 @@ void wlaninfExit(void) {
|
||||
}
|
||||
}
|
||||
|
||||
Service* wlaninfGetServiceSession(void) {
|
||||
return &g_wlaninfSrv;
|
||||
}
|
||||
|
||||
Result wlaninfGetState(WlanInfState* out) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
Loading…
Reference in New Issue
Block a user