aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@codesourcery.com>2009-12-06 13:08:14 -0500
committerGeert Uytterhoeven <geert@linux-m68k.org>2010-02-27 12:35:22 -0500
commita58f75349063f60949614de39390df594ba1418d (patch)
treeb0fec4508132df99cfa81e5d9f080028fe234b91
parent9674cdc74d63f346870943ef966a034f8c71ee57 (diff)
m68knommu: NPTL support for uClinux
Port syscalls for NPTL support to m68knommu. Signed-off-by: Maxim Kuvyrkov <maxim@codesourcery.com> Acked-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r--arch/m68k/include/asm/thread_info_no.h1
-rw-r--r--arch/m68knommu/kernel/process.c4
-rw-r--r--arch/m68knommu/kernel/ptrace.c5
-rw-r--r--arch/m68knommu/kernel/sys_m68k.c36
-rw-r--r--arch/m68knommu/kernel/syscalltable.S4
5 files changed, 50 insertions, 0 deletions
diff --git a/arch/m68k/include/asm/thread_info_no.h b/arch/m68k/include/asm/thread_info_no.h
index a6512bfdd01d..884776f686ca 100644
--- a/arch/m68k/include/asm/thread_info_no.h
+++ b/arch/m68k/include/asm/thread_info_no.h
@@ -37,6 +37,7 @@ struct thread_info {
37 unsigned long flags; /* low level flags */ 37 unsigned long flags; /* low level flags */
38 int cpu; /* cpu we're on */ 38 int cpu; /* cpu we're on */
39 int preempt_count; /* 0 => preemptable, <0 => BUG */ 39 int preempt_count; /* 0 => preemptable, <0 => BUG */
40 unsigned long tp_value; /* thread pointer */
40 struct restart_block restart_block; 41 struct restart_block restart_block;
41}; 42};
42 43
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 5c9ecd427090..959cb249c759 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -221,6 +221,10 @@ int copy_thread(unsigned long clone_flags,
221 221
222 p->thread.usp = usp; 222 p->thread.usp = usp;
223 p->thread.ksp = (unsigned long)childstack; 223 p->thread.ksp = (unsigned long)childstack;
224
225 if (clone_flags & CLONE_SETTLS)
226 task_thread_info(p)->tp_value = regs->d5;
227
224 /* 228 /*
225 * Must save the current SFC/DFC value, NOT the value when 229 * Must save the current SFC/DFC value, NOT the value when
226 * the parent was last descheduled - RGH 10-08-96 230 * the parent was last descheduled - RGH 10-08-96
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index 4d3828959fb0..85ed2f988f98 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -319,6 +319,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
319 } 319 }
320#endif 320#endif
321 321
322 case PTRACE_GET_THREAD_AREA:
323 ret = put_user(task_thread_info(child)->tp_value,
324 (unsigned long __user *)data);
325 break;
326
322 default: 327 default:
323 ret = -EIO; 328 ret = -EIO;
324 break; 329 break;
diff --git a/arch/m68knommu/kernel/sys_m68k.c b/arch/m68knommu/kernel/sys_m68k.c
index b67cbc735a9b..923dd4aab875 100644
--- a/arch/m68knommu/kernel/sys_m68k.c
+++ b/arch/m68knommu/kernel/sys_m68k.c
@@ -190,3 +190,39 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[])
190 : "d" (__a), "d" (__b), "d" (__c)); 190 : "d" (__a), "d" (__b), "d" (__c));
191 return __res; 191 return __res;
192} 192}
193
194asmlinkage unsigned long sys_get_thread_area(void)
195{
196 return current_thread_info()->tp_value;
197}
198
199asmlinkage int sys_set_thread_area(unsigned long tp)
200{
201 current_thread_info()->tp_value = tp;
202 return 0;
203}
204
205/* This syscall gets its arguments in A0 (mem), D2 (oldval) and
206 D1 (newval). */
207asmlinkage int
208sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
209 unsigned long __user * mem)
210{
211 struct mm_struct *mm = current->mm;
212 unsigned long mem_value;
213
214 down_read(&mm->mmap_sem);
215
216 mem_value = *mem;
217 if (mem_value == oldval)
218 *mem = newval;
219
220 up_read(&mm->mmap_sem);
221 return mem_value;
222}
223
224asmlinkage int sys_atomic_barrier(void)
225{
226 /* no code needed for uniprocs */
227 return 0;
228}
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S
index 486837efa3d7..56dd01ded148 100644
--- a/arch/m68knommu/kernel/syscalltable.S
+++ b/arch/m68knommu/kernel/syscalltable.S
@@ -351,6 +351,10 @@ ENTRY(sys_call_table)
351 .long sys_pwritev /* 330 */ 351 .long sys_pwritev /* 330 */
352 .long sys_rt_tgsigqueueinfo 352 .long sys_rt_tgsigqueueinfo
353 .long sys_perf_event_open 353 .long sys_perf_event_open
354 .long sys_get_thread_area
355 .long sys_set_thread_area
356 .long sys_atomic_cmpxchg_32 /* 335 */
357 .long sys_atomic_barrier
354 358
355 .rept NR_syscalls-(.-sys_call_table)/4 359 .rept NR_syscalls-(.-sys_call_table)/4
356 .long sys_ni_syscall 360 .long sys_ni_syscall