diff options
| author | Russell King <rmk@arm.linux.org.uk> | 2003-08-13 19:21:40 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-08-13 19:21:40 -0700 |
| commit | 72d717bfd9a9e1170be2cf989ed322f85dcfe68f (patch) | |
| tree | 13efe78f581370956d86de84fc0dd0e101ee25d1 /mm/vmalloc.c | |
| parent | 0371b9a349b3c056ca61e30b41f09eab113d1684 (diff) | |
[PATCH] Make modules work on ARM
This patch allows modules to work for ARM, and is the one thing which
prevents the standard tree from building for any ARM machine.
After reviewing the /proc/kcore and kclist issues, I've decided that I'm
no longer prepared to even _think_ about supporting /proc/kcore on ARM -
it just gets too ugly, and adds too much code to make it worth the effort,
the time or the energy to implement a solution to that problem.
/proc/kcore should probably go away, but in the meantime this just allows
ARM to ignore the issues.
Diffstat (limited to 'mm/vmalloc.c')
| -rw-r--r-- | mm/vmalloc.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index d746a85391ff..5ddf2a7a0b8e 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -178,21 +178,11 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages) return err; } - -/** - * get_vm_area - reserve a contingous kernel virtual area - * - * @size: size of the area - * @flags: %VM_IOREMAP for I/O mappings or VM_ALLOC - * - * Search an area of @size in the kernel virtual mapping area, - * and reserved it for out purposes. Returns the area descriptor - * on success or %NULL on failure. - */ -struct vm_struct *get_vm_area(unsigned long size, unsigned long flags) +struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, + unsigned long start, unsigned long end) { struct vm_struct **p, *tmp, *area; - unsigned long addr = VMALLOC_START; + unsigned long addr = start; area = kmalloc(sizeof(*area), GFP_KERNEL); if (unlikely(!area)) @@ -209,12 +199,14 @@ struct vm_struct *get_vm_area(unsigned long size, unsigned long flags) write_lock(&vmlist_lock); for (p = &vmlist; (tmp = *p) ;p = &tmp->next) { + if ((unsigned long)tmp->addr < addr) + continue; if ((size + addr) < addr) goto out; if (size + addr <= (unsigned long)tmp->addr) goto found; addr = tmp->size + (unsigned long)tmp->addr; - if (addr > VMALLOC_END-size) + if (addr > end - size) goto out; } @@ -239,6 +231,21 @@ out: } /** + * get_vm_area - reserve a contingous kernel virtual area + * + * @size: size of the area + * @flags: %VM_IOREMAP for I/O mappings or VM_ALLOC + * + * Search an area of @size in the kernel virtual mapping area, + * and reserved it for out purposes. Returns the area descriptor + * on success or %NULL on failure. + */ +struct vm_struct *get_vm_area(unsigned long size, unsigned long flags) +{ + return __get_vm_area(size, flags, VMALLOC_START, VMALLOC_END); +} + +/** * remove_vm_area - find and remove a contingous kernel virtual area * * @addr: base address |
