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 19, 2020
1 parent 9ae8c87 commit 4c6e2e3
Show file tree
Hide file tree
Showing 5 changed files with 490 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 @@ -244,6 +244,7 @@ cc_library(
hdrs = ["percpu.h"],
copts = TCMALLOC_DEFAULT_COPTS,
textual_hdrs = [
"percpu_rseq_aarch64.S",
"percpu_rseq_ppc.S",
"percpu_rseq_x86_64.S",
],
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 4c6e2e3

Please sign in to comment.