src/occ_gpe0/gpe_get_tod.c
/**
 * IPC function that gets the current Time Of Day (TOD) value.
 *
 * First reads the TOD_STATUS_REG register to make sure the TOD is running.
 * Then reads the TOD_VALUE_REG register to get the TOD value.
 *
 * @param cmd A pointer to the IPC command message
 * @param arg IPC function argument.  Currently not used.
 */
IPC function that gets the current Time Of Day (TOD) value.
First reads the TOD_STATUS_REG register to make sure the TOD is running.
Then reads the TOD_VALUE_REG register to get the TOD value.

@param cmd A pointer to the IPC command message
@param arg IPC function argument.  Currently not used.
IPC function that gets the current Time Of Day ( TOD ) value . First reads the TOD_STATUS_REG register to make sure the TOD is running . Then reads the TOD_VALUE_REG register to get the TOD value . @param cmd A pointer to the IPC command message @param arg IPC function argument . Currently not used .
void gpe_get_tod(ipc_msg_t * cmd, void * arg)
{
    ipc_async_cmd_t * async_cmd = (ipc_async_cmd_t *) cmd;
    gpe_get_tod_args_t * args = (gpe_get_tod_args_t *) async_cmd->cmd_data;
    gpe_read_tod_registers(args);
    int rc = ipc_send_rsp(cmd, IPC_RC_SUCCESS);
    if (rc != 0)
    {
        PK_TRACE("gpe_get_tod: Failed to send response back. Halting GPE0. rc=0x%08X", rc);
        gpe_set_ffdc(&(args->error), 0x00, GPE_RC_IPC_SEND_FAILED, rc);
        pk_halt();
    }
}
void gpe_get_tod ( ipc_msg_t * cmd , void * arg ) { ipc_async_cmd_t * async_cmd = ( ipc_async_cmd_t * ) cmd ; gpe_get_tod_args_t * args = ( gpe_get_tod_args_t * ) async_cmd -> cmd_data ; gpe_read_tod_registers ( args ) ; int rc = ipc_send_rsp ( cmd , IPC_RC_SUCCESS ) ; if ( rc != 0 ) { PK_TRACE ( " " , rc ) ; gpe_set_ffdc ( & ( args -> error ) , 0x00 , GPE_RC_IPC_SEND_FAILED , rc ) ; pk_halt ( ) ; } }
IPC function that gets the current Time Of Day (TOD) value.
IPC function that gets the current Time Of Day ( TOD ) value .
// Cast command message pointer to more specific type to access cmd_data field // Cast cmd_data field to specific type of arguments for this IPC function // Read the TOD registers to get the TOD value.  Store the result in args. // Send back a response with IPC success even if ffdc/rc fields are non-zero