Import 2.3.18pre1
[davej-history.git] / include / asm-i386 / mmu_context.h
blobcd142e9958f964b61d848d6e5428638e883c5957
1 #ifndef __I386_MMU_CONTEXT_H
2 #define __I386_MMU_CONTEXT_H
4 #include <asm/desc.h>
5 #include <asm/atomic.h>
7 /*
8 * possibly do the LDT unload here?
9 */
10 #define destroy_context(mm) do { } while(0)
11 #define init_new_context(tsk,mm) do { } while (0)
13 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
16 if (prev != next) {
18 * Re-load LDT if necessary
20 if (prev->segments != next->segments)
21 load_LDT(next);
23 /* Re-load page tables */
24 asm volatile("movl %0,%%cr3": :"r" (__pa(next->pgd)));
25 clear_bit(cpu, &prev->cpu_vm_mask);
27 set_bit(cpu, &next->cpu_vm_mask);
30 #define activate_mm(prev, next) \
31 switch_mm((prev),(next),NULL,smp_processor_id())
33 #endif