Changeset 605 for trunk


Ignore:
Timestamp:
Dec 3, 2018, 12:19:16 PM (3 years ago)
Author:
alain
Message:

Improve the FAT32 file system to support cat, rm, cp commands.

Location:
trunk/kernel/devices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_ioc.c

    r565 r605  
    101101    thread_t * this = CURRENT_THREAD;              // pointer on client thread
    102102
     103#if ( DEV_IOC_RX  || DEV_IOC_TX )
     104uint32_t   cycle = (uint32_t)hal_get_cycles();
     105#endif
     106
    103107    // software L2/L3 cache coherence for memory buffer
    104108    if( chdev_dir.iob )
     
    111115    xptr_t  dev_xp = chdev_dir.ioc[0];
    112116
    113     assert( (dev_xp != XPTR_NULL) , "undefined IOC chdev descriptor" );
     117// check dev_xp
     118assert( (dev_xp != XPTR_NULL) , "undefined IOC chdev descriptor" );
    114119
    115120    // register command in calling thread descriptor
     
    125130    chdev_register_command( dev_xp );
    126131
     132#if(DEV_IOC_RX & 1)
     133if( (DEV_IOC_RX < cycle) && (cmd_type != IOC_WRITE) )
     134printk("\n[%s] thread[%x,%x] resumes for RX\n",
     135__FUNCTION__, this->process->pid , this->trdid )
     136#endif
     137
     138#if(DEV_IOC_TX & 1)
     139if( (DEV_IOC_RX < cycle) && (cmd_type == IOC_WRITE) )
     140printk("\n[%s] thread[%x,%x] resumes for TX\n",
     141__FUNCTION__, this->process->pid , this->trdid )
     142#endif
     143
    127144    // return I/O operation status
    128145    return this->ioc_cmd.error;
     
    137154
    138155#if DEBUG_DEV_IOC_RX
    139 uint32_t cycle = (uint32_t)hal_get_cycles();
    140 if( DEBUG_DEV_IOC_RX < cycle )
    141 printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
    142 __FUNCTION__ , this, lba, buffer, cycle );
     156uint32_t   cycle = (uint32_t)hal_get_cycles();
     157thread_t * this  = CURRENT_THREAD;
     158if( DEBUG_DEV_IOC_RX < cycle )
     159printk("\n[%s] thread[%x,%x] enters / lba  %x / buffer %x / cycle %d\n",
     160__FUNCTION__ , this->process->pid, this->trdid, lba, buffer, cycle );
    143161#endif
    144162
     
    148166cycle = (uint32_t)hal_get_cycles();
    149167if( DEBUG_DEV_IOC_RX < cycle )
    150 printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
    151 __FUNCTION__ , this, lba, buffer, cycle );
     168printk("\n[%s] thread[%x,%x] exit / lba  %x / buffer %x / cycle %d\n",
     169__FUNCTION__ , this->process->pid, this->trdid, lba, buffer, cycle );
    152170#endif
    153171
     
    161179
    162180#if DEBUG_DEV_IOC_TX
    163 uint32_t cycle = (uint32_t)hal_get_cycles();
     181uint32_t   cycle = (uint32_t)hal_get_cycles();
     182thread_t * this  = CURRENT_THREAD;
    164183if( DEBUG_DEV_IOC_TX < cycle )
    165 printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
    166 __FUNCTION__ , this, lba, buffer, cycle );
     184printk("\n[%s] thread[%x,%x] enters / lba  %x / buffer %x / cycle %d\n",
     185__FUNCTION__ , this->process->pid, this->trdid, lba, buffer, cycle );
    167186#endif
    168187
     
    172191cycle = (uint32_t)hal_get_cycles();
    173192if( DEBUG_DEV_IOC_TX < cycle )
    174 printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
    175 __FUNCTION__ , this, lba, buffer, cycle );
     193printk("\n[%s] thread[%x,%x] exit / lba  %x / buffer %x / cycle %d\n",
     194__FUNCTION__ , this->process->pid, this->trdid, lba, buffer, cycle );
    176195#endif
    177196
     
    189208uint32_t cycle = (uint32_t)hal_get_cycles();
    190209if( DEBUG_DEV_IOC_RX < cycle )
    191 printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
    192 __FUNCTION__ , this, lba, buffer, cycle );
     210printk("\n[%s] thread[%x,%x] enters / lba  %x / buffer %x / cycle %d\n",
     211__FUNCTION__ , this->process->pid, this->trdid, lba, buffer, cycle );
    193212#endif
    194213
     
    230249cycle = (uint32_t)hal_get_cycles();
    231250if( DEBUG_DEV_IOC_RX < cycle )
    232 printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
    233 __FUNCTION__ , this, lba, buffer, cycle );
     251printk("\n[%s] thread[%x,%x] exit / lba  %x / buffer %x / cycle %d\n",
     252__FUNCTION__ , this->process->pid, this->trdid, lba, buffer, cycle );
    234253#endif
    235254
  • trunk/kernel/devices/dev_mmc.c

    r565 r605  
    103103uint32_t cycle = (uint32_t)hal_get_cycles();
    104104if( DEBUG_DEV_MMC < cycle )
    105 printk("\n[DBG] %s : thread %x enters / process %x / buf_xp = %l\n",
    106 __FUNCTION__, this, this->process->pid , buf_xp );
     105printk("\n[%s] thread[%x,%x] enters / cluster %x / buffer %x\n",
     106__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
    107107#endif
    108108
     
    126126cycle = (uint32_t)hal_get_cycles();
    127127if( DEBUG_DEV_MMC < cycle )
    128 printk("\n[DBG] %s : thread %x exit / process %x / buf_xp = %l\n",
    129 __FUNCTION__, this, this->process->pid , buf_xp );
     128printk("\n[%s] thread[%x,%x] exit / cluster %x / buffer %x\n",
     129__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
    130130#endif
    131131
     
    144144uint32_t cycle = (uint32_t)hal_get_cycles();
    145145if( DEBUG_DEV_MMC < cycle )
    146 printk("\n[DBG] %s : thread %x enters / process %x / buf_xp = %l\n",
    147 __FUNCTION__, this, this->process->pid , buf_xp );
     146printk("\n[%s] thread[%x,%x] enters / cluster %x / buffer %x\n",
     147__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
    148148#endif
    149149
     
    167167cycle = (uint32_t)hal_get_cycles();
    168168if( DEBUG_DEV_MMC < cycle )
    169 printk("\n[DBG] %s : thread %x exit / process %x / buf_xp = %l\n",
    170 __FUNCTION__, this, this->process->pid , buf_xp );
     169printk("\n[%s] thread[%x,%x] exit / cluster %x / buffer %x\n",
     170__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
    171171#endif
    172172
Note: See TracChangeset for help on using the changeset viewer.