patch-1.3.16 linux/include/asm-i386/page.h

Next file: linux/include/asm-i386/pgtable.h
Previous file: linux/fs/umsdos/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.15/linux/include/asm-i386/page.h linux/include/asm-i386/page.h
@@ -50,8 +50,24 @@
 
 #endif
 
+/*
+ * TLB invalidation:
+ *
+ *  - invalidate() invalidates the current task TLBs
+ *  - invalidate_all() invalidates all processes TLBs
+ *  - invalidate_task(task) invalidates the specified tasks TLB's
+ *  - invalidate_page(task, vmaddr) invalidates one page
+ *
+ * ..but the i386 has somewhat limited invalidation capabilities.
+ */
 #define invalidate() \
 __asm__ __volatile__("movl %%cr3,%%eax\n\tmovl %%eax,%%cr3": : :"ax")
+
+#define invalidate_all() invalidate()
+#define invalidate_task(task) \
+do { if ((task)->mm == current->mm) invalidate(); } while (0)
+#define invalidate_page(task,addr) \
+do { if ((task)->mm == current->mm) invalidate(); } while (0)
 
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this