Commit 72d717bf authored by Russell King's avatar Russell King Committed by Linus Torvalds

[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.
parent 0371b9a3
...@@ -178,21 +178,11 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages) ...@@ -178,21 +178,11 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
return err; return err;
} }
struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
/** unsigned long start, unsigned long end)
* 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 **p, *tmp, *area; struct vm_struct **p, *tmp, *area;
unsigned long addr = VMALLOC_START; unsigned long addr = start;
area = kmalloc(sizeof(*area), GFP_KERNEL); area = kmalloc(sizeof(*area), GFP_KERNEL);
if (unlikely(!area)) if (unlikely(!area))
...@@ -209,12 +199,14 @@ struct vm_struct *get_vm_area(unsigned long size, unsigned long flags) ...@@ -209,12 +199,14 @@ struct vm_struct *get_vm_area(unsigned long size, unsigned long flags)
write_lock(&vmlist_lock); write_lock(&vmlist_lock);
for (p = &vmlist; (tmp = *p) ;p = &tmp->next) { for (p = &vmlist; (tmp = *p) ;p = &tmp->next) {
if ((unsigned long)tmp->addr < addr)
continue;
if ((size + addr) < addr) if ((size + addr) < addr)
goto out; goto out;
if (size + addr <= (unsigned long)tmp->addr) if (size + addr <= (unsigned long)tmp->addr)
goto found; goto found;
addr = tmp->size + (unsigned long)tmp->addr; addr = tmp->size + (unsigned long)tmp->addr;
if (addr > VMALLOC_END-size) if (addr > end - size)
goto out; goto out;
} }
...@@ -238,6 +230,21 @@ struct vm_struct *get_vm_area(unsigned long size, unsigned long flags) ...@@ -238,6 +230,21 @@ struct vm_struct *get_vm_area(unsigned long size, unsigned long flags)
return NULL; return NULL;
} }
/**
* 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 * remove_vm_area - find and remove a contingous kernel virtual area
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment