// SPDX-License-Identifier: GPL-2.0 /* linux/arch/sparc/kernel/process.c * * Copyright (C) 1995, 2008 David S. Miller (davem@davemloft.net) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
*/
/* * This file handles the architecture-dependent parts of process handling..
*/ #include <linux/elfcore.h> #include <linux/errno.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/sched/debug.h> #include <linux/sched/task.h> #include <linux/sched/task_stack.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/stddef.h> #include <linux/ptrace.h> #include <linux/user.h> #include <linux/smp.h> #include <linux/reboot.h> #include <linux/delay.h> #include <linux/pm.h> #include <linux/slab.h> #include <linux/cpu.h>
/* * Power management idle function * Set in pm platform drivers (apc.c and pmc.c)
*/ void (*sparc_idle)(void);
/* * Power-off handler instantiation for pm.h compliance * This is done via auxio, but could be used as a fallback * handler when auxio is not present-- unused for now...
*/ void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);
/* * sysctl - toggle power-off restriction for serial console * systems in machine_power_off()
*/ int scons_pwroff = 1;
/* * The show_stack() is external API which we do not use ourselves. * The oops is printed in die_if_kernel.
*/ void show_stack(struct task_struct *tsk, unsignedlong *_ksp, constchar *loglvl)
{ unsignedlong pc, fp; unsignedlong task_base; struct reg_window32 *rw; int count = 0;
if (!tsk)
tsk = current;
if (tsk == current && !_ksp)
__asm__ __volatile__("mov %%fp, %0" : "=r" (_ksp));
/* do_fork() grabs the parent semaphore, we must release it * temporarily so we can build the child clone stack frame * without deadlocking.
*/ if (__copy_user(sp, src, size))
sp = NULL; elseif (put_user(fp, &sp->fp))
sp = NULL;
return sp;
}
/* Copy a Sparc thread. The fork() return value conventions * under SunOS are nothing short of bletcherous: * Parent --> %o0 == childs pid, %o1 == 0 * Child --> %o0 == parents pid, %o1 == 1 * * NOTE: We have a separate fork kpsr/kwim because * the parent could change these values between * sys_fork invocation and when we reach here * if the parent should sleep while trying to * allocate the task_struct and kernel stack in * do_fork(). * XXX See comment above sys_vfork in sparc64. todo.
*/ externvoid ret_from_fork(void); externvoid ret_from_kernel_thread(void);
/* * A new process must start with interrupts disabled, see schedule_tail() * and finish_task_switch(). (If we do not do it and if a timer interrupt * hits before we unlock and attempts to take the rq->lock, we deadlock.) * * Thus, kpsr |= PSR_PIL.
*/
ti->ksp = (unsignedlong) new_stack;
p->thread.kregs = childregs;
/* * This is a clone() call with supplied user stack. * Set some valid stack frames to give to the child.
*/
childstack = (struct sparc_stackf __user *)
(sp & ~0xfUL);
parentstack = (struct sparc_stackf __user *)
regs->u_regs[UREG_FP];
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.