From 6d457cc14e57816aedcb8a7e7ea04b0dbeec0ec6 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 3 Jul 2010 01:24:53 +0200 Subject: Put a name on the 16MiB magic number * linux/dev/glue/kmem.c (MEM_DMA_LIMIT): New macro (linux_kmem_init): Replace 16 * 1024 * 1024 occurrences with MEM_DMA_LIMIT. --- linux/dev/glue/kmem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'linux/dev/glue') diff --git a/linux/dev/glue/kmem.c b/linux/dev/glue/kmem.c index 908d086..8c21ce7 100644 --- a/linux/dev/glue/kmem.c +++ b/linux/dev/glue/kmem.c @@ -48,6 +48,7 @@ extern int printf (const char *, ...); Increase MEM_CHUNKS if the kernel is running out of memory. */ #define MEM_CHUNK_SIZE (64 * 1024) #define MEM_CHUNKS 7 +#define MEM_DMA_LIMIT (16 * 1024 * 1024) /* Mininum amount that linux_kmalloc will allocate. */ #define MIN_ALLOC 12 @@ -100,7 +101,7 @@ linux_kmem_init () { /* Allocate memory. */ pages_free[i].start = (unsigned long) alloc_contig_mem (MEM_CHUNK_SIZE, - 16 * 1024 * 1024, + MEM_DMA_LIMIT, 0xffff, &pages); assert (pages_free[i].start); @@ -109,7 +110,7 @@ linux_kmem_init () /* Sanity check: ensure pages are contiguous and within DMA limits. */ for (p = pages, j = 0; j < MEM_CHUNK_SIZE - PAGE_SIZE; j += PAGE_SIZE) { - assert (p->phys_addr < 16 * 1024 * 1024); + assert (p->phys_addr < MEM_DMA_LIMIT); assert (p->phys_addr + PAGE_SIZE == ((vm_page_t) p->pageq.next)->phys_addr); -- cgit v1.2.3