summaryrefslogtreecommitdiff
path: root/linux/dev/glue/kmem.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-04 10:27:44 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-04 10:27:44 +0100
commitba1b3afd50913473f3036a63b4a82d7ba5c42009 (patch)
tree9dff0ddec4bf8b927a025b4bf9882cb1731170f3 /linux/dev/glue/kmem.c
parentbfdb3be16e5a20eebc97b3ca613d9a4da4465533 (diff)
parent51e87d005139a435cd846ac5c224eed5042c4fa0 (diff)
Merge branch 'master' into master-gdb_stubs
Diffstat (limited to 'linux/dev/glue/kmem.c')
-rw-r--r--linux/dev/glue/kmem.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/linux/dev/glue/kmem.c b/linux/dev/glue/kmem.c
index 8c21ce7d..28321711 100644
--- a/linux/dev/glue/kmem.c
+++ b/linux/dev/glue/kmem.c
@@ -29,6 +29,7 @@
#include <kern/assert.h>
#include <kern/kalloc.h>
+#include <kern/printf.h>
#include <vm/vm_page.h>
#include <vm/vm_kern.h>
@@ -40,14 +41,13 @@
#include <asm/system.h>
-extern void *alloc_contig_mem (unsigned, unsigned, unsigned, vm_page_t *);
-extern int printf (const char *, ...);
+#include <linux/dev/glue/glue.h>
/* Amount of memory to reserve for Linux memory allocator.
We reserve 64K chunks to stay within DMA limits.
Increase MEM_CHUNKS if the kernel is running out of memory. */
#define MEM_CHUNK_SIZE (64 * 1024)
-#define MEM_CHUNKS 7
+#define MEM_CHUNKS 32
#define MEM_DMA_LIMIT (16 * 1024 * 1024)
/* Mininum amount that linux_kmalloc will allocate. */
@@ -218,7 +218,7 @@ void *
linux_kmalloc (unsigned int size, int priority)
{
int order, coalesced = 0;
- unsigned flags;
+ unsigned long flags;
struct pagehdr *ph;
struct blkhdr *bh, *new_bh;
@@ -310,7 +310,7 @@ again:
void
linux_kfree (void *p)
{
- unsigned flags;
+ unsigned long flags;
struct blkhdr *bh;
struct pagehdr *ph;
@@ -385,7 +385,8 @@ unsigned long
__get_free_pages (int priority, unsigned long order, int dma)
{
int i, pages_collected = 0;
- unsigned flags, bits, off, j, len;
+ unsigned bits, off, j, len;
+ unsigned long flags;
assert ((PAGE_SIZE << order) <= MEM_CHUNK_SIZE);
@@ -444,7 +445,8 @@ void
free_pages (unsigned long addr, unsigned long order)
{
int i;
- unsigned flags, bits, len, j;
+ unsigned bits, len, j;
+ unsigned long flags;
assert ((addr & PAGE_MASK) == 0);
@@ -554,7 +556,7 @@ vfree (void *addr)
if (!p)
panic ("vmalloc_list_lookup failure");
- kmem_free (kernel_map, addr, p->size);
+ kmem_free (kernel_map, (vm_offset_t) addr, p->size);
vmalloc_list_remove (p);
}