当前位置: 首页>>代码示例>>C++>>正文


C++ os_printk函数代码示例

本文整理汇总了C++中os_printk函数的典型用法代码示例。如果您正苦于以下问题:C++ os_printk函数的具体用法?C++ os_printk怎么用?C++ os_printk使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了os_printk函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_bd

/**
 * get_bd - get a null bd
 * @args - arg1: dir, arg2: ep number
 */
PBD get_bd(USB_DIR dir, DEV_UINT32 num)
{
	PBD ptr;

	if (dir == USB_RX) {
		ptr = (PBD) Rx_bd_List[num].pNext;

		os_printk(K_DEBUG, "%s Rx_bd_List[%d].pNext=%p\n", __func__, num,
			  (Rx_bd_List[num].pNext));

		if ((Rx_bd_List[num].pNext + 1) < Rx_bd_List[num].pEnd)
			Rx_bd_List[num].pNext++;
		else
			Rx_bd_List[num].pNext = Rx_bd_List[num].pStart;

	} else {
		ptr = (PBD) Tx_bd_List[num].pNext;

		os_printk(K_DEBUG, "%s Tx_gpd_List[%d].pNext=%p\n", __func__, num,
			  (Tx_bd_List[num].pNext));

		Tx_bd_List[num].pNext++;
		Tx_bd_List[num].pNext = Tx_bd_List[num].pNext + AT_BD_EXT_LEN;

		if (Tx_bd_List[num].pNext >= Tx_bd_List[num].pEnd) {
			Tx_bd_List[num].pNext = Tx_bd_List[num].pStart;
		}
	}
	return ptr;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:34,代码来源:mu3d_hal_qmu_drv.c

示例2: mu3d_hal_resume_qmu

/**
 * mu3d_hal_resume_qmu - resume qmu function
 * @args - arg1: ep number, arg2: dir
 */
void mu3d_hal_resume_qmu(DEV_INT32 q_num, USB_DIR dir)
{

#if defined(USB_RISC_CACHE_ENABLED)
	os_flushinvalidateDcache();
#endif

	if (dir == USB_TX) {
		os_writel(USB_QMU_TQCSR(q_num), QMU_Q_RESUME);
		if (!os_readl(USB_QMU_TQCSR(q_num))) {
			os_printk(K_DEBUG, "%s QMU_TQCSR[%d]=%x\n", __func__, q_num,
				  os_readl(USB_QMU_TQCSR(q_num)));
			os_writel(USB_QMU_TQCSR(q_num), QMU_Q_RESUME);
		}
	} else if (dir == USB_RX) {
		os_writel(USB_QMU_RQCSR(q_num), QMU_Q_RESUME);
		if (!os_readl(USB_QMU_RQCSR(q_num))) {
			os_printk(K_DEBUG, "%s QMU_RQCSR[%d]=%x\n", __func__, q_num,
				  os_readl(USB_QMU_RQCSR(q_num)));
			os_writel(USB_QMU_RQCSR(q_num), QMU_Q_RESUME);
		}
	} else {
		os_printk(K_INFO, "%s wrong direction!!!\n", __func__);
		BUG_ON(1);
	}
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:30,代码来源:mu3d_hal_qmu_drv.c

示例3: mt_usb_disconnect

void mt_usb_disconnect(void)
{
	os_printk(K_DEBUG,"%s\n", __func__);

	musb_stop(mu3d_musb);

	os_printk(K_DEBUG,"%s-\n", __func__);
}
开发者ID:Scorpio92,项目名称:mediatek,代码行数:8,代码来源:mt_usb.c

示例4: mt_usb_connect

void mt_usb_connect(void)
{
	os_printk(K_DEBUG,"%s+\n", __func__);

	musb_start(mu3d_musb);

	os_printk(K_DEBUG,"%s-\n", __func__);
}
开发者ID:Scorpio92,项目名称:mediatek,代码行数:8,代码来源:mt_usb.c

示例5: print_key

/*
 * print out a key in hex
 */
static void print_key(const char *tag, uint8_t *key, int bits)
{
	int bytes = (bits + 7) / 8;

	di_info("%s", tag);
	while (bytes--)
		os_printk("%02x", *key++);
	os_printk("\n");
}
开发者ID:traveller42,项目名称:linux-2.6.28.mx233-falconwing,代码行数:12,代码来源:dryice.c

示例6: dump

static void dump(const char *name, const uint8_t * data, unsigned int len)
{
	os_printk("%s: ", name);
	while (len > 0) {
		os_printk("%02x ", (unsigned)*data++);
		len--;
	}
	os_printk("\n");
}
开发者ID:AvalueAES,项目名称:rev-sa01,代码行数:9,代码来源:fsl_shw_wrap.c

示例7: mtu3d_u2_common_intr_handler

static inline void mtu3d_u2_common_intr_handler(u32 dwIntrUsbValue)
{
	if (dwIntrUsbValue & DISCONN_INTR) {
		mu3d_hal_pdn_ip_port(1, 0, 1, 1);

		os_printk(K_NOTICE, "[U2 DISCONN_INTR] Set SOFT_CONN=0\n");
		os_clrmsk(U3D_POWER_MANAGEMENT, SOFT_CONN);

		/*TODO-J: ADD musb_g_disconnect(musb);??*/
	}

	if (dwIntrUsbValue & LPM_INTR) 	{
		u32 rmwake ;
		rmwake = os_readl(U3D_POWER_MANAGEMENT);

		os_printk(K_NOTICE, "[U2 LPM interrupt] last rmwake is 0x%x\n", rmwake & LPM_RWP);

		if (!((os_readl(U3D_POWER_MANAGEMENT) & LPM_HRWE))) {
			mu3d_hal_pdn_ip_port(0, 0, 0, 1);
		}

#ifdef CONFIG_USBIF_COMPLIANCE
		// SW word around for USBIF test with Fresco FL1100 with LPM L1C enabling
		#if 0
		if (rmwake & LPM_RWP){
			os_writel(U3D_USB20_MISC_CONTROL, os_readl(U3D_USB20_MISC_CONTROL) | LPM_U3_ACK_EN);
			os_writel(U3D_POWER_MANAGEMENT, os_readl(U3D_POWER_MANAGEMENT) | RESUME);
		}
		#endif
#endif		
	}

	if (dwIntrUsbValue & LPM_RESUME_INTR) {
		if (!(os_readl(U3D_POWER_MANAGEMENT) & LPM_HRWE)) {
			mu3d_hal_pdn_ip_port(1, 0, 0, 1);

			os_writel(U3D_USB20_MISC_CONTROL, os_readl(U3D_USB20_MISC_CONTROL) | LPM_U3_ACK_EN);
		}
	}

	if(dwIntrUsbValue & SUSPEND_INTR) {
		os_printk(K_NOTICE, "[U2 SUSPEND_INTR]\n");
		mu3d_hal_pdn_ip_port(0, 0, 0, 1);
	}

	if (dwIntrUsbValue & RESUME_INTR) {
		os_printk(K_NOTICE,"[U2 RESUME_INTR]\n");
		mu3d_hal_pdn_ip_port(1, 0, 0, 1);
	}

	if (dwIntrUsbValue & RESET_INTR) {
		os_printk(K_NOTICE,"[U2 RESET_INTR]\n");
	}

}
开发者ID:Scorpio92,项目名称:mediatek,代码行数:55,代码来源:musb_init.c

示例8: init_gpd_list

/**
 * init_gpd_list - initialize gpd management list
 * @args - arg1: dir, arg2: ep number, arg3: gpd virtual addr, arg4: gpd ioremap addr, arg5: gpd number
 */
void init_gpd_list(USB_DIR dir, int num, PGPD ptr, PGPD io_ptr, DEV_UINT32 size)
{
	if (dir == USB_RX) {
		Rx_gpd_List[num].pStart = ptr;
		Rx_gpd_List[num].pEnd = (PGPD) (ptr + size);
		Rx_gpd_Offset[num] = (DEV_UINT32) ptr - (DEV_UINT32) io_ptr;	/* (DEV_UINT32)os_virt_to_phys(ptr); */
		ptr++;
		Rx_gpd_List[num].pNext = ptr;
		os_printk(K_DEBUG, "Rx_gpd_List[%d].pStart=%p, pNext=%p, pEnd=%p\n",
			  num, Rx_gpd_List[num].pStart, Rx_gpd_List[num].pNext,
			  Rx_gpd_List[num].pEnd);
		os_printk(K_DEBUG, "Rx_gpd_Offset[%d]=0x%08X\n", num, Rx_gpd_Offset[num]);
		os_printk(K_DEBUG, "virtual start=%p, end=%p\n", ptr, ptr + size);
		os_printk(K_DEBUG, "dma addr start=%p, end=%p\n", io_ptr, io_ptr + size);
	} else {
		Tx_gpd_List[num].pStart = ptr;
		Tx_gpd_List[num].pEnd = (PGPD) ((DEV_UINT8 *) (ptr + size) + AT_GPD_EXT_LEN * size);
		Tx_gpd_Offset[num] = (DEV_UINT32) ptr - (DEV_UINT32) io_ptr;	/* (DEV_UINT32)os_virt_to_phys(ptr); */
		ptr++;
		Tx_gpd_List[num].pNext = (PGPD) ((DEV_UINT8 *) ptr + AT_GPD_EXT_LEN);
		os_printk(K_DEBUG, "Tx_gpd_List[%d].pStart=%p, pNext=%p, pEnd=%p\n",
			  num, Tx_gpd_List[num].pStart, Tx_gpd_List[num].pNext,
			  Tx_gpd_List[num].pEnd);
		os_printk(K_DEBUG, "Tx_gpd_Offset[%d]=0x%08X\n", num, Tx_gpd_Offset[num]);
		os_printk(K_DEBUG, "virtual start=%p, end=%p\n", ptr, ptr + size);
		os_printk(K_DEBUG, "dma addr start=%p, end=%p\n", io_ptr, io_ptr + size);
	}
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:32,代码来源:mu3d_hal_qmu_drv.c

示例9: mu3d_hal_init_qmu

/**
 * mu3d_hal_init_qmu - initialize qmu
 *
 */
void mu3d_hal_init_qmu(void)
{
	DEV_UINT32 i;
	DEV_UINT32 QCR = 0;

	/* Initialize QMU Tx/Rx start address. */
	for (i = 1; i <= MAX_QMU_EP; i++) {
		os_printk(K_DEBUG, "==EP[%d]==Start addr RXQ=0x%08x, TXQ=0x%08x\n", i,
			  mu3d_hal_gpd_virt_to_phys(Rx_gpd_head[i], USB_RX, i),
			  mu3d_hal_gpd_virt_to_phys(Tx_gpd_head[i], USB_TX, i));
		QCR |= QMU_RX_EN(i);
		QCR |= QMU_TX_EN(i);
		os_writel(USB_QMU_RQSAR(i), mu3d_hal_gpd_virt_to_phys(Rx_gpd_head[i], USB_RX, i));
		os_writel(USB_QMU_TQSAR(i), mu3d_hal_gpd_virt_to_phys(Tx_gpd_head[i], USB_TX, i));
		Tx_gpd_end[i] = Tx_gpd_last[i] = Tx_gpd_head[i];
		Rx_gpd_end[i] = Rx_gpd_last[i] = Rx_gpd_head[i];
		gpd_ptr_align(USB_TX, i, Tx_gpd_end[i]);
		gpd_ptr_align(USB_RX, i, Rx_gpd_end[i]);
	}
	/* Enable QMU Tx/Rx. */
	os_writel(U3D_QGCSR, QCR);
	os_writel(U3D_QIESR0, QCR);
	/* Enable QMU interrupt. */
	os_writel(U3D_QIESR1,
		  TXQ_EMPTY_IESR | TXQ_CSERR_IESR | TXQ_LENERR_IESR | RXQ_EMPTY_IESR |
		  RXQ_CSERR_IESR | RXQ_LENERR_IESR | RXQ_ZLPERR_IESR);
	os_writel(U3D_EPIESR, EP0ISR);
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:32,代码来源:mu3d_hal_qmu_drv.c

示例10: hpt_attach

static int hpt_attach(device_t dev)
{
	PHBA hba = (PHBA)device_get_softc(dev);
	HIM *him = hba->ldm_adapter.him;
	PCI_ID pci_id;
	HPT_UINT size;
	PVBUS vbus;
	PVBUS_EXT vbus_ext;

	KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)));

	pci_enable_busmaster(dev);

	pci_id.vid = pci_get_vendor(dev);
	pci_id.did = pci_get_device(dev);
	pci_id.rev = pci_get_revid(dev);
	pci_id.subsys = (HPT_U32)(pci_get_subdevice(dev)) << 16 | pci_get_subvendor(dev);

	size = him->get_adapter_size(&pci_id);
	hba->ldm_adapter.him_handle = kmalloc(size, M_DEVBUF, M_WAITOK);
	if (!hba->ldm_adapter.him_handle)
		return ENXIO;

	hba->pcidev = dev;
	hba->pciaddr.tree = 0;
	hba->pciaddr.bus = pci_get_bus(dev);
	hba->pciaddr.device = pci_get_slot(dev);
	hba->pciaddr.function = pci_get_function(dev);

	if (!him->create_adapter(&pci_id, hba->pciaddr, hba->ldm_adapter.him_handle, hba)) {
		kfree(hba->ldm_adapter.him_handle, M_DEVBUF);
		return -1;
	}

	os_printk("adapter at PCI %d:%d:%d, IRQ %d",
		hba->pciaddr.bus, hba->pciaddr.device, hba->pciaddr.function, pci_get_irq(dev));

	if (!ldm_register_adapter(&hba->ldm_adapter)) {
		size = ldm_get_vbus_size();
		vbus_ext = kmalloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK);
		if (!vbus_ext) {
			kfree(hba->ldm_adapter.him_handle, M_DEVBUF);
			return -1;
		}
		memset(vbus_ext, 0, sizeof(VBUS_EXT));
		vbus_ext->ext_type = EXT_TYPE_VBUS;
		ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext);
		ldm_register_adapter(&hba->ldm_adapter);
	}

	ldm_for_each_vbus(vbus, vbus_ext) {
		if (hba->ldm_adapter.vbus==vbus) {
			hba->vbus_ext = vbus_ext;
			hba->next = vbus_ext->hba_list;
			vbus_ext->hba_list = hba;
			break;
		}
	}
	return 0;
}
开发者ID:varialus,项目名称:DragonFlyX,代码行数:60,代码来源:osm_bsd.c

