23 #include <linux/export.h>
24 #include <linux/sched.h>
25 #include <linux/kernel.h>
27 #include <linux/stddef.h>
31 #include <linux/reboot.h>
36 #include <linux/elfcore.h>
39 #include <linux/utsname.h>
41 #include <linux/random.h>
42 #include <linux/hw_breakpoint.h>
43 #include <linux/personality.h>
46 #include <asm/compat.h>
47 #include <asm/cacheflush.h>
48 #include <asm/processor.h>
49 #include <asm/stacktrace.h>
52 static void setup_restart(
void)
90 static void default_idle(
void)
115 tick_nohz_idle_enter();
117 while (!need_resched()) {
123 if (!need_resched()) {
137 tick_nohz_idle_exit();
177 printk(
"Reboot failed -- System halted\n");
185 printk(
"CPU: %d %s (%s %.*s)\n",
191 print_symbol(
"LR is at %s\n", regs->
regs[30]);
192 printk(
"pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n",
195 for (i = 29; i >= 0; i--) {
241 unsigned long tls = p->thread.tp_value;
244 childregs->
regs[0] = 0;
253 asm(
"mrs %0, tpidr_el0" :
"=r" (tls));
258 p->thread.cpu_context.sp = (
unsigned long)childregs;
259 p->thread.cpu_context.
pc = (
unsigned long)ret_from_fork;
264 p->thread.tp_value = tls;
266 ptrace_hw_copy_thread(p);
273 unsigned long tpidr, tpidrro;
276 asm(
"mrs %0, tpidr_el0" :
"=r" (tpidr));
277 current->thread.tp_value = tpidr;
282 tpidrro = next->
thread.tp_value;
284 tpidr = next->
thread.tp_value;
289 " msr tpidr_el0, %0\n"
290 " msr tpidrro_el0, %1"
291 : :
"r" (tpidr),
"r" (tpidrro));
303 tls_thread_switch(next);
307 last = cpu_switch_to(prev, next);
318 asm(
".section .text\n"
320 " .type kernel_thread_helper, #function\n"
321 "kernel_thread_helper:\n"
325 " .size kernel_thread_helper, . - kernel_thread_helper\n"
328 #define kernel_thread_exit do_exit
337 memset(®s, 0,
sizeof(regs));
356 frame.
fp = thread_saved_fp(p);
357 frame.
sp = thread_saved_sp(p);
365 }
while (count ++ < 16);
376 static unsigned long randomize_base(
unsigned long base)
384 return randomize_base(mm->
brk);
389 return randomize_base(base);