diff -u -r --new-file linux-2.4.0-test11/include/asm-generic/pgtable.h linux-2.4.0-test11-establish_pte/include/asm-generic/pgtable.h --- linux-2.4.0-test11/include/asm-generic/pgtable.h Fri Oct 20 00:51:16 2000 +++ linux-2.4.0-test11-establish_pte/include/asm-generic/pgtable.h Wed Dec 6 20:52:00 2000 @@ -1,6 +1,8 @@ #ifndef _ASM_GENERIC_PGTABLE_H #define _ASM_GENERIC_PGTABLE_H +#include + static inline int ptep_test_and_clear_young(pte_t *ptep) { pte_t pte = *ptep; @@ -40,4 +40,17 @@ #define pte_same(A,B) (pte_val(A) == pte_val(B)) +/* + * Establish a new mapping: + * - flush the old one + * - update the page tables + * - inform the TLB about the new one + */ +static inline void establish_pte(struct vm_area_struct * vma, unsigned long address, pte_t *page_table, pte_t entry) +{ + set_pte(page_table, entry); + flush_tlb_page(vma, address); + update_mmu_cache(vma, address, entry); +} + #endif /* _ASM_GENERIC_PGTABLE_H */ diff -u -r --new-file linux-2.4.0-test11/include/asm-i386/pgtable.h linux-2.4.0-test11-establish_pte/include/asm-i386/pgtable.h --- linux-2.4.0-test11/include/asm-i386/pgtable.h Sun Nov 19 05:56:59 2000 +++ linux-2.4.0-test11-establish_pte/include/asm-i386/pgtable.h Wed Dec 6 20:53:43 2000 @@ -287,6 +287,20 @@ static inline void ptep_mkdirty(pte_t *ptep) { set_bit(_PAGE_BIT_RW, ptep); } /* + * Establish a new mapping: + * - flush the old one + * - update the page tables + * - inform the TLB about the new one + */ +static inline void establish_pte(struct vm_area_struct * vma, unsigned long address, pte_t *page_table, pte_t entry) +{ + set_pte(page_table, entry); + if (vma->vm_mm == current->active_mm) + __flush_tlb_one(addr); + update_mmu_cache(vma, address, entry); +} + +/* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ diff -u -r --new-file linux-2.4.0-test11/mm/memory.c linux-2.4.0-test11-establish_pte/mm/memory.c --- linux-2.4.0-test11/mm/memory.c Wed Nov 1 16:45:09 2000 +++ linux-2.4.0-test11-establish_pte/mm/memory.c Wed Dec 6 20:52:00 2000 @@ -773,19 +773,6 @@ return error; } -/* - * Establish a new mapping: - * - flush the old one - * - update the page tables - * - inform the TLB about the new one - */ -static inline void establish_pte(struct vm_area_struct * vma, unsigned long address, pte_t *page_table, pte_t entry) -{ - set_pte(page_table, entry); - flush_tlb_page(vma, address); - update_mmu_cache(vma, address, entry); -} - static inline void break_cow(struct vm_area_struct * vma, struct page * old_page, struct page * new_page, unsigned long address, pte_t *page_table) {