Changeset 295 for soft/giet_vm/giet_drivers/dma_driver.c
- Timestamp:
- Mar 26, 2014, 6:44:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/dma_driver.c
r267 r295 196 196 unsigned int procid = _get_procid(); 197 197 unsigned int cluster_xy = procid/NB_PROCS_MAX; 198 unsigned int x = cluster_xy >> Y_WIDTH; 199 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 198 200 unsigned int channel_id = procid%NB_PROCS_MAX; 199 201 … … 203 205 204 206 #if GIET_DEBUG_DMA_DRIVER 205 _tty_get_lock( 0 ); 206 _puts("\n[DMA DEBUG] Enter _dma_copy() at cycle "); 207 _putd( _get_proctime() ); 208 _puts("\n - vspace_id = "); 209 _putx( vspace_id ); 210 _puts("\n - cluster_xy = "); 211 _putx( cluster_xy ); 212 _puts("\n - channel_id = "); 213 _putx( channel_id ); 214 _puts("\n - dest = "); 215 _putx( (unsigned int)dest ); 216 _puts("\n - source = "); 217 _putx( (unsigned int)source ); 218 _puts("\n - bytes = "); 219 _putd( size ); 220 _tty_release_lock( 0 ); 207 unsigned int x = cluster_xy >> Y_WIDTH; 208 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 209 210 _printf("\n[DMA DEBUG] Processor[%d,%d,%d] enters _dma_copy() at cycle %d\n" 211 " - vspace_id = %d\n" 212 " - cluster_xy = %x\n" 213 " - channel_id = %d\n" 214 " - dest = %x\n" 215 " - source = %x\n" 216 " - bytes = %x\n", 217 x, y, channel_id, _get_proctime(), vspace_id, cluster_xy, 218 (unsigned int)dest, (unsigned int)source, size ); 221 219 #endif 222 220 … … 226 224 (size & 0x3) ) 227 225 { 228 _tty_get_lock( 0 ); 229 _puts("\n[GIET ERROR] in _dma_copy() : buffer unaligned\n"); 230 _tty_release_lock( 0 ); 226 _printf("\n[GIET ERROR] in _dma_copy() : buffer unaligned\n"); 231 227 _exit(); 232 228 } … … 242 238 if ( ko ) 243 239 { 244 _tty_get_lock( 0 ); 245 _puts("\n[GIET ERROR] in _dma_copy() : source buffer unmapped\n"); 246 _tty_release_lock( 0 ); 240 _printf("\n[GIET ERROR] in _dma_copy() : source buffer unmapped\n"); 247 241 _exit(); 248 242 } … … 257 251 if ( ko ) 258 252 { 259 _tty_get_lock( 0 ); 260 _puts("\n[GIET ERROR] in _dma_copy() : dest buffer unmapped\n"); 261 _tty_release_lock( 0 ); 253 _printf("\n[GIET ERROR] in _dma_copy() : dest buffer unmapped\n"); 262 254 _exit(); 263 255 } … … 266 258 267 259 #if GIET_DEBUG_DMA_DRIVER 268 _tty_get_lock( 0 ); 269 _puts("\n - src_paddr = "); 270 _putl( src_paddr ); 271 _puts("\n - dst_paddr = "); 272 _putl( dst_paddr ); 273 _puts("\n"); 274 _tty_release_lock( 0 ); 260 _printf(" - src_paddr = %llx\n" 261 " - dst_paddr = %llx\n", 262 src_paddr, dst_paddr ); 275 263 #endif 276 264 … … 282 270 if ( ko ) 283 271 { 284 _tty_get_lock( 0 ); 285 _puts("\n[GIET ERROR] in _dma_copy() : cannot start transfer\n"); 286 _tty_release_lock( 0 ); 272 _printf("\n[GIET ERROR] in _dma_copy() : cannot start transfer\n"); 287 273 _exit(); 288 274 } … … 297 283 298 284 #if GIET_DEBUG_DMA_DRIVER 299 _tty_get_lock( 0 ); 300 _puts("\n[DMA DEBUG] _dma_copy() : ... waiting on DMA_STATUS register ...\n"); 301 _tty_release_lock( 0 ); 285 _printf("\n[DMA DEBUG] _dma_copy() : ... waiting on DMA_STATUS register ...\n"); 302 286 #endif 303 287 … … 307 291 if( status != DMA_SUCCESS ) 308 292 { 309 _tty_get_lock( 0 ); 310 _puts("\n[GIET ERROR] in _dma_copy() : DMA_STATUS error = "); 311 _putd( status ); 312 _puts("\n"); 313 _tty_release_lock( 0 ); 293 _printf("\n[GIET ERROR] in _dma_copy() : DMA_STATUS = %x\n", status ); 314 294 _exit(); 315 295 } … … 318 298 319 299 #if GIET_DEBUG_DMA_DRIVER 320 _tty_get_lock( 0 ); 321 _puts("\n[DMA DEBUG] _dma_copy() completed at cycle "); 322 _putd( _get_proctime() ); 323 _puts("\n"); 324 _tty_release_lock( 0 ); 300 _printf("\n[DMA DEBUG] _dma_copy() completed at cycle %d\n", _get_proctime() ); 325 301 #endif 326 302 327 303 #else // NB_DMA_CHANNELS == 0 328 _tty_get_lock( 0 ); 329 _puts("\n[GIET ERROR] in _dma_copy() : NB_DMA_CHANNELS = 0 !\n"); 330 _tty_release_lock( 0 ); 304 _printf("\n[GIET ERROR] in _dma_copy() : NB_DMA_CHANNELS = 0 !\n"); 331 305 _exit(); 332 306 #endif
Note: See TracChangeset
for help on using the changeset viewer.