Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AArch64 support for RSEQ. #50

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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