Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/arch/aarch64/atomic Do previous differently ...



details:   https://anonhg.NetBSD.org/src/rev/faaf4ce89f8b
branches:  trunk
changeset: 961837:faaf4ce89f8b
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Apr 21 16:23:47 2021 +0000

description:
Do previous differently as the API is different.

diffstat:

 common/lib/libc/arch/aarch64/atomic/Makefile.inc             |  10 +-
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_acq.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_acq_rel.S |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_rel.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_relax.S   |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_acq.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_acq_rel.S |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_rel.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_relax.S   |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp4_acq.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp4_acq_rel.S |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp4_rel.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp4_relax.S   |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp8_acq.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp8_acq_rel.S |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp8_rel.S     |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/__aarch64_swp8_relax.S   |  41 +++++++++++
 common/lib/libc/arch/aarch64/atomic/atomic_swap_16.S         |   3 +-
 common/lib/libc/arch/aarch64/atomic/atomic_swap_32.S         |   3 +-
 common/lib/libc/arch/aarch64/atomic/atomic_swap_64.S         |   3 +-
 common/lib/libc/arch/aarch64/atomic/atomic_swap_8.S          |   3 +-
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_16.S     |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_32.S     |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_64.S     |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_8.S      |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_rel_16.S |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_rel_32.S |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_rel_64.S |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_acq_rel_8.S  |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_rel_16.S     |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_rel_32.S     |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_rel_64.S     |  44 ------------
 common/lib/libc/arch/aarch64/atomic/atomic_swap_rel_8.S      |  44 ------------
 33 files changed, 665 insertions(+), 541 deletions(-)

diffs (truncated from 1388 to 300 lines):

diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/Makefile.inc
--- a/common/lib/libc/arch/aarch64/atomic/Makefile.inc  Wed Apr 21 14:04:26 2021 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/Makefile.inc  Wed Apr 21 16:23:47 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.2 2021/04/21 07:31:37 skrll Exp $
+# $NetBSD: Makefile.inc,v 1.3 2021/04/21 16:23:47 skrll Exp $
 
 .if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
        || ${LIB} == "rump")
@@ -12,10 +12,10 @@
 SRCS.atomic+=  atomic_inc_32.S atomic_inc_64.S
 SRCS.atomic+=  membar_ops.S
 #and cas nand or sub swap xor
-.for op in swap
-.for sz in 8 16 32 64
-.for ar in acq rel acq_rel
-SRCS.atomic+=  atomic_${op}_${ar}_${sz}.S
+.for op in swp
+.for sz in 1 2 4 8
+.for ar in relax acq rel acq_rel
+SRCS.atomic+=  __aarch64_${op}${sz}_${ar}.S
 .endfor
 .endfor
 .endfor
diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_acq.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_acq.S  Wed Apr 21 16:23:47 2021 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: __aarch64_swp1_acq.S,v 1.1 2021/04/21 16:23:47 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "atomic_op_asm.h"
+
+ENTRY_NP(__aarch64_swp1_acq)
+       mov     x4, x0
+1:     ldaxrb  w0, [x1]
+       stxrb   w3, w4, [x1]
+       cbnz    w3, 2f
+       ret
+2:     b       1b
+END(__aarch64_swp1_acq)
diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_acq_rel.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_acq_rel.S      Wed Apr 21 16:23:47 2021 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: __aarch64_swp1_acq_rel.S,v 1.1 2021/04/21 16:23:47 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "atomic_op_asm.h"
+
+ENTRY_NP(__aarch64_swp1_acq_rel)
+       mov     x4, x0
+1:     ldaxrb  w0, [x1]
+       stlxrb  w3, w4, [x1]
+       cbnz    w3, 2f
+       ret
+2:     b       1b
+END(__aarch64_swp1_acq_rel)
diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_rel.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_rel.S  Wed Apr 21 16:23:47 2021 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: __aarch64_swp1_rel.S,v 1.1 2021/04/21 16:23:47 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "atomic_op_asm.h"
+
+ENTRY_NP(__aarch64_swp1_rel)
+       mov     x4, x0
+1:     ldxrb   w0, [x1]
+       stlxrb  w3, w4, [x1]
+       cbnz    w3, 2f
+       ret
+2:     b       1b
+END(__aarch64_swp1_rel)
diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_relax.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/__aarch64_swp1_relax.S        Wed Apr 21 16:23:47 2021 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: __aarch64_swp1_relax.S,v 1.1 2021/04/21 16:23:47 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "atomic_op_asm.h"
+
+ENTRY_NP(__aarch64_swp1_relax)
+       mov     x4, x0
+1:     ldxrb   w0, [x1]
+       stxrb   w3, w4, [x1]
+       cbnz    w3, 2f
+       ret
+2:     b       1b
+END(__aarch64_swp1_relax)
diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_acq.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_acq.S  Wed Apr 21 16:23:47 2021 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: __aarch64_swp2_acq.S,v 1.1 2021/04/21 16:23:47 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "atomic_op_asm.h"
+
+ENTRY_NP(__aarch64_swp2_acq)
+       mov     x4, x0
+1:     ldaxrh  w0, [x1]
+       stxrh   w3, w4, [x1]
+       cbnz    w3, 2f
+       ret
+2:     b       1b
+END(__aarch64_swp2_acq)
diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_acq_rel.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_acq_rel.S      Wed Apr 21 16:23:47 2021 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: __aarch64_swp2_acq_rel.S,v 1.1 2021/04/21 16:23:47 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "atomic_op_asm.h"
+
+ENTRY_NP(__aarch64_swp2_acq_rel)
+       mov     x4, x0
+1:     ldaxrh  w0, [x1]
+       stlxrh  w3, w4, [x1]
+       cbnz    w3, 2f
+       ret
+2:     b       1b
+END(__aarch64_swp2_acq_rel)
diff -r 1df31e27a6ec -r faaf4ce89f8b common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_rel.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/__aarch64_swp2_rel.S  Wed Apr 21 16:23:47 2021 +0000
@@ -0,0 +1,41 @@
+/* $NetBSD: __aarch64_swp2_rel.S,v 1.1 2021/04/21 16:23:47 skrll Exp $ */
+



Home | Main Index | Thread Index | Old Index