Changeset 255 for soft/giet_vm/sys


Ignore:
Timestamp:
Oct 9, 2013, 9:32:41 AM (11 years ago)
Author:
meunier
Message:
  • Added a syscall and some user functions to manipulate the Simulation Helper
  • Changed the the way the Vseg -> Pseg mapping is made during the boot to better utilize the address space (+ adaptation of the algorithm in memo)
  • Fixed a bug in boot_init (vobj_init): the vobj initialization could only be made for the first application (ptpr was not changed)
Location:
soft/giet_vm/sys
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/common.h

    r253 r255  
    3131extern _ld_symbol_t seg_mmc_base;
    3232extern _ld_symbol_t seg_cma_base;
     33extern _ld_symbol_t seg_sim_base;
    3334
    3435extern _ld_symbol_t vseg_cluster_increment;
  • soft/giet_vm/sys/drivers.c

    r254 r255  
    18341834}
    18351835
     1836
     1837////////////////////////////////////////////////////////////////////////////////
     1838// _sim_helper_access()
     1839// Accesses the Simulation Helper Component
     1840// If the access is on a writable register (except SIMHELPER_PAUSE_SIM),
     1841// the function should never return since the simulation will stop before
     1842// If the access is on a readable register, returns 0 on success, 1 on failure,
     1843// and writes the return value at address retval
     1844////////////////////////////////////////////////////////////////////////////////
     1845unsigned int _sim_helper_access(unsigned int register_index,
     1846                                unsigned int value,
     1847                                unsigned int * retval) {
     1848    unsigned int * sim_helper_address = (unsigned int *) &seg_sim_base;
     1849   
     1850    if (register_index == SIMHELPER_SC_STOP ||
     1851        register_index == SIMHELPER_END_WITH_RETVAL ||
     1852        register_index == SIMHELPER_EXCEPT_WITH_VAL ||
     1853        register_index == SIMHELPER_PAUSE_SIM ||
     1854        register_index == SIMHELPER_SIGINT) {
     1855        sim_helper_address[register_index] = value;
     1856    }
     1857    else if (register_index == SIMHELPER_CYCLES) {
     1858        *retval = sim_helper_address[register_index];
     1859    }
     1860    else {
     1861        _get_lock(&_tty_put_lock);
     1862        _puts("\n[GIET ERROR] in _sim_helper_access() : access to unmapped register\n");
     1863        _release_lock(&_tty_put_lock);
     1864        return -1;
     1865    }
     1866
     1867    return 0;
     1868}
     1869
     1870
     1871
    18361872// Local Variables:
    18371873// tab-width: 4
  • soft/giet_vm/sys/drivers.h

    r253 r255  
    132132
    133133///////////////////////////////////////////////////////////////////////////////////
     134// Sim Helper access function
     135///////////////////////////////////////////////////////////////////////////////////
     136unsigned int _sim_helper_access(unsigned int register_index,
     137                                unsigned int value,
     138                                unsigned int * retval);
     139
     140///////////////////////////////////////////////////////////////////////////////////
    134141// MEMC access functions
    135142///////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/sys/giet.s

    r219 r255  
    99* - the _cause_vector[16] array defines the 16 causes to enter the GIET
    1010*   it is initialized in th exc_handler.c file
    11 * - the _syscall_vector[32] array defines the 32 system calls entry points
     11* - the _syscall_vector[64] array defines the 64 system calls entry points
    1212*   it is initialised in the sys_handler.c file
    1313***********************************************************************************/
     
    3838 *
    3939 * A system call is handled as a special function call.
    40  *  - $2 contains the system call index (< 16).
     40 *  - $2 contains the system call index (< 64).
    4141 *  - $3 is used to store the syscall address
    4242 *  - $4, $5, $6, $7 contain the arguments values.
     
    6262    sw      $27,    20($29)         /* save it in the stack */
    6363
    64     andi    $26,    $2,     0x1F    /* $26 <= syscall index (i < 32) */
     64    andi    $26,    $2,     0x3F    /* $26 <= syscall index (i < 64) */
    6565    sll     $26,    $26,    2       /* $26 <= index * 4 */
    6666    la      $27,    _syscall_vector /* $27 <= &_syscall_vector[0] */
  • soft/giet_vm/sys/hwr_mapping.h

    r253 r255  
    192192};
    193193
     194enum SoclibSimhelperRegisters
     195{
     196    SIMHELPER_SC_STOP,
     197    SIMHELPER_END_WITH_RETVAL,
     198    SIMHELPER_EXCEPT_WITH_VAL,
     199    SIMHELPER_PAUSE_SIM,
     200    SIMHELPER_CYCLES,
     201    SIMHELPER_SIGINT,
     202};
     203
     204
     205
    194206#endif
    195207
  • soft/giet_vm/sys/sys_handler.c

    r253 r255  
    66///////////////////////////////////////////////////////////////////////////////////
    77// The sys_handler.c and sys_handler.h files are part of the GIET-VM nano-kernel.
    8 // It define the syscall_vector[] (at the end of this file), as well as the
     8// It defines the syscall_vector[], as well as the
    99// associated syscall handlers that are not related to peripherals.
    1010// The syscall handlers for peripherals are defined in the drivers.c file.
     
    2121//    Initialize the syscall vector with syscall handlers
    2222////////////////////////////////////////////////////////////////////////////
    23 const void * _syscall_vector[32] =
     23const void * _syscall_vector[64] =
    2424{
    2525    &_procid,              /* 0x00 */
     
    5555    &_nic_sync_read,       /* 0x1E */
    5656    &_nic_sync_write,      /* 0x1F */
     57    &_sim_helper_access,   /* 0x20 */
    5758};
    5859
  • soft/giet_vm/sys/sys_handler.h

    r238 r255  
    1313//////////////////////////////////////////////////////////////////////////////////
    1414
    15 extern const void * _syscall_vector[32];
     15extern const void * _syscall_vector[64];
    1616
    1717//////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.