Ignore:
Timestamp:
Oct 4, 2014, 3:20:52 PM (10 years ago)
Author:
alain
Message:

Introducing fixed format (X_WIDTH / Y_WIDTH / P_WIDTH) for processor index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_fat32/fat32.c

    r417 r429  
    193193#if GIET_DEBUG_FAT
    194194unsigned int procid  = _get_procid();
    195 unsigned int cid     = procid / NB_PROCS_MAX;
    196 unsigned int lpid    = procid % NB_PROCS_MAX;
    197 unsigned int x       = cid >> Y_WIDTH;
    198 unsigned int y       = cid & ((1<<Y_WIDTH) - 1);
     195unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     196unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);
     197unsigned int p       = procid & ((1<<P_WIDTH)-1);
     198
    199199_printf("\n[FAT DEBUG] _get_next_cluster() : P[%d,%d,%d] enters for cluster %x\n",
    200         x, y, lpid, cluster );
     200        x, y, p, cluster );
    201201#endif
    202202
     
    231231#if GIET_DEBUG_FAT
    232232_printf("\n[FAT DEBUG] _get_next_cluster() : P[%d,%d,%d] next cluster = %x\n",
    233         x, y, lpid, next );
     233        x, y, p, next );
    234234#endif
    235235
     
    820820#if GIET_DEBUG_FAT
    821821unsigned int procid  = _get_procid();
    822 unsigned int cid     = procid / NB_PROCS_MAX;
    823 unsigned int lpid    = procid % NB_PROCS_MAX;
    824 unsigned int x       = cid >> Y_WIDTH;
    825 unsigned int y       = cid & ((1<<Y_WIDTH) - 1);
     822unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     823unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);
     824unsigned int p       = procid & ((1<<P_WIDTH)-1);
     825
    826826_printf("\n[FAT DEBUG] _scan_directory() : P[%d,%d,%d] enters for %s / is_sfn = %d\n",
    827         x, y, lpid, file_name, is_sfn );
     827        x, y, p, file_name, is_sfn );
    828828#endif
    829829
     
    973973#if GIET_DEBUG_FAT
    974974_printf("\n[FAT DEBUG] _scan_directory() : P[%d,%d,%d] found %s / cluster = %x\n",
    975         x, y, lpid, file_name, searched_cluster );
     975        x, y, p, file_name, searched_cluster );
    976976#endif
    977977
     
    10101010#if GIET_DEBUG_FAT
    10111011unsigned int procid  = _get_procid();
    1012 unsigned int cid     = procid / NB_PROCS_MAX;
    1013 unsigned int lpid    = procid % NB_PROCS_MAX;
    1014 unsigned int x       = cid >> Y_WIDTH;
    1015 unsigned int y       = cid & ((1<<Y_WIDTH) - 1);
    1016 
    1017 _printf("\n[FAT DEBUG] _fat_init() : P[%d,%d,%d] enters", x, y, lpid );
     1012unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     1013unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);
     1014unsigned int p       = procid & ((1<<P_WIDTH)-1);
     1015
     1016_printf("\n[FAT DEBUG] _fat_init() : P[%d,%d,%d] enters", x, y, p );
    10181017if ( mode == IOC_BOOT_MODE   ) _printf(" / IOC_BOOT_MODE\n");
    10191018if ( mode == IOC_KERNEL_MODE ) _printf(" / IOC_KERNEL_MODE\n");
     
    10951094
    10961095#if GIET_DEBUG_FAT
    1097 _printf("\n[FAT DEBUG] _fat_init() : P[%d,%d,%d] initialises FAT descriptor\n", x, y, lpid );
     1096_printf("\n[FAT DEBUG] _fat_init() : P[%d,%d,%d] initialises FAT descriptor\n", x, y, p );
    10981097_fat_print();
    1099 _printf("\n[FAT DEBUG] _fat_init() : P[%d,%d,%d] exit\n", x, y, lpid );
     1098_printf("\n[FAT DEBUG] _fat_init() : P[%d,%d,%d] exit\n", x, y, p );
    11001099#endif
    11011100
     
    11451144#if GIET_DEBUG_FAT
    11461145unsigned int procid  = _get_procid();
    1147 unsigned int cid     = procid / NB_PROCS_MAX;
    1148 unsigned int lpid    = procid % NB_PROCS_MAX;
    1149 unsigned int x       = cid >> Y_WIDTH;
    1150 unsigned int y       = cid & ((1<<Y_WIDTH) - 1);
     1146unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     1147unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);
     1148unsigned int p       = procid & ((1<<P_WIDTH)-1);
     1149
    11511150_printf("\n[FAT DEBUG] _fat_open() : P[%d,%d,%d] enters for path %s\n",
    1152         x, y, lpid, pathname );
     1151        x, y, p, pathname );
    11531152#endif
    11541153
     
    11651164#if GIET_DEBUG_FAT
    11661165_printf("\n[FAT DEBUG] _fat_open() : P[%d,%d,%d] takes the FAT lock\n",
    1167         x, y, lpid );
     1166        x, y, p );
    11681167#endif
    11691168
     
    11931192#if GIET_DEBUG_FAT
    11941193_printf("\n[FAT DEBUG] _fat_open() : P[%d,%d,%d] search dir/file : %s\n",
    1195         x, y, lpid, name );
     1194        x, y, p, name );
    11961195#endif
    11971196
     
    12231222#if GIET_DEBUG_FAT
    12241223_printf("\n[FAT DEBUG] _fat_open() : P[%d,%d,%d] found cluster index for file %s : %x\n",
    1225         x, y, lpid, pathname, cluster );
     1224        x, y, p, pathname, cluster );
    12261225#endif
    12271226
     
    12491248#if GIET_DEBUG_FAT
    12501249_printf("\n[FAT DEBUG] _fat_open() : P[%d,%d,%d] exit : fd = %d for file %s\n",
    1251         x, y, lpid, fd_id, pathname );
     1250        x, y, p, fd_id, pathname );
    12521251#endif
    12531252
     
    13431342#if GIET_DEBUG_FAT
    13441343unsigned int procid  = _get_procid();
    1345 unsigned int cid     = procid / NB_PROCS_MAX;
    1346 unsigned int lpid    = procid % NB_PROCS_MAX;
    1347 unsigned int x       = cid >> Y_WIDTH;
    1348 unsigned int y       = cid & ((1<<Y_WIDTH) - 1);
     1344unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     1345unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);
     1346unsigned int p       = procid & ((1<<P_WIDTH)-1);
    13491347_printf("\n[FAT DEBUG] _fat_read() : P[%d,%d,%d] enters for file %s\n"
    13501348        " - buffer vbase    = %x\n"
     
    13531351        " - first cluster   = %x\n"
    13541352        " - skiped clusters = %x\n",
    1355         x, y, lpid, fat.fd[fd_id].name,
     1353        x, y, p, fat.fd[fd_id].name,
    13561354        (unsigned int)buffer, offset, count, cluster, clusters_to_skip );   
    13571355#endif
     
    13881386        " - lba     = %x\n"
    13891387        " - sectors = %d\n",
    1390         x, y, lpid, cluster, (unsigned int)dst, lba, iter_sectors );
     1388        x, y, p, cluster, (unsigned int)dst, lba, iter_sectors );
    13911389#endif
    13921390
     
    14631461#if GIET_DEBUG_FAT
    14641462unsigned int procid  = _get_procid();
    1465 unsigned int cid     = procid / NB_PROCS_MAX;
    1466 unsigned int lpid    = procid % NB_PROCS_MAX;
    1467 unsigned int x       = cid >> Y_WIDTH;
    1468 unsigned int y       = cid & ((1<<Y_WIDTH) - 1);
     1463unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     1464unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);
     1465unsigned int p       = procid & ((1<<P_WIDTH)-1);
     1466
    14691467_printf("\n[FAT DEBUG] _fat_write() : P[%d,%d,%d] enters for file %s\n",
    14701468        " - buffer vbase    = %x\n"
     
    14731471        " - file sectors    = %x\n"
    14741472        " - need allocate   = %d\n",
    1475         x, y, lpid, fat.fd[fd_id].name, (unsigned int)buffer,
     1473        x, y, p, fat.fd[fd_id].name, (unsigned int)buffer,
    14761474        offset, count, file_sectors, allocate );
    14771475#endif
     
    15441542_printf("\n[FAT DEBUG] _fat_write() : P[%d,%d,%d] makes an IOC write : "
    15451543        "buf = %x / lba = %x / sectors = %x\n",
    1546         x, y, lpid, (unsigned int)src, lba, iter_sectors );
     1544        x, y, p, (unsigned int)src, lba, iter_sectors );
    15471545#endif
    15481546
Note: See TracChangeset for help on using the changeset viewer.