| 1 |
/* -*- linux-c -*- |
| 2 |
* |
| 3 |
* MIPS dwarf unwinder header file |
| 4 |
* |
| 5 |
* This file is part of systemtap, and is free software. You can |
| 6 |
* redistribute it and/or modify it under the terms of the GNU General |
| 7 |
* Public License (GPL); either version 2, or (at your option) any |
| 8 |
* later version. |
| 9 |
*/ |
| 10 |
#ifndef _STP_ARM_UNWIND_H |
| 11 |
#define _STP_ARM_UNWIND_H |
| 12 |
|
| 13 |
#include <linux/sched.h> |
| 14 |
#include <asm/ptrace.h> |
| 15 |
|
| 16 |
#define _stp_get_unaligned(ptr) (*(ptr)) |
| 17 |
|
| 18 |
#define UNW_PC(frame) (frame)->regs.cp0_epc |
| 19 |
#define UNW_SP(frame) (frame)->regs.regs[29] |
| 20 |
|
| 21 |
#define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1)) |
| 22 |
|
| 23 |
#define UNW_REGISTER_INFO \ |
| 24 |
PTREGS_INFO(regs[0]), \ |
| 25 |
PTREGS_INFO(regs[1]), \ |
| 26 |
PTREGS_INFO(regs[2]), \ |
| 27 |
PTREGS_INFO(regs[3]), \ |
| 28 |
PTREGS_INFO(regs[4]), \ |
| 29 |
PTREGS_INFO(regs[5]), \ |
| 30 |
PTREGS_INFO(regs[6]), \ |
| 31 |
PTREGS_INFO(regs[7]), \ |
| 32 |
PTREGS_INFO(regs[8]), \ |
| 33 |
PTREGS_INFO(regs[9]), \ |
| 34 |
PTREGS_INFO(regs[10]), \ |
| 35 |
PTREGS_INFO(regs[11]), \ |
| 36 |
PTREGS_INFO(regs[12]), \ |
| 37 |
PTREGS_INFO(regs[13]), \ |
| 38 |
PTREGS_INFO(regs[14]), \ |
| 39 |
PTREGS_INFO(regs[16]), \ |
| 40 |
PTREGS_INFO(regs[17]), \ |
| 41 |
PTREGS_INFO(regs[18]), \ |
| 42 |
PTREGS_INFO(regs[19]), \ |
| 43 |
PTREGS_INFO(regs[20]), \ |
| 44 |
PTREGS_INFO(regs[21]), \ |
| 45 |
PTREGS_INFO(regs[22]), \ |
| 46 |
PTREGS_INFO(regs[23]), \ |
| 47 |
PTREGS_INFO(regs[24]), \ |
| 48 |
PTREGS_INFO(regs[26]), \ |
| 49 |
PTREGS_INFO(regs[27]), \ |
| 50 |
PTREGS_INFO(regs[28]), \ |
| 51 |
PTREGS_INFO(regs[29]), \ |
| 52 |
PTREGS_INFO(regs[30]), \ |
| 53 |
PTREGS_INFO(regs[31]), \ |
| 54 |
PTREGS_INFO(lo), \ |
| 55 |
PTREGS_INFO(hi), \ |
| 56 |
PTREGS_INFO(cp0_epc) |
| 57 |
|
| 58 |
#define UNW_PC_IDX 34 |
| 59 |
#define UNW_SP_IDX 29 |
| 60 |
|
| 61 |
/* Use default rules. The stack pointer should be set from the CFA. |
| 62 |
And the instruction pointer should be set from the return address |
| 63 |
column (which normally is the return register (regs[31]). */ |
| 64 |
|
| 65 |
static inline void arch_unw_init_frame_info(struct unwind_frame_info *info, |
| 66 |
/*const*/ struct pt_regs *regs, |
| 67 |
int sanitize) |
| 68 |
{ |
| 69 |
if (&info->regs == regs) { /* happens when unwinding kernel->user */ |
| 70 |
info->call_frame = 1; |
| 71 |
return; |
| 72 |
} |
| 73 |
|
| 74 |
memset(info, 0, sizeof(*info)); |
| 75 |
/* XXX handle sanitize??? */ |
| 76 |
info->regs = *regs; |
| 77 |
} |
| 78 |
|
| 79 |
#endif /* _STP_ARM_UNWIND_H */ |