Esempio n. 1
0
static IMG_BOOL PDumpWriteILock(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32Count, IMG_UINT32 ui32Flags)
{
	IMG_UINT32 ui32Written = 0;
	if ((psStream == IMG_NULL) || PDumpSuspended() || ((ui32Flags & PDUMP_FLAGS_NEVER) != 0))
	{
		PVR_DPF((PVR_DBG_MESSAGE, "PDumpWriteILock: Failed to write 0x%x bytes to stream 0x%x", ui32Count, (IMG_UINT32)psStream));
		return IMG_TRUE;
	}




	if (psStream == gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2])
	{
		IMG_UINT32 ui32ParamOutPos = gpfnDbgDrv->pfnGetStreamOffset(gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2]);

		if (ui32ParamOutPos + ui32Count > MAX_FILE_SIZE)
		{
			if ((gsDBGPdumpState.psStream[PDUMP_STREAM_SCRIPT2] && PDumpWriteString2("\r\n-- Splitting pdump output file\r\n\r\n", ui32Flags)))
			{
				DbgSetMarker(gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2], ui32ParamOutPos);
				gsDBGPdumpState.ui32ParamFileNum++;
			}
		}
	}

	ui32Written = DbgWrite(psStream, pui8Data, ui32Count, ui32Flags);

	if (ui32Written == 0xFFFFFFFF)
	{
		return IMG_FALSE;
	}

	return IMG_TRUE;
}
Esempio n. 2
0
static IMG_BOOL PDumpWriteILock(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32Count, IMG_UINT32 ui32Flags)
{
	IMG_UINT32 ui32Written = 0;
	IMG_UINT32 ui32Off = 0;

	if ((psStream == IMG_NULL) || PDumpSuspended() || ((ui32Flags & PDUMP_FLAGS_NEVER) != 0))
	{
		return IMG_TRUE;
	}


	

	if (psStream == gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2])
	{
		IMG_UINT32 ui32ParamOutPos = gpfnDbgDrv->pfnGetStreamOffset(gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2]);

		if (ui32ParamOutPos + ui32Count > MAX_FILE_SIZE)
		{
			if ((gsDBGPdumpState.psStream[PDUMP_STREAM_SCRIPT2] && PDumpWriteString2("\r\n-- Splitting pdump output file\r\n\r\n", ui32Flags)))
			{
				DbgSetMarker(gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2], ui32ParamOutPos);
				gsDBGPdumpState.ui32ParamFileNum++;
			}
		}
	}


	while (((IMG_UINT32) ui32Count > 0) && (ui32Written != 0xFFFFFFFF))
	{
		ui32Written = DbgWrite(psStream, &pui8Data[ui32Off], ui32Count, ui32Flags);

		


		if (ui32Written == 0)
		{
			OSReleaseThreadQuanta();
		}

		if (ui32Written != 0xFFFFFFFF)
		{
			ui32Off += ui32Written;
			ui32Count -= ui32Written;
		}
	}

	if (ui32Written == 0xFFFFFFFF)
	{
		return IMG_FALSE;
	}

	return IMG_TRUE;
}
Esempio n. 3
0
static IMG_BOOL PDumpWriteILock(struct DBG_STREAM *psStream, u8 *pui8Data,
				u32 ui32Count, u32 ui32Flags)
{
	u32 ui32Written = 0;
	u32 ui32Off = 0;

	if (!psStream || gui32PDumpSuspended || (ui32Flags & PDUMP_FLAGS_NEVER))
		return IMG_TRUE;

	if (psStream == gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2]) {
		u32 ui32ParamOutPos =
		    gpfnDbgDrv->pfnGetStreamOffset(gsDBGPdumpState.
						   psStream
						   [PDUMP_STREAM_PARAM2]);

		if (ui32ParamOutPos + ui32Count > MAX_FILE_SIZE)
			if ((gsDBGPdumpState.psStream[PDUMP_STREAM_SCRIPT2]
			     &&
			     PDumpWriteString2
			     ("\r\n-- Splitting pdump output file\r\n\r\n",
			      ui32Flags))) {
				DbgSetMarker(gsDBGPdumpState.
					     psStream[PDUMP_STREAM_PARAM2],
					     ui32ParamOutPos);
				gsDBGPdumpState.ui32ParamFileNum++;
			}
	}

	while (((u32) ui32Count > 0) && (ui32Written != 0xFFFFFFFF)) {
		ui32Written =
		    DbgWrite(psStream, &pui8Data[ui32Off], ui32Count,
			     ui32Flags);

		if (ui32Written == 0)
			OSReleaseThreadQuanta();

		if (ui32Written != 0xFFFFFFFF) {
			ui32Off += ui32Written;
			ui32Count -= ui32Written;
		}
	}

	if (ui32Written == 0xFFFFFFFF)
		return IMG_FALSE;

	return IMG_TRUE;
}