Exemple #1
0
Result GSPGPU_AcquireRight(u8 flags)
{
	u32* cmdbuf=getThreadCommandBuffer();
	cmdbuf[0]=IPC_MakeHeader(0x16,1,2); // 0x160042
	cmdbuf[1]=flags;
	cmdbuf[2]=IPC_Desc_SharedHandles(1);
	cmdbuf[3]=CUR_PROCESS_HANDLE;

	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(gspGpuHandle)))return ret;

	return cmdbuf[1];
}
Exemple #2
0
Result HB_FlushInvalidateCache(void)
{
	Result ret = 0;
	u32 *cmdbuf = getThreadCommandBuffer();

	cmdbuf[0] = IPC_MakeHeader(0x1,1,2); // 0x10042
	cmdbuf[1] = 0x00000000;
	cmdbuf[2] = IPC_Desc_SharedHandles(1);
	cmdbuf[3] = CUR_PROCESS_HANDLE;

	if(R_FAILED(ret = svcSendSyncRequest(hbHandle))) return ret;
	
	return (Result)cmdbuf[1];
}
Exemple #3
0
Result GSPGPU_FlushDataCache(const void* adr, u32 size)
{
	u32* cmdbuf=getThreadCommandBuffer();
	cmdbuf[0]=IPC_MakeHeader(0x8,2,2); // 0x80082
	cmdbuf[1]=(u32)adr;
	cmdbuf[2]=size;
	cmdbuf[3]=IPC_Desc_SharedHandles(1);
	cmdbuf[4]=CUR_PROCESS_HANDLE;

	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(gspGpuHandle)))return ret;

	return cmdbuf[1];
}
Exemple #4
0
Result srvRegisterPort(const char* name, Handle clientHandle)
{
	Result rc = 0;
	u32* cmdbuf = getThreadCommandBuffer();

	cmdbuf[0] = IPC_MakeHeader(0x6,3,2); // 0x600C2
	strncpy((char*) &cmdbuf[1], name,8);
	cmdbuf[3] = strlen(name);
	cmdbuf[4] = IPC_Desc_SharedHandles(0);
	cmdbuf[5] = clientHandle;

	if(R_FAILED(rc = svcSendSyncRequest(srvHandle)))return rc;

	return cmdbuf[1];
}
Exemple #5
0
Result APT_JumpToApplication(const u8 *param, size_t paramSize, Handle handle)
{
	u32* cmdbuf=getThreadCommandBuffer();
	cmdbuf[0]=IPC_MakeHeader(0x24,1,4); // 0x240044
	cmdbuf[1]=paramSize;
	cmdbuf[2]=IPC_Desc_SharedHandles(1);
	cmdbuf[3]=handle;
	cmdbuf[4]=IPC_Desc_StaticBuffer(paramSize,0);
	cmdbuf[5]= (u32) param;
	
	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(aptuHandle)))return ret;
	
	return cmdbuf[1];
}
Exemple #6
0
static Result sslcipc_ContextInitSharedmem(sslcContext *context, u32 size)
{
	u32* cmdbuf=getThreadCommandBuffer();

	cmdbuf[0]=IPC_MakeHeader(0x1F,2,2); // 0x1F0082
	cmdbuf[1]=context->sslchandle;
	cmdbuf[2]=size;
	cmdbuf[3]=IPC_Desc_SharedHandles(1);
	cmdbuf[4]=context->sharedmem_handle;
	
	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(context->servhandle)))return ret;

	return cmdbuf[1];
}
Exemple #7
0
Result CAMU_SetReceiving(Handle* event, void* dst, u32 port, u32 imageSize, s16 transferUnit) {
	Result ret = 0;
	u32* cmdbuf = getThreadCommandBuffer();
	cmdbuf[0] = IPC_MakeHeader(0x7,4,2); // 0x70102
	cmdbuf[1] = (u32) dst;
	cmdbuf[2] = port;
	cmdbuf[3] = imageSize;
	cmdbuf[4] = transferUnit;
	cmdbuf[5] = IPC_Desc_SharedHandles(1);
	cmdbuf[6] = CUR_PROCESS_HANDLE;

	if (R_FAILED(ret = svcSendSyncRequest(camHandle))) return ret;
	*event = cmdbuf[3];
	return cmdbuf[1];
}
Exemple #8
0
Result Y2RU_SetReceiving(void* dst_buf, u32 image_size, s16 transfer_unit, s16 transfer_gap)
{
	Result ret = 0;
	u32* cmdbuf = getThreadCommandBuffer();
	cmdbuf[0] = IPC_MakeHeader(0x18,4,2); // 0x180102
	cmdbuf[1] = (u32)dst_buf;
	cmdbuf[2] = image_size;
	cmdbuf[3] = transfer_unit;
	cmdbuf[4] = transfer_gap;
	cmdbuf[5] = IPC_Desc_SharedHandles(1);
	cmdbuf[6] = CUR_PROCESS_HANDLE;

	if (R_FAILED(ret = svcSendSyncRequest(y2rHandle))) return ret;
	return cmdbuf[1];
}
Exemple #9
0
Result APT_StartSystemApplet(NS_APPID appID, u32 bufSize, Handle applHandle, u8 *buf)
{
	u32* cmdbuf=getThreadCommandBuffer();
	cmdbuf[0] = IPC_MakeHeader(0x1F,2,4); // 0x001F0084
	cmdbuf[1] = appID;
	cmdbuf[2] = bufSize;
	cmdbuf[3] = IPC_Desc_SharedHandles(1);
	cmdbuf[4] = applHandle;
	cmdbuf[5] = IPC_Desc_StaticBuffer(bufSize,0);
	cmdbuf[6] = (u32)buf;
	
	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(aptuHandle)))return ret;

	return cmdbuf[1];
}
Exemple #10
0
Result APT_StartLibraryApplet(NS_APPID appID, Handle inhandle, u32 *parambuf, u32 parambufsize)
{
	u32* cmdbuf=getThreadCommandBuffer();
	cmdbuf[0]=IPC_MakeHeader(0x1E,2,4); // 0x1E0084
	cmdbuf[1]=appID;
	cmdbuf[2]=parambufsize;
	cmdbuf[3]=IPC_Desc_SharedHandles(1);
	cmdbuf[4]=inhandle;
	cmdbuf[5]=IPC_Desc_StaticBuffer(parambufsize,0);
	cmdbuf[6]=(u32)parambuf;
	
	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(aptuHandle)))return ret;

	return cmdbuf[1];
}
Exemple #11
0
Result AM_GetCiaFileInfo(u8 mediatype, AM_TitleEntry *titleEntry, Handle fileHandle)
{
	Result ret = 0;
	u32 *cmdbuf = getThreadCommandBuffer();
	
	cmdbuf[0] = IPC_MakeHeader(0x408,1,2); // 0x04080042
	cmdbuf[1] = mediatype;
	cmdbuf[2] = IPC_Desc_SharedHandles(1);
	cmdbuf[3] = fileHandle;

	if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;

	if(titleEntry) memcpy(titleEntry, &cmdbuf[2], sizeof(AM_TitleEntry));

	return (Result)cmdbuf[1];
}
Exemple #12
0
Result GSPGPU_RegisterInterruptRelayQueue(Handle eventHandle, u32 flags, Handle* outMemHandle, u8* threadID)
{
	u32* cmdbuf=getThreadCommandBuffer();
	cmdbuf[0]=IPC_MakeHeader(0x13,1,2); // 0x130042
	cmdbuf[1]=flags;
	cmdbuf[2]=IPC_Desc_SharedHandles(1);
	cmdbuf[3]=eventHandle;

	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(gspGpuHandle)))return ret;

	if(threadID)*threadID=cmdbuf[2] & 0xFF;
	if(outMemHandle)*outMemHandle=cmdbuf[4];

	return cmdbuf[1];
}
Exemple #13
0
static Result SOCU_Initialize(Handle memhandle, u32 memsize)
{
    Result ret = 0;
    u32 *cmdbuf = getThreadCommandBuffer();

    cmdbuf[0] = IPC_MakeHeader(0x1,1,4); // 0x10044
    cmdbuf[1] = memsize;
    cmdbuf[2] = IPC_Desc_CurProcessHandle();
    cmdbuf[4] = IPC_Desc_SharedHandles(1);
    cmdbuf[5] = memhandle;

    ret = svcSendSyncRequest(SOCU_handle);
    if(ret != 0)
        return ret;

    return cmdbuf[1];
}
Exemple #14
0
static Result udsipc_RecvBeaconBroadcastData(u8 *outbuf, u32 maxsize, nwmScanInputStruct *scaninput, u32 wlancommID, u8 id8, Handle event)
{
	u32* cmdbuf=getThreadCommandBuffer();

	cmdbuf[0]=IPC_MakeHeader(0xF,16,4); // 0xF0404
	cmdbuf[1]=maxsize;
	memcpy(&cmdbuf[2], scaninput, sizeof(nwmScanInputStruct));
	cmdbuf[15]=wlancommID;
	cmdbuf[16]=id8;
	cmdbuf[17]=IPC_Desc_SharedHandles(1);
	cmdbuf[18]=event;
	cmdbuf[19]=IPC_Desc_Buffer(maxsize, IPC_BUFFER_W);
	cmdbuf[20]=(u32)outbuf;

	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(__uds_servhandle)))return ret;

	return cmdbuf[1];
}
Exemple #15
0
Result APT_SendParameter(NS_APPID src_appID, NS_APPID dst_appID, u32 bufferSize, u32* buffer, Handle paramhandle, u8 signalType)
{
	u32* cmdbuf=getThreadCommandBuffer();

	cmdbuf[0] = IPC_MakeHeader(0xC,4,4); // 0xC0104
	cmdbuf[1] = src_appID;
	cmdbuf[2] = dst_appID;
	cmdbuf[3] = signalType;
	cmdbuf[4] = bufferSize;

	cmdbuf[5] = IPC_Desc_SharedHandles(1);
	cmdbuf[6] = paramhandle;
	
	cmdbuf[7] = IPC_Desc_StaticBuffer(bufferSize,0);
	cmdbuf[8] = (u32)buffer;
	
	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(aptuHandle)))return ret;

	return cmdbuf[1];
}
Exemple #16
0
static Result udsipc_InitializeWithVersion(udsNodeInfo *nodeinfo, Handle sharedmem_handle, u32 sharedmem_size, Handle *eventhandle)
{
	u32* cmdbuf=getThreadCommandBuffer();

	cmdbuf[0]=IPC_MakeHeader(0x1B,12,2); // 0x1B0302
	cmdbuf[1]=sharedmem_size;
	memcpy(&cmdbuf[2], nodeinfo, sizeof(udsNodeInfo));
	cmdbuf[12] = 0x400;//version
	cmdbuf[13] = IPC_Desc_SharedHandles(1);
	cmdbuf[14] = sharedmem_handle;

	Result ret=0;
	if(R_FAILED(ret=svcSendSyncRequest(__uds_servhandle)))return ret;
	ret = cmdbuf[1];

	if(R_SUCCEEDED(ret))
	{
		if(eventhandle)*eventhandle = cmdbuf[3];
	}

	return ret;
}