Changeset 492 for trunk/kernel/kern


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/kernel/kern
Files:
9 edited

Legend:

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

    r485 r492  
    264264
    265265    // deschedule
    266     assert( thread_can_yield( this ) , __FUNCTION__ , "illegal sched_yield\n" );
     266    assert( thread_can_yield( this ) , "illegal sched_yield\n" );
    267267    sched_yield("blocked on I/O");
    268268
     
    327327
    328328            // deschedule
    329             assert( thread_can_yield( server ) , __FUNCTION__ , "illegal sched_yield\n" );
     329            assert( thread_can_yield( server ) , "illegal sched_yield\n" );
    330330            sched_yield("I/O queue empty");
    331331        }
     
    408408    chdev_t     * chdev_ptr;
    409409
    410     assert( (file_xp != XPTR_NULL) , __FUNCTION__,
     410    assert( (file_xp != XPTR_NULL) ,
    411411    "file_xp == XPTR_NULL\n" );
    412412
     
    420420    inode_ptr  = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
    421421
    422     assert( (inode_type == INODE_TYPE_DEV) , __FUNCTION__ ,
     422    assert( (inode_type == INODE_TYPE_DEV) ,
    423423    "inode type %d is not INODE_TYPE_DEV\n", inode_type );
    424424
  • trunk/kernel/kern/cluster.c

    r485 r492  
    450450
    451451    // check lpid
    452     assert( (lpid < CONFIG_MAX_PROCESS_PER_CLUSTER), __FUNCTION__ ,
     452    assert( (lpid < CONFIG_MAX_PROCESS_PER_CLUSTER),
    453453    "illegal LPID = %d" , lpid );
    454454
    455455    // check owner cluster
    456     assert( (owner_cxy == local_cxy) , __FUNCTION__ ,
     456    assert( (owner_cxy == local_cxy) ,
    457457    "local_cluster %x !=  owner_cluster %x" , local_cxy , owner_cxy );
    458458
     
    650650
    651651    assert( (cluster_is_undefined( cxy ) == false),
    652     __FUNCTION__, "illegal cluster index" );
     652    "illegal cluster index" );
    653653
    654654    // get extended pointer on root and lock for local process list in cluster
  • trunk/kernel/kern/do_syscall.c

    r488 r492  
    3636static int sys_undefined()
    3737{
    38     assert( false , __FUNCTION__ , "undefined system call" );
     38    assert( false , "undefined system call" );
    3939    return 0;
    4040}
     
    176176        int  error = 0;
    177177       
    178     assert( (this == CURRENT_THREAD), __FUNCTION__,
     178    assert( (this == CURRENT_THREAD),
    179179    "wrong <this> argument\n" );
    180180
     
    200200
    201201    // check kernel stack overflow
    202     assert( (CURRENT_THREAD->signature == THREAD_SIGNATURE), __FUNCTION__,
     202    assert( (CURRENT_THREAD->signature == THREAD_SIGNATURE),
    203203    "kernel stack overflow after for thread %x in cluster %x\n", CURRENT_THREAD, local_cxy );
    204204
  • trunk/kernel/kern/dqdt.c

    r485 r492  
    102102                    uint32_t y_width )
    103103{
    104     assert( ((x_size <= 32) && (y_size <= 32)) , __FUNCTION__ , "illegal mesh size\n");
     104    assert( ((x_size <= 32) && (y_size <= 32)) , "illegal mesh size\n");
    105105
    106106        dqdt_node_t * node;
  • trunk/kernel/kern/kernel_init.c

    r490 r492  
    231231        if (func == DEV_FUNC_TXT )
    232232        {
    233             assert( (channels > 0) , __FUNCTION__ , "number of TXT channels cannot be 0\n");
     233            assert( (channels > 0) , "number of TXT channels cannot be 0\n");
    234234
    235235            // initializes TXT_TX[0] chdev
     
    298298        if( func == DEV_FUNC_MMC ) 
    299299        {
    300             assert( (channels == 1) , __FUNCTION__ ,
    301                     "MMC device must be single channel\n" );
     300            assert( (channels == 1) , "MMC device must be single channel\n" );
    302301
    303302            // create chdev in local cluster
     
    308307                                      base );
    309308
    310             assert( (chdev_ptr != NULL) , __FUNCTION__ ,
     309            assert( (chdev_ptr != NULL) ,
    311310                    "cannot allocate memory for MMC chdev\n" );
    312311           
     
    344343                                          base );
    345344
    346                 assert( (chdev_ptr != NULL) , __FUNCTION__ ,
    347                         "cannot allocate memory for DMA chdev" );
     345                assert( (chdev_ptr != NULL) , "cannot allocate memory for DMA chdev" );
    348346           
    349347                // make DMA specific initialisation
     
    420418
    421419        // check PIC device initialized
    422         assert( (chdev_dir.pic != XPTR_NULL ) , __FUNCTION__ ,
     420        assert( (chdev_dir.pic != XPTR_NULL ) ,
    423421              "PIC device must be initialized before other devices\n" );
    424422
     
    428426                  (func == DEV_FUNC_TXT) ||
    429427                  (func == DEV_FUNC_NIC) ||
    430                   (func == DEV_FUNC_FBF) ) , __FUNCTION__ ,
     428                  (func == DEV_FUNC_FBF) ) ,
    431429                  "undefined external peripheral type\n" );
    432430
     
    456454                                          base );
    457455
    458                     assert( (chdev != NULL), __FUNCTION__ ,
     456                    assert( (chdev != NULL),
    459457                            "cannot allocate external device" );
    460458
     
    544542    }
    545543
    546     assert( found , __FUNCTION__ , "PIC device not found\n" );
     544    assert( found , "PIC device not found\n" );
    547545
    548546    // allocate and initialize the PIC chdev in cluster 0
     
    553551                          base );
    554552
    555     assert( (chdev != NULL), __FUNCTION__ , "no memory for PIC chdev\n" );
     553    assert( (chdev != NULL), "no memory for PIC chdev\n" );
    556554
    557555    // make PIC device type specific initialisation
     
    607605            else if((func == DEV_FUNC_TXT) && (is_rx == 0)) ptr = &iopic_input.txt_tx[channel];
    608606            else if((func == DEV_FUNC_TXT) && (is_rx != 0)) ptr = &iopic_input.txt_rx[channel];
    609             else if((func == DEV_FUNC_NIC) && (is_rx == 0)) ptr = &iopic_input.nic_tx[channel]; 
    610             else if((func == DEV_FUNC_NIC) && (is_rx != 0)) ptr = &iopic_input.nic_rx[channel]; 
    611             else if( func == DEV_FUNC_IOB )                 ptr = &iopic_input.iob; 
    612             else     assert( false , __FUNCTION__ , "illegal source device for IOPIC input" );
     607            else if((func == DEV_FUNC_NIC) && (is_rx == 0)) ptr = &iopic_input.nic_tx[channel];
     608            else if((func == DEV_FUNC_NIC) && (is_rx != 0)) ptr = &iopic_input.nic_rx[channel];
     609            else if( func == DEV_FUNC_IOB )                 ptr = &iopic_input.iob;
     610            else     assert( false , "illegal source device for IOPIC input" );
    613611
    614612            // set one entry in all "iopic_input" structures
     
    697695                if     ( func == DEV_FUNC_MMC ) lapic_input.mmc = id;
    698696                else if( func == DEV_FUNC_DMA ) lapic_input.dma[channel] = id;
    699                 else assert( false , __FUNCTION__ , "illegal source device for LAPIC input" );
     697                else assert( false , "illegal source device for LAPIC input" );
    700698            }
    701699        }
     
    818816    if( error )
    819817    {
    820         assert( false , __FUNCTION__ ,
     818        assert( false ,
    821819        "illegal core identifiers gid = %x / cxy = %x / lid = %d",
    822820        core_lid , core_cxy , core_lid );
     
    830828        if( error )
    831829        {
    832             assert( false , __FUNCTION__ ,
     830            assert( false ,
    833831            "cannot initialise cluster %x", local_cxy );
    834832        }
     
    950948            fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc();
    951949
    952             assert( (fatfs_ctx != NULL) , __FUNCTION__ ,
     950            assert( (fatfs_ctx != NULL) ,
    953951                    "cannot create FATFS context in cluster 0\n" );
    954952
     
    973971                                      &vfs_root_inode_xp );                // return
    974972
    975             assert( (error == 0) , __FUNCTION__ ,
     973            assert( (error == 0) ,
    976974                    "cannot create VFS root inode\n" );
    977975
     
    987985            vfs_ctx_t   * vfs_ctx = &fs_context[FS_TYPE_FATFS];
    988986            assert( (((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster == 8),
    989             __FUNCTION__ , "illegal value for FATFS context in cluster %x\n", local_cxy );
     987            "illegal value for FATFS context in cluster %x\n", local_cxy );
    990988        }
    991989        else
    992990        {
    993             assert( false , __FUNCTION__ ,
     991            assert( false ,
    994992            "root FS must be FATFS" );
    995993        }
     
    10281026            fatfs_ctx_t * local_fatfs_ctx = fatfs_ctx_alloc();
    10291027
    1030             assert( (local_fatfs_ctx != NULL) , __FUNCTION__ ,
     1028            assert( (local_fatfs_ctx != NULL) ,
    10311029            "cannot create FATFS context in cluster %x\n", local_cxy );
    10321030
     
    10501048            // 7. check initialisation
    10511049            assert( (((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster == 8),
    1052             __FUNCTION__ , "illegal value for FATFS context in cluster %x\n", local_cxy );
     1050            "illegal value for FATFS context in cluster %x\n", local_cxy );
    10531051        }
    10541052
     
    10891087        devfs_ctx_t * devfs_ctx = devfs_ctx_alloc();
    10901088
    1091         assert( (devfs_ctx != NULL) , __FUNCTION__ ,
     1089        assert( (devfs_ctx != NULL) ,
    10921090                "cannot create DEVFS context in cluster IO\n");
    10931091
  • trunk/kernel/kern/process.c

    r485 r492  
    132132    // initialize vmm as empty
    133133    error = vmm_init( process );
    134     assert( (error == 0) , __FUNCTION__ , "cannot initialize VMM\n" );
     134    assert( (error == 0) , "cannot initialize VMM\n" );
    135135 
    136136#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
     
    175175                           &stdin_id );
    176176
    177         assert( (error == 0) , __FUNCTION__ , "cannot open stdin pseudo file" );
    178         assert( (stdin_id == 0) , __FUNCTION__ , "stdin index must be 0" );
     177        assert( (error == 0) , "cannot open stdin pseudo file" );
     178        assert( (stdin_id == 0) , "stdin index must be 0" );
    179179
    180180#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
     
    193193                           &stdout_id );
    194194
    195         assert( (error == 0) , __FUNCTION__ , "cannot open stdout pseudo file" );
    196         assert( (stdout_id == 1) , __FUNCTION__ , "stdout index must be 1" );
     195        assert( (error == 0) , "cannot open stdout pseudo file" );
     196        assert( (stdout_id == 1) , "stdout index must be 1" );
    197197
    198198#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
     
    211211                           &stderr_id );
    212212
    213         assert( (error == 0) , __FUNCTION__ , "cannot open stderr pseudo file" );
    214         assert( (stderr_id == 2) , __FUNCTION__ , "stderr index must be 2" );
     213        assert( (error == 0) , "cannot open stderr pseudo file" );
     214        assert( (stderr_id == 2) , "stderr index must be 2" );
    215215
    216216#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
     
    330330    // reset local process vmm
    331331    error = vmm_init( local_process );
    332     assert( (error == 0) , __FUNCTION__ , "cannot initialize VMM\n");
     332    assert( (error == 0) , "cannot initialize VMM\n");
    333333
    334334    // reset process file descriptors array
     
    393393    pid_t       pid = process->pid;
    394394
    395         assert( (process->th_nr == 0) , __FUNCTION__ ,
     395        assert( (process->th_nr == 0) ,
    396396    "process %x in cluster %x has still active threads", pid , local_cxy );
    397397
     
    511511    assert( ((type == DELETE_ALL_THREADS ) ||
    512512             (type == BLOCK_ALL_THREADS )  ||
    513              (type == UNBLOCK_ALL_THREADS )), __FUNCTION__ , "illegal action type" );
     513             (type == UNBLOCK_ALL_THREADS )), "illegal action type" );
    514514             
    515515
     
    843843        xptr_t ref_xp = cluster_get_reference_process_from_pid( pid );
    844844
    845         assert( (ref_xp != XPTR_NULL) , __FUNCTION__ , "illegal pid\n" );
     845        assert( (ref_xp != XPTR_NULL) , "illegal pid\n" );
    846846
    847847        // allocate memory for local process descriptor
     
    10461046 
    10471047
    1048     assert( (process != NULL) , __FUNCTION__ , "process argument is NULL" );
    1049 
    1050     assert( (thread != NULL) , __FUNCTION__ , "thread argument is NULL" );
     1048    assert( (process != NULL) , "process argument is NULL" );
     1049
     1050    assert( (thread != NULL) , "thread argument is NULL" );
    10511051
    10521052    // take lock protecting th_tbl, depending on thread type:
     
    10891089    uint32_t count;  // number of threads in local process descriptor
    10901090
    1091     assert( (thread != NULL) , __FUNCTION__ , "thread argument is NULL" );
     1091    assert( (thread != NULL) , "thread argument is NULL" );
    10921092
    10931093    process_t * process = thread->process;
     
    11011101    count = process->th_nr;
    11021102
    1103     assert( (count > 0) , __FUNCTION__ , "process th_nr cannot be 0\n" );
     1103    assert( (count > 0) , "process th_nr cannot be 0\n" );
    11041104
    11051105    // remove thread from th_tbl[]
     
    11401140    ref_xp = hal_remote_lwd( XPTR( parent_process_cxy , &parent_process_ptr->ref_xp ) );
    11411141
    1142     assert( (parent_process_xp == ref_xp ) , __FUNCTION__ ,
     1142    assert( (parent_process_xp == ref_xp ) ,
    11431143    "parent process must be the reference process\n" );
    11441144
     
    12431243
    12441244    // check main thread LTID
    1245     assert( (LTID_FROM_TRDID(thread->trdid) == 0) , __FUNCTION__ ,
     1245    assert( (LTID_FROM_TRDID(thread->trdid) == 0) ,
    12461246    "main thread must have LTID == 0\n" );
    12471247
     
    14211421    }
    14221422
    1423     assert( false, __FUNCTION__, "we should not execute this code");
     1423    assert( false, "we should not execute this code");
    14241424 
    14251425        return 0;
     
    14911491        process = process_alloc();
    14921492       
    1493     assert( (process != NULL), __FUNCTION__,
     1493    assert( (process != NULL),
    14941494    "no memory for process descriptor in cluster %x\n", local_cxy  );
    14951495
     
    14971497    error = cluster_pid_alloc( process , &pid );
    14981498
    1499     assert( (error == 0), __FUNCTION__,
     1499    assert( (error == 0),
    15001500    "cannot allocate PID in cluster %x\n", local_cxy );
    15011501
    1502     assert( (pid == 1) , __FUNCTION__,
     1502    assert( (pid == 1) ,
    15031503    "process INIT must be first process in cluster 0\n" );
    15041504
     
    15181518                            &file_id );
    15191519
    1520         assert( (error == 0), __FUNCTION__,
     1520        assert( (error == 0),
    15211521    "failed to open file <%s>\n", CONFIG_PROCESS_INIT_PATH );
    15221522
     
    15251525        error = elf_load_process( file_xp , process );
    15261526
    1527         assert( (error == 0), __FUNCTION__,
     1527        assert( (error == 0),
    15281528    "cannot access .elf file <%s>\n", CONFIG_PROCESS_INIT_PATH );
    15291529
     
    15531553                                &thread );
    15541554
    1555         assert( (error == 0), __FUNCTION__,
     1555        assert( (error == 0),
    15561556    "cannot create main thread for <%s>\n", CONFIG_PROCESS_INIT_PATH );
    15571557
    1558     assert( (thread->trdid == 0), __FUNCTION__,
     1558    assert( (thread->trdid == 0),
    15591559    "main thread must have index 0 for <%s>\n", CONFIG_PROCESS_INIT_PATH );
    15601560
     
    16311631    txt_file_xp = hal_remote_lwd( XPTR( owner_cxy , &owner_ptr->fd_array.array[0] ) );
    16321632
    1633     assert( (txt_file_xp != XPTR_NULL) , __FUNCTION__ ,
     1633    assert( (txt_file_xp != XPTR_NULL) ,
    16341634    "process must be attached to one TXT terminal\n" );
    16351635
     
    16951695    }
    16961696
    1697     assert( false , __FUNCTION__ , "no free TXT terminal found" );
     1697    assert( false , "no free TXT terminal found" );
    16981698
    16991699    return -1;
     
    17121712
    17131713    // check process is in owner cluster
    1714     assert( (CXY_FROM_PID( process->pid ) == local_cxy) , __FUNCTION__ ,
     1714    assert( (CXY_FROM_PID( process->pid ) == local_cxy) ,
    17151715    "process descriptor not in owner cluster" );
    17161716
    17171717    // check terminal index
    17181718    assert( (txt_id < LOCAL_CLUSTER->nb_txt_channels) ,
    1719     __FUNCTION__ , "illegal TXT terminal index" );
     1719    "illegal TXT terminal index" );
    17201720
    17211721    // get pointers on TXT_RX[txt_id] chdev
     
    17611761    // check process descriptor in owner cluster
    17621762    process_pid = hal_remote_lw( XPTR( process_cxy , &process_ptr->pid ) );
    1763     assert( (CXY_FROM_PID( process_pid ) == process_cxy ) , __FUNCTION__ ,
     1763    assert( (CXY_FROM_PID( process_pid ) == process_cxy ) ,
    17641764    "process descriptor not in owner cluster" );
    17651765
     
    18111811
    18121812    // check owner cluster
    1813     assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,
     1813    assert( (process_cxy == CXY_FROM_PID( process_pid )) ,
    18141814    "process descriptor not in owner cluster\n" );
    18151815
     
    18641864
    18651865    // check owner cluster
    1866     assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,
     1866    assert( (process_cxy == CXY_FROM_PID( process_pid )) ,
    18671867    "process descriptor not in owner cluster\n" );
    18681868
     
    19221922
    19231923            // PANIC if KSH not found
    1924             assert( false , __FUNCTION__ , "KSH process not found for TXT %d" );
     1924            assert( false , "KSH process not found for TXT %d" );
    19251925
    19261926            return;
     
    19951995    // check owner cluster
    19961996    pid_t process_pid = hal_remote_lw( XPTR( process_cxy , &process_ptr->pid ) );
    1997     assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,
     1997    assert( (process_cxy == CXY_FROM_PID( process_pid )) ,
    19981998    "process descriptor not in owner cluster\n" );
    19991999
     
    20412041   
    20422042    assert( (txt_id < LOCAL_CLUSTER->nb_txt_channels) ,
    2043     __FUNCTION__ , "illegal TXT terminal index" );
     2043    "illegal TXT terminal index" );
    20442044
    20452045    // get pointers on TXT0 chdev
  • trunk/kernel/kern/rpc.c

    r485 r492  
    8585void __attribute__((noinline)) rpc_undefined()
    8686{
    87         assert( false , __FUNCTION__ , "called in cluster %x", local_cxy );
     87        assert( false , "called in cluster %x", local_cxy );
    8888}
    8989
     
    204204
    205205        // check response available
    206         assert( (rpc->responses == 0) , __FUNCTION__, "illegal RPC response\n" );
     206        assert( (rpc->responses == 0) , "illegal RPC response\n" );
    207207    }
    208208    else  // non blocking RPC
     
    280280                                                      core->lid );
    281281                 
    282             assert( (error == 0), __FUNCTION__ ,
     282            assert( (error == 0),
    283283            "no memory to allocate a new RPC thread in cluster %x", local_cxy );
    284284
     
    459459
    460460            // RPC thread deschedules
    461             assert( thread_can_yield( server_ptr ) , __FUNCTION__, "illegal sched_yield\n" );
     461            assert( thread_can_yield( server_ptr ) , "illegal sched_yield\n" );
    462462            sched_yield("RPC fifo empty");
    463463        }
     
    484484#endif
    485485
    486     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     486    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    487487
    488488    // initialise RPC descriptor header
     
    555555#endif
    556556
    557     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     557    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    558558
    559559    // initialise RPC descriptor header
     
    631631#endif
    632632
    633     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     633    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    634634
    635635    // initialise RPC descriptor header
     
    723723                                    error_t        * error )      // out
    724724{
    725     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     725    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    726726
    727727    // initialise RPC descriptor header
     
    803803                                      error_t * error )      // out
    804804{
    805     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     805    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    806806
    807807    // initialise RPC descriptor header
     
    879879
    880880    // check some RPC arguments
    881     assert( (rpc->blocking == false) , __FUNCTION__ , "must be non-blocking\n");
    882     assert( (rpc->index == RPC_PROCESS_SIGACTION ) , __FUNCTION__ , "bad RPC index\n" );
     881    assert( (rpc->blocking == false) , "must be non-blocking\n");
     882    assert( (rpc->index == RPC_PROCESS_SIGACTION ) , "bad RPC index\n" );
    883883
    884884    // register RPC request in remote RPC fifo and return
     
    987987#endif
    988988
    989     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     989    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    990990
    991991    // initialise RPC descriptor header
     
    10941094#endif
    10951095
    1096     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1096    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    10971097
    10981098    // initialise RPC descriptor header
     
    11721172#endif
    11731173
    1174     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1174    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    11751175
    11761176    // initialise RPC descriptor header
     
    12631263#endif
    12641264
    1265     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1265    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    12661266
    12671267    // initialise RPC descriptor header
     
    13411341#endif
    13421342
    1343     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1343    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    13441344
    13451345    // initialise RPC descriptor header
     
    14231423#endif
    14241424
    1425     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1425    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    14261426
    14271427    // initialise RPC descriptor header
     
    14861486                                error_t     * error )          // out
    14871487{
    1488     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1488    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    14891489
    14901490    // initialise RPC descriptor header
     
    15471547                                     error_t     * error )     // out
    15481548{
    1549     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1549    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    15501550
    15511551    // initialise RPC descriptor header
     
    15991599                                   error_t  * error )    // out
    16001600{
    1601     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1601    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    16021602
    16031603    // initialise RPC descriptor header
     
    16661666#endif
    16671667
    1668     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1668    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    16691669
    16701670    // initialise RPC descriptor header
     
    17541754#endif
    17551755
    1756     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1756    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    17571757
    17581758    // initialise RPC descriptor header
     
    18341834                           xptr_t *   buf_xp )     // out
    18351835{
    1836     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1836    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    18371837
    18381838    // initialise RPC descriptor header
     
    18841884                          uint32_t   kmem_type )   // in
    18851885{
    1886     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1886    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    18871887
    18881888    // initialise RPC descriptor header
     
    19341934                                    error_t  * error )        // out
    19351935{
    1936     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     1936    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    19371937
    19381938    // initialise RPC descriptor header
     
    20182018                                 page_t         ** page )      // out
    20192019{
    2020     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     2020    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    20212021
    20222022    // initialise RPC descriptor header
     
    20732073                                 struct vseg_s   ** vseg )
    20742074{
    2075     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     2075    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    20762076
    20772077    // initialise RPC descriptor header
     
    21432143                             process_t * process )
    21442144{
    2145     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     2145    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    21462146
    21472147    // initialise RPC descriptor header
     
    21852185                             bool_t      detailed )
    21862186{
    2187     assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     2187    assert( (cxy != local_cxy) , "target cluster is not remote\n");
    21882188
    21892189    // initialise RPC descriptor header
  • 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
  • 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.