Changeset 322 for soft


Ignore:
Timestamp:
Jun 10, 2014, 1:28:14 PM (11 years ago)
Author:
alain
Message:

Various small modifs to comply with the genmap tool.

Location:
soft/giet_vm/giet_kernel
Files:
6 edited

Legend:

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

    r294 r322  
    8383        // the NB_PROCS_MAX timers are system timers (TICK)
    8484
    85 #if USE_XICU
     85#if USE_XCU
    8686        _xcu_timer_reset_cpt( cluster_xy, lpid );
    8787#else
  • soft/giet_vm/giet_kernel/irq_handler.c

    r310 r322  
    1919#include <bdv_driver.h>
    2020#include <dma_driver.h>
     21#include <spi_driver.h>
    2122#include <mapping_info.h>
    2223#include <utils.h>
    2324
    24 #if !defined( USE_XICU )
    25 # error: You must define USE_XICU in the hard_config.h file
     25#if !defined( USE_XCU )
     26# error: You must define USE_XCU in the hard_config.h file
    2627#endif
    2728
     
    6061    unsigned int icu_out_index = lpid * IRQ_PER_PROCESSOR;
    6162
    62 #if USE_XICU
     63#if USE_XCU
    6364    _xcu_get_index( cluster_xy, icu_out_index, &irq_id, &irq_type );
    6465#else
     
    118119        else if ( isr_type == ISR_TIMER  ) _timer_isr  ( irq_type, irq_id, channel );
    119120        else if ( isr_type == ISR_MMC    ) _mmc_isr    ( irq_type, irq_id, channel );
     121        else if ( isr_type == ISR_DMA    ) _dma_isr    ( irq_type, irq_id, channel );
     122        else if ( isr_type == ISR_SPI    ) _spi_isr    ( irq_type, irq_id, channel );
    120123        else
    121124        {
     
    146149    unsigned int lpid       = gpid % NB_PROCS_MAX;
    147150
    148     // We don't take TTY lock to avoid deadlock
    149     _puts("\n[GIET WARNING] IRQ handler called but no active IRQ on processor[");
    150     _putd( x );
    151     _puts(",");
    152     _putd( y );
    153     _puts(",");
    154     _putd( lpid );
    155     _puts("] at cycle ");
    156     _putd( _get_proctime() );
    157     _puts("\n  ");
     151    _printf("\n[GIET WARNING] IRQ handler called but no active IRQ "
     152            "on processor[%d,%d,%d] at cycle %d\n",
     153            x, y, lpid, _get_proctime() );
    158154}
    159155
  • soft/giet_vm/giet_kernel/irq_handler.h

    r297 r322  
    3232    ISR_CMA     = 9,
    3333    ISR_MMC     = 10,
     34    ISR_DMA     = 11,
     35    ISR_SPI     = 12,
    3436};
    3537
  • soft/giet_vm/giet_kernel/kernel.ld

    r258 r322  
    1212SECTIONS
    1313{
    14     . = seg_kernel_code_base;
     14    . = kernel_code_vbase;
    1515    seg_kernel_code :
    1616    {
     
    1919    }
    2020
    21     . = seg_kernel_data_base;
     21    . = kernel_data_vbase;
    2222    seg_kernel_data :
    2323    {
     
    3838    }
    3939
    40     . = seg_kernel_uncdata_base;
     40    . = kernel_uncdata_vbase;
    4141    seg_kernel_uncdata :
    4242    {
     
    4444    }
    4545
    46     . = seg_kernel_init_base;
     46    . = kernel_init_vbase;
    4747    seg_kernel_init :
    4848    {
  • soft/giet_vm/giet_kernel/kernel_init.c

    r310 r322  
    7171#include <mips32_registers.h>
    7272
     73#if !defined(X_SIZE)
     74# error: You must define X_SIZE in the hard_config.h file
     75#endif
     76
     77#if !defined(Y_SIZE)
     78# error: You must define Y_SIZE in the hard_config.h file
     79#endif
     80
     81#if !defined(Y_WIDTH)
     82# error: You must define Y_WIDTH in the hard_config.h file
     83#endif
     84
     85#if !defined(Y_WIDTH)
     86# error: You must define Y_WIDTH in the hard_config.h file
     87#endif
     88
     89#if !defined(NB_PROCS_MAX)
     90# error: You must define NB_PROCS_MAX in the hard_config.h file
     91#endif
     92
     93#if !defined(NB_TOTAL_PROCS)
     94# error: You must define NB_TOTAL_PROCS in the hard_config.h file
     95#endif
     96
     97#if !defined(USE_XCU)
     98# error: You must define USE_XCU in the hard_config.h file
     99#endif
     100
     101#if !defined(IDLE_TASK_INDEX)
     102# error: You must define IDLE_TASK_INDEX in the giet_config.h file
     103#endif
     104
     105#if !defined(GIET_TICK_VALUE)
     106# error: You must define GIET_TICK_VALUE in the giet_config.h file
     107#endif
     108
     109#if !defined(GIET_NB_VSPACE_MAX)
     110# error: You must define GIET_NB_VSPACE_MAX in the giet_config.h file
     111#endif
     112
    73113///////////////////////////////////////////////////////////////////////////////////
    74114// array of pointers on the page tables (virtual addresses)
     
    110150    unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
    111151    unsigned int lpid       = global_pid % NB_PROCS_MAX;
    112     unsigned int nprocs     = TOTAL_PROCS;
    113152    unsigned int pid        = ((( x * Y_SIZE) + y) * NB_PROCS_MAX) + lpid;
    114153//  unsigned int pid        = _get_id(i n_procs );
     
    217256    unsigned int channel = lpid * IRQ_PER_PROCESSOR;
    218257
    219 #if USE_XICU
     258#if USE_XCU
    220259    _xcu_set_mask( cluster_xy, channel, hwi_mask, IRQ_TYPE_HWI );
    221260    _xcu_set_mask( cluster_xy, channel, wti_mask, IRQ_TYPE_WTI );
     
    238277        // start system timer
    239278
    240 #if USE_XICU
     279#if USE_XCU
    241280        _xcu_timer_start( cluster_xy, isr_switch_index, GIET_TICK_VALUE );
    242281#else
     
    296335            x, y, lpid, _get_proctime() );
    297336
    298 /*
    299     unsigned int*  pcount = &_init_barrier;
    300     unsigned int   count;
    301 
    302     // increment barrier counter with atomic LL/SC
    303     asm volatile ( "_init_barrier_loop:             \n"
    304                    "ll    %0,   0(%1)               \n"
    305                    "addi  $3,   %0,   1             \n"
    306                    "sc    $3,   0(%1)               \n"
    307                    "beqz  $3,   _init_barrier_loop  \n"
    308                    "nop                             \n"
    309                    : "=&r"(count)
    310                    : "r"(pcount)
    311                    : "$3" );
    312    
    313     // busy waiting until all processors synchronized
    314     while ( *pcount != nprocs ) asm volatile ("nop");
    315 */
    316 
    317337    // increment barrier counter
    318338    _init_barrier++;
    319339
    320340    // busy waiting until all processors synchronized
    321     while ( _init_barrier != nprocs ) asm volatile ("nop");
    322 
    323 /*
    324     _printf("\n[GIET] Processor[%d,%d,%d] jumps to user code at cycle %d\n",
    325             x, y, lpid, _get_proctime() );
    326 */
    327        
     341    while ( _init_barrier != NB_TOTAL_PROCS ) asm volatile ("nop");
     342
    328343    // set registers and jump to user code
    329344    asm volatile ( "move  $29,  %0                  \n"   /* SP <= ctx[CTX_SP_ID] */
  • soft/giet_vm/giet_kernel/sys_handler.c

    r301 r322  
    2020#include <fat32.h>
    2121#include <utils.h>
     22#include <hard_config.h>
    2223#include <giet_config.h>
    2324#include <mapping_info.h>
     25
     26#if !defined(SEG_BOOT_MAPPING_BASE)
     27# error: You must define SEG_BOOT_MAPPING_BASE in the hard_config.h file
     28#endif
    2429
    2530////////////////////////////////////////////////////////////////////////////
     
    139144                           unsigned int* buffer)
    140145{
    141     mapping_header_t * header  = (mapping_header_t *) &seg_boot_mapping_base;
     146    mapping_header_t * header  = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
    142147    mapping_cluster_t * cluster = _get_cluster_base(header);
    143148
     
    186191               mapping_vobj_t**  res_vobj )
    187192{
    188     mapping_header_t * header = (mapping_header_t *) &seg_boot_mapping_base;
     193    mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
    189194    mapping_vspace_t * vspace = _get_vspace_base(header);
    190195    mapping_vobj_t * vobj     = _get_vobj_base(header);
     
    215220
    216221/////////////////////////////////////////////////////////////////////////////
    217 // This function writes in vobj_vaddr the virtual base address of a vobj
     222// This function writes in vobj_vbase the virtual base address of a vobj
    218223// identified by the (vspace_name / vobj_name ) couple.
    219224// returns 0 if success, >0 if not found
Note: See TracChangeset for help on using the changeset viewer.