src/occ_gpe0/gpe_get_tod.c
/**
 * Reads the value of the TOD_STATUS_REG and TOD_VALUE_REG registers.  If the
 * TOD is running, the current Time Of Day value is stored in the tod field of
 * the args parameter.
 *
 * @param args Arguments passed from the OCC 405 via the IPC framework
 */
Reads the value of the TOD_STATUS_REG and TOD_VALUE_REG registers.  If the
TOD is running, the current Time Of Day value is stored in the tod field of
the args parameter.

@param args Arguments passed from the OCC 405 via the IPC framework
Reads the value of the TOD_STATUS_REG and TOD_VALUE_REG registers . If the TOD is running the current Time Of Day value is stored in the tod field of the args parameter . @param args Arguments passed from the OCC 405 via the IPC framework
void gpe_read_tod_registers(gpe_get_tod_args_t * args)
{
    args->error.rc   = GPE_RC_SUCCESS;
    args->error.addr = 0;
    args->error.ffdc = 0;
    args->tod        = TOD_VALUE_UNKNOWN;
    uint64_t l_reg_val;
    uint32_t rc = getscom_abs(TOD_STATUS_REG, &l_reg_val);
    if (rc != 0)
    {
        gpe_set_ffdc(&(args->error), TOD_STATUS_REG, GPE_RC_SCOM_GET_FAILED, rc);
        return;
    }
    if (!TOD_IS_RUNNING(l_reg_val))
    {
        return;
    }
    rc = getscom_abs(TOD_VALUE_REG, &l_reg_val);
    if (rc != 0)
    {
        gpe_set_ffdc(&(args->error), TOD_VALUE_REG, GPE_RC_SCOM_GET_FAILED, rc);
        return;
    }
    args->tod = TOD_VALUE(l_reg_val);
}
void gpe_read_tod_registers ( gpe_get_tod_args_t * args ) { args -> error . rc = GPE_RC_SUCCESS ; args -> error . addr = 0 ; args -> error . ffdc = 0 ; args -> tod = TOD_VALUE_UNKNOWN ; uint64_t l_reg_val ; uint32_t rc = getscom_abs ( TOD_STATUS_REG , & l_reg_val ) ; if ( rc != 0 ) { gpe_set_ffdc ( & ( args -> error ) , TOD_STATUS_REG , GPE_RC_SCOM_GET_FAILED , rc ) ; return ; } if ( ! TOD_IS_RUNNING ( l_reg_val ) ) { return ; } rc = getscom_abs ( TOD_VALUE_REG , & l_reg_val ) ; if ( rc != 0 ) { gpe_set_ffdc ( & ( args -> error ) , TOD_VALUE_REG , GPE_RC_SCOM_GET_FAILED , rc ) ; return ; } args -> tod = TOD_VALUE ( l_reg_val ) ; }
Reads the value of the TOD_STATUS_REG and TOD_VALUE_REG registers.
Reads the value of the TOD_STATUS_REG and TOD_VALUE_REG registers .
// Initialize output arguments to default values // Read value of TOD_STATUS_REG register // Check if TOD is running based on TOD_STATUS_REG value. // TOD is not running.  Operating system is likely fixing it.  Not an error. // Read value of TOD_VALUE_REG register // The TOD_VALUE_REG register contains two fields.  Get the TOD_VALUE field // and store that as the Time Of Day value.