ia64/xen-unstable

view patches/linux-2.6.18/fixaddr-top.patch @ 14131:64d80037e524

Save elfnotes in VM sxpr under image/notes, and load them on restore.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
author kfraser@localhost.localdomain
date Mon Feb 26 09:59:56 2007 +0000 (2007-02-26)
parents 3adf00179a63
children
line source
1 diff -pruN ../orig-linux-2.6.18/arch/i386/mm/pgtable.c ./arch/i386/mm/pgtable.c
2 --- ../orig-linux-2.6.18/arch/i386/mm/pgtable.c 2006-09-20 04:42:06.000000000 +0100
3 +++ ./arch/i386/mm/pgtable.c 2007-01-17 17:19:36.000000000 +0000
4 @@ -12,6 +12,7 @@
5 #include <linux/slab.h>
6 #include <linux/pagemap.h>
7 #include <linux/spinlock.h>
8 +#include <linux/module.h>
10 #include <asm/system.h>
11 #include <asm/pgtable.h>
12 @@ -137,6 +138,10 @@ void set_pmd_pfn(unsigned long vaddr, un
13 __flush_tlb_one(vaddr);
14 }
16 +static int nr_fixmaps = 0;
17 +unsigned long __FIXADDR_TOP = 0xfffff000;
18 +EXPORT_SYMBOL(__FIXADDR_TOP);
19 +
20 void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
21 {
22 unsigned long address = __fix_to_virt(idx);
23 @@ -146,6 +151,13 @@ void __set_fixmap (enum fixed_addresses
24 return;
25 }
26 set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
27 + nr_fixmaps++;
28 +}
29 +
30 +void set_fixaddr_top(unsigned long top)
31 +{
32 + BUG_ON(nr_fixmaps > 0);
33 + __FIXADDR_TOP = top - PAGE_SIZE;
34 }
36 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
37 diff -pruN ../orig-linux-2.6.18/include/asm-i386/fixmap.h ./include/asm-i386/fixmap.h
38 --- ../orig-linux-2.6.18/include/asm-i386/fixmap.h 2006-09-20 04:42:06.000000000 +0100
39 +++ ./include/asm-i386/fixmap.h 2007-01-17 17:19:36.000000000 +0000
40 @@ -19,7 +19,7 @@
41 * Leave one empty page between vmalloc'ed areas and
42 * the start of the fixmap.
43 */
44 -#define __FIXADDR_TOP 0xfffff000
45 +extern unsigned long __FIXADDR_TOP;
47 #ifndef __ASSEMBLY__
48 #include <linux/kernel.h>
49 @@ -94,6 +94,8 @@ enum fixed_addresses {
50 extern void __set_fixmap (enum fixed_addresses idx,
51 unsigned long phys, pgprot_t flags);
53 +extern void set_fixaddr_top(unsigned long top);
54 +
55 #define set_fixmap(idx, phys) \
56 __set_fixmap(idx, phys, PAGE_KERNEL)
57 /*
58 diff -pruN ../orig-linux-2.6.18/include/asm-i386/page.h ./include/asm-i386/page.h
59 --- ../orig-linux-2.6.18/include/asm-i386/page.h 2006-09-20 04:42:06.000000000 +0100
60 +++ ./include/asm-i386/page.h 2007-01-17 17:19:36.000000000 +0000
61 @@ -122,7 +122,7 @@ extern int page_is_ram(unsigned long pag
63 #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
64 #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE)
65 -#define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE)
66 +#define MAXMEM (__FIXADDR_TOP-__PAGE_OFFSET-__VMALLOC_RESERVE)
67 #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
68 #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
69 #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)