sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * mb_submit() - Submit a command the embedded scheduler command queue
 *
 * @xcmd:  Command to submit
 * Return: %true if successfully submitted, %false otherwise
 */
Submit a command the embedded scheduler command queue
@xcmd:  Command to submit
Return: %true if successfully submitted, %false otherwise
Submit a command the embedded scheduler command queue @xcmd : Command to submit Return : %true if successfully submitted %false otherwise
static int
mb_submit(struct xocl_cmd *xcmd)
{
	u32 slot_addr;
	SCHED_DEBUG("-> mb_submit\n");
	xcmd->slot_idx = acquire_slot_idx(xcmd->xdev);
	if (xcmd->slot_idx<0) {
		SCHED_DEBUG("<- mb_submit returns 0\n");
		return 0;
	}
	slot_addr = ERT_CQ_BASE_ADDR + xcmd->slot_idx*slot_size(xcmd->xdev);
	SCHED_DEBUGF("++ mb_submit slot_idx=%d, slot_addr=0x%x\n",xcmd->slot_idx,slot_addr);
	memcpy_toio(xcmd->xdev->user_bar + slot_addr + 4,xcmd->packet->data,(packet_size(xcmd)-1)*sizeof(u32));
	iowrite32(xcmd->packet->header,xcmd->xdev->user_bar + slot_addr);
	if (xcmd->xdev->exec.cq_interrupt) {
		u32 cq_int_addr = ERT_CQ_STATUS_REGISTER_ADDR + (slot_mask_idx(xcmd->slot_idx)<<2);
		u32 mask = 1<<slot_idx_in_mask(xcmd->slot_idx);
		SCHED_DEBUGF("++ mb_submit writes slot mask 0x%x to CQ_INT register at addr 0x%x\n",
			     mask,cq_int_addr);
		iowrite32(mask,xcmd->xdev->user_bar + cq_int_addr);
	}
	SCHED_DEBUG("<- mb_submit returns 1\n");
	return 1;
}
static int mb_submit ( struct xocl_cmd * xcmd ) { u32 slot_addr ; SCHED_DEBUG ( " \n " ) ; xcmd -> slot_idx = acquire_slot_idx ( xcmd -> xdev ) ; if ( xcmd -> slot_idx < 0 ) { SCHED_DEBUG ( " \n " ) ; return 0 ; } slot_addr = ERT_CQ_BASE_ADDR + xcmd -> slot_idx * slot_size ( xcmd -> xdev ) ; SCHED_DEBUGF ( " \n " , xcmd -> slot_idx , slot_addr ) ; memcpy_toio ( xcmd -> xdev -> user_bar + slot_addr + 4 , xcmd -> packet -> data , ( packet_size ( xcmd ) - 1 ) * sizeof ( u32 ) ) ; iowrite32 ( xcmd -> packet -> header , xcmd -> xdev -> user_bar + slot_addr ) ; if ( xcmd -> xdev -> exec . cq_interrupt ) { u32 cq_int_addr = ERT_CQ_STATUS_REGISTER_ADDR + ( slot_mask_idx ( xcmd -> slot_idx ) << 2 ) ; u32 mask = 1 << slot_idx_in_mask ( xcmd -> slot_idx ) ; SCHED_DEBUGF ( " \n " , mask , cq_int_addr ) ; iowrite32 ( mask , xcmd -> xdev -> user_bar + cq_int_addr ) ; } SCHED_DEBUG ( " \n " ) ; return 1 ; }
mb_submit() - Submit a command the embedded scheduler command queue
 @xcmd:  Command to submit
 Return: %true if successfully submitted, %false otherwise
mb_submit () - Submit a command the embedded scheduler command queue @xcmd : Command to submit Return : %true if successfully submitted %false otherwise
/* write packet minus header */ /* write header */ /* trigger interrupt to embedded scheduler if feature is enabled */