asmlinkage long sparc_fork(struct pt_regs *regs)
{ unsignedlong orig_i1 = regs->u_regs[UREG_I1]; long ret; struct kernel_clone_args args = {
.exit_signal = SIGCHLD, /* Reuse the parent's stack for the child. */
.stack = regs->u_regs[UREG_FP],
};
ret = kernel_clone(&args);
/* If we get an error and potentially restart the system * call, we're screwed because copy_thread() clobbered * the parent's %o1. So detect that case and restore it * here.
*/ if ((unsignedlong)ret >= -ERESTART_RESTARTBLOCK)
regs->u_regs[UREG_I1] = orig_i1;
return ret;
}
asmlinkage long sparc_vfork(struct pt_regs *regs)
{ unsignedlong orig_i1 = regs->u_regs[UREG_I1]; long ret;
struct kernel_clone_args args = {
.flags = CLONE_VFORK | CLONE_VM,
.exit_signal = SIGCHLD, /* Reuse the parent's stack for the child. */
.stack = regs->u_regs[UREG_FP],
};
ret = kernel_clone(&args);
/* If we get an error and potentially restart the system * call, we're screwed because copy_thread() clobbered * the parent's %o1. So detect that case and restore it * here.
*/ if ((unsignedlong)ret >= -ERESTART_RESTARTBLOCK)
regs->u_regs[UREG_I1] = orig_i1;
return ret;
}
asmlinkage long sparc_clone(struct pt_regs *regs)
{ unsignedlong orig_i1 = regs->u_regs[UREG_I1]; unsignedint flags = lower_32_bits(regs->u_regs[UREG_I0]); long ret;
/* Did userspace give setup a separate stack for the child or are we * reusing the parent's?
*/ if (regs->u_regs[UREG_I1])
args.stack = regs->u_regs[UREG_I1]; else
args.stack = regs->u_regs[UREG_FP];
ret = kernel_clone(&args);
/* If we get an error and potentially restart the system * call, we're screwed because copy_thread() clobbered * the parent's %o1. So detect that case and restore it * here.
*/ if ((unsignedlong)ret >= -ERESTART_RESTARTBLOCK)
regs->u_regs[UREG_I1] = orig_i1;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.