Changes between Version 24 and Version 25 of kernel_syscalls
- Timestamp:
- Dec 29, 2014, 11:20:49 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kernel_syscalls
v24 v25 55 55 === 1) int '''_sys_nic_alloc'''( unsigned int is_rx ) === 56 56 This function allocates a private NIC_RX or NIC_TX channel, the associated chbuf, and a private CMA channel to the calling task. It register these channel indexes in the task context. 57 * '''is_ isr''' : boolean (RX transfer if non zero)57 * '''is_rx''' : boolean (RX transfer if non zero) 58 58 Returns the NIC channel index if success. Return -1 if no NIC channel available, or if no CMA channel available. 59 59 60 60 === 2) int '''_sys_nic_start'''( unsigned int is_rx ) === 61 This function starts the NIC channel allocated to the calling task, and starts the CMA transfer between the internal NIC chbuf and the kernel chbuf allocated to the calling task. 62 * '''is_isr''' : boolean (RX transfer if non zero) 61 This function initializes the kernel chbuf allocated to the calling task. It allocates the distributed 4 Kbytes containers (2 containers per cluster) from the distributed kernel heap, and initializes the kernel chbuf describing the containers status. This chbuf descriptor is allocated in the seg_kernel_data segment in cluster [0,0]. 62 It starts the NIC channel allocated to the calling task, and starts the CMA transfer between the NIC chbuf and the distributed kernel chbuf. The CMA component is configured in OUT_OF_ORDER transfer mode (non blocking when a DST buffer is full. 63 * '''is_rx''' : boolean (RX transfer if non zero) 63 64 Returns 0 if success. Returns -1 if no NIC channel or no CMA channel allocated to the calling task. 64 65 65 66 === 3) int '''_sys_nic_move'''( unsigned int nic_channel, unsigned int is_rx, void* buffer ) === 66 This function moves one 4 kbytes container between the kernel chbuf defined by the nic_channel argument, and an user buffer.67 * '''nic_channel''' : selected nic _chbufchannel.68 * '''is_ isr''' : boolean (RX transfer if non zero)67 This function moves one 4 Kbytes container from the kernel chbuf defined by the ''nic_channel'' argument, to an user buffer defined by the ''buffer'' argument. This blocking function enforces locality and parallelism: it scans the two containers located in the same cluster as the calling task, and returns only when a full container has been found. 68 * '''nic_channel''' : selected nic channel. 69 * '''is_rx''' : boolean (RX transfer if non zero) 69 70 * '''buffer''' is the user buffer virtual base address. 70 It supports concurrent kernel access to the chbuf, because It takes the lock protecting exclusive access to the chbuf pointer (index field).71 It is blocking if the kernel chbuf is empty (for an RX transfer) or full (for a TX transfer). The bloking situation72 is bounded by a timeout defined by the GIET_NIC_TIMEOUT parameter defined in the ''giet_config.h'' file.73 71 Returns 0 if success, returns -1 if the user buffer address is illegal, or if the NIC channel is too large, or if the timeout is elapsed. 74 72 75 73 === 4) int '''_sys_nic_stop'''( unsigned int is_rx ) === 76 74 This function stops the NIC and the CMA channels allocated to the calling task. 77 * '''is_ isr''' : boolean (RX transfer if non zero)75 * '''is_rx''' : boolean (RX transfer if non zero) 78 76 Returns 0 if success. Returns -1 if no NIC channel or no CMA channel allocated to the calling task. 79 77