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