ia64/linux-2.6.18-xen.hg

changeset 20:cb5094f46707

Imported patch fixaddr-top.patch from xen-unstable.hg 15200:bd3d6b4c52ec
author Ian Campbell <ian.campbell@xensource.com>
date Mon Jun 04 10:05:24 2007 +0100 (2007-06-04)
parents 3bf38ecef900
children 139f7610ddf6
files arch/i386/mm/pgtable.c include/asm-i386/fixmap.h include/asm-i386/page.h
line diff
     1.1 --- a/arch/i386/mm/pgtable.c	Mon Jun 04 10:05:24 2007 +0100
     1.2 +++ b/arch/i386/mm/pgtable.c	Mon Jun 04 10:05:24 2007 +0100
     1.3 @@ -12,6 +12,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 @@ -137,6 +138,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 @@ -146,6 +151,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/include/asm-i386/fixmap.h	Mon Jun 04 10:05:24 2007 +0100
     2.2 +++ b/include/asm-i386/fixmap.h	Mon Jun 04 10:05:24 2007 +0100
     2.3 @@ -19,7 +19,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/include/asm-i386/page.h	Mon Jun 04 10:05:24 2007 +0100
     3.2 +++ b/include/asm-i386/page.h	Mon Jun 04 10:05:24 2007 +0100
     3.3 @@ -122,7 +122,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)