Ignore:
Timestamp:
Apr 4, 2018, 2:49:02 PM (6 years ago)
Author:
alain
Message:

Fix a bug in scheduler related to RPC blocking.

File:
1 edited

Legend:

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

    r435 r438  
    262262    "no FAT access required for first page\n");
    263263
    264 #if CONFIG_DEBUG_FATFS_GET_CLUSTER
     264#if DEBUG_FATFS_GET_CLUSTER
    265265uint32_t cycle = (uint32_t)hal_get_cycles();
    266 if( CONFIG_DEBUG_FATFS_GET_CLUSTER < cycle )
     266if( DEBUG_FATFS_GET_CLUSTER < cycle )
    267267printk("\n[DBG] %s : thread %x enter / first_cluster_id %d / searched_index / cycle %d\n",
    268268__FUNCTION__, CURRENT_THREAD, first_cluster_id, searched_page_index, cycle );
     
    293293        next_cluster_id = current_page_buffer[current_page_offset];
    294294
    295 #if (CONFIG_DEBUG_FATFS_GET_CLUSTER & 1)
    296 if( CONFIG_DEBUG_FATFS_GET_CLUSTER < cycle )
     295#if (DEBUG_FATFS_GET_CLUSTER & 1)
     296if( DEBUG_FATFS_GET_CLUSTER < cycle )
    297297printk("\n[DBG] %s : traverse FAT / current_page_index = %d\n"
    298298"current_page_offset = %d / next_cluster_id = %d\n",
     
    308308    if( next_cluster_id == 0xFFFFFFFF ) return EIO;
    309309   
    310 #if CONFIG_DEBUG_FATFS_GET_CLUSTER
     310#if DEBUG_FATFS_GET_CLUSTER
    311311cycle = (uint32_t)hal_get_cycles();
    312 if( CONFIG_DEBUG_FATFS_GET_CLUSTER < cycle )
     312if( DEBUG_FATFS_GET_CLUSTER < cycle )
    313313printk("\n[DBG] %s : thread %x exit / searched_cluster_id = %d / cycle %d\n",
    314314__FUNCTION__, CURRENT_THREAD, next_cluster_id / cycle );
     
    345345    uint8_t     * buffer;
    346346
    347 #if CONFIG_DEBUG_FATFS_INIT
     347#if DEBUG_FATFS_INIT
    348348uint32_t cycle = (uint32_t)hal_get_cycles();
    349 if( CONFIG_DEBUG_FATFS_INIT < cycle )
     349if( DEBUG_FATFS_INIT < cycle )
    350350printk("\n[DBG] %s : thread %x enter for fatfs_ctx = %x / cycle %d\n",
    351351__FUNCTION__ , CURRENT_THREAD , fatfs_ctx , cycle );
     
    370370    "cannot access boot record\n" );
    371371
    372 #if (CONFIG_DEBUG_FATFS_INIT & 0x1)
    373 if( CONFIG_DEBUG_FATFS_INIT < cycle )
     372#if (DEBUG_FATFS_INIT & 0x1)
     373if( DEBUG_FATFS_INIT < cycle )
    374374{
    375375    uint32_t   line;
     
    448448    fatfs_ctx->fat_mapper_xp         = XPTR( local_cxy , fat_mapper );
    449449
    450 #if CONFIG_DEBUG_FATFS_INIT
     450#if DEBUG_FATFS_INIT
    451451cycle = (uint32_t)hal_get_cycles();
    452 if( CONFIG_DEBUG_FATFS_INIT < cycle )
     452if( DEBUG_FATFS_INIT < cycle )
    453453printk("\n[DBG] %s : thread %x exit for fatfs_ctx = %x / cycle %d\n",
    454454__FUNCTION__ , CURRENT_THREAD , fatfs_ctx , cycle );
     
    486486    inode = mapper->inode;
    487487
    488 #if CONFIG_DEBUG_FATFS_MOVE
     488#if DEBUG_FATFS_MOVE
    489489uint32_t cycle = (uint32_t)hal_get_cycles();
    490 if( CONFIG_DEBUG_FATFS_MOVE < cycle )
     490if( DEBUG_FATFS_MOVE < cycle )
    491491printk("\n[DBG] %s : thread %x enter / page %d / inode %x / mapper %x / cycle %d\n",
    492492__FUNCTION__ , CURRENT_THREAD , index , inode , mapper , cycle );
     
    507507        lba = fatfs_ctx->fat_begin_lba + (count * index);
    508508 
    509 #if (CONFIG_DEBUG_FATFS_MOVE & 0x1)
    510 if( CONFIG_DEBUG_FATFS_MOVE < cycle )
     509#if (DEBUG_FATFS_MOVE & 0x1)
     510if( DEBUG_FATFS_MOVE < cycle )
    511511printk("\n[DBG] %s : access FAT on device / lba = %d\n", __FUNCTION__ , lba );
    512512#endif
     
    541541            {
    542542
    543 #if (CONFIG_DEBUG_FATFS_MOVE & 0x1)
    544 if( CONFIG_DEBUG_FATFS_MOVE < cycle )
     543#if (DEBUG_FATFS_MOVE & 0x1)
     544if( DEBUG_FATFS_MOVE < cycle )
    545545print("\n[DBG] %s : access local FAT mapper\n"
    546546"fat_mapper_cxy = %x / fat_mapper_ptr = %x / first_cluster_id = %d / index = %d\n",
     
    555555            {
    556556
    557 #if (CONFIG_DEBUG_FATFS_MOVE & 0x1)
    558 if( CONFIG_DEBUG_FATFS_MOVE < cycle )
     557#if (DEBUG_FATFS_MOVE & 0x1)
     558if( DEBUG_FATFS_MOVE < cycle )
    559559printk("\n[DBG] %s : access remote FAT mapper\n"
    560560"fat_mapper_cxy = %x / fat_mapper_ptr = %x / first_cluster_id = %d / index = %d\n",
     
    572572        }
    573573
    574 #if (CONFIG_DEBUG_FATFS_MOVE & 0x1)
    575 if( CONFIG_DEBUG_FATFS_MOVE < cycle )
     574#if (DEBUG_FATFS_MOVE & 0x1)
     575if( DEBUG_FATFS_MOVE < cycle )
    576576printk("\n[DBG] %s : access device for inode %x / cluster_id %d\n",
    577577__FUNCTION__ , inode , searched_cluster_id );
     
    588588    }
    589589
    590 #if CONFIG_DEBUG_FATFS_MOVE
     590#if DEBUG_FATFS_MOVE
    591591cycle = (uint32_t)hal_get_cycles();
    592 if( CONFIG_DEBUG_FATFS_MOVE < cycle )
     592if( DEBUG_FATFS_MOVE < cycle )
    593593printk("\n[DBG] %s : thread %x exit / page %d / inode %x / mapper %x / cycle %d\n",
    594594__FUNCTION__ , CURRENT_THREAD , index , inode , mapper , cycle );
    595595#endif
    596596
    597 #if (CONFIG_DEBUG_FATFS_MOVE & 0x1)
    598 if( CONFIG_DEBUG_FATFS_MOVE < cycle )
     597#if (DEBUG_FATFS_MOVE & 0x1)
     598if( DEBUG_FATFS_MOVE < cycle )
    599599{
    600600    uint32_t * tab = (uint32_t *)buffer;
     
    623623    // - scan the directory entries in each 4 Kbytes page
    624624
    625 #if CONFIG_DEBUG_FATFS_LOAD
     625#if DEBUG_FATFS_LOAD
    626626uint32_t cycle = (uint32_t)hal_get_cycles();
    627 if( CONFIG_DEBUG_FATFS_LOAD < cycle )
     627if( DEBUG_FATFS_LOAD < cycle )
    628628printk("\n[DBG] %s : thread %x enter for child <%s> in parent inode %x / cycle %d\n",
    629629__FUNCTION__ , CURRENT_THREAD , name , parent_inode , cycle );
     
    665665        base = (uint8_t *)GET_PTR( base_xp );
    666666
    667 #if (CONFIG_DEBUG_FATFS_LOAD & 0x1)
    668 if( CONFIG_DEBUG_FATFS_LOAD < cycle )
     667#if (DEBUG_FATFS_LOAD & 0x1)
     668if( DEBUG_FATFS_LOAD < cycle )
    669669{
    670670    uint32_t * buf = (uint32_t *)base;
     
    749749    {
    750750
    751 #if CONFIG_DEBUG_FATFS_LOAD
     751#if DEBUG_FATFS_LOAD
    752752cycle = (uint32_t)hal_get_cycles();
    753 if( CONFIG_DEBUG_FATFS_LOAD < cycle )
     753if( DEBUG_FATFS_LOAD < cycle )
    754754printk("\n[DBG] %s : thread %x exit / child <%s> not found / cycle %d\n",
    755755__FUNCTION__ , CURRENT_THREAD, name, cycle );
     
    771771        hal_remote_sw( XPTR( child_cxy , &child_ptr->extend ) , cluster );
    772772
    773 #if CONFIG_DEBUG_FATFS_LOAD
     773#if DEBUG_FATFS_LOAD
    774774cycle = (uint32_t)hal_get_cycles();
    775 if( CONFIG_DEBUG_FATFS_LOAD < cycle )
     775if( DEBUG_FATFS_LOAD < cycle )
    776776printk("\n[DBG] %s : thread %x exit / child <%s> loaded / cycle %d\n",
    777777__FUNCTION__ , CURRENT_THREAD, name, cycle );
Note: See TracChangeset for help on using the changeset viewer.