13 #include <linux/export.h>
14 #include <linux/sched.h>
15 #include <linux/kernel.h>
17 #include <linux/stddef.h>
21 #include <linux/reboot.h>
26 #include <linux/elfcore.h>
29 #include <linux/utsname.h>
31 #include <linux/random.h>
32 #include <linux/hw_breakpoint.h>
36 #include <asm/cacheflush.h>
37 #include <asm/processor.h>
39 #include <asm/stacktrace.h>
42 #ifdef CONFIG_CC_STACKPROTECTOR
48 static const char *processor_modes[] = {
49 "USER_26",
"FIQ_26" ,
"IRQ_26" ,
"SVC_26" ,
"UK4_26" ,
"UK5_26" ,
"UK6_26" ,
"UK7_26" ,
50 "UK8_26" ,
"UK9_26" ,
"UK10_26",
"UK11_26",
"UK12_26",
"UK13_26",
"UK14_26",
"UK15_26",
51 "USER_32",
"FIQ_32" ,
"IRQ_32" ,
"SVC_32" ,
"UK4_32" ,
"UK5_32" ,
"UK6_32" ,
"ABT_32" ,
52 "UK8_32" ,
"UK9_32" ,
"UK10_32",
"UND_32" ,
"UK12_32",
"UK13_32",
"UK14_32",
"SYS_32"
55 static const char *isa_modes[] = {
56 "ARM" ,
"Thumb" ,
"Jazelle",
"ThumbEE"
61 static volatile int hlt_counter;
102 static u64 soft_restart_stack[16];
104 static void __soft_restart(
void *
addr)
122 phys_reset((
unsigned long)addr);
147 static void null_restart(
char mode,
const char *
cmd)
166 static void default_idle(
void)
190 tick_nohz_idle_enter();
193 while (!need_resched()) {
194 #ifdef CONFIG_HOTPLUG_CPU
204 #ifdef CONFIG_PL310_ERRATA_769419
210 }
else if (!need_resched()) {
225 tick_nohz_idle_exit();
230 static char reboot_mode =
'h';
234 reboot_mode = str[0];
271 printk(
"Reboot failed -- System halted\n");
281 printk(
"CPU: %d %s (%s %.*s)\n",
287 print_symbol(
"LR is at %s\n", regs->ARM_lr);
288 printk(
"pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n"
289 "sp : %08lx ip : %08lx fp : %08lx\n",
290 regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr,
291 regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
292 printk(
"r10: %08lx r9 : %08lx r8 : %08lx\n",
293 regs->ARM_r10, regs->ARM_r9,
295 printk(
"r7 : %08lx r6 : %08lx r5 : %08lx r4 : %08lx\n",
296 regs->ARM_r7, regs->ARM_r6,
297 regs->ARM_r5, regs->ARM_r4);
298 printk(
"r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
299 regs->ARM_r3, regs->ARM_r2,
300 regs->ARM_r1, regs->ARM_r0);
302 flags = regs->ARM_cpsr;
309 printk(
"Flags: %s IRQs o%s FIQs o%s Mode %s ISA %s Segment %s\n",
315 #ifdef CONFIG_CPU_CP15
320 #ifdef CONFIG_CPU_CP15_MMU
322 unsigned int transbase, dac;
323 asm(
"mrc p15, 0, %0, c2, c0\n\t"
324 "mrc p15, 0, %1, c3, c0\n"
325 :
"=r" (transbase),
"=r" (dac));
326 snprintf(buf,
sizeof(buf),
" Table: %08x DAC: %08x",
330 asm(
"mrc p15, 0, %0, c1, c0\n" :
"=r" (
ctrl));
332 printk(
"Control: %08x%s\n", ctrl, buf);
364 memset(thread->used_cp, 0,
sizeof(thread->used_cp));
368 thread_notify(THREAD_NOTIFY_FLUSH, thread);
384 memset(&thread->cpu_context, 0,
sizeof(
struct cpu_context_save));
388 childregs->ARM_r0 = 0;
392 thread->cpu_context.r4 = stk_sz;
396 thread->cpu_context.pc = (
unsigned long)ret_from_fork;
397 thread->cpu_context.sp = (
unsigned long)childregs;
399 clear_ptrace_hw_breakpoint(p);
404 thread_notify(THREAD_NOTIFY_COPY, thread);
424 int used_math = thread->used_cp[1] | thread->used_cp[2];
429 return used_math != 0;
440 frame.
fp = thread_saved_fp(p);
441 frame.
sp = thread_saved_sp(p);
450 }
while (count ++ < 16);
456 unsigned long range_end = mm->
brk + 0x02000000;
468 static int __init gate_vma_init(
void)
470 gate_vma.vm_start = 0xffff0000;
471 gate_vma.vm_end = 0xffff0000 +
PAGE_SIZE;
473 gate_vma.vm_flags = VM_READ | VM_EXEC |
474 VM_MAYREAD | VM_MAYEXEC;
486 return (addr >= gate_vma.vm_start) && (addr < gate_vma.vm_end);
496 return (vma == &gate_vma) ?
"[vectors]" :
NULL;