diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-07-03 01:24:53 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-07-31 16:16:45 +0200 |
commit | 6d457cc14e57816aedcb8a7e7ea04b0dbeec0ec6 (patch) | |
tree | 8d4e02f7256890d04dfbb13fd4846b19bf0d56f7 /linux/dev | |
parent | 38a058ad3e5b0ff21fa6d12ce9d29af70a0db826 (diff) |
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.
Diffstat (limited to 'linux/dev')
-rw-r--r-- | linux/dev/glue/kmem.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |