ia64/xen-unstable

changeset 9036:e480a5db8abb

Fix non-xen build for: Make the fixmap area moveable in kernel address space.

From: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Feb 27 10:34:03 2006 +0000 (2006-02-27)
parents bf594e88f046
children bf1dc22ca24c f1e5b29dd15a
files linux-2.6-xen-sparse/arch/i386/mm/pgtable.c linux-2.6-xen-sparse/include/asm-i386/fixmap.h linux-2.6-xen-sparse/include/asm-i386/page.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/pgtable.c	Mon Feb 27 10:31:30 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/pgtable.c	Mon Feb 27 10:34:03 2006 +0000
     1.3 @@ -13,6 +13,7 @@
     1.4  #include <linux/slab.h>
     1.5  #include <linux/pagemap.h>
     1.6  #include <linux/spinlock.h>
     1.7 +#include <linux/module.h>
     1.8  
     1.9  #include <asm/system.h>
    1.10  #include <asm/pgtable.h>
    1.11 @@ -138,6 +139,10 @@ void set_pmd_pfn(unsigned long vaddr, un
    1.12  	__flush_tlb_one(vaddr);
    1.13  }
    1.14  
    1.15 +static int nr_fixmaps = 0;
    1.16 +unsigned long __FIXADDR_TOP = 0xfffff000;
    1.17 +EXPORT_SYMBOL(__FIXADDR_TOP);
    1.18 +
    1.19  void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
    1.20  {
    1.21  	unsigned long address = __fix_to_virt(idx);
    1.22 @@ -147,6 +152,13 @@ void __set_fixmap (enum fixed_addresses 
    1.23  		return;
    1.24  	}
    1.25  	set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
    1.26 +	nr_fixmaps++;
    1.27 +}
    1.28 +
    1.29 +void set_fixaddr_top(unsigned long top)
    1.30 +{
    1.31 +	BUG_ON(nr_fixmaps > 0);
    1.32 +	__FIXADDR_TOP = top - PAGE_SIZE;
    1.33  }
    1.34  
    1.35  pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
     2.1 --- a/linux-2.6-xen-sparse/include/asm-i386/fixmap.h	Mon Feb 27 10:31:30 2006 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/fixmap.h	Mon Feb 27 10:34:03 2006 +0000
     2.3 @@ -20,7 +20,7 @@
     2.4   * Leave one empty page between vmalloc'ed areas and
     2.5   * the start of the fixmap.
     2.6   */
     2.7 -#define __FIXADDR_TOP	0xfffff000
     2.8 +extern unsigned long __FIXADDR_TOP;
     2.9  
    2.10  #ifndef __ASSEMBLY__
    2.11  #include <linux/kernel.h>
    2.12 @@ -94,6 +94,8 @@ enum fixed_addresses {
    2.13  extern void __set_fixmap (enum fixed_addresses idx,
    2.14  					unsigned long phys, pgprot_t flags);
    2.15  
    2.16 +extern void set_fixaddr_top(unsigned long top);
    2.17 +
    2.18  #define set_fixmap(idx, phys) \
    2.19  		__set_fixmap(idx, phys, PAGE_KERNEL)
    2.20  /*
     3.1 --- a/linux-2.6-xen-sparse/include/asm-i386/page.h	Mon Feb 27 10:31:30 2006 +0000
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/page.h	Mon Feb 27 10:34:03 2006 +0000
     3.3 @@ -121,7 +121,7 @@ extern int page_is_ram(unsigned long pag
     3.4  
     3.5  #define PAGE_OFFSET		((unsigned long)__PAGE_OFFSET)
     3.6  #define VMALLOC_RESERVE		((unsigned long)__VMALLOC_RESERVE)
     3.7 -#define MAXMEM			(-__PAGE_OFFSET-__VMALLOC_RESERVE)
     3.8 +#define MAXMEM			(__FIXADDR_TOP-__PAGE_OFFSET-__VMALLOC_RESERVE)
     3.9  #define __pa(x)			((unsigned long)(x)-PAGE_OFFSET)
    3.10  #define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))
    3.11  #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)