--- linux-2.6.0/mm/memory.c.memFix 2004-01-03 13:39:37.000000000 +0100 +++ linux-2.6.0/mm/memory.c 2004-01-03 13:42:17.000000000 +0100 @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -680,6 +681,24 @@ } +static struct vm_area_struct fixmap_vma = { + /* Catch users - if there are any valid + ones, we can make this be "&init_mm" or + something. */ + .vm_mm = NULL, + .vm_page_prot = PAGE_READONLY, + .vm_flags = VM_READ | VM_EXEC, +}; + +static int init_fixmap_vma(void) +{ + fixmap_vma.vm_start = FIXADDR_USER_START; + fixmap_vma.vm_end = FIXADDR_USER_END; + return(0); +} + +__initcall(init_fixmap_vma); + int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, int len, int write, int force, struct page **pages, struct vm_area_struct **vmas) @@ -703,16 +722,6 @@ #ifdef FIXADDR_USER_START if (!vma && start >= FIXADDR_USER_START && start < FIXADDR_USER_END) { - static struct vm_area_struct fixmap_vma = { - /* Catch users - if there are any valid - ones, we can make this be "&init_mm" or - something. */ - .vm_mm = NULL, - .vm_start = FIXADDR_USER_START, - .vm_end = FIXADDR_USER_END, - .vm_page_prot = PAGE_READONLY, - .vm_flags = VM_READ | VM_EXEC, - }; unsigned long pg = start & PAGE_MASK; pgd_t *pgd; pmd_t *pmd;