Changeset 240


Ignore:
Timestamp:
Jun 3, 2013, 5:28:47 PM (11 years ago)
Author:
joannou
Message:

Bug fix for scheduler handling :

  • In boot_init.c, changed left shifts of 10 to left shifts of 12 to support 4K schedulers instead of 1K schedulers
  • In common.c, updated _get_sched() function to return the content of CP0_SCHED register
Location:
soft/giet_vm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/boot/boot_init.c

    r238 r240  
    15211521        boot_get_sched_vaddr( cluster_id, &sched_vbase, &sched_length );
    15221522
    1523         // each processor scheduler requires 1 Kbytes
    1524         if ( sched_length < (nprocs<<10) )
     1523        // each processor scheduler requires 4 Kbytes
     1524        if ( sched_length < (nprocs<<12) )
    15251525        {
    15261526            boot_puts("\n[BOOT ERROR] Schedulers segment too small in cluster ");
     
    15361536            // set the schedulers pointers array
    15371537            boot_schedulers[cluster_id * NB_PROCS_MAX + lpid] =
    1538                (static_scheduler_t*)( sched_vbase + (lpid<<10) );
     1538               (static_scheduler_t*)( sched_vbase + (lpid<<12) );
    15391539
    15401540#if BOOT_DEBUG_SCHED
     
    15421542boot_putd(lpid);
    15431543boot_puts(" : scheduler virtual base address = ");
    1544 boot_putx( sched_vbase + (lpid<<10) );
     1544boot_putx( sched_vbase + (lpid<<12) );
    15451545boot_puts("\n");
    15461546#endif
    15471547            // current processor scheduler pointer : psched
    1548             static_scheduler_t* psched = (static_scheduler_t*)(sched_vbase+(lpid<<10));
     1548            static_scheduler_t* psched = (static_scheduler_t*)(sched_vbase+(lpid<<12));
    15491549
    15501550            // initialise the "tasks" variable
  • soft/giet_vm/boot/reset.S

    r238 r240  
    183183
    184184    # all processors initialise the CP0 SCHED register
    185     # SCHED contains the schedulers array virtual base address
     185    # SCHED contains the scheduler virtual base address
    186186    mfc0        k0, CP0_PROCID
    187187    andi    k0, k0, 0xFFF
  • soft/giet_vm/giet_config.h

    r238 r240  
    1515/* Debug parameters */
    1616
    17 #define BOOT_DEBUG_PERI          1                      /* trace peripherals initialisation */
    18 #define BOOT_DEBUG_PT                1                  /* trace page tables initialisation */
    19 #define BOOT_DEBUG_VOBJS             1                  /* trace vobjs initialisation */
    20 #define BOOT_DEBUG_SCHED             1                  /* trace schedulers initialisation */
     17#define BOOT_DEBUG_PERI          0                      /* trace peripherals initialisation */
     18#define BOOT_DEBUG_PT                0                  /* trace page tables initialisation */
     19#define BOOT_DEBUG_VOBJS             0                  /* trace vobjs initialisation */
     20#define BOOT_DEBUG_SCHED             0                  /* trace schedulers initialisation */
    2121
    2222#define GIET_DEBUG_INIT              0                  /* trace parallel kernel initialisation */
  • soft/giet_vm/sys/common.c

    r238 r240  
    2626//       _get_sched()
    2727// Access CP0 and returns a pointer (virtual address) on the calling
    28 // processor scheduler (taking into account the processor local index).
     28// processor scheduler.
    2929///////////////////////////////////////////////////////////////////////////////////
    3030static_scheduler_t* _get_sched()
    3131{
    32     static_scheduler_t* psched;
    33     unsigned int        vaddr;
    34     unsigned int        lpid = _procid() % NB_PROCS_MAX;
    35 
     32    unsigned int vaddr;
    3633    asm volatile(
    3734            "mfc0    %0,   $22    \n"
    3835            : "=r"(vaddr) );
    39 
    40     psched = (static_scheduler_t*)vaddr;
    41     return (psched + lpid);
     36    return (static_scheduler_t*)vaddr;
    4237}
    4338
Note: See TracChangeset for help on using the changeset viewer.