sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * add_cmd() - Add a new command to pending list
 *
 * @xdev: device owning adding the buffer object 
 * @bo: buffer objects from user space from which new command is created
 *
 * Scheduler copies pending commands to its internal command queue.
 *
 * Return: 0 on success, -errno on failure
 */
Add a new command to pending list
@xdev: device owning adding the buffer object
@bo: buffer objects from user space from which new command is created

Scheduler copies pending commands to its internal command queue.

0 on success, -errno on failure
Add a new command to pending list @xdev : device owning adding the buffer object @bo : buffer objects from user space from which new command is created Scheduler copies pending commands to its internal command queue . 0 on success - errno on failure
static int
add_cmd(struct drm_xocl_dev *xdev, struct drm_xocl_bo* bo)
{
	struct xocl_cmd *xcmd = get_free_xocl_cmd();
	SCHED_DEBUG("-> add_cmd\n");
	xcmd->bo=bo;
	xcmd->xdev=xdev;
	xcmd->cu_idx=-1;
	xcmd->slot_idx=-1;
	xcmd->packet = (struct ert_packet*)bo->vmapping;
	xcmd->xs = xdev->exec.scheduler;
	set_cmd_state(xcmd,ERT_CMD_STATE_NEW);
	mutex_lock(&pending_cmds_mutex);
	list_add_tail(&xcmd->list,&pending_cmds);
	mutex_unlock(&pending_cmds_mutex);
	atomic_inc(&num_pending);
	wake_up_interruptible(&xcmd->xs->wait_queue);
	SCHED_DEBUG("<- add_cmd\n");
	return 0;
}
static int add_cmd ( struct drm_xocl_dev * xdev , struct drm_xocl_bo * bo ) { struct xocl_cmd * xcmd = get_free_xocl_cmd ( ) ; SCHED_DEBUG ( " \n " ) ; xcmd -> bo = bo ; xcmd -> xdev = xdev ; xcmd -> cu_idx = -1 ; xcmd -> slot_idx = -1 ; xcmd -> packet = ( struct ert_packet * ) bo -> vmapping ; xcmd -> xs = xdev -> exec . scheduler ; set_cmd_state ( xcmd , ERT_CMD_STATE_NEW ) ; mutex_lock ( & pending_cmds_mutex ) ; list_add_tail ( & xcmd -> list , & pending_cmds ) ; mutex_unlock ( & pending_cmds_mutex ) ; atomic_inc ( & num_pending ) ; wake_up_interruptible ( & xcmd -> xs -> wait_queue ) ; SCHED_DEBUG ( " \n " ) ; return 0 ; }
add_cmd() - Add a new command to pending list
 @xdev: device owning adding the buffer object
 @bo: buffer objects from user space from which new command is created
add_cmd () - Add a new command to pending list @xdev : device owning adding the buffer object @bo : buffer objects from user space from which new command is created
/* wake scheduler */