//**************************************************
void AudioControlAp_DeliveryFunction	(IPC_Buffer Buffer)
{
	char *		Response		= IPC_BufferDataPointer (Buffer);
	U32			ResponseLength	= IPC_BufferDataSize  (Buffer);
    char dd[256];

	//(void) dprintf(5, "\n\nAudioControlCp_DeliveryFunction: Length %d. First 16 bytes...\n\n", ResponseLength);
    memcpy(dd, Response, ResponseLength);

#if 0
	{
    int i=0;
    Log_DebugPrintf(LOGID_AUDIO,"\n%02X %02X %02X %02X %02X %02X %02X %02X\n", dd[i], dd[i+1], dd[i+2], dd[i+3], dd[i+4], dd[i+5], dd[i+6], dd[i+7]);
    i=8;
    Log_DebugPrintf(LOGID_AUDIO,"\n%02X %02X %02X %02X %02X %02X %02X %02X\n", dd[i], dd[i+1], dd[i+2], dd[i+3], dd[i+4], dd[i+5], dd[i+6], dd[i+7]);
    i=16;
	}
#endif

    IPC_process_dsp_interrupt(dd, ResponseLength);

	IPC_FreeBuffer (Buffer);
}
static void AudioControlAp_DeliveryFunction (IPC_Buffer buf)
{
        brcm_dsp_interrupt_hisr(IPC_BufferDataPointer(buf), IPC_BufferDataSize(buf));
        IPC_FreeBuffer(buf);
}
예제 #3
0
UInt32 RPC_PACKET_GetBufferLength(PACKET_BufHandle_t dataBufHandle)
{
	return IPC_BufferDataSize((IPC_Buffer) dataBufHandle);
}
void ipcs_cplog_bd(IPC_Buffer ipc_buffer)
{
	BCMLOG_HandleCpLogMsg( (const char*)IPC_BufferDataPointer(ipc_buffer), IPC_BufferDataSize(ipc_buffer) ) ;
	IPC_FreeBuffer(ipc_buffer);
}
void IPC_ProcessEvents(void)
{
	IPC_Buffer Buffer;
	IPC_CPU_ID_T Cpu = IPC_SM_CURRENT_CPU;

	IPC_TRACE(IPC_Channel_Hisr, "IPC_ProcessEvents", "CPU %02X", Cpu, 0, 0,
		  0);

	if (!SmLocalControl.ConfiguredReported) {

		if ((SmLocalControl.SmControl->
		     Initialised[IPC_CPU_ID_INDEX(Cpu)] == IPC_SmConfigured)
		    && (SmLocalControl.SmControl->
			Initialised[IPC_CPU_ID_INDEX(IPC_OTHER_CPU[Cpu])] ==
			IPC_SmConfigured)) {
			SmLocalControl.ConfiguredReported = IPC_TRUE;
			(*SmLocalControl.IPCInitialisedFunction) ();
		} else {
			IPC_TRACE(IPC_Channel_Error, "IPC_ProcessEvents",
				  "CPU %02X, Not Initialised", Cpu, 0, 0, 0);
			return;
		}
	}
#ifdef FUSE_IPC_CRASH_SUPPORT
	if ((Cpu == IPC_AP_CPU) && (g_bCpCrashed == IPC_FALSE)
	    && (SmLocalControl.SmControl->CrashCode != IPC_CP_NOT_CRASHED)) {
		/* CP has crashed so set the crash status */
		g_bCpCrashed = IPC_TRUE;

		/**
		 * CP should be analysing crach here as this is the first
		 * indication - but call crash function in case finished.
		 */
		if (SmLocalControl.IPCCPCrashed)
			SmLocalControl.IPCCPCrashed(SmLocalControl.SmControl->
						    CrashCode);

	}

	if (g_bCpCrashed == IPC_TRUE) {
		if ((SmLocalControl.SmControl->CrashCode !=
		     IPC_CP_ANALYSING_CRASH)
		    && (SmLocalControl.SmControl->CrashCode !=
			IPC_CP_NOT_CRASHED)) {

			/**
			 * if CP is not analysing any more than we should
			 * have crash dump now
			 *
			 * call the function to handle the crash dump
			 */
			if (SmLocalControl.IPCCPCrashed)
				SmLocalControl.IPCCPCrashed(SmLocalControl.
							    SmControl->
							    CrashCode);
			/**
			 * This function can call  IPCAP_GetCrashData to get
			 * crash location.
			 */
		} else {
			g_bCpCrashed = IPC_FALSE;
		}
	} else
#endif /* FUSE_IPC_CRASH_SUPPORT */
	{
		{
			IPC_Fifo SendFifo = SmLocalControl.SendFifo;

			while (0 != (Buffer = IPC_SmFifoRead(SendFifo))) {
				IPC_EndpointId_T DestinationEpId =
				    IPC_PoolDestinationEndpointId
				    (IPC_BufferOwningPool(Buffer));
				IPC_Endpoint DestinationEpPtr =
				    IPC_SmEndpointInfo(DestinationEpId);

#ifdef IPC_DEBUG
				if (DestinationEpPtr
				    && DestinationEpPtr->DeliveryFunction
				    && DestinationEpPtr->Cpu ==
				    IPC_SM_CURRENT_CPU) {
					IPC_TRACE(IPC_Channel_Hisr,
						  "IPC_ProcessEvents",
						  "Buffer %08X, size %d, EP %d, Fn %08X",
						  Buffer,
						  IPC_BufferDataSize(Buffer),
						  DestinationEpId,
						  (IPC_U32) DestinationEpPtr->
						  DeliveryFunction);

					(DestinationEpPtr->
					 DeliveryFunction) (Buffer);

				} else {
					IPC_TRACE(IPC_Channel_Error,
						  "IPC_ProcessEvents",
						  "No Delivery Function for EP %d, Function %08X, CpuId %d",
						  DestinationEpId,
						  (IPC_U32) DestinationEpPtr->
						  DeliveryFunction,
						  DestinationEpPtr->Cpu, 0);

					IPC_FreeBuffer(Buffer);
				}
#else
				(DestinationEpPtr->DeliveryFunction) (Buffer);
#endif
			}
		}
		{

			IPC_Fifo FreeFifo = SmLocalControl.FreeFifo;
			while (0 != (Buffer = IPC_SmFifoRead(FreeFifo))) {
				IPC_BufferReturn(Buffer,
						 IPC_BufferOwningPool(Buffer));
			}
		}
	}
}