diff options
Diffstat (limited to 'include/libunwind-aarch64.h')
-rw-r--r-- | include/libunwind-aarch64.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/include/libunwind-aarch64.h b/include/libunwind-aarch64.h index 85812e15..11e2a9c1 100644 --- a/include/libunwind-aarch64.h +++ b/include/libunwind-aarch64.h @@ -44,9 +44,13 @@ extern "C" { leaving some slack for future expansion. Changing this value will require recompiling all users of this library. Stack allocation is relatively cheap and unwind-state copying is relatively rare, so we - want to err on making it rather too big than too small. */ + want to err on making it rather too big than too small. -#define UNW_TDEP_CURSOR_LEN 512 + Calculation is regs used (64 + 34) * 2 + 40 (bytes of rest of + cursor) + padding +*/ + +#define UNW_TDEP_CURSOR_LEN 250 typedef uint64_t unw_word_t; typedef int64_t unw_sword_t; @@ -169,8 +173,28 @@ typedef struct unw_tdep_save_loc unw_tdep_save_loc_t; -/* On AArch64, we can directly use ucontext_t as the unwind context. */ -typedef ucontext_t unw_tdep_context_t; +/* On AArch64, we can directly use ucontext_t as the unwind context, + * however, the __reserved struct is quite large: tune it down to only + * the necessary used fields. */ + +struct unw_sigcontext + { + uint64_t fault_address; + uint64_t regs[31]; + uint64_t sp; + uint64_t pc; + uint64_t pstate; + uint8_t __reserved[(34 * 8)] __attribute__((__aligned__(16))); +}; + +typedef struct + { + unsigned long uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + __sigset_t uc_sigmask; + struct unw_sigcontext uc_mcontext; + } unw_tdep_context_t; #include "libunwind-common.h" #include "libunwind-dynamic.h" |