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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/scheduler.c

    r470 r492  
    124124        while( done == false )
    125125        {
    126             assert( (count < sched->k_threads_nr), __FUNCTION__, "bad kernel threads list" );
     126            assert( (count < sched->k_threads_nr), "bad kernel threads list" );
    127127
    128128            // get next entry in kernel list
     
    159159        while( done == false )
    160160        {
    161             assert( (count < sched->u_threads_nr), __FUNCTION__, "bad user threads list" );
     161            assert( (count < sched->u_threads_nr), "bad user threads list" );
    162162
    163163            // get next entry in user list
     
    228228            // check thread blocked
    229229            assert( (thread->blocked & THREAD_BLOCKED_GLOBAL) ,
    230             __FUNCTION__ , "thread not blocked" );
     230            "thread not blocked" );
    231231 
    232232            // decrement response counter
     
    249249            uint32_t threads_nr = sched->u_threads_nr;
    250250
    251             assert( (threads_nr != 0) , __FUNCTION__ , "u_threads_nr cannot be 0\n" );
     251            assert( (threads_nr != 0) , "u_threads_nr cannot be 0\n" );
    252252
    253253            sched->u_threads_nr = threads_nr - 1;
     
    327327
    328328    // check next thread kernel_stack overflow
    329     assert( (next->signature == THREAD_SIGNATURE), __FUNCTION__ ,
     329    assert( (next->signature == THREAD_SIGNATURE),
    330330    "kernel stack overflow for thread %x on core[%x,%d] \n", next, local_cxy, core->lid );
    331331
    332332    // check next thread attached to same core as the calling thread
    333     assert( (next->core == current->core), __FUNCTION__ ,
     333    assert( (next->core == current->core),
    334334    "next core %x != current core %x\n", next->core, current->core );
    335335
    336336    // check next thread not blocked when type != IDLE
    337     assert( ((next->blocked == 0) || (next->type == THREAD_IDLE)) , __FUNCTION__ ,
     337    assert( ((next->blocked == 0) || (next->type == THREAD_IDLE)) ,
    338338    "next thread %x (%s) is blocked on core[%x,%d]\n",
    339339    next->trdid , thread_type_str(next->type) , local_cxy , core->lid );
     
    396396    uint32_t       save_sr;
    397397
    398     assert( (lid < LOCAL_CLUSTER->cores_nr), __FUNCTION__, "illegal core index %d\n", lid);
     398    assert( (lid < LOCAL_CLUSTER->cores_nr), "illegal core index %d\n", lid);
    399399
    400400    core_t       * core    = &LOCAL_CLUSTER->core_tbl[lid];
     
    456456    // check cxy
    457457    bool_t undefined = cluster_is_undefined( cxy );
    458     assert( (undefined == false), __FUNCTION__, "illegal cluster %x\n", cxy );
     458    assert( (undefined == false), "illegal cluster %x\n", cxy );
    459459
    460460    // check lid
    461461    uint32_t cores = hal_remote_lw( XPTR( cxy , &LOCAL_CLUSTER->cores_nr ) );
    462     assert( (lid < cores), __FUNCTION__, "illegal core index %d\n", lid);
     462    assert( (lid < cores), "illegal core index %d\n", lid);
    463463
    464464    // get local pointer on target scheduler
Note: See TracChangeset for help on using the changeset viewer.