31 | | === void '''_sys_tty_get_lock'''( unsigned int channel, unsigned int* save_sr_ptr ) === |
32 | | This blocking function try to take the lock protecting exclusive access to TTY terminal identified by the "channel" argument. |
33 | | It enters a critical section before taking the lock, and save the SR value at address defined by the ''save_sr_ptr'' argument. |
34 | | It returns only when the lock has been successfully taken. |
| 26 | === int '''_sys_tty_get_lock'''( unsigned int channel, unsigned int* save_sr_ptr ) === |
| 27 | This blocking function try to take the lock protecting exclusive access to TTY terminal identified by the "channel" argument. It enters a critical section before taking the lock, and save the SR value at address defined by the ''save_sr_ptr'' argument. Returns -1 if no TTY terminal allocated to the calling task. If a TTY terminal is allocated, it returns only when the lock has been successfully taken. |
36 | | === void '''_sys_tty_release_lock'''( unsigned int channel, unsigned int* save_sr_ptr ) === |
37 | | This function releases the lock protecting exclusive access to TTY terminal identified by the channel argument. |
38 | | It exit the critical section after lock release, and restore SR value from address defined by the ''save_sr_ptr'' argument. |
| 29 | === int '''_sys_tty_release_lock'''( unsigned int channel, unsigned int* save_sr_ptr ) === |
| 30 | This function releases the lock protecting exclusive access to TTY terminal identified by the ''channel'' argument. |
| 31 | It exit the critical section after lock release, and restore SR value from address defined by the ''save_sr_ptr'' argument. Returns -1 if no TTY terminal allocated to the calling task. |
| 32 | |
| 33 | |
54 | | === void '''_task_exit'''() === |
| 49 | |
| 50 | |
| 51 | == __NIC related syscall handlers__ == |
| 52 | |
| 53 | === int '''_sys_nic_alloc'''() === |
| 54 | This function allocates a private NIC channel to the calling task, and register the channel index in the task context. |
| 55 | Return -1 if no NIC channel available. |
| 56 | |
| 57 | === int '''_sys_nic_sync_send'''( void* vbuf ) === |
| 58 | This function uses a physical_memcpy() to transfer a 4kbytes container from an user buffer to a private NIC TX channel. It computes the physical base address associated to the user buffer. Returns 0 if success, returns -1 if the buffer address is illegal, or if there is no NIC channel allocated to the calling task. |
| 59 | |
| 60 | === int '''_sys_nic_sync_receive'''( void* vbuf ) === |
| 61 | This function uses a physical_memcpy() to transfer a 4kbytes container from a private NIC RX channel to an user buffer. It computes the physical base address associated to the user buffer. Returns 0 if success, returns -1 if the buffer address is illegal, or if there is no NIC channel allocated to the calling task. |
| 62 | |
| 63 | |
| 64 | |
| 65 | == __Miscelaneous syscall handlers__ == |
| 66 | |
| 67 | === int '''_sys_ukn'''() === |
| 68 | Function executed in case of undefined syscall |
| 69 | |
| 70 | === int '''_sys_proc_xyp'''( unsigned int* x, unsigned int*, unsigned int* p ) === |
| 71 | This function returns the processor (x,y,p) identifiers. |
| 72 | |
| 73 | === int '''_sys_task_exit'''() === |
73 | | === unsigned int '''_get_vobj_ptr'''( char* vspace_name, char* vobj_name, mapping_vobj_t** pvobj ) === |
74 | | This function returns in the res_vobj argument a pointer on a vobj identified by the (vspace_name / vobj_name ) couple. |
75 | | Returns 0 if success, >0 if not found |
| 92 | === int '''_sys_vobj_get_vbase'''( char* vspace_name, char* vobj_name, unsigned int* vbase ) === |
| 93 | This function returns in the ''vbase'' argument the virtual base address of the vobj identified by the (vspace_name / vobj_name ) couple. Returns 0 if success, -1 if vobj not found. |
77 | | === unsigned int '''_vobj_get_vbase'''( char* vspace_name, char* vobj_name, unsigned int* vobj_vbase ) === |
78 | | This function writes in vobj_base the virtual base address of a vobj identified by the (vspace_name / vobj_name ) couple. |
79 | | Returns 0 if success, >0 if not found |
| 95 | === int '''_sys_vobj_get_length'''( char* vspace_name, char* vobj_name, unsigned int* length ) === |
| 96 | This function returns in the ''length'' argument the length of the vobj identified by the (vspace_name / vobj_name ) couple. Returns 0 if success, -1 if vobj not found |
81 | | === unsigned int '''_vobj_get_length'''( char* vspace_name, char* vobj_name, unsigned int* vobj_length ) === |
82 | | This function writes in vobj_length the length of a vobj identified by the (vspace_name / vobj_name ) couple. |
83 | | Returns 0 if success, >0 if not found |
| 98 | === int '''_sys_xy_from_ptr'''( void* ptr, unsigned int* x, unsigned int* y ) === |
| 99 | This function returns in the (x,y) arguments the coordinates of the cluster where is mapped the ptr virtual address. It use the _get_context_slot() function to get the calling task page table, and uses the _v2p_translate() function to obtain the physical address. Returns 0 if success, -1 if ptr not mapped in the calling task vspace. |
85 | | === unsigned int '''_get_xy_from_ptr'''( void* ptr, unsigned int* px, unsigned int* py ) === |
86 | | This function returns in the (x,y) arguments the coordinates of the cluster where is mapped the ptr virtual address. It use the _get_context_slot() function to get the calling task page table, and uses the _v2p_translate() function to obtain the physical address. Returns 0 if success, > 0 if ptr not mapped in the calling task vspace. |
| 101 | === int '''_sys_heap_info'''( unsigned int* vaddr, unsigned int* length, unsigned int x, unsigned int y ) === |
| 102 | This function returns the information associated to a heap : vaddr and length. |
| 103 | * If (x < X_SIZE) and (y < Y_SIZE), it return the heap associated to any task running in cluster(x,y). |
| 104 | * else, it return the heap associated to the calling task. |
| 105 | It uses the global task index (CTX_GTID_ID, unique for each giet task) and the vspace index (CTX_VSID_ID), that are defined in the calling task context to find the vobj_id containing the heap. |
| 106 | Returns 0 if success, returns -1 if not found. |