Changes between Version 14 and Version 15 of kernel_syscalls
- Timestamp:
- Nov 10, 2014, 2:17:13 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kernel_syscalls
v14 v15 1 = GIET-VM / Syscall Handler =1 = GIET-VM / Syscall Handlers = 2 2 3 3 The [source:soft/giet_vm/giet_kernel/sys_handler.c sys_handler.c] and [source:soft/giet_vm/giet_kernel/sys_handler.h sys_handler.h] files define the kernel data structure and functions that are used to handle the system calls. These functions are prefixed by ''_'' to remind that they can only be executed by a processor in kernel mode. … … 51 51 == __NIC related syscall handlers__ == 52 52 53 === int '''_sys_nic_rx_alloc'''() === 54 This function allocates a private NIC_RX channel, the associated NIC_RX chbuf, and a private CMA channel to the calling task, and register these channel indexes in the task context. 55 Return -1 if no NIC_RX channel available, or if no CMA channel available. 53 These '4 functions can be used for both a NIC_RX or NIC_TX channel, depending on the '''is_rx''' argument. 56 54 57 === int '''_sys_nic_ tx_alloc'''() ===58 This function allocates a private NIC_ TX channel, the associated NIC_TXchbuf, and a private CMA channel to the calling task, and register these channel indexes in the task context.59 Return -1 if no NIC_TXchannel available, or if no CMA channel available.55 === int '''_sys_nic_alloc'''( unsigned int is_rx ) === 56 This function allocates a private NIC_RX or NIC_TX channel, the associated chbuf, and a private CMA channel to the calling task, and register these channel indexes in the task context. 57 Returns 0 if success. Return -1 if no NIC channel available, or if no CMA channel available. 60 58 61 === int '''_sys_nic_ rx_start'''() ===62 This function starts the NIC _RXand the CMA channels allocated to the calling task.63 Returns -1 if no NIC_RXchannel or no CMA channel allocated to the calling task.59 === int '''_sys_nic_start'''( unsigned int is_rx ) === 60 This function starts the NIC and the CMA channels allocated to the calling task. 61 Returns 0 if success. Returns -1 if no NIC channel or no CMA channel allocated to the calling task. 64 62 65 === int '''_sys_nic_tx_start'''() === 66 This function starts the NIC_RX and the CMA channels allocated to the calling task. 67 Returns -1 if no NIC_RX channel or no CMA channel allocated to the calling task. 68 69 === int '''_sys_nic_rx_move'''( void* buffer ) === 70 This function moves one 4kbytes container from the private kernel NIC_RX chbuf allocated to the calling task, to an user buffer. 63 === int '''_sys_nic_move'''( unsigned int is_rx, void* buffer ) === 64 This function moves one 4kbytes container between the kernel chbuf allocated to the calling task, and an user buffer. 65 * '''is_rx''' defines the transfer direction (user -> kernel for TX / kernel -> user for RX) 71 66 * '''buffer''' is the user buffer virtual base address. 72 It is blocking if the kernel NIC_RX chbuf is empty, with a time-out limit. 67 It is blocking if the kernel chbuf is empty (for an RX transfer) or full (for a TX transfer). The bloking situation 68 is bounded by a timeout defined by the GIET_NIC_TIMEOUT parameter defined in the ''giet_config.h'' file. 73 69 Returns 0 if success, returns -1 if the user buffer address is illegal, or if there is no NIC_RX channel allocated to the calling task, or if the timeout is elapsed. 74 75 === int '''_sys_nic_tx_move'''( void* buffer ) ===76 This function moves one 4kbytes container from an user buffer, to the private kernel NIC_TX chbuf allocated to the calling task.77 * '''buffer''' is the user buffer virtual base address.78 It is blocking if the kernel NIC_TX chbuf is full, with a time-out limit.79 Returns 0 if success, returns -1 if the user buffer address is illegal, or if there is no NIC_TX channel allocated to the calling task, or if the timeout is elapsed.80 70 81 71