src/lib/occlib/ipc_core.c
///////////////////////////////////////////////////////////////////////////////
/// Processes an incoming message (response or command) after it has been
/// removed from the circular buffer.
/// This function is for internal use only!
///
Processes an incoming message (response or command) after it has been
removed from the circular buffer.
This function is for internal use only!
Processes an incoming message ( response or command ) after it has been removed from the circular buffer . This function is for internal use only!
void ipc_process_msg(ipc_msg_t* msg)
{
    uint32_t                table_index;
    uint32_t                table_limit;
    ipc_func_table_entry_t* func_table;
    do
    {
        if(msg->func_id.response_flag)
        {
            if(msg->resp_callback)
            {
#ifdef GPE_IPC_TIMERS
                msg->end_time = in32(OCB_OTBR);
#endif
                msg->resp_callback(msg, msg->callback_arg);
            }
            else
            {
                ipc_free_msg(msg);
            }
            break;
        }
        table_index = msg->func_id.table_index;
        if(msg->func_id.multi_target_flag)
        {
            table_limit = IPC_MT_NUM_FUNCIDS;
            func_table = G_ipc_mt_handlers;
        }
        else
        {
            table_limit = IPC_ST_NUM_FUNCIDS;
            func_table = G_ipc_st_handlers;
        }
        if(table_index < table_limit)
        {
            func_table[table_index].handler(msg, func_table[table_index].arg);
        }
        else
        {
            ipc_send_rsp(msg, IPC_RC_INVALID_FUNC_ID);
        }
    }
    while(0);
}
void ipc_process_msg ( ipc_msg_t * msg ) { uint32_t table_index ; uint32_t table_limit ; ipc_func_table_entry_t * func_table ; do { if ( msg -> func_id . response_flag ) { if ( msg -> resp_callback ) { #ifdef GPE_IPC_TIMERS msg -> end_time = in32 ( OCB_OTBR ) ; #endif msg -> resp_callback ( msg , msg -> callback_arg ) ; } else { ipc_free_msg ( msg ) ; } break ; } table_index = msg -> func_id . table_index ; if ( msg -> func_id . multi_target_flag ) { table_limit = IPC_MT_NUM_FUNCIDS ; func_table = G_ipc_mt_handlers ; } else { table_limit = IPC_ST_NUM_FUNCIDS ; func_table = G_ipc_st_handlers ; } if ( table_index < table_limit ) { func_table [ table_index ] . handler ( msg , func_table [ table_index ] . arg ) ; } else { ipc_send_rsp ( msg , IPC_RC_INVALID_FUNC_ID ) ; } } while ( 0 ) ; }
Processes an incoming message (response or command) after it has been
removed from the circular buffer.
Processes an incoming message ( response or command ) after it has been removed from the circular buffer .
// If this is a response message, call the response callback function //normally, the resp_callback function would call this function //to notify users of the message that it is free to be re-used. //Since there is no callback for this message we call it here. // extract the function table index //setup for multi-target commands //setup for single-target commands //Common command handling code //drop errors if this fails.  If target was waiting for a response //it should eventually time out and log the message as FFDC.