if (!usp)
usp = rdusp();
- return do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0,
- parent_tid, child_tid);
+ return do_fork(clone_flags, usp, regs, 0, parent_tid, child_tid);
}
int
if (!newsp)
newsp = regs->ARM_sp;
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0, NULL, NULL);
+ return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
}
asmlinkage int sys_vfork(struct pt_regs *regs)
if (!newsp)
newsp = regs->ARM_sp;
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0, NULL, NULL);
+ return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
}
asmlinkage int sys_vfork(struct pt_regs *regs)
{
if (!newusp)
newusp = rdusp();
- return do_fork(flags & ~CLONE_IDLETASK, newusp, regs, 0, parent_tid, child_tid);
+ return do_fork(flags, newusp, regs, 0, parent_tid, child_tid);
}
/* vfork is a system call in i386 because of register-pressure - maybe
newsp = regs->er2;
if (!newsp)
newsp = rdusp();
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0, NULL, NULL);
+ return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
}
child_tidptr = (int __user *)regs.edi;
if (!newsp)
newsp = regs.esp;
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, ®s, 0, parent_tidptr, child_tidptr);
+ return do_fork(clone_flags, newsp, ®s, 0, parent_tidptr, child_tidptr);
}
/*
zxt4 out1=in1 // newsp
mov out3=16 // stacksize (compensates for 16-byte scratch area)
adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s
- dep out0=0,in0,CLONE_IDLETASK_BIT,1 // out0 = clone_flags & ~CLONE_IDLETASK
+ mov out0=in0 // out0 = clone_flags
zxt4 out4=in2 // out4 = parent_tidptr
zxt4 out5=in4 // out5 = child_tidptr
br.call.sptk.many rp=do_fork
DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET, offsetof (struct timespec, tv_nsec));
- DEFINE(CLONE_IDLETASK_BIT, 12);
-#if CLONE_IDLETASK != (1 << 12)
-# error "CLONE_IDLETASK_BIT incorrect, please fix"
-#endif
-
DEFINE(CLONE_SETTLS_BIT, 19);
#if CLONE_SETTLS != (1<<19)
# error "CLONE_SETTLS_BIT incorrect, please fix"
(p6) st8 [r2]=in5 // store TLS in r16 for copy_thread()
mov out5=in4 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s
- dep out0=0,in0,CLONE_IDLETASK_BIT,1 // out0 = clone_flags & ~CLONE_IDLETASK
+ mov out0=in0 // out0 = clone_flags
br.call.sptk.many rp=do_fork
.ret1: .restore sp
adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
(p6) st8 [r2]=in4 // store TLS in r13 (tp)
mov out5=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s
- dep out0=0,in0,CLONE_IDLETASK_BIT,1 // out0 = clone_flags & ~CLONE_IDLETASK
+ mov out0=in0 // out0 = clone_flags
br.call.sptk.many rp=do_fork
.ret2: .restore sp
adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
child_tidptr = (int *)regs->d4;
if (!newsp)
newsp = rdusp();
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0,
+ return do_fork(clone_flags, newsp, regs, 0,
parent_tidptr, child_tidptr);
}
newsp = regs->d2;
if (!newsp)
newsp = rdusp();
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0, NULL, NULL);
+ return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
}
int copy_thread(int nr, unsigned long clone_flags,
newsp = regs.regs[29];
parent_tidptr = (int *) regs.regs[6];
child_tidptr = (int *) regs.regs[7];
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, ®s, 0,
+ return do_fork(clone_flags, newsp, ®s, 0,
parent_tidptr, child_tidptr);
}
if(usp == 0)
usp = regs->gr[30];
- return do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0, user_tid, NULL);
+ return do_fork(clone_flags, usp, regs, 0, user_tid, NULL);
}
int
CHECK_FULL_REGS(regs);
if (usp == 0)
usp = regs->gpr[1]; /* stack pointer for child */
- return do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0,
- parent_tidp, child_tidp);
+ return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp);
}
int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6,
}
}
- return do_fork(clone_flags & ~CLONE_IDLETASK, p2, regs, 0,
+ return do_fork(clone_flags, p2, regs, 0,
(int __user *)parent_tidptr, (int __user *)child_tidptr);
}
child_tidptr = (int *) (regs.gprs[5] & 0x7fffffffUL);
if (!newsp)
newsp = regs.gprs[15];
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, ®s, 0,
+ return do_fork(clone_flags, newsp, ®s, 0,
parent_tidptr, child_tidptr);
}
child_tidptr = (int __user *) regs.gprs[5];
if (!newsp)
newsp = regs.gprs[15];
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, ®s, 0,
+ return do_fork(clone_flags, newsp, ®s, 0,
parent_tidptr, child_tidptr);
}
{
if (!newsp)
newsp = regs.regs[15];
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, ®s, 0,
+ return do_fork(clone_flags, newsp, ®s, 0,
(int __user *)parent_tidptr, (int __user *)child_tidptr);
}
{
if (!newsp)
newsp = pregs->regs[15];
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, pregs, 0, 0, 0);
+ return do_fork(clone_flags, newsp, pregs, 0, 0, 0);
}
/*
{
unsigned long parent_tid_ptr, child_tid_ptr;
- clone_flags &= ~CLONE_IDLETASK;
-
parent_tid_ptr = regs->u_regs[UREG_I2];
child_tid_ptr = regs->u_regs[UREG_I4];
{
int __user *parent_tid_ptr, *child_tid_ptr;
- clone_flags &= ~CLONE_IDLETASK;
-
#ifdef CONFIG_COMPAT
if (test_thread_flag(TIF_32BIT)) {
parent_tid_ptr = compat_ptr(regs->u_regs[UREG_I2]);
void __user *child_tid = (void __user *)regs->rdi;
if (!newsp)
newsp = regs->rsp;
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0,
- parent_tid, child_tid);
+ return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
}
/*
{
if (!newsp)
newsp = regs->rsp;
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0,
- parent_tid, child_tid);
+ return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
}
/*
#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
-#define CLONE_IDLETASK 0x00001000 /* set if new pid should be 0 (kernel only)*/
#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
+/* set if new pid should be 0 (kernel only)*/
+#define CLONE_IDLETASK 0x00001000
+
/* The idle threads do not count..
* Protected by write_lock_irq(&tasklist_lock)
*/
static inline int fork_traceflag (unsigned clone_flags)
{
- if (clone_flags & (CLONE_UNTRACED | CLONE_IDLETASK))
+ if (clone_flags & CLONE_UNTRACED)
return 0;
else if (clone_flags & CLONE_VFORK) {
if (current->ptrace & PT_TRACE_VFORK)
int trace = 0;
long pid;
+ clone_flags &= ~CLONE_IDLETASK;
if (unlikely(current->ptrace)) {
trace = fork_traceflag (clone_flags);
if (trace)
set_tsk_thread_flag(p, TIF_SIGPENDING);
}
- if (likely(!(clone_flags & CLONE_IDLETASK))) {
- if (!(clone_flags & CLONE_STOPPED))
- wake_up_new_task(p, clone_flags);
- else
- p->state = TASK_STOPPED;
- ++total_forks;
- }
+ if (!(clone_flags & CLONE_STOPPED))
+ wake_up_new_task(p, clone_flags);
+ else
+ p->state = TASK_STOPPED;
+ ++total_forks;
if (unlikely (trace)) {
current->ptrace_message = pid;