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

aarch32 support #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion lib/bindings/barrier_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define mb() __asm__ __volatile__("mfence" ::: "memory")
#define rmb() __asm__ __volatile__("lfence" ::: "memory")
#define wmb() __asm__ __volatile__("sfence" ::: "memory")
#elif defined(__aarch64__)
#elif defined(__aarch64__) || defined(__arm__)
#define dsb(opt) __asm__ __volatile__("dsb " #opt ::: "memory")
#define mb() dsb(sy)
#define rmb() dsb(ld)
Expand Down
4 changes: 4 additions & 0 deletions lib/bindings/cstruct_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ caml_fill_bigstring(value val_buf, value val_ofs, value val_len, value val_byte)
CAMLprim value
caml_check_alignment_bigstring(value val_buf, value val_ofs, value val_alignment)
{
#if defined(__BITS_32__)
uint32_t address = (uint32_t) (Caml_ba_data_val(val_buf) + Long_val(val_ofs));
#else
uint64_t address = (uint64_t) (Caml_ba_data_val(val_buf) + Long_val(val_ofs));
#endif
int alignment = Int_val(val_alignment);
return Val_bool(address % alignment == 0);
}