aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/cma.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/cma.c b/mm/cma.c
index 103a6663b7c7..488e50810ed1 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -141,13 +141,13 @@ core_initcall(cma_init_reserved_areas);
141 141
142/** 142/**
143 * cma_declare_contiguous() - reserve custom contiguous area 143 * cma_declare_contiguous() - reserve custom contiguous area
144 * @size: Size of the reserved area (in bytes),
145 * @base: Base address of the reserved area optional, use 0 for any 144 * @base: Base address of the reserved area optional, use 0 for any
145 * @size: Size of the reserved area (in bytes),
146 * @limit: End address of the reserved memory (optional, 0 for any). 146 * @limit: End address of the reserved memory (optional, 0 for any).
147 * @alignment: Alignment for the CMA area, should be power of 2 or zero 147 * @alignment: Alignment for the CMA area, should be power of 2 or zero
148 * @order_per_bit: Order of pages represented by one bit on bitmap. 148 * @order_per_bit: Order of pages represented by one bit on bitmap.
149 * @res_cma: Pointer to store the created cma region.
150 * @fixed: hint about where to place the reserved area 149 * @fixed: hint about where to place the reserved area
150 * @res_cma: Pointer to store the created cma region.
151 * 151 *
152 * This function reserves memory from early allocator. It should be 152 * This function reserves memory from early allocator. It should be
153 * called by arch specific code once the early allocator (memblock or bootmem) 153 * called by arch specific code once the early allocator (memblock or bootmem)
@@ -157,12 +157,12 @@ core_initcall(cma_init_reserved_areas);
157 * If @fixed is true, reserve contiguous area at exactly @base. If false, 157 * If @fixed is true, reserve contiguous area at exactly @base. If false,
158 * reserve in range from @base to @limit. 158 * reserve in range from @base to @limit.
159 */ 159 */
160int __init cma_declare_contiguous(phys_addr_t size, 160int __init cma_declare_contiguous(phys_addr_t base,
161 phys_addr_t base, phys_addr_t limit, 161 phys_addr_t size, phys_addr_t limit,
162 phys_addr_t alignment, unsigned int order_per_bit, 162 phys_addr_t alignment, unsigned int order_per_bit,
163 struct cma **res_cma, bool fixed) 163 bool fixed, struct cma **res_cma)
164{ 164{
165 struct cma *cma = &cma_areas[cma_area_count]; 165 struct cma *cma;
166 int ret = 0; 166 int ret = 0;
167 167
168 pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n", 168 pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n",
@@ -218,6 +218,7 @@ int __init cma_declare_contiguous(phys_addr_t size,
218 * Each reserved area must be initialised later, when more kernel 218 * Each reserved area must be initialised later, when more kernel
219 * subsystems (like slab allocator) are available. 219 * subsystems (like slab allocator) are available.
220 */ 220 */
221 cma = &cma_areas[cma_area_count];
221 cma->base_pfn = PFN_DOWN(base); 222 cma->base_pfn = PFN_DOWN(base);
222 cma->count = size >> PAGE_SHIFT; 223 cma->count = size >> PAGE_SHIFT;
223 cma->order_per_bit = order_per_bit; 224 cma->order_per_bit = order_per_bit;