Ignore:
Timestamp:
Jan 19, 2016, 11:23:02 AM (9 years ago)
Author:
alain
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/kernel_init.c

    r742 r760  
    9595////////////////////////////////////////////////////////////////////////////////
    9696
    97 // array of page tables virtual addresses
    98 __attribute__((section(".kdata")))
    99 volatile unsigned int _ptabs_vaddr[GIET_NB_VSPACE_MAX][X_SIZE][Y_SIZE];
    100 
    101 // array of page tables PTPR values (physical addresses >> 13)
    102 __attribute__((section(".kdata")))
    103 volatile unsigned int _ptabs_ptprs[GIET_NB_VSPACE_MAX][X_SIZE][Y_SIZE];
     97// Array of page tables virtual addresses (one per vspace and per cluster)
     98__attribute__((section(".kdata")))
     99unsigned int        _ptabs_vaddr[GIET_NB_VSPACE_MAX][X_SIZE][Y_SIZE];
     100
     101// Array of page tables physical addresses (one per vspace and per cluster)
     102__attribute__((section(".kdata")))
     103unsigned long long  _ptabs_paddr[GIET_NB_VSPACE_MAX][X_SIZE][Y_SIZE];
     104
     105// Array of pt2 allocators (one per vspace and per cluster)
     106__attribute__((section(".kdata")))
     107unsigned int        _ptabs_next_pt2[GIET_NB_VSPACE_MAX][X_SIZE][Y_SIZE];
     108
     109// Page tables max_pt2  (same value for all page tables)
     110__attribute__((section(".kdata")))
     111unsigned int        _ptabs_max_pt2;
    104112
    105113// Array of pointers on the schedulers
     
    122130__attribute__((section(".kdata")))
    123131sqt_barrier_t  _all_procs_barrier  __attribute__((aligned(64)));
     132
     133// required for concurrent PTAB building
     134__attribute__((section(".kdata")))
     135spin_lock_t    _ptabs_spin_lock[GIET_NB_VSPACE_MAX][X_SIZE][Y_SIZE];
     136
    124137
    125138////////////////////////////////////////////////////////////////////////////////
     
    191204#endif
    192205
     206        ////// get max_pt2 value stored in mapping header
     207        mapping_header_t*  header = (mapping_header_t*)SEG_BOOT_MAPPING_BASE;
     208        _ptabs_max_pt2 = header->max_pt2;
     209
    193210        //////  TTY fifos initialisation
    194211        unsigned int tty_id;
     
    277294    // step 2 : each processor that is allocated at least one thread loops
    278295    //          on its allocated threads:
    279     //          - contributes to _ptabs_vaddr & _ptabs_ptprs arrays
     296    //          - contributes to _ptabs_vaddr & _ptabs_paddr arrays
    280297    //            initialisation, from values stored in the threads contexts.
    281298    //          - set CTX_RA slot  with the kernel _ctx_eret() virtual address.
     
    292309        unsigned int ptab = _get_thread_slot( x, y, p, ltid , CTX_PTAB_ID );
    293310        unsigned int ptpr = _get_thread_slot( x, y, p, ltid , CTX_PTPR_ID );
     311        unsigned int npt2 = _get_thread_slot( x, y, p, ltid , CTX_NPT2_ID );
    294312
    295313        // initialize PTABS arrays
    296         _ptabs_vaddr[vsid][x][y] = ptab;
    297         _ptabs_ptprs[vsid][x][y] = ptpr;
     314        _ptabs_vaddr[vsid][x][y]    = ptab;
     315        _ptabs_paddr[vsid][x][y]    = ((unsigned long long)ptpr) << 13;
     316        _ptabs_next_pt2[vsid][x][y] = npt2;
    298317
    299318        // set the PTPR to use the local page table
     
    319338        " - ctx_ra               = %x\n",
    320339        x , y , p , ltid , 
    321         vsid , x , y , ptab ,
    322         vsid , x , y , ((unsigned long long)ptpr)<<13 ,
     340        vsid , x , y , _ptabs_vaddr[vsid][x][y] ,
     341        vsid , x , y , _ptabs_paddr[vsid][x][y] ,
    323342        ctx_entry, ctx_ra );
    324343#endif
Note: See TracChangeset for help on using the changeset viewer.