ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / um / kernel / skas / mmu.c
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #include "linux/sched.h"
7 #include "linux/list.h"
8 #include "linux/spinlock.h"
9 #include "linux/slab.h"
10 #include "asm/current.h"
11 #include "asm/segment.h"
12 #include "asm/mmu.h"
13 #include "os.h"
14 #include "skas.h"
15
16 int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
17 {
18         int from;
19
20         if((current->mm != NULL) && (current->mm != &init_mm))
21                 from = current->mm->context.skas.mm_fd;
22         else from = -1;
23
24         mm->context.skas.mm_fd = new_mm(from);
25         if(mm->context.skas.mm_fd < 0)
26                 panic("init_new_context_skas - new_mm failed, errno = %d\n",
27                       mm->context.skas.mm_fd);
28
29         return(0);
30 }
31
32 void destroy_context_skas(struct mm_struct *mm)
33 {
34         os_close_file(mm->context.skas.mm_fd);
35 }
36
37 /*
38  * Overrides for Emacs so that we follow Linus's tabbing style.
39  * Emacs will notice this stuff at the end of the file and automatically
40  * adjust the settings for this buffer only.  This must remain at the end
41  * of the file.
42  * ---------------------------------------------------------------------------
43  * Local variables:
44  * c-file-style: "linux"
45  * End:
46  */