diff options
Diffstat (limited to 'arch/m68k/kernel')
-rw-r--r-- | arch/m68k/kernel/entry.S | 4 | ||||
-rw-r--r-- | arch/m68k/kernel/sys_m68k.c | 131 |
2 files changed, 2 insertions, 133 deletions
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index e136b8cbe9b9..2391bdff0996 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S | |||
@@ -510,7 +510,7 @@ sys_call_table: | |||
510 | .long sys_settimeofday | 510 | .long sys_settimeofday |
511 | .long sys_getgroups16 /* 80 */ | 511 | .long sys_getgroups16 /* 80 */ |
512 | .long sys_setgroups16 | 512 | .long sys_setgroups16 |
513 | .long old_select | 513 | .long sys_old_select |
514 | .long sys_symlink | 514 | .long sys_symlink |
515 | .long sys_lstat | 515 | .long sys_lstat |
516 | .long sys_readlink /* 85 */ | 516 | .long sys_readlink /* 85 */ |
@@ -518,7 +518,7 @@ sys_call_table: | |||
518 | .long sys_swapon | 518 | .long sys_swapon |
519 | .long sys_reboot | 519 | .long sys_reboot |
520 | .long sys_old_readdir | 520 | .long sys_old_readdir |
521 | .long old_mmap /* 90 */ | 521 | .long sys_old_mmap /* 90 */ |
522 | .long sys_munmap | 522 | .long sys_munmap |
523 | .long sys_truncate | 523 | .long sys_truncate |
524 | .long sys_ftruncate | 524 | .long sys_ftruncate |
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index e3ad2d671973..77896692eb0a 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c | |||
@@ -46,137 +46,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | |||
46 | return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); | 46 | return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); |
47 | } | 47 | } |
48 | 48 | ||
49 | /* | ||
50 | * Perform the select(nd, in, out, ex, tv) and mmap() system | ||
51 | * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to | ||
52 | * handle more than 4 system call parameters, so these system calls | ||
53 | * used a memory block for parameter passing.. | ||
54 | */ | ||
55 | |||
56 | struct mmap_arg_struct { | ||
57 | unsigned long addr; | ||
58 | unsigned long len; | ||
59 | unsigned long prot; | ||
60 | unsigned long flags; | ||
61 | unsigned long fd; | ||
62 | unsigned long offset; | ||
63 | }; | ||
64 | |||
65 | asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) | ||
66 | { | ||
67 | struct mmap_arg_struct a; | ||
68 | int error = -EFAULT; | ||
69 | |||
70 | if (copy_from_user(&a, arg, sizeof(a))) | ||
71 | goto out; | ||
72 | |||
73 | error = -EINVAL; | ||
74 | if (a.offset & ~PAGE_MASK) | ||
75 | goto out; | ||
76 | |||
77 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, | ||
78 | a.offset >> PAGE_SHIFT); | ||
79 | out: | ||
80 | return error; | ||
81 | } | ||
82 | |||
83 | struct sel_arg_struct { | ||
84 | unsigned long n; | ||
85 | fd_set __user *inp, *outp, *exp; | ||
86 | struct timeval __user *tvp; | ||
87 | }; | ||
88 | |||
89 | asmlinkage int old_select(struct sel_arg_struct __user *arg) | ||
90 | { | ||
91 | struct sel_arg_struct a; | ||
92 | |||
93 | if (copy_from_user(&a, arg, sizeof(a))) | ||
94 | return -EFAULT; | ||
95 | /* sys_select() does the appropriate kernel locking */ | ||
96 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
97 | } | ||
98 | |||
99 | /* | ||
100 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | ||
101 | * | ||
102 | * This is really horribly ugly. | ||
103 | */ | ||
104 | asmlinkage int sys_ipc (uint call, int first, int second, | ||
105 | int third, void __user *ptr, long fifth) | ||
106 | { | ||
107 | int version, ret; | ||
108 | |||
109 | version = call >> 16; /* hack for backward compatibility */ | ||
110 | call &= 0xffff; | ||
111 | |||
112 | if (call <= SEMCTL) | ||
113 | switch (call) { | ||
114 | case SEMOP: | ||
115 | return sys_semop (first, ptr, second); | ||
116 | case SEMGET: | ||
117 | return sys_semget (first, second, third); | ||
118 | case SEMCTL: { | ||
119 | union semun fourth; | ||
120 | if (!ptr) | ||
121 | return -EINVAL; | ||
122 | if (get_user(fourth.__pad, (void __user *__user *) ptr)) | ||
123 | return -EFAULT; | ||
124 | return sys_semctl (first, second, third, fourth); | ||
125 | } | ||
126 | default: | ||
127 | return -ENOSYS; | ||
128 | } | ||
129 | if (call <= MSGCTL) | ||
130 | switch (call) { | ||
131 | case MSGSND: | ||
132 | return sys_msgsnd (first, ptr, second, third); | ||
133 | case MSGRCV: | ||
134 | switch (version) { | ||
135 | case 0: { | ||
136 | struct ipc_kludge tmp; | ||
137 | if (!ptr) | ||
138 | return -EINVAL; | ||
139 | if (copy_from_user (&tmp, ptr, sizeof (tmp))) | ||
140 | return -EFAULT; | ||
141 | return sys_msgrcv (first, tmp.msgp, second, | ||
142 | tmp.msgtyp, third); | ||
143 | } | ||
144 | default: | ||
145 | return sys_msgrcv (first, ptr, | ||
146 | second, fifth, third); | ||
147 | } | ||
148 | case MSGGET: | ||
149 | return sys_msgget ((key_t) first, second); | ||
150 | case MSGCTL: | ||
151 | return sys_msgctl (first, second, ptr); | ||
152 | default: | ||
153 | return -ENOSYS; | ||
154 | } | ||
155 | if (call <= SHMCTL) | ||
156 | switch (call) { | ||
157 | case SHMAT: | ||
158 | switch (version) { | ||
159 | default: { | ||
160 | ulong raddr; | ||
161 | ret = do_shmat (first, ptr, second, &raddr); | ||
162 | if (ret) | ||
163 | return ret; | ||
164 | return put_user (raddr, (ulong __user *) third); | ||
165 | } | ||
166 | } | ||
167 | case SHMDT: | ||
168 | return sys_shmdt (ptr); | ||
169 | case SHMGET: | ||
170 | return sys_shmget (first, second, third); | ||
171 | case SHMCTL: | ||
172 | return sys_shmctl (first, second, ptr); | ||
173 | default: | ||
174 | return -ENOSYS; | ||
175 | } | ||
176 | |||
177 | return -EINVAL; | ||
178 | } | ||
179 | |||
180 | /* Convert virtual (user) address VADDR to physical address PADDR */ | 49 | /* Convert virtual (user) address VADDR to physical address PADDR */ |
181 | #define virt_to_phys_040(vaddr) \ | 50 | #define virt_to_phys_040(vaddr) \ |
182 | ({ \ | 51 | ({ \ |