src/occ_gpe1/gpe_centaur_scom.c
// CentaurConfiguration needs to be setup before this is called
CentaurConfiguration needs to be setup before this is called
CentaurConfiguration needs to be setup before this is called
void gpe_scom_centaur(CentaurConfiguration_t* i_config,
                      CentaurScomParms_t* i_parms)
{
    int i;
    int rc = 0;
    mtmsr((mfmsr() & ~(MSR_SIBRC | MSR_SIBRCA)) | MSR_SEM);
    for(i = 0; i < i_parms->entries; ++i)
    {
        switch(i_parms->scomList[i].commandType)
        {
            case CENTAUR_SCOM_NOP:
                break;
            case CENTAUR_SCOM_READ:
                rc =centaur_get_scom(i_config,
                                     i_parms->scomList[i].instanceNumber,
                                     i_parms->scomList[i].scom,
                                     &(i_parms->scomList[i].data));
                break;
            case CENTAUR_SCOM_WRITE:
                rc = centaur_put_scom(i_config,
                                      i_parms->scomList[i].instanceNumber,
                                      i_parms->scomList[i].scom,
                                      i_parms->scomList[i].data);
                break;
            case CENTAUR_SCOM_RMW:
                rc = centaur_scom_rmw(i_config,
                                      i_parms->scomList[i].instanceNumber,
                                      i_parms->scomList[i].scom,
                                      i_parms->scomList[i].mask,
                                      &(i_parms->scomList[i].data));
                break;
            case CENTAUR_SCOM_READ_VECTOR:
                rc = centaur_get_scom_vector(i_config,
                                             i_parms->scomList[i].scom,
                                             i_parms->scomList[i].pData
                                            );
                break;
            case CENTAUR_SCOM_WRITE_ALL:
                rc = centaur_put_scom_all(i_config,
                                          i_parms->scomList[i].scom,
                                          i_parms->scomList[i].data);
                break;
            case CENTAUR_SCOM_RMW_ALL:
                rc = centaur_scom_rmw_all(i_config,
                                          i_parms->scomList[i].scom,
                                          i_parms->scomList[i].mask,
                                          i_parms->scomList[i].data);
                break;
            case CENTAUR_SCOM_CENTAUR_SYNC:
                rc = centaur_scom_sync(i_config);
                break;
            default:
                break;
        };
        i_parms->error.rc = rc;
        if (rc)
        {
            break;
        }
    }
}
void gpe_scom_centaur ( CentaurConfiguration_t * i_config , CentaurScomParms_t * i_parms ) { int i ; int rc = 0 ; mtmsr ( ( mfmsr ( ) & ~ ( MSR_SIBRC | MSR_SIBRCA ) ) | MSR_SEM ) ; for ( i = 0 ; i < i_parms -> entries ; ++ i ) { switch ( i_parms -> scomList [ i ] . commandType ) { case CENTAUR_SCOM_NOP : break ; case CENTAUR_SCOM_READ : rc = centaur_get_scom ( i_config , i_parms -> scomList [ i ] . instanceNumber , i_parms -> scomList [ i ] . scom , & ( i_parms -> scomList [ i ] . data ) ) ; break ; case CENTAUR_SCOM_WRITE : rc = centaur_put_scom ( i_config , i_parms -> scomList [ i ] . instanceNumber , i_parms -> scomList [ i ] . scom , i_parms -> scomList [ i ] . data ) ; break ; case CENTAUR_SCOM_RMW : rc = centaur_scom_rmw ( i_config , i_parms -> scomList [ i ] . instanceNumber , i_parms -> scomList [ i ] . scom , i_parms -> scomList [ i ] . mask , & ( i_parms -> scomList [ i ] . data ) ) ; break ; case CENTAUR_SCOM_READ_VECTOR : rc = centaur_get_scom_vector ( i_config , i_parms -> scomList [ i ] . scom , i_parms -> scomList [ i ] . pData ) ; break ; case CENTAUR_SCOM_WRITE_ALL : rc = centaur_put_scom_all ( i_config , i_parms -> scomList [ i ] . scom , i_parms -> scomList [ i ] . data ) ; break ; case CENTAUR_SCOM_RMW_ALL : rc = centaur_scom_rmw_all ( i_config , i_parms -> scomList [ i ] . scom , i_parms -> scomList [ i ] . mask , i_parms -> scomList [ i ] . data ) ; break ; case CENTAUR_SCOM_CENTAUR_SYNC : rc = centaur_scom_sync ( i_config ) ; break ; default : break ; } ; i_parms -> error . rc = rc ; if ( rc ) { break ; } } }
CentaurConfiguration needs to be setup before this is called
CentaurConfiguration needs to be setup before this is called