mirror of
				https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
				synced 2025-10-31 18:53:24 +00:00 
			
		
		
		
	 5bc23d32d8
			
		
	
	
		5bc23d32d8
		
	
	
	
	
		
			
			The DMA coherent remap area is used to provide an uncached mapping of memory for coherency with DMA engines. Currently, we look for any free hole which our allocation will fit in with page alignment. However, this can lead to fragmentation of the area, and allows small allocations to cross L1 entry boundaries. This is undesirable as we want to move towards allocating sections of memory. Align allocations according to the size, limiting the alignment between the page and section sizes. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
		
			
				
	
	
		
			30 lines
		
	
	
		
			730 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			730 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #ifndef VMREGION_H
 | |
| #define VMREGION_H
 | |
| 
 | |
| #include <linux/spinlock.h>
 | |
| #include <linux/list.h>
 | |
| 
 | |
| struct page;
 | |
| 
 | |
| struct arm_vmregion_head {
 | |
| 	spinlock_t		vm_lock;
 | |
| 	struct list_head	vm_list;
 | |
| 	unsigned long		vm_start;
 | |
| 	unsigned long		vm_end;
 | |
| };
 | |
| 
 | |
| struct arm_vmregion {
 | |
| 	struct list_head	vm_list;
 | |
| 	unsigned long		vm_start;
 | |
| 	unsigned long		vm_end;
 | |
| 	struct page		*vm_pages;
 | |
| 	int			vm_active;
 | |
| };
 | |
| 
 | |
| struct arm_vmregion *arm_vmregion_alloc(struct arm_vmregion_head *, size_t, size_t, gfp_t);
 | |
| struct arm_vmregion *arm_vmregion_find(struct arm_vmregion_head *, unsigned long);
 | |
| struct arm_vmregion *arm_vmregion_find_remove(struct arm_vmregion_head *, unsigned long);
 | |
| void arm_vmregion_free(struct arm_vmregion_head *, struct arm_vmregion *);
 | |
| 
 | |
| #endif
 |