Changeset 798 for soft/giet_vm/giet_fat32
- Timestamp:
- Mar 2, 2016, 3:08:27 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_fat32/fat32.c
r797 r798 565 565 566 566 ///////////////////////////////////////////////////////////////// 567 static inlineunsigned int _get_fat_entry( unsigned int cluster,567 static unsigned int _get_fat_entry( unsigned int cluster, 568 568 unsigned int* value ) 569 569 { … … 2440 2440 2441 2441 #if GIET_DEBUG_FAT 2442 unsigned int procid = _get_procid();2443 unsigned int x = procid >> (Y_WIDTH + P_WIDTH);2444 unsigned int y = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);2445 unsigned int p = procid & ((1<<P_WIDTH)-1);2446 if ( _get_proctime() > GIET_DEBUG_FAT )2447 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] enters for path <%s>\n"2448 " create = %d / read_only = %d / truncate = %d\n",2449 x, y, p, pathname , create , read_only , truncate );2442 unsigned int procid = _get_procid(); 2443 unsigned int x = procid >> (Y_WIDTH + P_WIDTH); 2444 unsigned int y = (procid >> P_WIDTH) & ((1 << Y_WIDTH) - 1); 2445 unsigned int p = procid & ((1 << P_WIDTH) - 1); 2446 if ( _get_proctime() > GIET_DEBUG_FAT ) 2447 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] enters for path <%s>\n" 2448 " create = %d / read_only = %d / truncate = %d\n", 2449 x, y, p, pathname , create , read_only , truncate ); 2450 2450 #endif 2451 2451 2452 2452 // checking FAT initialized 2453 if ( _fat.initialized != FAT_INITIALIZED )2453 if ( _fat.initialized != FAT_INITIALIZED ) 2454 2454 { 2455 2455 _printf("\n[FAT ERROR] _fat_open(): FAT not initialized\n"); … … 2499 2499 2500 2500 #if GIET_DEBUG_FAT 2501 if ( _get_proctime() > GIET_DEBUG_FAT )2502 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] create a new file <%s>\n",2503 x , y , p , pathname );2501 if ( _get_proctime() > GIET_DEBUG_FAT ) 2502 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] create a new file <%s>\n", 2503 x , y , p , pathname ); 2504 2504 #endif 2505 2505 … … 2562 2562 2563 2563 #if GIET_DEBUG_FAT 2564 if ( _get_proctime() > GIET_DEBUG_FAT )2565 {2566 _printf("\n[DEBUG FAT] _fat_open() : new inode created for <%s>\n"2567 " size = %x / cluster = %x / cache = %x",2568 child->name , child->size , child->cluster , child->cache );2569 if ( child->cache != NULL )2570 {2571 _printf(" / pdesc[0] = %x\n", (unsigned int)(child->cache->children[0]) );2572 }2573 else2574 {2575 _printf("\n");2576 }2577 }2564 if ( _get_proctime() > GIET_DEBUG_FAT ) 2565 { 2566 _printf("\n[DEBUG FAT] _fat_open() : new inode created for <%s>\n" 2567 " size = %x / cluster = %x / cache = %x", 2568 child->name , child->size , child->cluster , child->cache ); 2569 if ( child->cache != NULL ) 2570 { 2571 _printf(" / pdesc[0] = %x\n", (unsigned int)(child->cache->children[0]) ); 2572 } 2573 else 2574 { 2575 _printf("\n"); 2576 } 2577 } 2578 2578 #endif 2579 2579 … … 2585 2585 2586 2586 #if GIET_DEBUG_FAT 2587 if ( _get_proctime() > GIET_DEBUG_FAT )2588 {2589 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] found file <%s>\n"2590 " inode = %x / size = %x\n",2591 x , y , p , pathname , (unsigned int)child , child->size );2592 2593 _display_clusters_list( child );2594 }2587 if ( _get_proctime() > GIET_DEBUG_FAT ) 2588 { 2589 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] found file <%s>\n" 2590 " inode = %x / size = %x\n", 2591 x , y , p , pathname , (unsigned int)child , child->size ); 2592 2593 _display_clusters_list( child ); 2594 } 2595 2595 #endif 2596 2596 … … 2624 2624 2625 2625 // truncate the file if requested 2626 if ( truncate && !read_only && !child->is_dir )2626 if ( truncate && !read_only && !child->is_dir && child->size != 0 ) 2627 2627 { 2628 2628 // empty file … … 2655 2655 2656 2656 #if GIET_DEBUG_FAT 2657 if ( _get_proctime() > GIET_DEBUG_FAT )2658 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] get fd = %d for <%s>\n"2659 " inode = %x / offset = %x / read_only = %d / size = %x / cluster = %x\n",2660 x , y , p , fd_id , pathname ,2661 (unsigned int)_fat.fd[fd_id].inode,2662 _fat.fd[fd_id].seek,2663 _fat.fd[fd_id].read_only,2664 _fat.fd[fd_id].inode->size,2665 _fat.fd[fd_id].inode->cluster );2657 if ( _get_proctime() > GIET_DEBUG_FAT ) 2658 _printf("\n[DEBUG FAT] _fat_open(): P[%d,%d,%d] get fd = %d for <%s>\n" 2659 " inode = %x / offset = %x / read_only = %d / size = %x / cluster = %x\n", 2660 x , y , p , fd_id , pathname , 2661 (unsigned int)_fat.fd[fd_id].inode, 2662 _fat.fd[fd_id].seek, 2663 _fat.fd[fd_id].read_only, 2664 _fat.fd[fd_id].inode->size, 2665 _fat.fd[fd_id].inode->cluster ); 2666 2666 #endif 2667 2667
Note: See TracChangeset
for help on using the changeset viewer.