11 #include <linux/errno.h>
12 #include <linux/sched.h>
14 #include <linux/kernel.h>
16 #include <linux/stddef.h>
18 #include <linux/export.h>
19 #include <linux/ptrace.h>
20 #include <linux/mman.h>
21 #include <linux/personality.h>
27 #include <linux/random.h>
30 #include <asm/bootinfo.h>
34 #include <asm/pgtable.h>
36 #include <asm/processor.h>
37 #include <asm/uaccess.h>
42 #include <asm/stacktrace.h>
58 tick_nohz_idle_enter();
61 #ifdef CONFIG_MIPS_MT_SMTC
74 #ifdef CONFIG_HOTPLUG_CPU
81 tick_nohz_idle_exit();
95 status |= test_thread_flag(TIF_32BIT_REGS) ? 0 :
ST0_FR;
120 unsigned long childksp;
136 childregs = (
struct pt_regs *) childksp - 1;
138 childksp = (
unsigned long) childregs;
140 childregs->
regs[7] = 0;
142 childregs->
regs[2] = 0;
145 childregs->
regs[28] = (
unsigned long) ti;
146 childregs->
regs[29] = childksp;
162 #ifdef CONFIG_MIPS_MT_SMTC
169 clear_tsk_thread_flag(p, TIF_USEDFPU);
171 #ifdef CONFIG_MIPS_MT_FPAFF
172 clear_tsk_thread_flag(p, TIF_FPUBOUND);
193 for (i = 0; i < EF_R0; i++)
196 for (i = 1; i <= 31; i++)
197 gp[EF_R0 + i] = regs->
regs[i];
200 gp[EF_LO] = regs->
lo;
201 gp[EF_HI] = regs->
hi;
202 gp[EF_CP0_EPC] = regs->
cp0_epc;
236 memset(®s, 0,
sizeof(regs));
242 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
304 max_insns =
min(128
U, max_insns);
306 for (i = 0; i < max_insns; i++, ip++) {
308 if (is_jal_jalr_jr_ins(ip))
311 if (is_sp_move_ins(ip))
315 if (info->
pc_offset == -1 && is_ra_save_ins(ip)) {
332 static int __init frame_info_init(
void)
334 unsigned long size = 0;
335 #ifdef CONFIG_KALLSYMS
341 schedule_mfi.func_size =
size;
343 get_frame_info(&schedule_mfi);
349 if (schedule_mfi.pc_offset < 0)
367 if (schedule_mfi.pc_offset < 0)
369 return ((
unsigned long *)t->
reg29)[schedule_mfi.pc_offset];
373 #ifdef CONFIG_KALLSYMS
375 unsigned long notrace unwind_stack_by_address(
unsigned long stack_page,
381 unsigned long size, ofs;
393 if (pc == (
unsigned long)ret_from_irq ||
394 pc == (
unsigned long)ret_from_exception) {
396 if (*sp >= stack_page &&
397 *sp +
sizeof(*regs) <= stack_page +
THREAD_SIZE - 32) {
401 *sp = regs->
regs[29];
402 *ra = regs->
regs[31];
419 info.
func = (
void *)(pc - ofs);
421 leaf = get_frame_info(&info);
425 if (*sp < stack_page ||
436 pc = pc != *ra ? *ra : 0;
438 pc = ((
unsigned long *)(*sp))[info.
pc_offset];
448 unsigned long pc,
unsigned long *ra)
451 return unwind_stack_by_address(stack_page, sp, pc, ra);
460 unsigned long pc = 0;
461 #ifdef CONFIG_KALLSYMS
463 unsigned long ra = 0;
473 #ifdef CONFIG_KALLSYMS
474 sp = task->
thread.reg29 + schedule_mfi.frame_size;