Changeset 492 for trunk/kernel/mm/vmm.c


Ignore:
Timestamp:
Aug 22, 2018, 11:55:48 PM (4 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/mm/vmm.c

    r473 r492  
    7979
    8080    assert( ((CONFIG_VMM_KENTRY_SIZE + CONFIG_VMM_ARGS_SIZE + CONFIG_VMM_ENVS_SIZE)
    81             <= CONFIG_VMM_ELF_BASE) , __FUNCTION__ , "UTILS zone too small\n" );
    82 
    83     assert( (CONFIG_THREAD_MAX_PER_CLUSTER <= 32) , __FUNCTION__ ,
     81            <= CONFIG_VMM_ELF_BASE) , "UTILS zone too small\n" );
     82
     83    assert( (CONFIG_THREAD_MAX_PER_CLUSTER <= 32) ,
    8484            "no more than 32 threads per cluster for a single process\n");
    8585
    8686    assert( ((CONFIG_VMM_STACK_SIZE * CONFIG_THREAD_MAX_PER_CLUSTER) <=
    87              (CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE)) , __FUNCTION__ ,
     87             (CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE)) ,
    8888             "STACK zone too small\n");
    8989
     
    274274
    275275    // check cluster is reference
    276     assert( (GET_CXY( process->ref_xp ) == local_cxy) , __FUNCTION__,
     276    assert( (GET_CXY( process->ref_xp ) == local_cxy) ,
    277277    "not called in reference cluster\n");
    278278
     
    346346
    347347    // check cluster is reference
    348     assert( (GET_CXY( process->ref_xp ) == local_cxy) , __FUNCTION__,
     348    assert( (GET_CXY( process->ref_xp ) == local_cxy) ,
    349349    "local cluster is not process reference cluster\n");
    350350
     
    386386            vseg     = GET_PTR( vseg_xp );
    387387
    388             assert( (GET_CXY( vseg_xp ) == local_cxy) , __FUNCTION__,
     388            assert( (GET_CXY( vseg_xp ) == local_cxy) ,
    389389            "all vsegs in reference VSL must be local\n" );
    390390
     
    11121112
    11131113            // check small page
    1114             assert( (attr & GPT_SMALL) , __FUNCTION__ ,
     1114            assert( (attr & GPT_SMALL) ,
    11151115            "an user vseg must use small pages" );
    11161116
     
    13801380    uint32_t     flags = vseg->flags;
    13811381
    1382     assert( ( type != VSEG_TYPE_FILE ) , __FUNCTION__ , "illegal vseg type\n" );
     1382    assert( ( type != VSEG_TYPE_FILE ) , "illegal vseg type\n" );
    13831383
    13841384    if( flags & VSEG_DISTRIB )    // distributed => cxy depends on vpn LSB
     
    14481448        xptr_t mapper_xp = vseg->mapper_xp;
    14491449
    1450         assert( (mapper_xp != XPTR_NULL), __FUNCTION__,
     1450        assert( (mapper_xp != XPTR_NULL),
    14511451        "mapper not defined for a FILE vseg\n" );
    14521452       
     
    14861486            xptr_t     mapper_xp = vseg->mapper_xp;
    14871487
    1488             assert( (mapper_xp != XPTR_NULL), __FUNCTION__,
     1488            assert( (mapper_xp != XPTR_NULL),
    14891489            "mapper not defined for a CODE or DATA vseg\n" );
    14901490       
     
    16551655
    16561656    // vseg has been checked by the vmm_handle_page_fault() function
    1657     assert( (vseg != NULL) , __FUNCTION__,
    1658     "vseg undefined / vpn %x / thread %x in process %x / core[%x,%d] / cycle %d\n",
    1659     vpn, this->trdid, process->pid, local_cxy, this->core->lid,
    1660     (uint32_t)hal_get_cycles() );
     1657    assert( (vseg != NULL) , "vseg undefined / vpn %x\n");
    16611658
    16621659    if( cow )  //////////////// copy_on_write request //////////////////////
     
    16691666        hal_gpt_get_pte( &vmm->gpt , vpn , &old_attr , &old_ppn );
    16701667
    1671         assert( (old_attr & GPT_MAPPED), __FUNCTION__,
    1672         "PTE unmapped for a COW exception / vpn %x / thread %x in process %x / cycle %d\n",
    1673         vpn, this, process->pid, (uint32_t)hal_get_cycles() );
     1668        assert( (old_attr & GPT_MAPPED),
     1669          "PTE unmapped for a COW exception / vpn %x\n" );
    16741670
    16751671#if( DEBUG_VMM_GET_PTE & 1 )
Note: See TracChangeset for help on using the changeset viewer.