| | 8 | |
| | 9 | == Coprocessors related sys call handlers == |
| | 10 | |
| | 11 | These functions are used to access coprocessors connected to the VCI network with a ''vci_mwmr_dma'' controller. |
| | 12 | They make the assumption that there is only one hardware coprocessor of a given type in a given cluster, and a coprocessor |
| | 13 | can be identified by the two (cluster_xy , coproc_type) variables. |
| | 14 | |
| | 15 | The following structure (defined in the stdio.h file) is used to define a specific TO_COPROC / FROM_COPROC channel. |
| | 16 | {{{ |
| | 17 | typedef struct giet_coproc_channel |
| | 18 | { |
| | 19 | unsigned int channel_mode; // MWMR / DMA_IRQ / DMA_NO_IRQ |
| | 20 | unsigned int buffer_size; // memory buffer size |
| | 21 | unsigned int buffer_vaddr; // memory buffer virtual address |
| | 22 | unsigned int mwmr_vaddr; // MWMR descriptor virtual address |
| | 23 | unsigned int lock_vaddr; // lock for MWMR virtual address |
| | 24 | } giet_coproc_channel_t; |
| | 25 | }}} |
| | 26 | |
| | 27 | === 1) int '''_sys_coproc_alloc'''( unsigned int coproc_type , unsigned int* coproc_info , unsigned int* cluster_xy ) === |
| | 28 | This function allocates an hardware coprocessor to the calling task. |
| | 29 | * '''coproc_type''' : requested processor type. |
| | 30 | * '''coproc_info''' : returns the number of ports (TO_COPROC / FROM_COPROC / CONFIG ) |
| | 31 | * '''cluster_xy''' : returns the cluster coordinates. |
| | 32 | In this implementation, the the requested coprocessor must be in the same cluster as the processor running the calling task. |
| | 33 | |
| | 34 | === 2) int '''_sys_coproc_release'''( unsigned int cluster_xy , unsigned int coproc_type ) === |
| | 35 | This function des-allocates a previously allocated coprocessor. |
| | 36 | * ''' cluster_xy''' : cluster coordinates. |
| | 37 | * '''coproc_type''' : requested processor type. |
| | 38 | |
| | 39 | === 3) int '''_sys_coproc_channel_init'''( unsigned int cluster_xy , unsigned int coproc_type , unsigned int channel , giet_coproc_channel_t* desc ) === |
| | 40 | This function initializes specific TO_COPROC or FROM_COPROC communication channel. |
| | 41 | * '''cluster_xy''' : cluster coordinates. |
| | 42 | * '''coproc_type''' : coprocessor type. |
| | 43 | * '''channel''' : channel index. |
| | 44 | * '''desc''' : pointer on the channel descriptor. |
| | 45 | |
| | 46 | === 4) int '''_sys_coproc_channel_start'''( unsigned int cluster_xy , unsigned int coproc_type , unsigned int channel ) === |
| | 47 | This function starts a specific TO_COPROC / FROM_COPROC communication channel. |
| | 48 | * '''cluster_xy''' : cluster coordinates. |
| | 49 | * '''coproc_type''' : coprocessor type. |
| | 50 | * '''channel''' : channel index. |
| | 51 | |
| | 52 | === 5) int '''_sys_coproc_channel_stop'''( unsigned int cluster_xy , unsigned int channel ) === |
| | 53 | |
| | 54 | === 6) int '''_sys_coproc_completed'''( unsigned int cluster_xy ) === |
| | 55 | |