Exemple #1
0
void sc_test_read(u32 read_cnt)
{
    u8* read_buf = NULL;
    u32 i;

    if(read_cnt>0)
    {
        read_buf = osl_malloc(read_cnt);
        if(NULL != read_buf)
        {
            memset(read_buf,0,read_cnt);
            /* write to file*/
            (void)bsp_sc_restore(read_buf, read_cnt);

            for(i=0;i<read_cnt;i++)
            {
                if(0x5A != read_buf[i])
                {
                    sc_error_printf("data is wrong, i is %d,data is 0x%x!\n",i,read_buf[i]);
                }
            }
            osl_free(read_buf);
        }
    }
}
/*
* Function   : mdrv_misc_scbackup_ext_read
* Discription: c core nv init,this phase build upon the a core kernel init,
*              this phase after icc init,this phase ensure to use all nv api normal
*              start at this phase ,ops global ddr need spinlock
* Parameter  : none
* Output     : result
* History    : 
*/
int mdrv_misc_scbackup_ext_read(unsigned char *pRamAddr, unsigned int len)
{
    return (int)bsp_sc_restore((u8*)pRamAddr, (u32)len);
}