about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibpthread_private.h
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-09 14:53:24 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-09 14:53:24 +0100
commit367e4ac3f7c602e8f979b20b38673b1c878ea78f (patch)
tree4ffe9879fe807b839cbdd74e5f65311ef6799257 /src/wrapped/wrappedlibpthread_private.h
parent094f961a0a362899093291c82fb861e964b5d9cc (diff)
downloadbox64-367e4ac3f7c602e8f979b20b38673b1c878ea78f.tar.gz
box64-367e4ac3f7c602e8f979b20b38673b1c878ea78f.zip
pthread_mutex_t is larger on ARM64 than on x86_64, that's unfortunate, but all mutex based function need alignements
Diffstat (limited to 'src/wrapped/wrappedlibpthread_private.h')
-rwxr-xr-xsrc/wrapped/wrappedlibpthread_private.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibpthread_private.h b/src/wrapped/wrappedlibpthread_private.h
index 68cd47d4..23a2a6a5 100755
--- a/src/wrapped/wrappedlibpthread_private.h
+++ b/src/wrapped/wrappedlibpthread_private.h
@@ -100,6 +100,7 @@ GO(pthread_mutexattr_setpshared, iFpi)
 GO(__pthread_mutexattr_settype, iFpi)
 GO(pthread_mutexattr_settype, iFpi)
 // pthread_mutex_consistent_np
+#ifdef NOALIGN
 GO(__pthread_mutex_destroy, iFp)
 GO(pthread_mutex_destroy, iFp)
 // pthread_mutex_getprioceiling
@@ -113,6 +114,22 @@ GO(__pthread_mutex_trylock, iFp)
 GO(pthread_mutex_trylock, iFp)
 GO(__pthread_mutex_unlock, iFp)
 GO(pthread_mutex_unlock, iFp)
+#else
+// phtread_mutex_t is 40 bytes on x86_64, but 48bytes on ARM64
+GOM(__pthread_mutex_destroy, iFp)
+GOM(pthread_mutex_destroy, iFp)
+// pthread_mutex_getprioceiling
+GOM(__pthread_mutex_init, iFpp)
+GOM(pthread_mutex_init, iFpp)
+GOM(__pthread_mutex_lock, iFp)
+GOM(pthread_mutex_lock, iFp)
+// pthread_mutex_setprioceiling
+GOM(pthread_mutex_timedlock, iFpp)
+GOM(__pthread_mutex_trylock, iFp)
+GOM(pthread_mutex_trylock, iFp)
+GOM(__pthread_mutex_unlock, iFp)
+GOM(pthread_mutex_unlock, iFp)
+#endif
 GOM(pthread_once, iFEpp)
 GOM(__pthread_once, iFEpp)
 GOM(__pthread_register_cancel, vFEp)