Lines Matching +full:halt +full:- +full:regs
1 // SPDX-License-Identifier: GPL-2.0-or-later
11 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
13 * This file handles the architecture-dependent parts of process handling...
50 * Used at user space -> kernel transitions.
63 /* Whoops - the platform was unable to reboot. Tell the user! */ in machine_restart()
64 pr_emerg("Reboot failed -- System halted\n"); in machine_restart()
69 * This is used if a sys-off handler was not set by a power management
80 * here to freeze the system for e.g. post-mortem debug purpose when
81 * possible. This halt has nothing to do with the idle halt.
85 printk(KERN_INFO "*** MACHINE HALT ***\n"); in machine_halt()
89 /* If or when software power-off is implemented, add code here. */
121 void show_regs(struct pt_regs *regs) in show_regs() argument
125 show_registers(regs); in show_regs()
129 * Copy the thread-specific (arch specific) info from the current
168 unsigned long clone_flags = args->flags; in copy_thread()
169 unsigned long usp = args->stack; in copy_thread()
170 unsigned long tls = args->tls; in copy_thread()
179 sp -= STACK_FRAME_OVERHEAD; /* redzone */ in copy_thread()
180 sp -= sizeof(struct pt_regs); in copy_thread()
184 sp -= STACK_FRAME_OVERHEAD; /* redzone */ in copy_thread()
185 sp -= sizeof(struct pt_regs); in copy_thread()
188 if (unlikely(args->fn)) { in copy_thread()
190 kregs->gpr[20] = (unsigned long)args->fn; in copy_thread()
191 kregs->gpr[22] = (unsigned long)args->fn_arg; in copy_thread()
196 userregs->sp = usp; in copy_thread()
202 userregs->gpr[10] = tls; in copy_thread()
204 userregs->gpr[11] = 0; /* Result from fork() */ in copy_thread()
206 kregs->gpr[20] = 0; /* Userspace thread */ in copy_thread()
210 * _switch wants the kernel stack page in pt_regs->sp so that it in copy_thread()
211 * can restore it to thread_info->ksp... see _switch for details. in copy_thread()
213 kregs->sp = top_of_kernel_stack; in copy_thread()
214 kregs->gpr[9] = (unsigned long)ret_from_fork; in copy_thread()
216 task_thread_info(p)->ksp = (unsigned long)kregs; in copy_thread()
224 void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) in start_thread() argument
228 memset(regs, 0, sizeof(struct pt_regs)); in start_thread()
230 regs->pc = pc; in start_thread()
231 regs->sr = sr; in start_thread()
232 regs->sp = sp; in start_thread()
251 * (one for each cpu). we need them at user->kernel transition, in __switch_to()
252 * while we save them at kernel->user transition in __switch_to()
254 new_ti = new->stack; in __switch_to()
255 old_ti = old->stack; in __switch_to()
260 last = (_switch(old_ti, new_ti))->task; in __switch_to()
273 void dump_elf_thread(elf_greg_t *dest, struct pt_regs* regs) in dump_elf_thread() argument
276 memcpy(dest+1, regs->gpr+1, 31*sizeof(unsigned long)); in dump_elf_thread()
277 dest[32] = regs->pc; in dump_elf_thread()
278 dest[33] = regs->sr; in dump_elf_thread()