Function report |
Source Code:mm\cma.c |
Create Date:2022-07-28 16:32:06 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:ma_alloc() - allocate pages from contiguous area*@cma: Contiguous memory region for which the allocation is performed
Proto:struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, bool no_warn)
Type:struct page
Parameter:
Type | Parameter | Name |
---|---|---|
struct cma * | cma | |
size_t | count | |
unsigned int | align | |
bool | no_warn |
419 | pfn = -1 |
420 | start = 0 |
432 | If Not count Then Return NULL |
435 | mask = cma_bitmap_aligned_mask(cma, align) |
436 | offset = Find the offset of the base PFN from the specified align_order.* The value returned is represented in order_per_bits. |
437 | bitmap_maxno = cma_bitmap_maxno(cma) |
438 | bitmap_count = cma_bitmap_pages_to_bits(cma, count) |
440 | If bitmap_count > bitmap_maxno Then Return NULL |
443 | cycle |
444 | mutex_lock( & lock) |
448 | If bitmap_no >= bitmap_maxno Then |
452 | bitmap_set(bitmap, bitmap_no, bitmap_count) |
460 | pfn = base_pfn + (bitmap_no << Order of pages represented by one bit ) |
461 | mutex_lock( & cma_mutex) |
465 | If ret == 0 Then |
466 | page = pfn_to_page(pfn) |
467 | Break |
470 | cma_clear_bitmap(cma, pfn, count) |
474 | pr_debug("%s(): memory range at %p is busy, retrying\n", __func__, pfn_to_page(pfn)) |
480 | trace_cma_alloc(pfn, page, count, align) |
487 | If page Then |
495 | cma_debug_show_areas(cma) |
499 | Return page |
Name | Describe |
---|---|
dma_alloc_contiguous | dma_alloc_contiguous() - allocate contiguous pages*@dev: Pointer to device for which the allocation is performed |
cma_alloc_mem | |
dma_alloc_from_contiguous | dma_alloc_from_contiguous() - allocate pages from contiguous area*@dev: Pointer to device for which the allocation is performed.*@count: Requested number of pages.*@align: Requested alignment of pages (in PAGE_SIZE order). |
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 |