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 support for arm64 (M1 mac) #35

Merged
merged 2 commits into from
Feb 11, 2023
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
unreleased
------------------------
* add support for `arm64` (M1 mac) (PR #35, @johnyob)

version 1.4, 15 aug 2021
------------------------
* switch to github actions
Expand Down
2 changes: 1 addition & 1 deletion landmarks.opam
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ build: [
]
]
dev-repo: "git+https://github.com/LexiFi/landmarks.git"
available: arch = "x86_64" | arch = "x86_32"
available: arch = "x86_64" | arch = "x86_32" | arch = "arm64"
2 changes: 1 addition & 1 deletion landmarks.opam.template
Original file line number Diff line number Diff line change
@@ -1 +1 @@
available: arch = "x86_64" | arch = "x86_32"
available: arch = "x86_64" | arch = "x86_32" | arch = "arm64"
4 changes: 4 additions & 0 deletions src/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ CAMLprim value caml_highres_clock(value unit)
int64_t v;
v = __rdtsc();
return caml_copy_int64(v);
#elif defined(__aarch64__)
uint64_t v;
__asm__ __volatile__ ("mrs %0, cntvct_el0" : "=r"(v));
return caml_copy_int64(v);
#elif defined(__GNUC__)
uint32_t hi = 0, lo = 0;
__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
Expand Down