X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=arch%2Fparisc%2Fkernel%2Fprocess.c;h=fee4f1f09adc687b84bcfdd5355a6f1fa3c8a1f4;hb=969780f8079994f161de991870feba68f49fc3d7;hp=46b759385115afd636a77a6e2b4a228581ad6ba9;hpb=5d54e69c68c05b162a56f9914cae72afd7e6f40a;p=linux-2.6-omap-h63xx.git diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 46b75938511..fee4f1f09ad 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -9,7 +9,7 @@ * Copyright (C) 2000-2003 Paul Bame * Copyright (C) 2000 Philipp Rumpf * Copyright (C) 2000 David Kennedy - * Copyright (C) 2000 Richard Hirst + * Copyright (C) 2000 Richard Hirst * Copyright (C) 2000 Grant Grundler * Copyright (C) 2001 Alan Modra * Copyright (C) 2001-2002 Ryan Bradetich @@ -88,11 +88,15 @@ void default_idle(void) */ void cpu_idle(void) { + set_thread_flag(TIF_POLLING_NRFLAG); + /* endless idle loop with no priority at all */ while (1) { while (!need_resched()) barrier(); + preempt_enable_no_resched(); schedule(); + preempt_disable(); check_pgt_cache(); } } @@ -245,7 +249,17 @@ int sys_clone(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs) { - int __user *user_tid = (int __user *)regs->gr[26]; + /* Arugments from userspace are: + r26 = Clone flags. + r25 = Child stack. + r24 = parent_tidptr. + r23 = Is the TLS storage descriptor + r22 = child_tidptr + + However, these last 3 args are only examined + if the proper flags are set. */ + int __user *child_tidptr; + int __user *parent_tidptr; /* usp must be word aligned. This also prevents users from * passing in the value 1 (which is the signal for a special @@ -253,10 +267,20 @@ sys_clone(unsigned long clone_flags, unsigned long usp, usp = ALIGN(usp, 4); /* A zero value for usp means use the current stack */ - if(usp == 0) - usp = regs->gr[30]; + if (usp == 0) + usp = regs->gr[30]; + + if (clone_flags & CLONE_PARENT_SETTID) + parent_tidptr = (int __user *)regs->gr[24]; + else + parent_tidptr = NULL; + + if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) + child_tidptr = (int __user *)regs->gr[22]; + else + child_tidptr = NULL; - return do_fork(clone_flags, usp, regs, 0, user_tid, NULL); + return do_fork(clone_flags, usp, regs, 0, parent_tidptr, child_tidptr); } int @@ -332,6 +356,10 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp, } else { cregs->kpc = (unsigned long) &child_return; } + /* Setup thread TLS area from the 4th parameter in clone */ + if (clone_flags & CLONE_SETTLS) + cregs->cr27 = pregs->gr[23]; + } return 0;