Lines Matching refs:mm
23 static void flush_ldt(void *mm) in flush_ldt() argument
59 if (current->mm->cpu_vm_mask != (1<<smp_processor_id())) in alloc_ldt()
89 int init_new_context(struct task_struct *tsk, struct mm_struct *mm) in init_new_context() argument
94 init_MUTEX(&mm->context.sem); in init_new_context()
95 mm->context.size = 0; in init_new_context()
96 old_mm = current->mm; in init_new_context()
99 retval = copy_ldt(&mm->context, &old_mm->context); in init_new_context()
110 void destroy_context(struct mm_struct *mm) in destroy_context() argument
112 if (mm->context.size) { in destroy_context()
113 if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE) in destroy_context()
114 vfree(mm->context.ldt); in destroy_context()
116 kfree(mm->context.ldt); in destroy_context()
117 mm->context.size = 0; in destroy_context()
125 struct mm_struct * mm = current->mm; in read_ldt() local
127 if (!mm->context.size) in read_ldt()
132 down(&mm->context.sem); in read_ldt()
133 size = mm->context.size*LDT_ENTRY_SIZE; in read_ldt()
138 if (copy_to_user(ptr, mm->context.ldt, size)) in read_ldt()
140 up(&mm->context.sem); in read_ldt()
171 struct mm_struct * mm = current->mm; in write_ldt() local
193 down(&mm->context.sem); in write_ldt()
194 if (ldt_info.entry_number >= mm->context.size) { in write_ldt()
195 error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); in write_ldt()
200 lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt); in write_ldt()
238 up(&mm->context.sem); in write_ldt()