File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,7 +165,6 @@ LIBNAME = libisoalloc.so
165165UNAME := $(shell uname)
166166ifeq ($(UNAME ) , Darwin)
167167OS_FLAGS = -framework Security
168- CPU_PIN =
169168LIBNAME = libisoalloc.dylib
170169endif
171170
Original file line number Diff line number Diff line change 11LOCAL_PATH := $(call my-dir)
22include $(CLEAR_VARS )
33
4- LOCAL_CFLAGS := -DTHREAD_SUPPORT=1 -pthread \
4+ LOCAL_CFLAGS := -DTHREAD_SUPPORT=1 -pthread \
55 -DPRE_POPULATE_PAGES=0 -DSMALL_MEM_STARTUP=0 -DSANITIZE_CHUNKS=0 \
66 -DFUZZ_MODE=0 -DPERM_FREE_REALLOC=0 -DDISABLE_CANARY=0 -Werror \
77 -pedantic -Wno-pointer-arith -Wno-gnu-zero-variadic-macro-arguments \
88 -Wno-format-pedantic -DMALLOC_HOOK=1 -fvisibility=hidden -std=c11 \
9- -DALLOC_SANITY=0 -DUNINIT_READ_SANITY=0 -DCPU_PIN=0 -DEXPERIMENTAL=0 \
9+ -DALLOC_SANITY=0 -DUNINIT_READ_SANITY=0 -DCPU_PIN=0 -DEXPERIMENTAL=0 \
1010 -DUAF_PTR_PAGE=0 -DVERIFY_BIT_SLOT_CACHE=0 -DNAMED_MAPPINGS=1 -fPIC \
11- -shared -DDEBUG=1 -DLEAK_DETECTOR=1 -DMEM_USAGE=1 -DUSE_MLOCK=1 \
11+ -shared -DDEBUG=1 -DLEAK_DETECTOR=1 -DMEM_USAGE=1 -DUSE_MLOCK=1 -DSCHED_GETCPU \
1212 -g -ggdb3 -fno-omit-frame-pointer
1313
1414LOCAL_SRC_FILES := ../../src/iso_alloc.c ../../src/iso_alloc_printf.c ../../src/iso_alloc_random.c \
Original file line number Diff line number Diff line change @@ -22,6 +22,19 @@ INTERNAL_HIDDEN INLINE int _iso_getcpu(void) {
2222 : "=r" (a )
2323 : "r" (cpunodesegment ));
2424 return (int ) (a & 0xfff );
25+ #elif defined(__aarch64__ )
26+ #if __APPLE__
27+ /* unlike other operating systems, the tpidr_el0 register on macOs
28+ * is unused data stored for the current thread is instead fetchable
29+ * from "tpidrro_el0".
30+ */
31+ uintptr_t a ;
32+ __asm__ volatile ("mrs %x0, tpidrro_el0" : "=r" (a ) :: "memory" );
33+ return (int )((a & 0x8 ) - 1 );
34+ #else
35+ /* TODO most likely different register/making on other platforms */
36+ return -1 ;
37+ #endif
2538#else
2639 return -1 ;
2740#endif
You can’t perform that action at this time.
0 commit comments