Changeset 255 for soft/giet_vm/libs
- Timestamp:
- Oct 9, 2013, 9:32:41 AM (11 years ago)
- Location:
- soft/giet_vm/libs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/libs/spin_lock.c
r244 r255 39 39 "sc $3, 0($16) \n" /* try to get lock */ 40 40 "bnez $3, giet_lock_ok \n" /* exit if atomic */ 41 "nop \n" 41 42 42 43 "giet_lock_delay: \n" -
soft/giet_vm/libs/stdio.c
r253 r255 45 45 #define SYSCALL_NIC_SYNC_READ 0x1E 46 46 #define SYSCALL_NIC_SYNC_WRITE 0x1F 47 #define SYSCALL_SIM_HELPER_ACCESS 0x20 47 48 48 49 ////////////////////////////////////////////////////////////////////////////////// … … 851 852 852 853 854 //////////////////////////////////////////////////////////////////////////////////// 855 // giet_sc_stop() 856 // This function causes the Sim Helper to cause sc_stop() 857 //////////////////////////////////////////////////////////////////////////////////// 858 unsigned int giet_sc_stop() 859 { 860 unsigned int reg_index = 0; // Index of the SIMHELPER_SC_STOP register 861 return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, 0, 0); 862 } 863 864 865 //////////////////////////////////////////////////////////////////////////////////// 866 // giet_end_simu() 867 // This function causes the Sim Helper to cause exit(val) 868 //////////////////////////////////////////////////////////////////////////////////// 869 unsigned int giet_end_simu(unsigned int val) 870 { 871 unsigned int reg_index = 1; // Index of the SIMHELPER_END_WITH_RETVAL register 872 return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, val, 0, 0); 873 } 874 875 876 //////////////////////////////////////////////////////////////////////////////////// 877 // giet_throw_soclib_exception() 878 // This function causes the Sim Helper to launch a soclib exception with val in message 879 //////////////////////////////////////////////////////////////////////////////////// 880 unsigned int giet_throw_soclib_exception(unsigned int val) 881 { 882 unsigned int reg_index = 2; // Index of the SIMHELPER_EXCEPT_WITH_VAL register 883 return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, val, 0, 0); 884 } 885 886 887 //////////////////////////////////////////////////////////////////////////////////// 888 // giet_pause_simu() 889 // This function causes the Sim Helper to pause the simulation 890 //////////////////////////////////////////////////////////////////////////////////// 891 unsigned int giet_pause_simu() 892 { 893 unsigned int reg_index = 3; // Index of the SIMHELPER_PAUSE_SIM register 894 return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, 0, 0); 895 } 896 897 898 //////////////////////////////////////////////////////////////////////////////////// 899 // giet_raise_sigint() 900 // This function causes the Sim Helper to call raise(SIGINT) to interrupt simulation 901 //////////////////////////////////////////////////////////////////////////////////// 902 unsigned int giet_raise_sigint() 903 { 904 unsigned int reg_index = 5; // Index of the SIMHELPER_PAUSE_SIM register 905 return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, 0, 0); 906 } 907 908 909 //////////////////////////////////////////////////////////////////////////////////// 910 // giet_simhelper_cycles() 911 // This function causes the Sim Helper to write the number of simulated cycles 912 // at address *retval 913 //////////////////////////////////////////////////////////////////////////////////// 914 unsigned int giet_simhelper_cycles(unsigned int * retval) 915 { 916 unsigned int reg_index = 4; // Index of the SIMHELPER_PAUSE_SIM register 917 return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, (unsigned int) retval, 0); 918 } 919 920 921 853 922 // Local Variables: 854 923 // tab-width: 4 -
soft/giet_vm/libs/stdio.h
r253 r255 50 50 unsigned int giet_fb_cma_stop(); 51 51 52 /* Network controller relate functions */52 /* Network controller related functions */ 53 53 unsigned int giet_nic_cma_rx_init(void* buf0, void* buf1, unsigned int length); 54 54 unsigned int giet_nic_cma_tx_init(void* buf0, void* buf1, unsigned int length); 55 55 unsigned int giet_nic_cma_stop(); 56 57 /* Simulation Helper related functions */ 58 unsigned int giet_sc_stop(); 59 unsigned int giet_end_simu(unsigned int retval); 60 unsigned int giet_throw_soclib_exception(unsigned int val); 61 unsigned int giet_pause_simu(); 62 unsigned int giet_raise_sigint(); 63 unsigned int giet_simhelper_cycles(unsigned int * retval); 56 64 57 65 /* Misc */
Note: See TracChangeset
for help on using the changeset viewer.