示例11: setup_user_driver_interaction

/**
 * Register the driver with the kernel.
 *
 * Call @c register_chrdev() to set this driver up as being
 * responsible for the SCC.  Save the major number for the driver
 * in scc2_test_major_node.
 *
 * Called from #scc2_test_init()
 *
 * @return 0 on success, -errno on failure.
 */
static os_error_code
setup_user_driver_interaction(void)
{
    os_error_code code = OS_ERROR_OK_S;

    os_driver_init_registration(reg_handle);
    os_driver_add_registration(reg_handle, OS_FN_OPEN,
                               OS_DEV_OPEN_REF(scc2_test_open));
    os_driver_add_registration(reg_handle, OS_FN_IOCTL,
                               OS_DEV_IOCTL_REF(scc2_test_ioctl));
    os_driver_add_registration(reg_handle, OS_FN_CLOSE,
                               OS_DEV_CLOSE_REF(scc2_test_release));
    code = os_driver_complete_registration(reg_handle, scc2_test_major_node,
                                               SCC2_TEST_DRIVER_NAME);

    if (code != OS_ERROR_OK_S) {
        /* failure ! */
        os_printk("SCC2 TEST Driver: register device driver failed: %d\n",
                  code);

        return code;
    }

    /* Save the major node value */
    if (scc2_test_major_node == 0) {
        /* We passed in a zero value, then one was assigned to us.  */
        scc2_test_major_node = code;
    }

    pr_debug("SCC2 TEST Driver:  Major node is %d\n", scc2_test_major_node);

    return code;
}
开发者ID:wanghao-xznu,项目名称:vte,代码行数:44,代码来源:scc2_test_driver.c

