13 #include <linux/elf.h>
14 #include <linux/errno.h>
16 #include <linux/kernel.h>
18 #include <linux/slab.h>
19 #include <linux/module.h>
21 #include <linux/personality.h>
22 #include <linux/sched.h>
23 #include <linux/stddef.h>
30 #include <linux/utsname.h>
35 #include <asm/delay.h>
38 #include <asm/kexec.h>
39 #include <asm/pgalloc.h>
40 #include <asm/processor.h>
42 #include <asm/switch_to.h>
43 #include <asm/tlbflush.h>
44 #include <asm/uaccess.h>
45 #include <asm/unwind.h>
51 # include <asm/perfmon.h>
68 unsigned long ip,
sp, bsp;
73 unw_get_ip(info, &ip);
77 unw_get_sp(info, &sp);
78 unw_get_bsp(info, &bsp);
81 " sp=%016lx bsp=%016lx\n",
83 print_symbol(buf, ip);
114 printk(
"\nPid: %d, CPU %d, comm: %20s\n", task_pid_nr(
current),
116 printk(
"psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s)\n",
119 print_symbol(
"ip is at %s\n", ip);
120 printk(
"unat: %016lx pfs : %016lx rsc : %016lx\n",
122 printk(
"rnat: %016lx bsps: %016lx pr : %016lx\n",
124 printk(
"ldrs: %016lx ccv : %016lx fpsr: %016lx\n",
127 printk(
"b0 : %016lx b6 : %016lx b7 : %016lx\n", regs->
b0, regs->
b6, regs->
b7);
128 printk(
"f6 : %05lx%016lx f7 : %05lx%016lx\n",
129 regs->
f6.u.bits[1], regs->
f6.u.bits[0],
130 regs->
f7.u.bits[1], regs->
f7.u.bits[0]);
131 printk(
"f8 : %05lx%016lx f9 : %05lx%016lx\n",
132 regs->
f8.u.bits[1], regs->
f8.u.bits[0],
133 regs->
f9.u.bits[1], regs->
f9.u.bits[0]);
134 printk(
"f10 : %05lx%016lx f11 : %05lx%016lx\n",
135 regs->
f10.u.bits[1], regs->
f10.u.bits[0],
136 regs->
f11.u.bits[1], regs->
f11.u.bits[0]);
138 printk(
"r1 : %016lx r2 : %016lx r3 : %016lx\n", regs->
r1, regs->
r2, regs->
r3);
139 printk(
"r8 : %016lx r9 : %016lx r10 : %016lx\n", regs->
r8, regs->
r9, regs->
r10);
140 printk(
"r11 : %016lx r12 : %016lx r13 : %016lx\n", regs->
r11, regs->
r12, regs->
r13);
141 printk(
"r14 : %016lx r15 : %016lx r16 : %016lx\n", regs->
r14, regs->
r15, regs->
r16);
142 printk(
"r17 : %016lx r18 : %016lx r19 : %016lx\n", regs->
r17, regs->
r18, regs->
r19);
143 printk(
"r20 : %016lx r21 : %016lx r22 : %016lx\n", regs->
r20, regs->
r21, regs->
r22);
144 printk(
"r23 : %016lx r24 : %016lx r25 : %016lx\n", regs->
r23, regs->
r24, regs->
r25);
145 printk(
"r26 : %016lx r27 : %016lx r28 : %016lx\n", regs->
r26, regs->
r27, regs->
r28);
146 printk(
"r29 : %016lx r30 : %016lx r31 : %016lx\n", regs->
r29, regs->
r30, regs->
r31);
150 unsigned long val, *
bsp, ndirty;
151 int i, sof, is_nat = 0;
153 sof = regs->
cr_ifs & 0x7f;
154 ndirty = (regs->
loadrs >> 19);
155 bsp = ia64_rse_skip_regs((
unsigned long *) regs->
ar_bspstore, ndirty);
156 for (i = 0; i < sof; ++
i) {
157 get_user(val, (
unsigned long __user *) ia64_rse_skip_regs(bsp, i));
158 printk(
"r%-3u:%c%016lx%s", 32 + i, is_nat ?
'*' :
' ', val,
159 ((i == sof - 1) || (i % 3) == 2) ?
"\n" :
" ");
185 #ifdef CONFIG_PERFMON
186 if (
current->thread.pfm_needs_checking)
202 tracehook_notify_resume(&scr->
pt);
214 static int pal_halt = 1;
215 static int can_do_pal_halt = 1;
217 static int __init nohalt_setup(
char *
str)
219 pal_halt = can_do_pal_halt = 0;
222 __setup(
"nohalt", nohalt_setup);
227 can_do_pal_halt = pal_halt &&
status;
237 while (!need_resched()) {
238 if (can_do_pal_halt) {
240 if (!need_resched()) {
249 #ifdef CONFIG_HOTPLUG_CPU
251 static inline void play_dead(
void)
261 ia64_jump_to_sal(&sal_boot_rendez_state[this_cpu]);
269 static inline void play_dead(
void)
284 if (can_do_pal_halt) {
295 if (!need_resched()) {
325 #ifdef CONFIG_PERFMON
332 #ifdef CONFIG_PERFMON
345 #ifdef CONFIG_PERFMON
352 #ifdef CONFIG_PERFMON
395 unsigned long user_stack_base,
unsigned long user_stack_size,
398 extern char ia64_ret_from_clone;
400 unsigned long rbs, child_rbs, rbs_size;
419 memcpy(child_stack, stack,
sizeof(*child_ptregs) +
sizeof(*child_stack));
426 memcpy((
void *) child_rbs, (
void *) rbs, rbs_size);
430 child_ptregs->
r13 = regs->
r16;
431 if (user_stack_base) {
432 child_ptregs->
r12 = user_stack_base + user_stack_size - 16;
445 child_ptregs->
r12 = (
unsigned long) child_ptregs - 16;
446 child_ptregs->
r13 = (
unsigned long) p;
449 child_stack->
b0 = (
unsigned long) &ia64_ret_from_clone;
452 p->
thread.ksp = (
unsigned long) child_stack - 16;
478 # define THREAD_FLAGS_TO_CLEAR (IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID \
479 | IA64_THREAD_PM_VALID)
480 # define THREAD_FLAGS_TO_SET 0
485 #ifdef CONFIG_PERFMON
486 if (
current->thread.pfm_context)
507 unw_get_sp(info, &sp);
508 pt = (
struct pt_regs *) (sp + 16);
515 ia64_peek(task, info->
sw, urbs_end, (
long) ia64_rse_rnat_addr((
long *) urbs_end),
530 for (i = 1, mask = (1
UL << i); i < 32; ++
i) {
539 for (i = 0; i < 8; ++
i)
542 unw_get_rp(info, &
ip);
578 for (i = 2; i < 32; ++
i)
589 do_copy_task_regs(
current, info, arg);
613 const char __user *
const __user *argv,
614 const char __user *
const __user *envp,
617 struct filename *
fname;
621 error = PTR_ERR(fname);
633 extern void start_kernel_thread (
void);
634 unsigned long *helper_fptr = (
unsigned long *) &start_kernel_thread;
641 regs.pt.cr_iip = helper_fptr[0];
642 regs.pt.r1 = helper_fptr[1];
647 regs.pt.cr_ifs = 1
UL << 63;
682 #ifdef CONFIG_PERFMON
684 if (
current->thread.pfm_context)
717 unw_get_ip(&info, &ip);
720 }
while (count++ < 16);
728 unsigned long min_power;
729 int i, min_power_state;
731 if (ia64_pal_halt_info(power_info) != 0)
736 for (i = 1; i < 8; ++
i)
737 if (power_info[i].pal_power_mgmt_info_s.
im
744 ia64_pal_halt(min_power_state);
749 #ifdef CONFIG_HOTPLUG_CPU