This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 09/15] RISC-V: Atomic and Locking Routines
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Palmer Dabbelt <palmer at dabbelt dot com>
- Cc: <libc-alpha at sourceware dot org>, Andrew Waterman <andrew at sifive dot com>, Darius Rad <darius at bluespec dot com>, <dj at redhat dot com>
- Date: Wed, 20 Dec 2017 17:08:18 +0000
- Subject: Re: [PATCH v2 09/15] RISC-V: Atomic and Locking Routines
- Authentication-results: sourceware.org; auth=none
- References: <20171220072022.26909-1-palmer@dabbelt.com> <20171220072022.26909-10-palmer@dabbelt.com>
On Tue, 19 Dec 2017, Palmer Dabbelt wrote:
> This patch implements various atomic and locking routines on RISC-V,
> either via the A extension (when present) or via a Linux system call
> that does a compare-and-exchange. This contains both the library
> routines and the syscall wrapper.
You said in the introduction that the 'A' extension would be required for
Linux. I think you need to update the patch description - *and* the patch
itself - to reflect that.
> diff --git a/sysdeps/riscv/rv64/rvd/s_roundeven.c b/sysdeps/riscv/rv64/rvd/s_roundeven.c
Does not belong in this patch.
> diff --git a/sysdeps/riscv/rv64/rvf/s_llrintf.c b/sysdeps/riscv/rv64/rvf/s_llrintf.c
Likewise.
> +#ifdef __riscv_atomic
> +
> +#define __HAVE_64B_ATOMICS (__riscv_xlen >= 64)
> +#define USE_ATOMIC_COMPILER_BUILTINS 1
> +#define ATOMIC_EXCHANGE_USES_CAS 0
Missing preprocessor indentation.
> +/* Miscellaneous. */
> +
> +#define asm_amo(which, ordering, mem, value) ({ \
Likewise, in this part of the file.
> +#else /* __riscv_atomic */
And this part of the file should now just have a #error. (Giving an error
for non-A at configure time would be a good idea as well, so the bad
configuration gets detected as early as possible.)
--
Joseph S. Myers
joseph@codesourcery.com