Changeset 713
- Timestamp:
- Oct 7, 2015, 11:58:24 AM (9 years ago)
- Location:
- soft/giet_vm/giet_libs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/stdio.c
r709 r713 111 111 } 112 112 113 ////////////////////////////////////////////// 114 int giet_pthread_pause( char* vspace_name, 115 char* thread_name )116 { 117 return sys_call( SYSCALL_PTHREAD_CONTROL, 118 THREAD_CMD_PAUSE,119 (unsigned int) vspace_name,120 (unsigned int) thread_name,121 0 );122 } 123 124 /////////////////////////////////////////////// 125 int giet_pthread_resume( char* vspace_name, 126 char* thread_name )127 { 128 return sys_call( SYSCALL_PTHREAD_CONTROL,129 THREAD_CMD_RESUME,130 (unsigned int) vspace_name,131 (unsigned int) thread_name,132 0);133 }134 135 /////////////////////////////////////////////// 136 int giet_pthread_context( char* vspace_name, 137 char* thread_name )138 { 139 return sys_call( SYSCALL_PTHREAD_CONTROL,140 THREAD_CMD_CONTEXT,141 (unsigned int) vspace_name,142 (unsigned int) thread_name,143 0 );113 //////////////////////////////////////////////// 114 void giet_pthread_control( unsigned int command, 115 char* vspace_name, 116 char* thread_name ) 117 { 118 int ret = sys_call( SYSCALL_PTHREAD_CONTROL, 119 command, 120 (unsigned int) vspace_name, 121 (unsigned int) thread_name, 122 0 ); 123 124 if ( ret == SYSCALL_VSPACE_NOT_FOUND ) 125 { 126 giet_tty_printf(" ERROR in PTHREAD_CONTROL : " 127 "vspace %s not found\n", vspace_name ); 128 } 129 if ( ret == SYSCALL_THREAD_NOT_FOUND ) 130 { 131 giet_tty_printf(" ERROR in PTHREAD_CONTROL : " 132 "thread %s not found\n", thread_name ); 133 } 134 if ( ret == SYSCALL_UNCOHERENT_THREAD_CONTEXT ) 135 { 136 giet_tty_printf(" ERROR in PTHREAD_CONTROL : " 137 "uncoherent context for thread %s\n", thread_name ); 138 } 139 if ( ret == SYSCALL_ILLEGAL_THREAD_COMMAND_TYPE ) 140 { 141 giet_tty_printf(" ERROR in PTHREAD_CONTROL : " 142 "illegal command type %d\n", command ); 143 } 144 144 } 145 145 … … 165 165 } 166 166 167 /////////////////////////////// 168 void giet_applications_status( )167 /////////////////////////////////////////// 168 void giet_applications_status( char* name ) 169 169 { 170 170 sys_call( SYSCALL_APPS_STATUS, 171 0, 0, 0, 0 ); 171 (unsigned int)name, 172 0, 0, 0 ); 172 173 } 173 174 … … 776 777 { 777 778 if ( sys_call( SYSCALL_TIM_ALLOC, 778 0, 0, 0, 0 ) ) giet_pthread_exit(" error in giet_timer_alloc()");779 0, 0, 0, 0 ) ) giet_pthread_exit("ERROR in TIMER_ALLOC"); 779 780 } 780 781 … … 784 785 if ( sys_call( SYSCALL_TIM_START, 785 786 period, 786 0, 0, 0 ) ) giet_pthread_exit(" error in giet_timer_start()");787 0, 0, 0 ) ) giet_pthread_exit("ERROR in TIMER_START"); 787 788 } 788 789 … … 791 792 { 792 793 if ( sys_call( SYSCALL_TIM_STOP, 793 0, 0, 0, 0 ) ) giet_pthread_exit(" error in giet_timer_stop()");794 0, 0, 0, 0 ) ) giet_pthread_exit("ERROR in TIMER_STOP"); 794 795 } 795 796 … … 799 800 ////////////////////////////////////////////////////////////////////////////////// 800 801 802 //////////////////////////////////////// 803 void giet_fbf_size( unsigned int* width, 804 unsigned int* height ) 805 { 806 sys_call( SYSCALL_FBF_SIZE, 807 (unsigned int)width, 808 (unsigned int)height, 809 0, 0 ); 810 } 811 812 ///////////////////// 813 void giet_fbf_alloc() 814 { 815 if ( sys_call( SYSCALL_FBF_ALLOC, 816 0, 0, 0, 0 ) ) giet_pthread_exit("ERROR in FBF_ALLOC"); 817 } 818 801 819 ///////////////////////// 802 820 void giet_fbf_cma_alloc() 803 821 { 804 822 if ( sys_call( SYSCALL_FBF_CMA_ALLOC, 805 0, 0, 0, 0 ) ) giet_pthread_exit(" error in giet_fbf_cma_alloc()");823 0, 0, 0, 0 ) ) giet_pthread_exit("ERROR in FBF_CMA_ALLOC"); 806 824 } 807 825 … … 816 834 (unsigned int)buf1_vbase, 817 835 (unsigned int)sts0_vaddr, 818 (unsigned int)sts1_vaddr ) ) giet_pthread_exit("error in giet_fbf_cma_init_buf()");836 (unsigned int)sts1_vaddr ) ) giet_pthread_exit("ERROR in FBF_CMA_INIT_BUF"); 819 837 } 820 838 … … 824 842 if ( sys_call( SYSCALL_FBF_CMA_START, 825 843 length, 826 0, 0, 0 ) ) giet_pthread_exit(" error in giet_fbf_cma_start()");844 0, 0, 0 ) ) giet_pthread_exit("ERROR in FBF_CMA_START"); 827 845 } 828 846 … … 832 850 if ( sys_call( SYSCALL_FBF_CMA_DISPLAY, 833 851 buffer, 834 0, 0, 0 ) ) giet_pthread_exit(" error in giet_fbf_cma_display()");852 0, 0, 0 ) ) giet_pthread_exit("ERROR in FBF_CMA_DISPLAY"); 835 853 } 836 854 … … 839 857 { 840 858 if ( sys_call( SYSCALL_FBF_CMA_STOP, 841 0, 0, 0, 0 ) ) giet_pthread_exit(" error in giet_fbf_cma_stop()");859 0, 0, 0, 0 ) ) giet_pthread_exit("ERROR in FBF_CMA_STOP"); 842 860 } 843 861 … … 851 869 (unsigned int)buffer, 852 870 length, 853 0 ) ) giet_pthread_exit(" error in giet_fbf_sync_write()");871 0 ) ) giet_pthread_exit("ERROR in FBF_SYNC_WRITE"); 854 872 } 855 873 … … 863 881 (unsigned int)buffer, 864 882 length, 865 0 ) ) giet_pthread_exit(" error in giet_fbf_sync_read()");883 0 ) ) giet_pthread_exit("ERROR in FBF_SYNC_READ"); 866 884 } 867 885 -
soft/giet_vm/giet_libs/stdio.h
r709 r713 24 24 #define SYSCALL_GET_XY 0x03 25 25 // 0x04 26 //0x0527 //0x0626 #define SYSCALL_VOBJ_GET_VBASE 0x05 27 #define SYSCALL_VOBJ_GET_LENGTH 0x06 28 28 #define SYSCALL_HEAP_INFO 0x07 29 #define SYSCALL_ VOBJ_GET_VBASE0x0830 #define SYSCALL_ VOBJ_GET_LENGTH0x0929 #define SYSCALL_FBF_SIZE 0x08 30 #define SYSCALL_FBF_ALLOC 0x09 31 31 #define SYSCALL_FBF_CMA_ALLOC 0x0A 32 32 #define SYSCALL_FBF_CMA_INIT_BUF 0x0B … … 86 86 #define SYSCALL_COPROC_RUN 0x3E 87 87 #define SYSCALL_COPROC_RELEASE 0x3F 88 89 //////////////////////////////////////////////////////////////////////////// 90 // Define the error codes for the syscall handlers 91 // These define must be synchronized with values in the sys_handler.h file 92 //////////////////////////////////////////////////////////////////////////// 93 94 #define SYSCALL_OK ( 0 ) 95 #define SYSCALL_VSPACE_NOT_FOUND (-1 ) 96 #define SYSCALL_THREAD_NOT_FOUND (-2 ) 97 #define SYSCALL_NOT_IN_SAME_VSPACE (-3 ) 98 #define SYSCALL_UNCOHERENT_THREAD_CONTEXT (-4 ) 99 #define SYSCALL_ILLEGAL_THREAD_COMMAND_TYPE (-5 ) 100 #define SYSCALL_CANNOT_LOAD_DATA_SEGMENT (-6 ) 101 #define SYSCALL_THREAD_ALREADY_ACTIVE (-7 ) 102 #define SYSCALL_MAIN_NOT_FOUND (-8 ) 103 #define SYSCALL_APPLI_CANNOT_BE_KILLED (-9 ) 104 #define SYSCALL_PTHREAD_ARGUMENT_NOT_SUPPORTED (-10) 105 #define SYSCALL_ILLEGAL_CLUSTER_COORDINATES (-11) 106 #define SYSCALL_VSEG_NOT_FOUND (-12) 107 #define SYSCALL_UNDEFINED_SYSTEM_CALL (-13) 108 #define SYSCALL_COPROCESSOR_NOT_FOUND (-14) 109 #define SYSCALL_COPROCESSOR_ILLEGAL_MODE (-15) 110 #define SYSCALL_COPROCESSOR_NON_ALLOCATED (-16) 111 #define SYSCALL_CHANNEL_ALREADY_ALLOCATED (-17) 112 #define SYSCALL_NO_CHANNEL_AVAILABLE (-18) 113 #define SYSCALL_CHANNEL_NON_ALLOCATED (-19) 114 #define SYSCALL_ILLEGAL_XY_ARGUMENTS (-20) 115 #define SYSCALL_OUT_OF_KERNEL_HEAP_MEMORY (-21) 116 #define SYSCALL_ADDRESS_NON_ALIGNED (-22) 117 #define SYSCALL_ADDRESS_NON_USER_ACCESSIBLE (-23) 118 #define SYSCALL_MISSING_INITIALISATION (-24) 119 #define SYSCALL_SHARED_PERIPHERAL_BUSY (-25) 120 121 //////////////////////////////////////////////////////////////////////////// 122 // Command values for the giet_pthread_control() syscall 123 // These define must be synchronized with values in the sys_handler.h file 124 //////////////////////////////////////////////////////////////////////////// 125 126 #define THREAD_CMD_PAUSE 0 127 #define THREAD_CMD_RESUME 1 128 #define THREAD_CMD_CONTEXT 2 88 129 89 130 //////////////////////////////////////////////////////////////////////////// … … 178 219 char* string ); 179 220 180 extern int giet_pthread_pause( char* vspace, 181 char* thread ); 182 183 extern int giet_pthread_resume( char* vspace, 184 char* thread ); 185 186 extern int giet_pthread_context( char* vspace, 187 char* thread ); 221 extern void giet_pthread_control( unsigned int command, 222 char* vspace_name, 223 char* thread_name ); 188 224 189 225 ////////////////////////////////////////////////////////////////////////// … … 195 231 extern int giet_exec_application( char* name ); 196 232 197 extern void giet_applications_status( );233 extern void giet_applications_status( char* name ); 198 234 199 235 ////////////////////////////////////////////////////////////////////////// … … 252 288 ////////////////////////////////////////////////////////////////////////// 253 289 290 extern void giet_fbf_size(); 291 292 extern void giet_fbf_alloc(); 293 254 294 extern void giet_fbf_cma_alloc(); 255 295
Note: See TracChangeset
for help on using the changeset viewer.