sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * xocl_init_exec() - Initialize the command execution for device
 *
 * @xdev: Device node to initialize
 *
 * Return: 0 on success, -errno otherwise
 */
Initialize the command execution for device
@xdev: Device node to initialize

0 on success, -errno otherwise
Initialize the command execution for device @xdev : Device node to initialize 0 on success - errno otherwise
int
xocl_init_exec(struct drm_xocl_dev *xdev)
{
	unsigned int i;
	mutex_init(&xdev->exec.user_msix_table_lock);
	spin_lock_init(&xdev->exec.ctx_list_lock);
	INIT_LIST_HEAD(&xdev->exec.ctx_list);
	init_waitqueue_head(&xdev->exec.poll_wait_queue);
	xdev->exec.scheduler = &global_scheduler0;
        for (i=0; i<XOCL_MAX_SLOTS; ++i)
		xdev->exec.submitted_cmds[i] = NULL;
	xdev->exec.num_slots = 16;
	xdev->exec.num_cus = 0;
	xdev->exec.cu_base_addr = 0;
	xdev->exec.cu_shift_offset = 0;
	xdev->exec.cq_interrupt = 0;
	xdev->exec.polling_mode = 1;
	for (i=0; i<XOCL_MAX_U32_SLOT_MASKS; ++i)
		xdev->exec.slot_status[i] = 0;
	xdev->exec.num_slot_masks = 1;
	for (i=0; i<XOCL_MAX_U32_CU_MASKS; ++i)
		xdev->exec.cu_status[i] = 0;
	xdev->exec.num_cu_masks = 0;
	xdma_user_interrupt_config(xdev, XOCL_CSR_INTR0, true);
	xdma_user_interrupt_config(xdev, XOCL_CSR_INTR1, true);
	xdma_user_interrupt_config(xdev, XOCL_CSR_INTR2, true);
	xdma_user_interrupt_config(xdev, XOCL_CSR_INTR3, true);
	xdev->exec.ops = &penguin_ops;
	atomic_set(&xdev->exec.sr0,0);
	atomic_set(&xdev->exec.sr1,0);
	atomic_set(&xdev->exec.sr2,0);
	atomic_set(&xdev->exec.sr3,0);
	init_scheduler_thread();
	return 0;
}
int xocl_init_exec ( struct drm_xocl_dev * xdev ) { unsigned int i ; mutex_init ( & xdev -> exec . user_msix_table_lock ) ; spin_lock_init ( & xdev -> exec . ctx_list_lock ) ; INIT_LIST_HEAD ( & xdev -> exec . ctx_list ) ; init_waitqueue_head ( & xdev -> exec . poll_wait_queue ) ; xdev -> exec . scheduler = & global_scheduler0 ; for ( i = 0 ; i < XOCL_MAX_SLOTS ; ++ i ) xdev -> exec . submitted_cmds [ i ] = NULL ; xdev -> exec . num_slots = 16 ; xdev -> exec . num_cus = 0 ; xdev -> exec . cu_base_addr = 0 ; xdev -> exec . cu_shift_offset = 0 ; xdev -> exec . cq_interrupt = 0 ; xdev -> exec . polling_mode = 1 ; for ( i = 0 ; i < XOCL_MAX_U32_SLOT_MASKS ; ++ i ) xdev -> exec . slot_status [ i ] = 0 ; xdev -> exec . num_slot_masks = 1 ; for ( i = 0 ; i < XOCL_MAX_U32_CU_MASKS ; ++ i ) xdev -> exec . cu_status [ i ] = 0 ; xdev -> exec . num_cu_masks = 0 ; xdma_user_interrupt_config ( xdev , XOCL_CSR_INTR0 , true ) ; xdma_user_interrupt_config ( xdev , XOCL_CSR_INTR1 , true ) ; xdma_user_interrupt_config ( xdev , XOCL_CSR_INTR2 , true ) ; xdma_user_interrupt_config ( xdev , XOCL_CSR_INTR3 , true ) ; xdev -> exec . ops = & penguin_ops ; atomic_set ( & xdev -> exec . sr0 , 0 ) ; atomic_set ( & xdev -> exec . sr1 , 0 ) ; atomic_set ( & xdev -> exec . sr2 , 0 ) ; atomic_set ( & xdev -> exec . sr3 , 0 ) ; init_scheduler_thread ( ) ; return 0 ; }
xocl_init_exec() - Initialize the command execution for device
 @xdev: Device node to initialize
xocl_init_exec () - Initialize the command execution for device @xdev : Device node to initialize