示例12: rng_sec_failure

/*!
 * Function to handle "Security Alarm" indication from SCC.
 *
 * This function is registered with the Security Monitor ans the callback
 * function for the RNG driver.  Upon alarm, it will shut down the driver so
 * that no more random data can be retrieved.
 *
 * @return void
 */
static void rng_sec_failure(void)
{
	os_printk(KERN_ALERT "RNG Driver: Security Failure Alarm received.\n");

	rng_cleanup();

	return;
}
开发者ID:despierto,项目名称:imx_233_linux,代码行数:17,代码来源:rng_driver.c

示例13: mt_usb_show_cmode

/*--FOR INSTANT POWER ON USAGE--------------------------------------------------*/
static ssize_t mt_usb_show_cmode(struct device* dev, struct device_attribute *attr, char *buf)
{
	if (!dev) {
		os_printk(K_DEBUG,"dev is null!!\n");
		return 0;
	}
	return scnprintf(buf, PAGE_SIZE, "%d\n", cable_mode);
}
开发者ID:Scorpio92,项目名称:mediatek,代码行数:9,代码来源:mt_usb.c

示例14: usb_cable_connected

bool usb_cable_connected(void)
{
#ifdef CONFIG_POWER_EXT
	CHARGER_TYPE chg_type = mt_charger_type_detection();
	os_printk(K_INFO, "%s ext-chrdet=%d type=%d\n", __func__, upmu_get_rgs_chrdet(), chg_type);
	if (upmu_get_rgs_chrdet() && (chg_type == STANDARD_HOST))
#else
	os_printk(K_INFO, "%s chrdet=%d\n", __func__, upmu_is_chr_det());
	if (upmu_is_chr_det())
#endif
	{
		return true;
	} else {
		return false;
	}
	return true;
}
开发者ID:Sector1369,项目名称:acer_v370_kk,代码行数:17,代码来源:mt_usb.c

示例15: musb_cmode_show

ssize_t musb_cmode_show(struct device* dev, struct device_attribute *attr, char *buf)
{
	if (!dev) {
		os_printk(K_ERR, "dev is null!!\n");
		return 0;
	}
	return sprintf(buf, "%s\n", usb_mode_str[cable_mode]);
}
开发者ID:Sector1369,项目名称:acer_v370_kk,代码行数:8,代码来源:mt_usb.c


注:本文中的os_printk函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。