Ignore:
Timestamp:
Nov 7, 2017, 3:08:12 PM (7 years ago)
Author:
alain
Message:

First implementation of fork/exec.

Location:
trunk/kernel/fs
Files:
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/kernel/fs/fatfs.c

    r406 r407  
    262262    "no FAT access required for first page\n");
    263263
    264     fatfs_dmsg("\n[DMSG] %s : enter / first_cluster_id = %d / searched_page_index = %d\n",
    265     __FUNCTION__ , first_cluster_id , searched_page_index );
     264fatfs_dmsg("\n[DBG] %s : core[%x,%d] enters / first_cluster_id = %d / searched_index = %d\n",
     265__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, first_cluster_id, searched_page_index );
    266266
    267267    // get number of FAT slots per page
     
    289289        next_cluster_id = current_page_buffer[current_page_offset];
    290290
    291         fatfs_dmsg("\n[DMSG] %s : traverse FAT / current_page_index = %d\n"
    292                    "       current_page_offset = %d / next_cluster_id = %d\n",
    293         __FUNCTION__ , current_page_index , current_page_offset , next_cluster_id );
     291fatfs_dmsg("\n[DBG] %s : core[%x,%d] traverse FAT / current_page_index = %d\n"
     292"current_page_offset = %d / next_cluster_id = %d\n",
     293__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, current_page_index,
     294current_page_offset , next_cluster_id );
    294295
    295296        // update loop variables
     
    301302    if( next_cluster_id == 0xFFFFFFFF ) return EIO;
    302303   
    303     fatfs_dmsg("\n[DMSG] %s : exit / cluster_id = %d\n", __FUNCTION__ , next_cluster_id );
     304fatfs_dmsg("\n[DBG] %s : core[%x;%d] exit / cluster_id = %d\n",
     305__FUNCTION__ , local_cxy, CURRENT_THREAD->core->lid, next_cluster_id );
    304306
    305307    *searched_cluster_id = next_cluster_id;
     
    333335    uint8_t     * buffer;
    334336
    335     fatfs_dmsg("\n[DMSG] %s : enter for fatfs_ctx = %x\n",
     337    fatfs_dmsg("\n[DBG] %s : enter for fatfs_ctx = %x\n",
    336338               __FUNCTION__ , fatfs_ctx );
    337339
     
    347349                   "cannot allocate memory for 512 bytes buffer\n" );
    348350     
    349     fatfs_dmsg("\n[DMSG] %s : allocated 512 bytes buffer\n", __FUNCTION__ );
     351    fatfs_dmsg("\n[DBG] %s : allocated 512 bytes buffer\n", __FUNCTION__ );
    350352
    351353    // load the boot record from device
     
    353355    error = dev_ioc_sync_read( buffer , 0 , 1 );
    354356
    355     fatfs_dmsg("\n[DMSG] %s : buffer loaded\n", __FUNCTION__ );
     357fatfs_dmsg("\n[DBG] %s : buffer loaded\n", __FUNCTION__ );
    356358
    357359    assert( (error == 0) , __FUNCTION__ , "cannot access boot record\n" );
     
    415417    kmem_free( &req );
    416418
    417     fatfs_dmsg("\n[DMSG] %s : boot record read & released\n",
     419    fatfs_dmsg("\n[DBG] %s : boot record read & released\n",
    418420               __FUNCTION__ );
    419421
     
    437439    fatfs_ctx->fat_mapper_xp         = XPTR( local_cxy , fat_mapper );
    438440
    439     fatfs_dmsg("\n[DMSG] %s : exit for fatfs_ctx = %x\n",
    440                __FUNCTION__ , fatfs_ctx );
     441fatfs_dmsg("\n[DBG] %s : exit for fatfs_ctx = %x\n", __FUNCTION__ , fatfs_ctx );
    441442
    442443}  // end fatfs_ctx_init()
     
    471472    inode = mapper->inode;
    472473
    473     fatfs_dmsg("\n[DMSG] %s : core[%x,%d] enter for page %d / inode %x / mapper %x\n",
    474     __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper );
     474fatfs_dmsg("\n[DBG] %s : core[%x,%d] enter for page %d / inode %x / mapper %x\n",
     475__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper );
    475476
    476477    // get page base address
     
    488489        lba = fatfs_ctx->fat_begin_lba + (count * index);
    489490 
    490         fatfs_dmsg("\n[DMSG] %s : core[%x,%d] access FAT on device / lba = %d\n",
    491         __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , lba );
     491fatfs_dmsg("\n[DBG] %s : core[%x,%d] access FAT on device / lba = %d\n",
     492__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , lba );
    492493
    493494        // access device
     
    511512        else                        // FAT mapper access required
    512513        {
    513             fatfs_dmsg("\n[DMSG] %s : core[%x,%d] must access FAT\n",
    514             __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid );
    515 
    516514            // get cluster and local pointer on FAT mapper
    517515            xptr_t     fat_mapper_xp  = fatfs_ctx->fat_mapper_xp;
     
    522520            if( fat_mapper_cxy == local_cxy )    // FAT mapper is local
    523521            {
     522
     523fatfs_dmsg("\n[DBG] %s : core[%x,%d] access local FAT mapper\n"
     524"fat_mapper_cxy = %x / fat_mapper_ptr = %x / first_cluster_id = %d / index = %d\n",
     525__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid ,
     526fat_mapper_cxy , fat_mapper_ptr , first_cluster_id , index );
     527
    524528                error = fatfs_get_cluster( fat_mapper_ptr,
    525529                                           first_cluster_id,
     
    529533            else                                 // FAT mapper is remote
    530534            {
     535
     536fatfs_dmsg("\n[DBG] %s : core[%x,%d] access remote FAT mapper\n"
     537"fat_mapper_cxy = %x / fat_mapper_ptr = %x / first_cluster_id = %d / index = %d\n",
     538__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid ,
     539fat_mapper_cxy , fat_mapper_ptr , first_cluster_id , index );
     540
    531541                rpc_fatfs_get_cluster_client( fat_mapper_cxy,
    532542                                              fat_mapper_ptr,
     
    540550        }
    541551
    542         fatfs_dmsg("\n[DMSG] %s : core[%x,%d] access device for inode %x / cluster_id %d\n",
    543         __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , inode , searched_cluster_id );
     552fatfs_dmsg("\n[DBG] %s : core[%x,%d] access device for inode %x / cluster_id %d\n",
     553__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , inode , searched_cluster_id );
    544554
    545555        // get lba from cluster_id
     
    553563    }
    554564
    555     fatfs_dmsg("\n[DMSG] %s : core[%x,%d] exit for page %d / inode %x / mapper %x\n",
    556     __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper );
     565fatfs_dmsg("\n[DBG] %s : core[%x,%d] exit for page %d / inode %x / mapper %x\n",
     566__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper );
    557567
    558568#if (CONFIG_FATFS_DEBUG & 0x1)
     
    584594    // - scan the directory entries in each 4 Kbytes page
    585595
    586     fatfs_dmsg("\n[DMSG] %s : enter for child <%s> in parent inode %l\n",
    587                __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
     596fatfs_dmsg("\n[DBG] %s : enter for child <%s> in parent inode %l\n",
     597__FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
    588598
    589599    mapper_t * mapper = parent_inode->mapper;
     
    705715    if ( found == -1 )  // found end of directory => failure
    706716    {
    707         fatfs_dmsg("\n[DMSG] %s : exit / child <%s> not found in parent inode %l\n",
    708                    __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
     717
     718fatfs_dmsg("\n[DBG] %s : exit / child <%s> not found in parent inode %l\n",
     719__FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
    709720
    710721        return ENOENT;
     
    723734        hal_remote_sw( XPTR( child_cxy , &child_ptr->extend ) , cluster );
    724735
    725         fatfs_dmsg("\n[DMSG] %s : exit / child <%s> found in parent inode %l\n",
    726                    __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
     736fatfs_dmsg("\n[DBG] %s : exit / child <%s> found in parent inode %l\n",
     737__FUNCTION__ , name , XPTR( local_cxy , parent_inode ) );
    727738
    728739        return 0;
Note: See TracChangeset for help on using the changeset viewer.