Ignore:
Timestamp:
Feb 8, 2015, 12:30:47 PM (9 years ago)
Author:
alain
Message:

1) Introduce a fully parallel procedure for both
page tables ans schedulers initialisation.
2) Introduce support for platforms containing clusters
without processors (as in the tsar_generic_leti).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_boot/boot_entry.S

    r490 r493  
    11/*
    2  * file   : boot.S
     2 * file   : boot_entry.S
    33 * date   : 01/17/2014
    44 * author : Cesar Fuguet & Alain Greiner & Hao Liu
     
    1919 * to the boot_init() fuction defined in the boot.c file.
    2020 *
    21  * - each processor[x][y][0] uses a larger stack: 1,25 Kbytes.
    22  * - Other processors use a smaller stack:    256 bytes.
    23  *     => the SEG_BOOT_STACK_SIZE cannot be smaller 512 Kytes.
    24  *         (256*(1024+256) + (1024 - 256) * 256 = 512 Kbytes = 0x80000)
     21 * - each processor P[x,y,0] uses a larger stack: 1,25 Kbytes.
     22 * - Other processors use a smaller stack:        0,25 Kbytes.
     23 *     => the SEG_BOOT_STACK_SIZE cannot be smaller than
     24 *        256 * (1024 + 256) + (1024 - 256) * 256 = 512 Kbytes
    2525 */
    2626
     
    3838boot_entry:
    3939
    40 
    41     /* All processors compute proc_id = (cluster_id * NBPROCS) + lpid             */
    42     /* where cluster_id = (x * Y_SIZE) + y                                        */
    4340    /* The (x,y,lpid) values are obtained from the processor CP0 register,        */
    44     /* where  proc_xyl == (((x<<4) + y) * NB_PROCS_MAX) + lpid                    */
    45     /* (proc_id is a "continuous" index, while proc_xyl is a "fixed format" index */
    46 
     41    /* where  proc_id == (((x<<Y_WIDTH) + y)<<P_WIDTH) + lpid (fixed format)      */
     42    /* The continuous cluster index is computed as cluster_id = (x * Y_SIZE) + y  */
    4743
    4844    mfc0   k0,      CP0_PROCID
    49     andi   k0,      k0,     0xFFF             /* k0 <= proc_xyl                   */
     45    andi   k0,      k0,     0xFFF             /* k0 <= proc_id                    */
    5046    andi   t1,      k0,     ((1<<P_WIDTH)-1)  /* t1 <= lpid                       */
    5147    srl    t2,      k0,     P_WIDTH           /* t2 <= cluster_xy                 */
     
    5450    la     t6,      Y_SIZE                    /* t6 <= Y_SIZE                     */
    5551    multu  t3,      t6
    56     mflo   t5
     52    mflo   t5                                 /* t5 <= x * Y_SIZE                 */
    5753    addu   t5,      t5,     t4                /* t5 <= cluster_id                 */
    58     li     t6,      0x100 * (NB_PROCS_MAX - 1) + 0x500  /* stack size per cluster */
     54
     55    /* All processors initializes stack pointer, depending on x,y,lpid            */
     56    /* Processors P[x,y,0] : stack size = 1,25 Kbytes                             */
     57    /* Other processors    : stack size = 0,25 Kbytes
     58    /* In each cluster, the total stack size is NB_PROCS_MAX-1)*0x100 + 0x500     */
     59
     60    li     t6,      (NB_PROCS_MAX-1) * 0x100 + 0x500  /* t6 <= cluster_size       */
    5961    multu  t6,      t5
    60     mflo   t7
    61 
    62     /* All processors initializes stack pointer, depending on proc_id             */
    63 
    64    la      k0,      SEG_BOOT_STACK_BASE
    65    addu    k0,      k0,     t7
    66    li      k1,      0x500           /* k1 <= local P0 stack size == 1,25 Kbytes            */
    67    addu    sp,      k0,     k1      /* P0 stack from base to (base + stack size * cluster_id + 1,25K )         */
    68 
    69    li      k1,      0x100           /* k1 <= Pi stack size == 256 bytes            */
    70    multu   k1,      t1             
    71    mflo    k0                       /* k0 <= 256 * proc_id                        */
    72    addu    sp,      sp,     k0      /* Pi stacks from base + stack size * cluster_id + 1,25K + proc_id*256    */
    73 
     62    mflo   t7                                 /* t7 <= cluster_size * cluster_id  */
     63    la     k0,      SEG_BOOT_STACK_BASE
     64    addu   k0,      k0,     t7                /* k0 <= stack base in cluster      */
     65    li     k1,      0x500                     /* k1 <= 1,25 Kbytes                */
     66    addu   sp,      k0,     k1                /* P[x,y,0] stack top               */
     67    li     k1,      0x100                     /* k1 <= 0,25 bytes                 */
     68    multu  k1,      t1             
     69    mflo   k0                                 /* k0 <= 256 * lpid                 */
     70    addu   sp,      sp,     k0                /* P[x,y,lpid] stack top            */
    7471
    7572    /* All processors jump to the boot_init function                              */
Note: See TracChangeset for help on using the changeset viewer.