Ignore:
Timestamp:
Mar 28, 2018, 2:40:29 PM (6 years ago)
Author:
alain
Message:

Fix various bugs

File:
1 edited

Legend:

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

    r408 r437  
    22 * dev_ioc.c - IOC (Block Device Controler) generic device API implementation.
    33 *
    4  * Author  Alain Greiner    (2016)
     4 * Author  Alain Greiner    (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    101101    thread_t * this = CURRENT_THREAD;              // pointer on client thread
    102102
    103     ioc_dmsg("\n[DBG] %s : thread %x in process %x"
    104              " for lba = %x / buffer = %x / at cycle %d\n",
    105              __FUNCTION__ , this->trdid , this->process->pid ,
    106              lba , (intptr_t)buffer , hal_get_cycles() );
    107 
    108103    // software L2/L3 cache coherence for memory buffer
    109104    if( chdev_dir.iob )
     
    130125    chdev_register_command( dev_xp );
    131126
    132     ioc_dmsg("\n[DBG] in %s : thread %x in process %x"
    133              " completes / error = %d / at cycle %d\n",
    134              __FUNCTION__ , this->trdid , this->process->pid ,
    135              this->ioc_cmd.error , hal_get_cycles() );
    136 
    137127    // return I/O operation status
    138128    return this->ioc_cmd.error;
     
    145135                      uint32_t       count )
    146136{
     137
     138#if CONFIG_DEBUG_DEV_IOC_RX
     139uint32_t cycle = (uint32_t)hal_get_cycles();
     140if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     141printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
     142__FUNCTION__ , this, lba, buffer, cycle );
     143#endif
     144
    147145    return dev_ioc_access( IOC_READ , buffer , lba , count );
     146
     147#if CONFIG_DEBUG_DEV_IOC_RX
     148cycle = (uint32_t)hal_get_cycles();
     149if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     150printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
     151__FUNCTION__ , this, lba, buffer, cycle );
     152#endif
     153
    148154}
    149155
     
    153159                       uint32_t      count )
    154160{
     161
     162#if CONFIG_DEBUG_DEV_IOC_TX
     163uint32_t cycle = (uint32_t)hal_get_cycles();
     164if( CONFIG_DEBUG_DEV_IOC_TX < cycle )
     165printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
     166__FUNCTION__ , this, lba, buffer, cycle );
     167#endif
     168
    155169    return dev_ioc_access( IOC_WRITE , buffer , lba , count );
     170
     171#if CONFIG_DEBUG_DEV_IOC_TX
     172cycle = (uint32_t)hal_get_cycles();
     173if( CONFIG_DEBUG_DEV_IOC_TX < cycle )
     174printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
     175__FUNCTION__ , this, lba, buffer, cycle );
     176#endif
     177
    156178}
    157179
     
    164186    thread_t * this = CURRENT_THREAD;
    165187
    166     ioc_dmsg("\n[DBG] %s : core[%x,%d] enter for %d blocks / lba = %x / cycle %d\n",
    167     __FUNCTION__ , local_cxy , this->core->lid , count , lba , hal_time_stamp() );
     188#if CONFIG_DEBUG_DEV_IOC_RX
     189uint32_t cycle = (uint32_t)hal_get_cycles();
     190if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     191printk("\n[DBG] %s : thread %x enters / lba  %x / buffer %x / cycle %d\n",
     192__FUNCTION__ , this, lba, buffer, cycle );
     193#endif
    168194
    169195    // software L2/L3 cache coherence for memory buffer
     
    201227    dev_pic_enable_irq( lid , ioc_xp );
    202228
    203     ioc_dmsg("\n[DBG] %s : core[%x,%d] exit / error = %d / cycle %d\n",
    204     __FUNCTION__ , local_cxy , this->core->lid , this->ioc_cmd.error , hal_time_stamp() );
     229#if CONFIG_DEBUG_DEV_IOC_RX
     230cycle = (uint32_t)hal_get_cycles();
     231if( CONFIG_DEBUG_DEV_IOC_RX < cycle )
     232printk("\n[DBG] %s : thread %x exit / lba  %x / buffer %x / cycle %d\n",
     233__FUNCTION__ , this, lba, buffer, cycle );
     234#endif
    205235
    206236    // return I/O operation status from calling thread descriptor
Note: See TracChangeset for help on using the changeset viewer.