]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/wrappers/remove-counter.c
xnu-4570.1.46.tar.gz
[apple/xnu.git] / libsyscall / wrappers / remove-counter.c
index fe41f2757fff32ebb95ecd41a0cfdc72a0214c16..f1757a654d8933253feb14c0af46ea8800ddc907 100644 (file)
@@ -22,6 +22,9 @@
  */
 
 #include <sys/types.h>
+#if defined(__arm__)
+#include <arm/arch.h>
+#endif
 
 #if defined(__ppc64__) || defined(__i386__) || defined(__x86_64__)
 static int64_t __remove_counter = 0;
@@ -31,11 +34,19 @@ static int32_t __remove_counter = 0;
 
 __uint64_t
 __get_remove_counter(void) {
+#if defined(__arm__) && !defined(_ARM_ARCH_6)
+       return __remove_counter;
+#else
        return __sync_add_and_fetch(&__remove_counter, 0);
+#endif
 }
 
 void
 __inc_remove_counter(void)
 {
+#if defined(__arm__) && !defined(_ARM_ARCH_6)
+       __remove_counter++;
+#else
        __sync_add_and_fetch(&__remove_counter, 1);
+#endif
 }