Changeset 255 for soft/giet_vm/libs/stdio.c
- Timestamp:
- Oct 9, 2013, 9:32:41 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.