Changeset 709 for soft/giet_vm/giet_kernel/sys_handler.h
- Timestamp:
- Oct 1, 2015, 4:20:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.h
r707 r709 16 16 #include "kernel_locks.h" 17 17 #include "stdio.h" 18 19 /////////////////////////////////////////////////////////////////////////////// 20 // Define the possible command values for the giet_pthread_control() syscall 21 /////////////////////////////////////////////////////////////////////////////// 22 23 #define THREAD_CMD_PAUSE 0 24 #define THREAD_CMD_RESUME 1 25 #define THREAD_CMD_CONTEXT 2 26 27 /////////////////////////////////////////////////////////////////////////////// 28 // Define the error codes for the thread related syscalls 29 /////////////////////////////////////////////////////////////////////////////// 30 31 #define GIET_SYSCALL_OK ( 0 ) 32 #define GIET_SYSCALL_VSPACE_NOT_FOUND (-1 ) 33 #define GIET_SYSCALL_THREAD_NOT_FOUND (-2 ) 34 #define GIET_SYSCALL_NOT_IN_SAME_VSPACE (-3 ) 35 #define GIET_SYSCALL_UNCOHERENT_THREAD_CONTEXT (-4 ) 36 #define GIET_SYSCALL_ILLEGAL_THREAD_COMMAND_TYPE (-5 ) 37 #define GIET_SYSCALL_CANNOT_LOAD_DATA_SEGMENT (-6 ) 38 #define GIET_SYSCALL_THREAD_ALREADY_ACTIVE (-7 ) 39 #define GIET_SYSCALL_MAIN_NOT_FOUND (-8 ) 40 #define GIET_SYSCALL_APPLI_CANNOT_BE_KILLED (-9 ) 41 #define GIET_SYSCALL_PTHREAD_ARGUMENT_NOT_SUPPORTED (-10) 42 #define GIET_SYSCALL_ILLEGAL_CLUSTER_COORDINATES (-11) 43 #define GIET_SYSCALL_VSEG_NOT_FOUND (-12) 44 #define GIET_SYSCALL_UNDEFINED_SYSTEM_CALL (-13) 45 #define GIET_SYSCALL_COPROCESSOR_NOT_FOUND (-14) 46 #define GIET_SYSCALL_COPROCESSOR_ILLEGAL_MODE (-15) 18 47 19 48 /////////////////////////////////////////////////////////////////////////////// … … 86 115 87 116 88 89 90 /////////////////////////////////////////////////////////////////////////////// 91 // Coprocessors related syscall handlers 92 /////////////////////////////////////////////////////////////////////////////// 93 94 int _sys_coproc_register_set( unsigned int cluster_xy, 95 unsigned int reg_index, 96 unsigned int value ); 97 98 int _sys_coproc_register_get( unsigned int cluster_xy, 99 unsigned int reg_index, 100 unsigned int* buffer ); 101 102 int _sys_coproc_alloc( unsigned int coproc_type, 103 unsigned int* coproc_info ); 104 105 int _sys_coproc_release( unsigned int coproc_reg_index ); 106 107 int _sys_coproc_channel_init( unsigned int channel, 108 giet_coproc_channel_t* desc ); 109 110 int _sys_coproc_run( unsigned int coproc_reg_index ); 111 112 int _sys_coproc_completed(); 117 ////////////////////////////////////////////////////////////////////////////// 118 // Applications related syscall handlers 119 ////////////////////////////////////////////////////////////////////////////// 120 121 extern int _sys_kill_application( char* name ); 122 123 extern int _sys_exec_application( char* name ); 124 125 extern int _sys_applications_status(); 126 127 ///////////////////////////////////////////////////////////////////////////// 128 // Threads related syscall handlers 129 ///////////////////////////////////////////////////////////////////////////// 130 131 extern int _sys_pthread_create( unsigned int* buffer, 132 void* attr, 133 void* function, 134 void* arg ); 135 136 extern int _sys_pthread_join( unsigned int trdid, 137 void* ptr ); 138 139 extern int _sys_pthread_kill( unsigned int trdid, 140 int signal ); 141 142 extern int _sys_pthread_exit( void* string); 143 144 extern int _sys_pthread_yield(); 145 146 extern int _sys_pthread_control( unsigned int command, 147 char* vspace_name, 148 char* thread_name ); 149 150 /////////////////////////////////////////////////////////////////////////////// 151 // Coprocessors related syscall handlers 152 /////////////////////////////////////////////////////////////////////////////// 153 154 extern int _sys_coproc_alloc( unsigned int coproc_type, 155 unsigned int* coproc_info ); 156 157 extern int _sys_coproc_release( unsigned int coproc_reg_index ); 158 159 extern int _sys_coproc_channel_init( unsigned int channel, 160 giet_coproc_channel_t* desc ); 161 162 extern int _sys_coproc_run( unsigned int coproc_reg_index ); 163 164 extern int _sys_coproc_completed(); 113 165 114 166 /////////////////////////////////////////////////////////////////////////////// … … 116 168 /////////////////////////////////////////////////////////////////////////////// 117 169 118 int _sys_tty_alloc( unsigned int shared );119 120 int _sys_tty_release();121 122 int _sys_tty_write( const char* buffer,170 extern int _sys_tty_alloc( unsigned int shared ); 171 172 extern int _sys_tty_release(); 173 174 extern int _sys_tty_write( const char* buffer, 123 175 unsigned int length, 124 176 unsigned int channel ); 125 177 126 int _sys_tty_read( char* buffer,178 extern int _sys_tty_read( char* buffer, 127 179 unsigned int length, 128 180 unsigned int channel ); … … 132 184 ////////////////////////////////////////////////////////////////////////////// 133 185 134 int _sys_tim_alloc();135 136 int _sys_tim_release();137 138 int _sys_tim_start( unsigned int period );139 140 int _sys_tim_stop();186 extern int _sys_tim_alloc(); 187 188 extern int _sys_tim_release(); 189 190 extern int _sys_tim_start( unsigned int period ); 191 192 extern int _sys_tim_stop(); 141 193 142 194 ////////////////////////////////////////////////////////////////////////////// … … 144 196 ////////////////////////////////////////////////////////////////////////////// 145 197 146 int _sys_nic_alloc( unsigned int is_rx, 147 unsigned int xmax, 148 unsigned int ymax ); 149 150 int _sys_nic_release( unsigned int is_rx ); 151 152 int _sys_nic_start( unsigned int is_rx, 153 unsigned int channel ); 154 155 int _sys_nic_move( unsigned int is_rx, 156 unsigned int channel, 157 void* buffer ); 158 159 int _sys_nic_stop( unsigned int is_rx, 160 unsigned int channel ); 161 162 int _sys_nic_clear( unsigned int is_rx, 163 unsigned int channel ); 164 165 int _sys_nic_stats( unsigned int is_rx, 166 unsigned int channel ); 198 extern int _sys_nic_alloc( unsigned int is_rx, 199 unsigned int xmax, 200 unsigned int ymax ); 201 202 extern int _sys_nic_release( unsigned int is_rx ); 203 204 extern int _sys_nic_start( unsigned int is_rx ); 205 206 extern int _sys_nic_move( unsigned int is_rx, 207 void* buffer ); 208 209 extern int _sys_nic_stop( unsigned int is_rx ); 210 211 extern int _sys_nic_clear( unsigned int is_rx ); 212 213 extern int _sys_nic_stats( unsigned int is_rx ); 167 214 168 215 ////////////////////////////////////////////////////////////////////////////// … … 170 217 ////////////////////////////////////////////////////////////////////////////// 171 218 172 int _sys_fbf_sync_write( unsigned int offset,219 extern int _sys_fbf_sync_write( unsigned int offset, 173 220 void* buffer, 174 221 unsigned int length ); 175 222 176 int _sys_fbf_sync_read( unsigned int offset,223 extern int _sys_fbf_sync_read( unsigned int offset, 177 224 void* buffer, 178 225 unsigned int length ); 179 226 180 int _sys_fbf_cma_alloc();181 182 int _sys_fbf_cma_release();183 184 int _sys_fbf_cma_init_buf(void* buf0_vbase,227 extern int _sys_fbf_cma_alloc(); 228 229 extern int _sys_fbf_cma_release(); 230 231 extern int _sys_fbf_cma_init_buf(void* buf0_vbase, 185 232 void* buf1_vbase, 186 233 void* sts0_vaddr, 187 234 void* sts1_vaddr ); 188 235 189 int _sys_fbf_cma_start( unsigned int length );190 191 int _sys_fbf_cma_display( unsigned int buffer_index );192 193 int _sys_fbf_cma_stop();236 extern int _sys_fbf_cma_start( unsigned int length ); 237 238 extern int _sys_fbf_cma_display( unsigned int buffer_index ); 239 240 extern int _sys_fbf_cma_stop(); 194 241 195 242 ////////////////////////////////////////////////////////////////////////////// … … 197 244 ////////////////////////////////////////////////////////////////////////////// 198 245 199 int _sys_ukn();200 201 int _sys_proc_xyp( unsigned int* x,246 extern int _sys_ukn(); 247 248 extern int _sys_proc_xyp( unsigned int* x, 202 249 unsigned int* y, 203 250 unsigned int* p ); 204 251 205 int _sys_task_exit( char* string ); 206 207 int _sys_kill_application( char* name ); 208 209 int _sys_exec_application( char* name ); 210 211 int _sys_context_switch(); 212 213 int _sys_local_task_id(); 214 215 int _sys_global_task_id(); 216 217 int _sys_thread_id(); 218 219 int _sys_procs_number( unsigned int* x_size, 252 extern int _sys_procs_number( unsigned int* x_size, 220 253 unsigned int* y_size, 221 254 unsigned int* nprocs ); 222 255 223 int _sys_vseg_get_vbase( char* vspace_name,256 extern int _sys_vseg_get_vbase( char* vspace_name, 224 257 char* vseg_name, 225 258 unsigned int* vbase ); 226 259 227 int _sys_vseg_get_length( char* vspace_name,260 extern int _sys_vseg_get_length( char* vspace_name, 228 261 char* vseg_name, 229 262 unsigned int* length ); 230 263 231 int _sys_xy_from_ptr( void* ptr,264 extern int _sys_xy_from_ptr( void* ptr, 232 265 unsigned int* x, 233 266 unsigned int* y ); 234 267 235 int _sys_heap_info( unsigned int* vaddr,268 extern int _sys_heap_info( unsigned int* vaddr, 236 269 unsigned int* length, 237 270 unsigned int x, 238 271 unsigned int y ); 239 240 int _sys_tasks_status();241 242 int _sys_fat_read( unsigned int fd_id,243 unsigned int buffer,244 unsigned int count );245 272 246 273 #endif
Note: See TracChangeset
for help on using the changeset viewer.