Changeset 255 for soft/giet_vm/sys
- Timestamp:
- Oct 9, 2013, 9:32:41 AM (11 years ago)
- Location:
- soft/giet_vm/sys
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/common.h
r253 r255 31 31 extern _ld_symbol_t seg_mmc_base; 32 32 extern _ld_symbol_t seg_cma_base; 33 extern _ld_symbol_t seg_sim_base; 33 34 34 35 extern _ld_symbol_t vseg_cluster_increment; -
soft/giet_vm/sys/drivers.c
r254 r255 1834 1834 } 1835 1835 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 //////////////////////////////////////////////////////////////////////////////// 1845 unsigned 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 1836 1872 // Local Variables: 1837 1873 // tab-width: 4 -
soft/giet_vm/sys/drivers.h
r253 r255 132 132 133 133 /////////////////////////////////////////////////////////////////////////////////// 134 // Sim Helper access function 135 /////////////////////////////////////////////////////////////////////////////////// 136 unsigned int _sim_helper_access(unsigned int register_index, 137 unsigned int value, 138 unsigned int * retval); 139 140 /////////////////////////////////////////////////////////////////////////////////// 134 141 // MEMC access functions 135 142 /////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/sys/giet.s
r219 r255 9 9 * - the _cause_vector[16] array defines the 16 causes to enter the GIET 10 10 * it is initialized in th exc_handler.c file 11 * - the _syscall_vector[ 32] array defines the 32system calls entry points11 * - the _syscall_vector[64] array defines the 64 system calls entry points 12 12 * it is initialised in the sys_handler.c file 13 13 ***********************************************************************************/ … … 38 38 * 39 39 * 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). 41 41 * - $3 is used to store the syscall address 42 42 * - $4, $5, $6, $7 contain the arguments values. … … 62 62 sw $27, 20($29) /* save it in the stack */ 63 63 64 andi $26, $2, 0x 1F /* $26 <= syscall index (i < 32) */64 andi $26, $2, 0x3F /* $26 <= syscall index (i < 64) */ 65 65 sll $26, $26, 2 /* $26 <= index * 4 */ 66 66 la $27, _syscall_vector /* $27 <= &_syscall_vector[0] */ -
soft/giet_vm/sys/hwr_mapping.h
r253 r255 192 192 }; 193 193 194 enum 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 194 206 #endif 195 207 -
soft/giet_vm/sys/sys_handler.c
r253 r255 6 6 /////////////////////////////////////////////////////////////////////////////////// 7 7 // 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 the8 // It defines the syscall_vector[], as well as the 9 9 // associated syscall handlers that are not related to peripherals. 10 10 // The syscall handlers for peripherals are defined in the drivers.c file. … … 21 21 // Initialize the syscall vector with syscall handlers 22 22 //////////////////////////////////////////////////////////////////////////// 23 const void * _syscall_vector[ 32] =23 const void * _syscall_vector[64] = 24 24 { 25 25 &_procid, /* 0x00 */ … … 55 55 &_nic_sync_read, /* 0x1E */ 56 56 &_nic_sync_write, /* 0x1F */ 57 &_sim_helper_access, /* 0x20 */ 57 58 }; 58 59 -
soft/giet_vm/sys/sys_handler.h
r238 r255 13 13 ////////////////////////////////////////////////////////////////////////////////// 14 14 15 extern const void * _syscall_vector[ 32];15 extern const void * _syscall_vector[64]; 16 16 17 17 //////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.