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/thread.c

    r485 r492  
    238238    vseg_t       * vseg;         // stack vseg
    239239
    240     assert( (attr != NULL) , __FUNCTION__, "pthread attributes must be defined" );
     240    assert( (attr != NULL) , "pthread attributes must be defined" );
    241241
    242242#if DEBUG_THREAD_USER_CREATE
     
    594594#endif
    595595
    596         assert( (thread->type == THREAD_USER )          , __FUNCTION__, "bad type" );
    597         assert( (thread->signature == THREAD_SIGNATURE) , __FUNCTION__, "bad signature" );
    598         assert( (thread->local_locks == 0)              , __FUNCTION__, "bad local locks" );
    599         assert( (thread->remote_locks == 0)             , __FUNCTION__, "bad remote locks" );
     596        assert( (thread->type == THREAD_USER )          , "bad type" );
     597        assert( (thread->signature == THREAD_SIGNATURE) , "bad signature" );
     598        assert( (thread->local_locks == 0)              , "bad local locks" );
     599        assert( (thread->remote_locks == 0)             , "bad remote locks" );
    600600
    601601        // re-initialize various thread descriptor fields
     
    662662        hal_cpu_context_exec( thread );
    663663
    664     assert( false, __FUNCTION__, "we should execute this code");
     664    assert( false, "we should execute this code");
    665665 
    666666    return 0;
     
    679679
    680680    assert( ( (type == THREAD_IDLE) || (type == THREAD_RPC) || (type == THREAD_DEV) ) ,
    681     __FUNCTION__ , "illegal thread type" );
     681        "illegal thread type" );
    682682
    683683    assert( (core_lid < LOCAL_CLUSTER->cores_nr) ,
    684             __FUNCTION__ , "illegal core_lid" );
     684            "illegal core_lid" );
    685685
    686686#if DEBUG_THREAD_KERNEL_CREATE
     
    740740                           lid_t           core_lid )
    741741{
    742     assert( (type == THREAD_IDLE) , __FUNCTION__ , "illegal thread type" );
    743     assert( (core_lid < LOCAL_CLUSTER->cores_nr) , __FUNCTION__ , "illegal core index" );
     742    assert( (type == THREAD_IDLE) , "illegal thread type" );
     743    assert( (core_lid < LOCAL_CLUSTER->cores_nr) , "illegal core index" );
    744744
    745745    // initialize thread descriptor
     
    752752                                  0 , 0 );   // no user stack for a kernel thread
    753753
    754     assert( (error == 0), __FUNCTION__, "cannot create thread idle" );
     754    assert( (error == 0), "cannot create thread idle" );
    755755
    756756    // allocate & initialize CPU context if success
    757757    error = hal_cpu_context_alloc( thread );
    758758
    759     assert( (error == 0), __FUNCTION__, "cannot allocate CPU context" );
     759    assert( (error == 0), "cannot allocate CPU context" );
    760760
    761761    hal_cpu_context_init( thread );
     
    782782#endif
    783783
    784     assert( (thread->local_locks == 0) , __FUNCTION__ ,
     784    assert( (thread->local_locks == 0) ,
    785785    "local lock not released for thread %x in process %x", thread->trdid, process->pid );
    786786
    787     assert( (thread->remote_locks == 0) , __FUNCTION__ ,
     787    assert( (thread->remote_locks == 0) ,
    788788    "remote lock not released for thread %x in process %x", thread->trdid, process->pid );
    789789
     
    867867
    868868    // check signal pending in scheduler
    869     assert( sched->req_ack_pending , __FUNCTION__ , "no pending signal" );
     869    assert( sched->req_ack_pending , "no pending signal" );
    870870   
    871871    // enter critical section
     
    10051005    // must be deleted by the parent process sys_wait() function
    10061006    owner_cxy = CXY_FROM_PID( pid );
    1007     assert( ((owner_cxy != target_cxy) || (target_ltid != 0)), __FUNCTION__,
     1007    assert( ((owner_cxy != target_cxy) || (target_ltid != 0)),
    10081008    "tharget thread cannot be the main thread\n" );
    10091009
Note: See TracChangeset for help on using the changeset viewer.