Skip to content

Commit

Permalink
Add AArch64 support for RSEQ.
Browse files Browse the repository at this point in the history
  • Loading branch information
avieira-arm committed Oct 12, 2020
1 parent 9ae8c87 commit ca67797
Show file tree
Hide file tree
Showing 5 changed files with 489 additions and 2 deletions.
1 change: 1 addition & 0 deletions tcmalloc/internal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ cc_library(
textual_hdrs = [
"percpu_rseq_ppc.S",
"percpu_rseq_x86_64.S",
"percpu_rseq_aarch64.S",
],
visibility = [
"//tcmalloc:__subpackages__",
Expand Down
2 changes: 1 addition & 1 deletion tcmalloc/internal/linux_syscall_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static_assert(sizeof(kernel_rseq_cs) == (4 * sizeof(unsigned long long)),
#if defined(__x86_64__)
#define __NR_rseq 334
#elif defined(__aarch64__)
#define __NR_rseq 398
#define __NR_rseq 293
#elif defined(__PPC__)
#define __NR_rseq 387
#endif
Expand Down
5 changes: 4 additions & 1 deletion tcmalloc/internal/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

// TCMALLOC_PERCPU_RSEQ_SUPPORTED_PLATFORM defines whether or not we have an
// implementation for the target OS and architecture.
#if defined(__linux__) && (defined(__x86_64__) || defined(__PPC64__))
#if defined(__linux__) && \
(defined(__x86_64__) || defined(__PPC64__) || defined (__aarch64__))
#define TCMALLOC_PERCPU_RSEQ_SUPPORTED_PLATFORM 1
#else
#define TCMALLOC_PERCPU_RSEQ_SUPPORTED_PLATFORM 0
Expand All @@ -31,6 +32,8 @@
#define TCMALLOC_PERCPU_RSEQ_SIGNATURE 0x53053053
#elif defined(__ppc__)
#define TCMALLOC_PERCPU_RSEQ_SIGNATURE 0x0FE5000B
#elif defined(__aarch64__)
#define TCMALLOC_PERCPU_RSEQ_SIGNATURE 0xd428bc00
#else
// Rather than error, allow us to build, but with an invalid signature.
#define TCMALLOC_PERCPU_RSEQ_SIGNATURE 0x0
Expand Down
Loading

0 comments on commit ca67797

Please sign in to comment.