Changeset 437 for trunk/hal/tsar_mips32/drivers
- Timestamp:
- Mar 28, 2018, 2:40:29 PM (7 years ago)
- Location:
- trunk/hal/tsar_mips32/drivers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_bdv.c
r436 r437 2 2 * soclib_bdv.c - soclib simple block device driver implementation. 3 3 * 4 * Author Alain Greiner (2016 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 74 74 buf_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->ioc_cmd.buf_xp ) ); 75 75 ioc_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->ioc_cmd.dev_xp ) ); 76 77 #if CONFIG_DEBUG_HAL_IOC_RX 78 uint32_t cycle = (uint32_t)hal_get_cycles(); 79 if( (CONFIG_DEBUG_HAL_IOC_RX < cycle) && (cmd_type != IOC_WRITE ) ) 80 printk("\n[DBG] %s : thread %x enter for RX / cycle %d\n", 81 __FUNCTION__ , CURRENT_THREAD , cycle ); 82 #endif 83 84 #if CONFIG_DEBUG_HAL_IOC_TX 85 uint32_t cycle = (uint32_t)hal_get_cycles(); 86 if( (CONFIG_DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_WRITE) ) 87 printk("\n[DBG] %s : thread %x enter for TX / cycle %d\n", 88 __FUNCTION__ , CURRENT_THREAD , cycle ); 89 #endif 76 90 77 91 // get IOC device cluster and local pointer … … 138 152 } 139 153 154 #if CONFIG_DEBUG_HAL_IOC_RX 155 cycle = (uint32_t)hal_get_cycles(); 156 if( (CONFIG_DEBUG_HAL_IOC_RX < cycle) && (cmd_type != TXT_WRITE) ) 157 printk("\n[DBG] %s : thread %x exit after RX / cycle %d\n", 158 __FUNCTION__ , CURRENT_THREAD , cycle ); 159 #endif 160 161 #if CONFIG_DEBUG_HAL_IOC_TX 162 cycle = (uint32_t)hal_get_cycles(); 163 if( (CONFIG_DEBUG_HAL_IOC_TX < cycle) && (cmd_type == TXT_WRITE) ) 164 printk("\n[DBG] %s : thread %x exit after TX / cycle %d\n", 165 __FUNCTION__ , CURRENT_THREAD , cycle ); 166 #endif 167 140 168 } // end soclib_bdv_cmd() 141 169 … … 144 172 void __attribute__ ((noinline)) soclib_bdv_isr( chdev_t * chdev ) 145 173 { 174 error_t error = 0; 175 146 176 // get extended pointer on client thread 147 177 xptr_t root = XPTR( local_cxy , &chdev->wait_root ); … … 155 185 thread_t * client_ptr = (thread_t *)GET_PTR( client_xp ); 156 186 187 // get command type 188 uint32_t cmd_type = hal_remote_lw( XPTR( client_cxy , &client_ptr->ioc_cmd.type ) ); 189 157 190 // get SOCLIB_BDV device cluster and local pointer 158 191 cxy_t bdv_cxy = GET_CXY( chdev->base ); … … 162 195 uint32_t status = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_STATUS_REG ) ); 163 196 197 if( cmd_type == IOC_READ ) 198 { 199 error = (status != BDV_READ_SUCCESS); 200 201 #if CONFIG_DEBUG_HAL_IOC_RX 202 uint32_t cycle = (uint32_t)hal_get_cycles(); 203 if( CONFIG_DEBUG_HAL_IOC_RX < cycle ) 204 printk("\n[DBG] %s : IOC_IRQ / RX transfer / client %x / server %x / cycle %d\n", 205 __FUNCTION__, client_ptr , chdev->server , cycle ); 206 #endif 207 208 } 209 else if( cmd_type == IOC_WRITE ) 210 { 211 error = (status != BDV_WRITE_SUCCESS); 212 213 #if CONFIG_DEBUG_HAL_IOC_TX 214 uint32_t cycle = (uint32_t)hal_get_cycles(); 215 if( CONFIG_DEBUG_HAL_IOC_TX < cycle ) 216 printk("\n[DBG] %s : IOC_IRQ / RX transfer / client %x / server %x / cycle %d\n", 217 __FUNCTION__, client_ptr , chdev->server , cycle ); 218 #endif 219 220 } 221 else 222 { 223 assert( false , __FUNCTION__ , "IOC_SYNC_READ should not use IRQ" ); 224 } 225 164 226 // set operation status in command 165 if((status != BDV_READ_SUCCESS) && (status != BDV_WRITE_SUCCESS)) 166 { 167 hal_remote_sw( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , 1 ); 168 } 169 else 170 { 171 hal_remote_sw( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , 0 ); 172 } 227 hal_remote_sw( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , error ); 173 228 174 229 // unblock server thread 175 230 thread_unblock( server_xp , THREAD_BLOCKED_ISR ); 176 231 177 // unblock client thread178 thread_unblock( client_xp , THREAD_BLOCKED_IO );179 180 232 } // end soclib_bdv_isr() 181 233 -
trunk/hal/tsar_mips32/drivers/soclib_bdv.h
r75 r437 2 2 * soclib_bdv.h - SOCLIB_BDV (simple block device) driver definition. 3 3 * 4 * Author Alain Greiner 4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites -
trunk/hal/tsar_mips32/drivers/soclib_hba.c
r436 r437 2 2 * soclib_hba.c - soclib AHCI block device driver implementation. 3 3 * 4 * Author Alain Greiner (2016 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 290 290 // unblock client thread 291 291 thread_unblock( client_xp , THREAD_BLOCKED_IO ); 292 293 ioc_dmsg("INFO in %s : thread %x at cycle %d\n",294 __FUNCTION__ , hal_remote_lw( XPTR( client_cxy , &client_ptr->trdid ) ) ,295 hal_get_cycles() );296 292 } 297 293 } -
trunk/hal/tsar_mips32/drivers/soclib_hba.h
r75 r437 2 2 * soclib_hba.h - soclib AHCI block device driver definition. 3 3 * 4 * Author Alain Greiner (2016 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites
Note: See TracChangeset
for help on using the changeset viewer.