55 | | === 1) int '''_sys_nic_alloc'''( unsigned int is_rx , unsigned int x_size , unsigned int y_size ) === |
56 | | This function allocates a private NIC_RX or NIC_TX channel, and a private CMA channel to the calling task. It register these channel indexes in the task context. It allocates the distributed kernel chbuf associated to the NIC channel: both the distributed 4 Kbytes containers (one container per cluster from the distributed kernel heap), and the chbuf descriptor (in the seg_kernel_data segment in cluster [0,0]). The involved clusters are defined by the (x_size / y_size) parameters. |
| 55 | === 1) int '''_sys_nic_alloc'''( unsigned int is_rx , unsigned int xmax , unsigned int ymax ) === |
| 56 | This function allocates a private NIC_RX or NIC_TX channel, and a private CMA channel to the calling task. It register these channel indexes in the task context. It allocates the distributed kernel chbuf associated to the NIC channel: both the distributed 4 Kbytes containers (one container per cluster from the distributed kernel heap), and the chbuf descriptor (in the seg_kernel_data segment in cluster [0,0]). The number of involved clusters is defined by the (xmax / ymax) parameters, that cannot be larger than (X_SIZE, Y_SIZE), but can be smaller. |
58 | | * '''x_size''' : number of clusters in a row |
59 | | * '''y_size''' : number of clusters in a column |
60 | | Returns the NIC channel index if success. Return -1 if no NIC channel available, if no CMA channel available, if (x_size / y_size) are too large, or if not enough memory in the kernel heap. |
| 58 | * '''xmax''' : number of clusters in a row |
| 59 | * '''ymax''' : number of clusters in a column |
| 60 | Returns the NIC channel index if success. Return -1 if no NIC channel available, if no CMA channel available, if (xmax / ymax) are too large, or if not enough memory in the kernel heap. |