• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ dma_pool_destroy函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ehci_mem_cleanup

static void ehci_mem_cleanup (struct ehci_hcd *ehci)
{
	if (ehci->async)
		qh_destroy(ehci, ehci->async);
	ehci->async = NULL;

	if (ehci->dummy)
		qh_destroy(ehci, ehci->dummy);
	ehci->dummy = NULL;

	/* DMA consistent memory and pools */
	dma_pool_destroy(ehci->qtd_pool);
	ehci->qtd_pool = NULL;
	dma_pool_destroy(ehci->qh_pool);
	ehci->qh_pool = NULL;
	dma_pool_destroy(ehci->itd_pool);
	ehci->itd_pool = NULL;
	dma_pool_destroy(ehci->sitd_pool);
	ehci->sitd_pool = NULL;

	if (ehci->periodic)
		dma_free_coherent(ehci_to_hcd(ehci)->self.sysdev,
			ehci->periodic_size * sizeof (u32),
			ehci->periodic, ehci->periodic_dma);
	ehci->periodic = NULL;

	/* shadow periodic table */
	kfree(ehci->pshadow);
	ehci->pshadow = NULL;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:30,代码来源:ehci-mem.c


示例2: dmabounce_unregister_dev

void dmabounce_unregister_dev(struct device *dev)
{
	struct dmabounce_device_info *device_info = dev->archdata.dmabounce;

	dev->archdata.dmabounce = NULL;

	if (!device_info) {
		dev_warn(dev,
			 "Never registered with dmabounce but attempting"
			 "to unregister!\n");
		return;
	}

	if (!list_empty(&device_info->safe_buffers)) {
		dev_err(dev,
			"Removing from dmabounce with pending buffers!\n");
		BUG();
	}

	if (device_info->small.pool)
		dma_pool_destroy(device_info->small.pool);
	if (device_info->large.pool)
		dma_pool_destroy(device_info->large.pool);

#ifdef STATS
	if (device_info->attr_res == 0)
		device_remove_file(dev, &dev_attr_dmabounce_stats);
#endif

	kfree(device_info);

	dev_info(dev, "dmabounce: device unregistered\n");
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:33,代码来源:dmabounce.c


示例3: ehci_mem_cleanup

static void ehci_mem_cleanup (struct ehci_hcd *ehci)
{
	free_cached_lists(ehci);
	if (ehci->async)
		qh_put (ehci->async);
	ehci->async = NULL;

	/* DMA consistent memory and pools */
	if (ehci->qtd_pool)
		dma_pool_destroy (ehci->qtd_pool);
	ehci->qtd_pool = NULL;

	if (ehci->qh_pool) {
		dma_pool_destroy (ehci->qh_pool);
		ehci->qh_pool = NULL;
	}

	if (ehci->itd_pool)
		dma_pool_destroy (ehci->itd_pool);
	ehci->itd_pool = NULL;

	if (ehci->sitd_pool)
		dma_pool_destroy (ehci->sitd_pool);
	ehci->sitd_pool = NULL;

	if (ehci->periodic)
		dma_free_coherent (ehci_to_hcd(ehci)->self.controller,
			ehci->periodic_size * sizeof (u32),
			ehci->periodic, ehci->periodic_dma);
	ehci->periodic = NULL;

	/* shadow periodic table */
	kfree(ehci->pshadow);
	ehci->pshadow = NULL;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:35,代码来源:ehci-mem.c


示例4: ohci_mem_cleanup

static void ohci_mem_cleanup (struct ohci_hcd *ohci)
{
	if (ohci->td_cache) {
		dma_pool_destroy (ohci->td_cache);
		ohci->td_cache = 0;
	}
	if (ohci->ed_cache) {
		dma_pool_destroy (ohci->ed_cache);
		ohci->ed_cache = 0;
	}
}
开发者ID:wxlong,项目名称:Test,代码行数:11,代码来源:ohci-mem.c


示例5: felica_rxbuf_init

/**
 * @brief  Initialize & alloc RX buffer
 * @details This function executes;\n
 *          # Create DMA pool\n
 *          # Alloc RX buffer\n
 *          # Call RX buffer clear
 * @param  N/A
 * @retval 0 : Success
 * @retval -ENOMEM : Error, no enough memory.
 * @note
 */
int felica_rxbuf_init(void)
{
	int i;

	pr_debug(PRT_NAME ": %s\n", __func__);

	rxbuf.dmapool = dma_pool_create(DMAPOOL_NAME, NULL, DMAPOOL_SIZE,
					DMAPOOL_ALIGN, DMAPOOL_ALIGN * RXBUF_N);
	if (!rxbuf.dmapool) {
		pr_err(PRT_NAME ": Error. Cannot create DMA pool for RXbuf.");
		return -ENOMEM;
	}
	for (i = 0; i < RXBUF_N; i++) {
		rxbuf.slot[i].buf = dma_pool_alloc(rxbuf.dmapool, GFP_KERNEL,
						&rxbuf.slot[i].dmabase);
		if (!rxbuf.slot[i].buf) {
			pr_err(PRT_NAME
			    ": Error. No enough mem for RXbuf.\n");
			goto err_alloc_rx_buf;
		}
	}

	felica_rxbuf_clear();

	return 0;

err_alloc_rx_buf:
	for (i--; i >= 0; i--) {
		dma_pool_free(rxbuf.dmapool, rxbuf.slot[i].buf,
					rxbuf.slot[i].dmabase);
	}
	dma_pool_destroy(rxbuf.dmapool);
	rxbuf.dmapool = NULL;
	return -ENOMEM;
}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:46,代码来源:felica_rxbuf.c


示例6: dmabounce_register_dev

int
dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
			unsigned long large_buffer_size)
{
	struct dmabounce_device_info *device_info;
	int ret;

	device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
	if (!device_info) {
		printk(KERN_ERR
			"Could not allocated dmabounce_device_info for %s",
			dev->bus_id);
		return -ENOMEM;
	}

	ret = dmabounce_init_pool(&device_info->small, dev,
				  "small_dmabounce_pool", small_buffer_size);
	if (ret) {
		dev_err(dev,
			"dmabounce: could not allocate DMA pool for %ld byte objects\n",
			small_buffer_size);
		goto err_free;
	}

	if (large_buffer_size) {
		ret = dmabounce_init_pool(&device_info->large, dev,
					  "large_dmabounce_pool",
					  large_buffer_size);
		if (ret) {
			dev_err(dev,
				"dmabounce: could not allocate DMA pool for %ld byte objects\n",
				large_buffer_size);
			goto err_destroy;
		}
	}

	device_info->dev = dev;
	INIT_LIST_HEAD(&device_info->safe_buffers);
	rwlock_init(&device_info->lock);

#ifdef STATS
	device_info->total_allocs = 0;
	device_info->map_op_count = 0;
	device_info->bounce_count = 0;
	device_info->attr_res = device_create_file(dev, &dev_attr_dmabounce_stats);
#endif

	dev->archdata.dmabounce = device_info;

	printk(KERN_INFO "dmabounce: registered device %s on %s bus\n",
		dev->bus_id, dev->bus->name);

	return 0;

 err_destroy:
	dma_pool_destroy(device_info->small.pool);
 err_free:
	kfree(device_info);
	return ret;
}
开发者ID:420GrayFox,项目名称:dsl-n55u-bender,代码行数:60,代码来源:dmabounce.c


示例7: whc_clean_up

void whc_clean_up(struct whc *whc)
{
	resource_size_t len;

	if (whc->di_buf)
		dma_free_coherent(&whc->umc->dev, sizeof(struct di_buf_entry) * whc->n_devices,
				  whc->di_buf, whc->di_buf_dma);
	if (whc->dn_buf)
		dma_free_coherent(&whc->umc->dev, sizeof(struct dn_buf_entry) * WHC_N_DN_ENTRIES,
				  whc->dn_buf, whc->dn_buf_dma);
	if (whc->gen_cmd_buf)
		dma_free_coherent(&whc->umc->dev, WHC_GEN_CMD_DATA_LEN,
				  whc->gen_cmd_buf, whc->gen_cmd_buf_dma);

	pzl_clean_up(whc);
	asl_clean_up(whc);

	dma_pool_destroy(whc->qset_pool);

	len   = resource_size(&whc->umc->resource);
	if (whc->base)
		iounmap(whc->base);
	if (whc->base_phys)
		release_mem_region(whc->base_phys, len);

	if (whc->workqueue)
		destroy_workqueue(whc->workqueue);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:28,代码来源:init.c


示例8: dmabounce_register_dev

int dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
		unsigned long large_buffer_size,
		int (*needs_bounce_fn)(struct device *, dma_addr_t, size_t))
{
	struct dmabounce_device_info *device_info;
	int ret;

	device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
	if (!device_info) {
		dev_err(dev,
			"Could not allocated dmabounce_device_info\n");
		return -ENOMEM;
	}

	ret = dmabounce_init_pool(&device_info->small, dev,
				  "small_dmabounce_pool", small_buffer_size);
	if (ret) {
		dev_err(dev,
			"dmabounce: could not allocate DMA pool for %ld byte objects\n",
			small_buffer_size);
		goto err_free;
	}

	if (large_buffer_size) {
		ret = dmabounce_init_pool(&device_info->large, dev,
					  "large_dmabounce_pool",
					  large_buffer_size);
		if (ret) {
			dev_err(dev,
				"dmabounce: could not allocate DMA pool for %ld byte objects\n",
				large_buffer_size);
			goto err_destroy;
		}
	}

	device_info->dev = dev;
	INIT_LIST_HEAD(&device_info->safe_buffers);
	rwlock_init(&device_info->lock);
	device_info->needs_bounce = needs_bounce_fn;

#ifdef STATS
	device_info->total_allocs = 0;
	device_info->map_op_count = 0;
	device_info->bounce_count = 0;
	device_info->attr_res = device_create_file(dev, &dev_attr_dmabounce_stats);
#endif

	dev->archdata.dmabounce = device_info;
	set_dma_ops(dev, &dmabounce_ops);

	dev_info(dev, "dmabounce: registered device\n");

	return 0;

 err_destroy:
	dma_pool_destroy(device_info->small.pool);
 err_free:
	kfree(device_info);
	return ret;
}
开发者ID:curbthepain,项目名称:android_kernel_us990_rev,代码行数:60,代码来源:dmabounce.c


示例9: my_init

static int __init my_init(void)
{

	/* dma_alloc_coherent method */

	printk(KERN_INFO "Loading DMA allocation test module\n");
	printk(KERN_INFO "\nTesting dma_alloc_coherent()..........\n\n");
	kbuf = dma_alloc_coherent(NULL, size, &handle, GFP_KERNEL);
	output(kbuf, handle, size, "This is the dma_alloc_coherent() string");
	dma_free_coherent(NULL, size, kbuf, handle);

	/* dma_map/unmap_single */

	printk(KERN_INFO "\nTesting dma_map_single()................\n\n");
	kbuf = kmalloc(size, GFP_KERNEL);
	handle = dma_map_single(NULL, kbuf, size, direction);
	output(kbuf, handle, size, "This is the dma_map_single() string");
	dma_unmap_single(NULL, handle, size, direction);
	kfree(kbuf);

	/* dma_pool method */

	printk(KERN_INFO "\nTesting dma_pool_alloc()..........\n\n");
	mypool = dma_pool_create("mypool", NULL, pool_size, pool_align, 0);
	kbuf = dma_pool_alloc(mypool, GFP_KERNEL, &handle);
	output(kbuf, handle, size, "This is the dma_pool_alloc() string");
	dma_pool_free(mypool, kbuf, handle);
	dma_pool_destroy(mypool);

	return 0;
}
开发者ID:YorkZ,项目名称:docs_utils,代码行数:31,代码来源:lab1_dma.c


示例10: destroy_hdlc_queues

static void destroy_hdlc_queues(struct port *port)
{
	int i;

	if (port->desc_tab) {
		for (i = 0; i < RX_DESCS; i++) {
			struct desc *desc = rx_desc_ptr(port, i);
			buffer_t *buff = port->rx_buff_tab[i];
			if (buff) {
				dma_unmap_single(&port->netdev->dev,
						 desc->data, RX_SIZE,
						 DMA_FROM_DEVICE);
				free_buffer(buff);
			}
		}
		for (i = 0; i < TX_DESCS; i++) {
			struct desc *desc = tx_desc_ptr(port, i);
			buffer_t *buff = port->tx_buff_tab[i];
			if (buff) {
				dma_unmap_tx(port, desc);
				free_buffer(buff);
			}
		}
		dma_pool_free(dma_pool, port->desc_tab, port->desc_tab_phys);
		port->desc_tab = NULL;
	}

	if (!ports_open && dma_pool) {
		dma_pool_destroy(dma_pool);
		dma_pool = NULL;
	}
}
开发者ID:mjduddin,项目名称:B14CKB1RD_kernel_m8,代码行数:32,代码来源:ixp4xx_hss.c


示例11: my_init

static int __init my_init(void)
{

        printk(KERN_INFO "Satish testing DMA module");

        printk(KERN_INFO "testing DMA coherent mapping dma_alloc_coherent()");
        kbuf = dma_alloc_coherent(NULL, size, &handle, GFP_KERNEL);
        output(kbuf, handle, size, "dma_alloc_coherent string");
        dma_free_coherent(NULL, size, kbuf, handle);


        printk(KERN_INFO "Testing DMA Mapping dma_map_page()");
        kbuf = kmalloc(size, GFP_KERNEL);
        handle = dma_map_single(NULL, size, &handle, GFP_KERNEL);
        output(kbuf, handle, size, "this is dma_map_single string");
        dma_unmap_single(NULL, handle, size, direction);
        kfree(kbuf);


        printk(KERN_INFO "Testing DMA Pool method");
        mypool = dma_pool_create("mypool", NULL, pool_size, pool_align, 0);
        kbuf = dma_pool_alloc(mypool, GFP_KERNEL, &handle);
        output(kbuf, handle, size, "This is dma_pool_alloc string");
        dma_pool_free(mypool, kbuf, handle);
        dma_pool_destroy(mypool);

        return 0;
}
开发者ID:Embedded-linux,项目名称:Linux-kernel-driver,代码行数:28,代码来源:dma-test1.c


示例12: ath10k_htt_tx_free

void ath10k_htt_tx_free(struct ath10k_htt *htt)
{
	ath10k_htt_tx_free_pending(htt);
	kfree(htt->pending_tx);
	kfree(htt->used_msdu_ids);
	dma_pool_destroy(htt->tx_pool);
}
开发者ID:383530895,项目名称:linux,代码行数:7,代码来源:htt_tx.c


示例13: destroy_crypto_dma_pool

static void destroy_crypto_dma_pool(struct nitrox_device *ndev)
{
	if (!ndev->ctx_pool)
		return;

	dma_pool_destroy(ndev->ctx_pool);
	ndev->ctx_pool = NULL;
}
开发者ID:CCNITSilchar,项目名称:linux,代码行数:8,代码来源:nitrox_lib.c


示例14: ath10k_htt_tx_detach

void ath10k_htt_tx_detach(struct ath10k_htt *htt)
{
	ath10k_htt_tx_cleanup_pending(htt);
	kfree(htt->pending_tx);
	kfree(htt->used_msdu_ids);
	dma_pool_destroy(htt->tx_pool);
	return;
}
开发者ID:7799,项目名称:linux,代码行数:8,代码来源:htt_tx.c


示例15: beiscsi_session_destroy

/**
 * beiscsi_session_destroy - destroys iscsi session
 * @cls_session:	pointer to iscsi cls session
 *
 * Destroys iSCSI session instance and releases
 * resources allocated for it.
 */
void beiscsi_session_destroy(struct iscsi_cls_session *cls_session)
{
	struct iscsi_session *sess = cls_session->dd_data;
	struct beiscsi_session *beiscsi_sess = sess->dd_data;

	printk(KERN_INFO "In beiscsi_session_destroy\n");
	dma_pool_destroy(beiscsi_sess->bhs_pool);
	iscsi_session_teardown(cls_session);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:16,代码来源:be_iscsi.c


示例16: ccp_destroy

static void ccp_destroy(struct ccp_device *ccp)
{
	struct ccp_cmd_queue *cmd_q;
	struct ccp_cmd *cmd;
	unsigned int qim, i;

	/* Unregister the DMA engine */
	ccp_dmaengine_unregister(ccp);

	/* Unregister the RNG */
	ccp_unregister_rng(ccp);

	/* Remove this device from the list of available units */
	ccp_del_device(ccp);

	/* Build queue interrupt mask (two interrupt masks per queue) */
	qim = 0;
	for (i = 0; i < ccp->cmd_q_count; i++) {
		cmd_q = &ccp->cmd_q[i];
		qim |= cmd_q->int_ok | cmd_q->int_err;
	}

	/* Disable and clear interrupts */
	iowrite32(0x00, ccp->io_regs + IRQ_MASK_REG);
	for (i = 0; i < ccp->cmd_q_count; i++) {
		cmd_q = &ccp->cmd_q[i];

		ioread32(cmd_q->reg_int_status);
		ioread32(cmd_q->reg_status);
	}
	iowrite32(qim, ccp->io_regs + IRQ_STATUS_REG);

	/* Stop the queue kthreads */
	for (i = 0; i < ccp->cmd_q_count; i++)
		if (ccp->cmd_q[i].kthread)
			kthread_stop(ccp->cmd_q[i].kthread);

	ccp->free_irq(ccp);

	for (i = 0; i < ccp->cmd_q_count; i++)
		dma_pool_destroy(ccp->cmd_q[i].dma_pool);

	/* Flush the cmd and backlog queue */
	while (!list_empty(&ccp->cmd)) {
		/* Invoke the callback directly with an error code */
		cmd = list_first_entry(&ccp->cmd, struct ccp_cmd, entry);
		list_del(&cmd->entry);
		cmd->callback(cmd->data, -ENODEV);
	}
	while (!list_empty(&ccp->backlog)) {
		/* Invoke the callback directly with an error code */
		cmd = list_first_entry(&ccp->backlog, struct ccp_cmd, entry);
		list_del(&cmd->entry);
		cmd->callback(cmd->data, -ENODEV);
	}
}
开发者ID:acton393,项目名称:linux,代码行数:56,代码来源:ccp-dev-v3.c


示例17: cc_buffer_mgr_fini

int cc_buffer_mgr_fini(struct cc_drvdata *drvdata)
{
	struct buff_mgr_handle *buff_mgr_handle = drvdata->buff_mgr_handle;

	if (buff_mgr_handle) {
		dma_pool_destroy(buff_mgr_handle->mlli_buffs_pool);
		kfree(drvdata->buff_mgr_handle);
		drvdata->buff_mgr_handle = NULL;
	}
	return 0;
}
开发者ID:Anjali05,项目名称:linux,代码行数:11,代码来源:cc_buffer_mgr.c


示例18: dma_controller_destroy

/*
 *  Destroy a previously-instantiated DMA controller.
 */
void dma_controller_destroy(struct dma_controller *c)
{
    struct cppi	*cppi;

    cppi = container_of(c, struct cppi, controller);

    /* assert:  caller stopped the controller first */
    dma_pool_destroy(cppi->pool);

    kfree(cppi);
}
开发者ID:artm1248,项目名称:linux,代码行数:14,代码来源:cppi_dma.c


示例19: hcd_buffer_destroy

/**
 * hcd_buffer_destroy - deallocate buffer pools
 * @hcd: the bus whose buffer pools are to be destroyed
 * Context: !in_interrupt()
 *
 * This frees the buffer pools created by hcd_buffer_create().
 */
void hcd_buffer_destroy(struct usb_hcd *hcd)
{
	int i;

	for (i = 0; i < HCD_BUFFER_POOLS; i++) {
		struct dma_pool *pool = hcd->pool[i];
		if (pool) {
			dma_pool_destroy(pool);
			hcd->pool[i] = NULL;
		}
	}
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:19,代码来源:buffer.c


示例20: ath10k_htt_tx_free

void ath10k_htt_tx_free(struct ath10k_htt *htt)
{

	idr_for_each(&htt->pending_tx, ath10k_htt_tx_clean_up_pending, htt->ar);
	idr_destroy(&htt->pending_tx);
	dma_pool_destroy(htt->tx_pool);

	if (htt->frag_desc.vaddr) {
		athp_descdma_free(htt->ar, &htt->frag_desc.dd);
	}
	mtx_destroy(&htt->tx_lock);
}
开发者ID:erikarn,项目名称:otus,代码行数:12,代码来源:if_athp_htt_tx.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dma_pool_free函数代码示例发布时间:2022-05-30
下一篇:
C++ dma_pool_create函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap