source: trunk/packages/xen-3.1/xen-3.1/patches/linux-2.6.18/fixaddr-top.patch @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/x-patch
File size: 2.4 KB
  • arch/i386/mm/pgtable.c

    diff -pruN ../orig-linux-2.6.18/arch/i386/mm/pgtable.c ./arch/i386/mm/pgtable.c
    old new  
    1212#include <linux/slab.h>
    1313#include <linux/pagemap.h>
    1414#include <linux/spinlock.h>
     15#include <linux/module.h>
    1516
    1617#include <asm/system.h>
    1718#include <asm/pgtable.h>
    void set_pmd_pfn(unsigned long vaddr, un 
    137138        __flush_tlb_one(vaddr);
    138139}
    139140
     141static int nr_fixmaps = 0;
     142unsigned long __FIXADDR_TOP = 0xfffff000;
     143EXPORT_SYMBOL(__FIXADDR_TOP);
     144
    140145void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
    141146{
    142147        unsigned long address = __fix_to_virt(idx);
    void __set_fixmap (enum fixed_addresses  
    146151                return;
    147152        }
    148153        set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
     154        nr_fixmaps++;
     155}
     156
     157void set_fixaddr_top(unsigned long top)
     158{
     159        BUG_ON(nr_fixmaps > 0);
     160        __FIXADDR_TOP = top - PAGE_SIZE;
    149161}
    150162
    151163pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
  • include/asm-i386/fixmap.h

    diff -pruN ../orig-linux-2.6.18/include/asm-i386/fixmap.h ./include/asm-i386/fixmap.h
    old new  
    1919 * Leave one empty page between vmalloc'ed areas and
    2020 * the start of the fixmap.
    2121 */
    22 #define __FIXADDR_TOP   0xfffff000
     22extern unsigned long __FIXADDR_TOP;
    2323
    2424#ifndef __ASSEMBLY__
    2525#include <linux/kernel.h>
    enum fixed_addresses { 
    9494extern void __set_fixmap (enum fixed_addresses idx,
    9595                                        unsigned long phys, pgprot_t flags);
    9696
     97extern void set_fixaddr_top(unsigned long top);
     98
    9799#define set_fixmap(idx, phys) \
    98100                __set_fixmap(idx, phys, PAGE_KERNEL)
    99101/*
  • include/asm-i386/page.h

    diff -pruN ../orig-linux-2.6.18/include/asm-i386/page.h ./include/asm-i386/page.h
    old new extern int page_is_ram(unsigned long pag 
    122122
    123123#define PAGE_OFFSET             ((unsigned long)__PAGE_OFFSET)
    124124#define VMALLOC_RESERVE         ((unsigned long)__VMALLOC_RESERVE)
    125 #define MAXMEM                  (-__PAGE_OFFSET-__VMALLOC_RESERVE)
     125#define MAXMEM                  (__FIXADDR_TOP-__PAGE_OFFSET-__VMALLOC_RESERVE)
    126126#define __pa(x)                 ((unsigned long)(x)-PAGE_OFFSET)
    127127#define __va(x)                 ((void *)((unsigned long)(x)+PAGE_OFFSET))
    128128#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
Note: See TracBrowser for help on using the repository browser.