Ignore:
Timestamp:
Aug 22, 2018, 11:55:48 PM (6 years ago)
Author:
viala@…
Message:

Refactoring assert calling to conform with new assert macro.

Made with this command for the general case.
find ./kernel/ hal/ -name "*.c" | xargs sed -i -e '/assert(/ s/,[ ]*FUNCTION[ ]*,/,/'

And some done by hand.

Location:
trunk/hal/tsar_mips32/core
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_context.c

    r459 r492  
    119119error_t hal_cpu_context_alloc( thread_t * thread )
    120120{
    121     assert( (sizeof(hal_cpu_context_t) <= CONFIG_CPU_CTX_SIZE) , __FUNCTION__ ,
     121    assert( (sizeof(hal_cpu_context_t) <= CONFIG_CPU_CTX_SIZE) ,
    122122    "illegal CPU context size" );
    123123
     
    146146    hal_cpu_context_t * context = (hal_cpu_context_t *)thread->cpu_context;
    147147
    148     assert( (context != NULL ), __FUNCTION__, "CPU context not allocated" );
     148    assert( (context != NULL ), "CPU context not allocated" );
    149149
    150150    // initialisation depends on thread type
     
    235235    else                           // current == child thread
    236236    {
    237         assert( (current == child_ptr) , __FUNCTION__ , "current = %x / child = %x\n");
     237        assert( (current == child_ptr) , "current = %x / child = %x\n");
    238238    }
    239239}  // end hal_cpu_context_fork()
     
    300300error_t hal_fpu_context_alloc( thread_t * thread )
    301301{
    302     assert( (sizeof(hal_fpu_context_t) <= CONFIG_FPU_CTX_SIZE) , __FUNCTION__ ,
     302    assert( (sizeof(hal_fpu_context_t) <= CONFIG_FPU_CTX_SIZE) ,
    303303    "illegal CPU context size" );
    304304
     
    322322    hal_fpu_context_t * context = thread->fpu_context;
    323323
    324     assert( (context != NULL) , __FUNCTION__ , "fpu context not allocated" );
     324    assert( (context != NULL) , "fpu context not allocated" );
    325325
    326326    memset( context , 0 , sizeof(hal_fpu_context_t) );
     
    331331                           thread_t * src )
    332332{
    333     assert( (src != NULL) , __FUNCTION__ , "src thread pointer is NULL\n");
    334     assert( (dst != NULL) , __FUNCTION__ , "dst thread pointer is NULL\n");
     333    assert( (src != NULL) , "src thread pointer is NULL\n");
     334    assert( (dst != NULL) , "dst thread pointer is NULL\n");
    335335
    336336    // get fpu context pointers
  • trunk/hal/tsar_mips32/core/hal_drivers.c

    r457 r492  
    4949                           uint32_t   impl )
    5050{
    51         assert( (impl == IMPL_TXT_TTY), __FUNCTION__ , "bad implementation" );
     51        assert( (impl == IMPL_TXT_TTY), "bad implementation" );
    5252
    5353        soclib_tty_init( txt );
     
    6262                           uint32_t   impl )
    6363{
    64     assert( (impl == IMPL_PIC_SCL), __FUNCTION__, "bad implementation" );
     64    assert( (impl == IMPL_PIC_SCL), "bad implementation" );
    6565
    6666        soclib_pic_init( pic );
     
    8585                           uint32_t   impl )
    8686{
    87         assert( (impl == IMPL_IOB_TSR), __FUNCTION__ , "bad implementation" );
     87        assert( (impl == IMPL_IOB_TSR), "bad implementation" );
    8888
    8989        soclib_iob_init( iob );
     
    116116    else
    117117    {
    118                 assert( false , __FUNCTION__ , "undefined IOC device implementation" );
     118                assert( false , "undefined IOC device implementation" );
    119119        }
    120120}
     
    128128                           uint32_t   impl )
    129129{
    130         assert( (impl == IMPL_MMC_TSR), __FUNCTION__ , "bad implementation" );
     130        assert( (impl == IMPL_MMC_TSR), "bad implementation" );
    131131 
    132132    soclib_mmc_init( mmc );
     
    141141                           uint32_t   impl )
    142142{
    143         assert( (impl == IMPL_NIC_CBF), __FUNCTION__ , "bad implementation" );
     143        assert( (impl == IMPL_NIC_CBF), "bad implementation" );
    144144 
    145145    soclib_nic_init( nic );
     
    154154                           uint32_t   impl )
    155155{
    156         assert( (impl == IMPL_DMA_SCL), __FUNCTION__ , "bad implementation" );
     156        assert( (impl == IMPL_DMA_SCL), "bad implementation" );
    157157 
    158158    soclib_dma_init( dma );
  • trunk/hal/tsar_mips32/core/hal_exception.c

    r481 r492  
    500500        hal_exception_dump( this , uzone , error );
    501501
    502         assert( false , __FUNCTION__ , "core[%x,%d] blocked\n", local_cxy, this->core->lid );
     502        assert( false , "Exception raised kernel panic see information below.\n" );
    503503    }
    504504
  • trunk/hal/tsar_mips32/core/hal_gpt.c

    r457 r492  
    140140
    141141    // check page size
    142     assert( (CONFIG_PPM_PAGE_SIZE == 4096) , __FUNCTION__ ,
     142    assert( (CONFIG_PPM_PAGE_SIZE == 4096) ,
    143143    "for TSAR, the page size must be 4 Kbytes\n" );
    144144
     
    283283    vpn_t      vpn;
    284284
    285     assert( (process != NULL) , __FUNCTION__ , "NULL process pointer\n");
     285    assert( (process != NULL) , "NULL process pointer\n");
    286286
    287287    // get pointer on gpt
     
    387387        pte1 = *pte1_ptr;
    388388
    389         assert( (pte1 == 0) , __FUNCTION__ ,
     389        assert( (pte1 == 0) ,
    390390                "try to set a big page in a mapped PT1 entry / PT1[%d] = %x\n", ix1 , pte1 );
    391391     
     
    441441        {
    442442            // This valid entry must be a PTD1
    443             assert( (pte1 & TSAR_MMU_SMALL) , __FUNCTION__ ,
     443            assert( (pte1 & TSAR_MMU_SMALL) ,
    444444            "try to set a small page in a big PT1 entry / PT1[%d] = %x\n", ix1 , pte1 );
    445445
     
    792792
    793793    // check src_pt1 and dst_pt1 existence
    794     assert( (src_pt1 != NULL) , __FUNCTION__ , "src_pt1 does not exist\n");
    795     assert( (dst_pt1 != NULL) , __FUNCTION__ , "dst_pt1 does not exist\n");
     794    assert( (src_pt1 != NULL) , "src_pt1 does not exist\n");
     795    assert( (dst_pt1 != NULL) , "dst_pt1 does not exist\n");
    796796
    797797    ix1 = TSAR_MMU_IX1_FROM_VPN( vpn );
     
    10101010            pt2     = (uint32_t*)GET_PTR( ppm_ppn2base( pt2_ppn ) );
    10111011
    1012             assert( (GET_CXY( ppm_ppn2base( pt2_ppn ) ) == gpt_cxy ), __FUNCTION__,
     1012            assert( (GET_CXY( ppm_ppn2base( pt2_ppn ) ) == gpt_cxy ),
    10131013            "PT2 and PT1 must be in the same cluster\n");
    10141014 
Note: See TracChangeset for help on using the changeset viewer.