Module Name:    src
Committed By:   christos
Date:           Fri Jan 31 19:49:14 UTC 2025

Modified Files:
        src/external/bsd/jemalloc/include/jemalloc/internal:
            jemalloc_internal_defs.h

Log Message:
bring some more changes from the jemalloc.old and add arm spinlocks


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
    src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
diff -u src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.16 src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.17
--- src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h:1.16	Mon Sep 23 17:08:37 2024
+++ src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h	Fri Jan 31 14:49:14 2025
@@ -33,9 +33,15 @@
  * Hyper-threaded CPUs may need a special instruction inside spin loops in
  * order to yield to another virtual CPU.
  */
+#if defined(__x86_64__) || defined(__i386__)
 #define CPU_SPINWAIT __asm__ volatile("pause")
 /* 1 if CPU_SPINWAIT is defined, 0 otherwise. */
 #define HAVE_CPU_SPINWAIT 1
+#elif defined(__arm__) || defined(__aarch64__)
+#define CPU_SPINWAIT __asm__ volatile("isb")
+/* 1 if CPU_SPINWAIT is defined, 0 otherwise. */
+#define HAVE_CPU_SPINWAIT 1
+#endif
 
 /*
  * Number of significant bits in virtual addresses.  This may be less than the
@@ -43,9 +49,20 @@
  * bits are the same as bit 47.
  */
 #ifdef _LP64
-#define LG_VADDR 48
+# ifdef __alpha__
+/*
+ * Bit 42 indicates kernel space. Bits 42--63 must be same. For user space,
+ * VA can be regarded to have 43 significant bits with sign-extension to
+ * 64 bits. ``Negative'' addresses are not used in this case. Alternatively,
+ * VA can also be regarded to have 42 significant bits with zero-extension.
+ * See rtree_leaf_elm_bits_extent_get() in rtree.h for more details.
+ */
+#  define LG_VADDR 43
+# else
+#  define LG_VADDR 48
+# endif
 #else
-#define LG_VADDR 32
+# define LG_VADDR 32
 #endif
 
 /* Defined if C11 atomics are available. */

Reply via email to