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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.