patch-2.3.12 linux/include/asm-i386/pgtable.h
Next file: linux/include/asm-i386/processor.h
Previous file: linux/include/asm-i386/parport.h
Back to the patch index
Back to the overall index
- Lines: 174
- Date:
Wed Jul 28 13:56:31 1999
- Orig file:
v2.3.11/linux/include/asm-i386/pgtable.h
- Orig date:
Wed Jul 21 15:46:48 1999
diff -u --recursive --new-file v2.3.11/linux/include/asm-i386/pgtable.h linux/include/asm-i386/pgtable.h
@@ -17,6 +17,8 @@
#include <asm/fixmap.h>
#include <linux/threads.h>
+extern pgd_t swapper_pg_dir[1024];
+
/* Caches aren't brain-dead on the intel. */
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
@@ -56,21 +58,21 @@
static inline void flush_tlb_mm(struct mm_struct *mm)
{
- if (mm == current->mm)
+ if (mm == current->active_mm)
__flush_tlb();
}
static inline void flush_tlb_page(struct vm_area_struct *vma,
unsigned long addr)
{
- if (vma->vm_mm == current->mm)
+ if (vma->vm_mm == current->active_mm)
__flush_tlb_one(addr);
}
static inline void flush_tlb_range(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
- if (mm == current->mm)
+ if (mm == current->active_mm)
__flush_tlb();
}
@@ -86,79 +88,19 @@
#define local_flush_tlb() \
__flush_tlb()
+extern void flush_tlb_all(void);
+extern void flush_tlb_current_task(void);
+extern void flush_tlb_mm(struct mm_struct *);
+extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
-#define CLEVER_SMP_INVALIDATE
-#ifdef CLEVER_SMP_INVALIDATE
-
-/*
- * Smarter SMP flushing macros.
- * c/o Linus Torvalds.
- *
- * These mean you can really definitely utterly forget about
- * writing to user space from interrupts. (Its not allowed anyway).
- */
-
-static inline void flush_tlb_current_task(void)
-{
- /* just one copy of this mm? */
- if (atomic_read(¤t->mm->mm_users) == 1)
- local_flush_tlb(); /* and that's us, so.. */
- else
- smp_flush_tlb();
-}
-
-#define flush_tlb() flush_tlb_current_task()
-
-#define flush_tlb_all() smp_flush_tlb()
-
-static inline void flush_tlb_mm(struct mm_struct * mm)
-{
- if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
- local_flush_tlb();
- else
- smp_flush_tlb();
-}
-
-static inline void flush_tlb_page(struct vm_area_struct * vma,
- unsigned long va)
-{
- if (vma->vm_mm == current->mm && atomic_read(¤t->mm->mm_users) == 1)
- __flush_tlb_one(va);
- else
- smp_flush_tlb();
-}
+#define flush_tlb() flush_tlb_current_task()
-static inline void flush_tlb_range(struct mm_struct * mm,
- unsigned long start, unsigned long end)
+static inline void flush_tlb_range(struct mm_struct * mm, unsigned long start, unsigned long end)
{
flush_tlb_mm(mm);
}
-#else
-
-#define flush_tlb() \
- smp_flush_tlb()
-
-#define flush_tlb_all() flush_tlb()
-
-static inline void flush_tlb_mm(struct mm_struct *mm)
-{
- flush_tlb();
-}
-
-static inline void flush_tlb_page(struct vm_area_struct *vma,
- unsigned long addr)
-{
- flush_tlb();
-}
-
-static inline void flush_tlb_range(struct mm_struct *mm,
- unsigned long start, unsigned long end)
-{
- flush_tlb();
-}
-#endif
#endif
#endif /* !__ASSEMBLY__ */
@@ -302,15 +244,6 @@
#define PAGE_PTR(address) \
((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
-/* to set the page-dir */
-#define SET_PAGE_DIR(tsk,pgdir) \
-do { \
- unsigned long __pgdir = __pa(pgdir); \
- (tsk)->thread.cr3 = __pgdir; \
- if ((tsk) == current) \
- __asm__ __volatile__("movl %0,%%cr3": :"r" (__pgdir)); \
-} while (0)
-
#define pte_none(x) (!pte_val(x))
#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE))
#define pte_clear(xp) do { pte_val(*(xp)) = 0; } while (0)
@@ -401,13 +334,11 @@
extern __inline__ pgd_t *get_pgd_slow(void)
{
- pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL), *init;
+ pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL);
if (ret) {
- init = pgd_offset(&init_mm, 0);
- memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
- memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
- (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+ memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
+ memcpy(ret + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
}
return ret;
}
@@ -416,9 +347,9 @@
{
unsigned long *ret;
- if((ret = pgd_quicklist) != NULL) {
+ if ((ret = pgd_quicklist) != NULL) {
pgd_quicklist = (unsigned long *)(*ret);
- ret[0] = ret[1];
+ ret[0] = 0;
pgtable_cache_size--;
} else
ret = (unsigned long *)get_pgd_slow();
@@ -571,8 +502,6 @@
pgd[address >> PGDIR_SHIFT] = entry;
#endif
}
-
-extern pgd_t swapper_pg_dir[1024];
/*
* The i386 doesn't have any external MMU info: the kernel page
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)