summaryrefslogtreecommitdiff
path: root/lib/sbi/riscv_atomic.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-03-04 08:38:35 +0300
committerAnup Patel <anup@brainfault.org>2020-03-08 08:36:18 +0300
commit00d332bbe726d85e4c2b81ab0a08182612f96c03 (patch)
tree7e0a75570a8b92bff0d74b2141869ce99dd7171a /lib/sbi/riscv_atomic.c
parent8c83fb2fc8ef0c356f291a7e6517dad70a759981 (diff)
downloadopensbi-00d332bbe726d85e4c2b81ab0a08182612f96c03.tar.xz
include: Move bits related defines and macros to sbi_bitops.h
The right location for all bits related defines and macros is sbi_bitops.h hence this patch. With this patch, the sbi_bits.h is redundant so we remove it. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/riscv_atomic.c')
-rw-r--r--lib/sbi/riscv_atomic.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/sbi/riscv_atomic.c b/lib/sbi/riscv_atomic.c
index 8b85801..9d8199e 100644
--- a/lib/sbi/riscv_atomic.c
+++ b/lib/sbi/riscv_atomic.c
@@ -7,11 +7,10 @@
* Anup Patel <anup.patel@wdc.com>
*/
-#include <sbi/sbi_types.h>
+#include <sbi/sbi_bitops.h>
#include <sbi/riscv_asm.h>
#include <sbi/riscv_atomic.h>
#include <sbi/riscv_barrier.h>
-#include <sbi/sbi_bits.h>
long atomic_read(atomic_t *atom)
{
@@ -209,12 +208,12 @@ unsigned long atomic_raw_xchg_ulong(volatile unsigned long *ptr,
#endif
}
-#if (BITS_PER_LONG == 64)
+#if (__SIZEOF_POINTER__ == 8)
#define __AMO(op) "amo" #op ".d"
-#elif (BITS_PER_LONG == 32)
+#elif (__SIZEOF_POINTER__ == 4)
#define __AMO(op) "amo" #op ".w"
#else
-#error "Unexpected BITS_PER_LONG"
+#error "Unexpected __SIZEOF_POINTER__"
#endif
#define __atomic_op_bit_ord(op, mod, nr, addr, ord) \