From b89aa87f042125b9cc4b59a0e9380231823cfa4d Mon Sep 17 00:00:00 2001 From: Venkataramanan Kumar Date: Tue, 8 Apr 2014 14:11:44 +0100 Subject: aarch64: Add setjmp and longjmp SystemTap probes Add setjmp, longjmp and longjmp_target SystemTap probes. ChangeLog: 2014-04-22 Will Newton Venkataramanan Kumar * sysdeps/aarch64/__longjmp.S: Include stap-probe.h. (__longjmp): Add longjmp and longjmp_target SystemTap probes. * sysdeps/aarch64/setjmp.S: Include stap-probe.h. (__sigsetjmp): Add setjmp SystemTap probe. --- libc/ports/ChangeLog.aarch64.linaro | 9 +++++++++ libc/ports/sysdeps/aarch64/__longjmp.S | 10 ++++++++++ libc/ports/sysdeps/aarch64/setjmp.S | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/libc/ports/ChangeLog.aarch64.linaro b/libc/ports/ChangeLog.aarch64.linaro index be992403a..6e7504574 100644 --- a/libc/ports/ChangeLog.aarch64.linaro +++ b/libc/ports/ChangeLog.aarch64.linaro @@ -1,3 +1,12 @@ +2014-04-22 Will Newton + Venkataramanan Kumar + + * sysdeps/aarch64/__longjmp.S: Include stap-probe.h. + (__longjmp): Add longjmp and longjmp_target SystemTap + probes. + * sysdeps/aarch64/setjmp.S: Include stap-probe.h. + (__sigsetjmp): Add setjmp SystemTap probe. + 2014-04-17 Will Newton [BZ #16629] diff --git a/libc/ports/sysdeps/aarch64/__longjmp.S b/libc/ports/sysdeps/aarch64/__longjmp.S index 2d38bbf6a..1bb7be368 100644 --- a/libc/ports/sysdeps/aarch64/__longjmp.S +++ b/libc/ports/sysdeps/aarch64/__longjmp.S @@ -18,6 +18,7 @@ #include #include +#include /* __longjmp(jmpbuf, val) */ @@ -56,6 +57,10 @@ ENTRY (__longjmp) #else ldp x29, x30, [x0, #JB_X29<<3] #endif + /* longjmp probe takes 3 arguments, address of jump buffer as + first argument (8@x0), return value as second argument (-4@x1), + and target address (8@x30), respectively. */ + LIBC_PROBE (longjmp, 3, 8@x0, -4@x1, 8@x30) ldp d8, d9, [x0, #JB_D8<<3] ldp d10, d11, [x0, #JB_D10<<3] ldp d12, d13, [x0, #JB_D12<<3] @@ -98,6 +103,11 @@ ENTRY (__longjmp) ldr x5, [x0, #JB_SP<<3] #endif mov sp, x5 + + /* longjmp_target probe takes 3 arguments, address of jump buffer + as first argument (8@x0), return value as second argument (-4@x1), + and target address (8@x30), respectively. */ + LIBC_PROBE (longjmp_target, 3, 8@x0, -4@x1, 8@x30) cmp x1, #0 mov x0, #1 csel x0, x1, x0, ne diff --git a/libc/ports/sysdeps/aarch64/setjmp.S b/libc/ports/sysdeps/aarch64/setjmp.S index 5822abd87..fd3931992 100644 --- a/libc/ports/sysdeps/aarch64/setjmp.S +++ b/libc/ports/sysdeps/aarch64/setjmp.S @@ -18,6 +18,7 @@ #include #include +#include /* Keep traditional entry points in with sigsetjmp(). */ ENTRY (setjmp) @@ -46,6 +47,10 @@ ENTRY (__sigsetjmp) #else stp x29, x30, [x0, #JB_X29<<3] #endif + /* setjmp probe takes 3 arguments, address of jump buffer + first argument (8@x0), return value second argument (-4@x1), + and target address (8@x30), respectively. */ + LIBC_PROBE (setjmp, 3, 8@x0, -4@x1, 8@x30) stp d8, d9, [x0, #JB_D8<<3] stp d10, d11, [x0, #JB_D10<<3] stp d12, d13, [x0, #JB_D12<<3] -- cgit v1.2.3