Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Dec 2019 03:20:38 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355841 - head/sys/mips/include
Message-ID:  <201912170320.xBH3KcU5098483@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue Dec 17 03:20:37 2019
New Revision: 355841
URL: https://svnweb.freebsd.org/changeset/base/355841

Log:
  Two minor issues:
  (1) Don't define load/store 64 atomics for o32. They aren't atomic
  there.
  (2) Add comment about why we need 64 atomic define on n32 only.

Modified:
  head/sys/mips/include/atomic.h

Modified: head/sys/mips/include/atomic.h
==============================================================================
--- head/sys/mips/include/atomic.h	Tue Dec 17 02:02:26 2019	(r355840)
+++ head/sys/mips/include/atomic.h	Tue Dec 17 03:20:37 2019	(r355841)
@@ -345,10 +345,16 @@ atomic_store_rel_##WIDTH(__volatile uint##WIDTH##_t *p
 }
 
 ATOMIC_STORE_LOAD(32)
+#if defined(__mips_n64) || defined(__mips_n32)
 ATOMIC_STORE_LOAD(64)
+#endif
 #undef ATOMIC_STORE_LOAD
 
-#ifdef __mips_n32
+/*
+ * MIPS n32 is not a LP64 API, so atomic_load_64 isn't defined there. Define it
+ * here since n32 is an oddball !LP64 but that can do 64-bit atomics.
+ */
+#if defined(__mips_n32)
 #define	atomic_load_64	atomic_load_acq_64
 #endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912170320.xBH3KcU5098483>