Function report |
Source Code:kernel\dma\direct.c |
Create Date:2022-07-28 10:33:05 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__dma_direct_alloc_pages
Proto:struct page *__dma_direct_alloc_pages(struct device *dev, size_t size, gfp_t gfp, unsigned long attrs)
Type:struct page
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct device * | dev | |
| size_t | size | |
| gfp_t | gfp | |
| unsigned long | attrs |
| 94 | node = dev_to_node(dev) |
| 102 | gfp &= ~__GFP_ZERO |
| 103 | gfp |= __dma_direct_optimal_gfp_mask(dev, Like dma_mask, but for alloc_coherent mappings as not all hardware supports 64 bit addresses for consistent allocations such descriptors. , & phys_limit) |
| 106 | If page && Not dma_coherent_ok(dev, Change "struct page" to physical address.(page), size) Then |
| 107 | dma_free_contiguous(dev, page, alloc_size) |
| 108 | page = NULL |
| 110 | again : |
| 111 | If Not page Then page = Allocate pages, preferring the node given as nid. When nid == NUMA_NO_NODE,* prefer the current CPU's closest node. Otherwise node must be valid and* online. |
| 113 | If page && Not dma_coherent_ok(dev, Change "struct page" to physical address.(page), size) Then |
| 114 | dma_free_contiguous(dev, page, size) |
| 115 | page = NULL |
| 117 | If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_ZONE_DMA32) && phys_limit < DMA_BIT_MASK(64) && Not (gfp & (GFP_DMA32 | GFP_DMA)) Then |
| 130 | Return page |
| Name | Describe |
|---|---|
| dma_direct_alloc_pages |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |