s/ifdef _ARM_ARCH_6/if defined(_ARM_ARCH_6)/ for consistency. NFCI.diff -r1.3 -r1.4 src/common/lib/libc/arch/arm/atomic/atomic_add_16.S
(skrll)
--- src/common/lib/libc/arch/arm/atomic/atomic_add_16.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_add_16.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_add_16.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_add_16.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_sub_16) | 36 | ENTRY_NP(_atomic_sub_16) | |
37 | negs r1, r1 | 37 | negs r1, r1 | |
38 | /* FALLTHROUGH */ | 38 | /* FALLTHROUGH */ | |
39 | ENTRY_NP(_atomic_add_16) | 39 | ENTRY_NP(_atomic_add_16) | |
40 | mov ip, r0 | 40 | mov ip, r0 | |
41 | 1: ldrexh r0, [ip] /* load old value */ | 41 | 1: ldrexh r0, [ip] /* load old value */ | |
42 | adds r3, r0, r1 /* calculate new value */ | 42 | adds r3, r0, r1 /* calculate new value */ | |
43 | strexh r2, r3, [ip] /* try to store */ | 43 | strexh r2, r3, [ip] /* try to store */ | |
44 | cmp r2, #0 /* succeed? */ | 44 | cmp r2, #0 /* succeed? */ | |
45 | bne 1b /* no, try again */ | 45 | bne 1b /* no, try again */ | |
46 | #ifdef _ARM_ARCH_7 | 46 | #ifdef _ARM_ARCH_7 | |
47 | dmb | 47 | dmb |
--- src/common/lib/libc/arch/arm/atomic/atomic_add_8.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_add_8.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_add_8.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_add_8.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_sub_8) | 36 | ENTRY_NP(_atomic_sub_8) | |
37 | negs r1, r1 | 37 | negs r1, r1 | |
38 | /* FALLTHROUGH */ | 38 | /* FALLTHROUGH */ | |
39 | ENTRY_NP(_atomic_add_8) | 39 | ENTRY_NP(_atomic_add_8) | |
40 | mov ip, r0 | 40 | mov ip, r0 | |
41 | 1: ldrexb r0, [ip] /* load old value */ | 41 | 1: ldrexb r0, [ip] /* load old value */ | |
42 | adds r3, r0, r1 /* calculate new value */ | 42 | adds r3, r0, r1 /* calculate new value */ | |
43 | strexb r2, r3, [ip] /* try to store */ | 43 | strexb r2, r3, [ip] /* try to store */ | |
44 | cmp r2, #0 /* succeed? */ | 44 | cmp r2, #0 /* succeed? */ | |
45 | bne 1b /* no, try again */ | 45 | bne 1b /* no, try again */ | |
46 | #ifdef _ARM_ARCH_7 | 46 | #ifdef _ARM_ARCH_7 | |
47 | dmb | 47 | dmb |
--- src/common/lib/libc/arch/arm/atomic/atomic_and_16.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_and_16.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_and_16.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_and_16.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_and_16) | 36 | ENTRY_NP(_atomic_and_16) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | |
39 | ands r3, r0, r1 /* calculate new value */ | 39 | ands r3, r0, r1 /* calculate new value */ | |
40 | strexh r2, r3, [ip] /* try to store */ | 40 | strexh r2, r3, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again */ | 42 | bne 1b /* no, try again */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
47 | #endif | 47 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_and_8.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_and_8.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_and_8.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_and_8.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_and_8) | 36 | ENTRY_NP(_atomic_and_8) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | |
39 | ands r3, r0, r1 /* calculate new value */ | 39 | ands r3, r0, r1 /* calculate new value */ | |
40 | strexb r2, r3, [ip] /* try to store */ | 40 | strexb r2, r3, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again */ | 42 | bne 1b /* no, try again */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
47 | #endif | 47 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S 2015/12/11 12:41:10 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_nand_16.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_nand_16.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */ | 1 | /* $NetBSD: atomic_nand_16.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_nand_16) | 36 | ENTRY_NP(_atomic_nand_16) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | |
39 | ands r3, r0, r1 /* calculate new value step 1 */ | 39 | ands r3, r0, r1 /* calculate new value step 1 */ | |
40 | mvns r3, r3 /* ... complement for new value */ | 40 | mvns r3, r3 /* ... complement for new value */ | |
41 | strexh r2, r3, [ip] /* try to store */ | 41 | strexh r2, r3, [ip] /* try to store */ | |
42 | cmp r2, #0 /* succeed? */ | 42 | cmp r2, #0 /* succeed? */ | |
43 | bne 1b /* no, try again */ | 43 | bne 1b /* no, try again */ | |
44 | #ifdef _ARM_ARCH_7 | 44 | #ifdef _ARM_ARCH_7 | |
45 | dmb | 45 | dmb | |
46 | #else | 46 | #else | |
47 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 47 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S 2015/12/11 12:41:10 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_nand_32.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_nand_32.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */ | 1 | /* $NetBSD: atomic_nand_32.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_nand_32) | 36 | ENTRY_NP(_atomic_nand_32) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | |
39 | ands r3, r0, r1 /* calculate new value step 1 */ | 39 | ands r3, r0, r1 /* calculate new value step 1 */ | |
40 | mvns r3, r3 /* ... complement for new value */ | 40 | mvns r3, r3 /* ... complement for new value */ | |
41 | strex r2, r3, [ip] /* try to store */ | 41 | strex r2, r3, [ip] /* try to store */ | |
42 | cmp r2, #0 /* succeed? */ | 42 | cmp r2, #0 /* succeed? */ | |
43 | bne 1b /* no, try again */ | 43 | bne 1b /* no, try again */ | |
44 | #ifdef _ARM_ARCH_7 | 44 | #ifdef _ARM_ARCH_7 | |
45 | dmb | 45 | dmb | |
46 | #else | 46 | #else | |
47 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 47 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S 2015/12/11 12:41:10 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_nand_8.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_nand_8.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */ | 1 | /* $NetBSD: atomic_nand_8.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_nand_8) | 36 | ENTRY_NP(_atomic_nand_8) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | |
39 | ands r3, r0, r1 /* calculate new value step 1 */ | 39 | ands r3, r0, r1 /* calculate new value step 1 */ | |
40 | mvns r3, r3 /* ... complement for new value */ | 40 | mvns r3, r3 /* ... complement for new value */ | |
41 | strexb r2, r3, [ip] /* try to store */ | 41 | strexb r2, r3, [ip] /* try to store */ | |
42 | cmp r2, #0 /* succeed? */ | 42 | cmp r2, #0 /* succeed? */ | |
43 | bne 1b /* no, try again */ | 43 | bne 1b /* no, try again */ | |
44 | #ifdef _ARM_ARCH_7 | 44 | #ifdef _ARM_ARCH_7 | |
45 | dmb | 45 | dmb | |
46 | #else | 46 | #else | |
47 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 47 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_or_16.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_or_16.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_or_16.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_or_16.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_or_16) | 35 | ENTRY_NP(_atomic_or_16) | |
36 | mov ip, r0 | 36 | mov ip, r0 | |
37 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | 37 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | |
38 | orrs r3, r0, r1 /* calculate new value */ | 38 | orrs r3, r0, r1 /* calculate new value */ | |
39 | strexh r2, r3, [ip] /* try to store */ | 39 | strexh r2, r3, [ip] /* try to store */ | |
40 | cmp r2, #0 /* succeed? */ | 40 | cmp r2, #0 /* succeed? */ | |
41 | bne 1b /* no, try again */ | 41 | bne 1b /* no, try again */ | |
42 | #ifdef _ARM_ARCH_7 | 42 | #ifdef _ARM_ARCH_7 | |
43 | dmb | 43 | dmb | |
44 | #else | 44 | #else | |
45 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 45 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
46 | #endif | 46 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_or_8.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_or_8.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_or_8.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_or_8.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_or_8) | 36 | ENTRY_NP(_atomic_or_8) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | |
39 | orrs r3, r0, r1 /* calculate new value */ | 39 | orrs r3, r0, r1 /* calculate new value */ | |
40 | strexb r2, r3, [ip] /* try to store */ | 40 | strexb r2, r3, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again */ | 42 | bne 1b /* no, try again */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
47 | #endif | 47 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_sub_64.S 2021/06/28 09:00:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_sub_64.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_sub_64.S,v 1.3 2021/06/28 09:00:45 skrll Exp $ */ | 1 | /* $NetBSD: atomic_sub_64.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_sub_64_nv) | 36 | ENTRY_NP(_atomic_sub_64_nv) | |
37 | push {r3, r4} /* save temporary */ | 37 | push {r3, r4} /* save temporary */ | |
38 | mov ip, r0 /* need r0 for return value */ | 38 | mov ip, r0 /* need r0 for return value */ | |
39 | #ifndef __ARM_EABI__ | 39 | #ifndef __ARM_EABI__ | |
40 | mov r3, r2 | 40 | mov r3, r2 | |
41 | mov r2, r1 | 41 | mov r2, r1 | |
42 | #endif | 42 | #endif | |
43 | 1: ldrexd r0, [ip] /* load old value */ | 43 | 1: ldrexd r0, [ip] /* load old value */ | |
44 | subs LO, LO, NLO /* calculate new value lo */ | 44 | subs LO, LO, NLO /* calculate new value lo */ | |
45 | sbcs HI, HI, NHI /* calculate new value hi */ | 45 | sbcs HI, HI, NHI /* calculate new value hi */ | |
46 | strexd r4, r0, [ip] /* try to store */ | 46 | strexd r4, r0, [ip] /* try to store */ | |
47 | cmp r4, #0 /* succeed? */ | 47 | cmp r4, #0 /* succeed? */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_xor_16.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_xor_16.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_xor_16.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_xor_16.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_xor_16) | 36 | ENTRY_NP(_atomic_xor_16) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrexh r0, [ip] /* load old value (to be returned) */ | |
39 | eors r3, r0, r1 /* calculate new value */ | 39 | eors r3, r0, r1 /* calculate new value */ | |
40 | strexh r2, r3, [ip] /* try to store */ | 40 | strexh r2, r3, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again */ | 42 | bne 1b /* no, try again */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
47 | #endif | 47 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_xor_32.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_xor_32.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_xor_32.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_xor_32.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_xor_32) | 35 | ENTRY_NP(_atomic_xor_32) | |
36 | mov ip, r0 | 36 | mov ip, r0 | |
37 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | 37 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | |
38 | eors r3, r0, r1 /* calculate new value */ | 38 | eors r3, r0, r1 /* calculate new value */ | |
39 | strex r2, r3, [ip] /* try to store */ | 39 | strex r2, r3, [ip] /* try to store */ | |
40 | cmp r2, #0 /* succeed? */ | 40 | cmp r2, #0 /* succeed? */ | |
41 | bne 1b /* no, try again */ | 41 | bne 1b /* no, try again */ | |
42 | #ifdef _ARM_ARCH_7 | 42 | #ifdef _ARM_ARCH_7 | |
43 | dmb | 43 | dmb | |
44 | #else | 44 | #else | |
45 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 45 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
46 | #endif | 46 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_xor_8.S 2014/06/23 21:53:45 1.3
+++ src/common/lib/libc/arch/arm/atomic/atomic_xor_8.S 2021/07/10 06:53:40 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_xor_8.S,v 1.3 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_xor_8.S,v 1.4 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_xor_8) | 36 | ENTRY_NP(_atomic_xor_8) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrexb r0, [ip] /* load old value (to be returned) */ | |
39 | eors r3, r0, r1 /* calculate new value */ | 39 | eors r3, r0, r1 /* calculate new value */ | |
40 | strexb r2, r3, [ip] /* try to store */ | 40 | strexb r2, r3, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again */ | 42 | bne 1b /* no, try again */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
47 | #endif | 47 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_add_32.S 2014/06/23 21:53:45 1.8
+++ src/common/lib/libc/arch/arm/atomic/atomic_add_32.S 2021/07/10 06:53:40 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_add_32.S,v 1.8 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_add_32.S,v 1.9 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_sub_32) | 36 | ENTRY_NP(_atomic_sub_32) | |
37 | negs r1, r1 | 37 | negs r1, r1 | |
38 | /* FALLTHROUGH */ | 38 | /* FALLTHROUGH */ | |
39 | ENTRY_NP(_atomic_add_32) | 39 | ENTRY_NP(_atomic_add_32) | |
40 | mov ip, r0 | 40 | mov ip, r0 | |
41 | 1: ldrex r0, [ip] /* load old value */ | 41 | 1: ldrex r0, [ip] /* load old value */ | |
42 | adds r3, r0, r1 /* calculate new value */ | 42 | adds r3, r0, r1 /* calculate new value */ | |
43 | strex r2, r3, [ip] /* try to store */ | 43 | strex r2, r3, [ip] /* try to store */ | |
44 | cmp r2, #0 /* succeed? */ | 44 | cmp r2, #0 /* succeed? */ | |
45 | bne 1b /* no, try again */ | 45 | bne 1b /* no, try again */ | |
46 | #ifdef _ARM_ARCH_7 | 46 | #ifdef _ARM_ARCH_7 | |
47 | dmb | 47 | dmb |
--- src/common/lib/libc/arch/arm/atomic/atomic_and_32.S 2014/06/23 21:53:45 1.8
+++ src/common/lib/libc/arch/arm/atomic/atomic_and_32.S 2021/07/10 06:53:40 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_and_32.S,v 1.8 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_and_32.S,v 1.9 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com> | 8 | * by Matt Thomas <matt@3am-software.com> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | 35 | |||
36 | ENTRY_NP(_atomic_and_32) | 36 | ENTRY_NP(_atomic_and_32) | |
37 | mov ip, r0 | 37 | mov ip, r0 | |
38 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | 38 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | |
39 | ands r3, r0, r1 /* calculate new value */ | 39 | ands r3, r0, r1 /* calculate new value */ | |
40 | strex r2, r3, [ip] /* try to store */ | 40 | strex r2, r3, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again */ | 42 | bne 1b /* no, try again */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
47 | #endif | 47 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_or_32.S 2014/06/23 21:53:45 1.8
+++ src/common/lib/libc/arch/arm/atomic/atomic_or_32.S 2021/07/10 06:53:40 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_or_32.S,v 1.8 2014/06/23 21:53:45 joerg Exp $ */ | 1 | /* $NetBSD: atomic_or_32.S,v 1.9 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_or_32) | 35 | ENTRY_NP(_atomic_or_32) | |
36 | mov ip, r0 | 36 | mov ip, r0 | |
37 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | 37 | 1: ldrex r0, [ip] /* load old value (to be returned) */ | |
38 | orrs r3, r0, r1 /* calculate new value */ | 38 | orrs r3, r0, r1 /* calculate new value */ | |
39 | strex r2, r3, [ip] /* try to store */ | 39 | strex r2, r3, [ip] /* try to store */ | |
40 | cmp r2, #0 /* succeed? */ | 40 | cmp r2, #0 /* succeed? */ | |
41 | bne 1b /* no, try again */ | 41 | bne 1b /* no, try again */ | |
42 | #ifdef _ARM_ARCH_7 | 42 | #ifdef _ARM_ARCH_7 | |
43 | dmb | 43 | dmb | |
44 | #else | 44 | #else | |
45 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 45 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
46 | #endif | 46 | #endif |
--- src/common/lib/libc/arch/arm/atomic/atomic_add_64.S 2021/06/28 09:00:45 1.12
+++ src/common/lib/libc/arch/arm/atomic/atomic_add_64.S 2021/07/10 06:53:40 1.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_add_64.S,v 1.12 2021/06/28 09:00:45 skrll Exp $ */ | 1 | /* $NetBSD: atomic_add_64.S,v 1.13 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_add_64_nv) | 35 | ENTRY_NP(_atomic_add_64_nv) | |
36 | push {r3, r4} /* save temporary */ | 36 | push {r3, r4} /* save temporary */ | |
37 | mov ip, r0 /* need r0 for return value */ | 37 | mov ip, r0 /* need r0 for return value */ | |
38 | #ifndef __ARM_EABI__ | 38 | #ifndef __ARM_EABI__ | |
39 | mov r3, r2 | 39 | mov r3, r2 | |
40 | mov r2, r1 | 40 | mov r2, r1 | |
41 | #endif | 41 | #endif | |
42 | 1: ldrexd r0, r1, [ip] /* load old value */ | 42 | 1: ldrexd r0, r1, [ip] /* load old value */ | |
43 | adds LO, LO, NLO /* calculate new value lo */ | 43 | adds LO, LO, NLO /* calculate new value lo */ | |
44 | adcs HI, HI, NHI /* calculate new value hi */ | 44 | adcs HI, HI, NHI /* calculate new value hi */ | |
45 | strexd r4, r0, r1, [ip] /* try to store */ | 45 | strexd r4, r0, r1, [ip] /* try to store */ | |
46 | cmp r4, #0 /* succeed? */ | 46 | cmp r4, #0 /* succeed? */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_or_64.S 2021/06/28 09:00:45 1.12
+++ src/common/lib/libc/arch/arm/atomic/atomic_or_64.S 2021/07/10 06:53:40 1.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_or_64.S,v 1.12 2021/06/28 09:00:45 skrll Exp $ */ | 1 | /* $NetBSD: atomic_or_64.S,v 1.13 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_or_64_nv) | 35 | ENTRY_NP(_atomic_or_64_nv) | |
36 | push {r3, r4} /* save temporary */ | 36 | push {r3, r4} /* save temporary */ | |
37 | #ifndef __ARM_EABI__ | 37 | #ifndef __ARM_EABI__ | |
38 | mov r3, r2 | 38 | mov r3, r2 | |
39 | mov r2, r1 | 39 | mov r2, r1 | |
40 | #endif | 40 | #endif | |
41 | mov ip, r0 /* need r0 for return value */ | 41 | mov ip, r0 /* need r0 for return value */ | |
42 | 1: ldrexd r0, r1, [ip] /* load old value */ | 42 | 1: ldrexd r0, r1, [ip] /* load old value */ | |
43 | orrs r0, r0, r2 /* calculate new value (return value) */ | 43 | orrs r0, r0, r2 /* calculate new value (return value) */ | |
44 | orrs r1, r1, r3 /* calculate new value (return value) */ | 44 | orrs r1, r1, r3 /* calculate new value (return value) */ | |
45 | strexd r4, r0, r1, [ip] /* try to store */ | 45 | strexd r4, r0, r1, [ip] /* try to store */ | |
46 | cmp r4, #0 /* succeed? */ | 46 | cmp r4, #0 /* succeed? */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_and_64.S 2021/06/28 09:00:45 1.11
+++ src/common/lib/libc/arch/arm/atomic/atomic_and_64.S 2021/07/10 06:53:40 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_and_64.S,v 1.11 2021/06/28 09:00:45 skrll Exp $ */ | 1 | /* $NetBSD: atomic_and_64.S,v 1.12 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_and_64_nv) | 35 | ENTRY_NP(_atomic_and_64_nv) | |
36 | push {r3, r4} /* save temporary */ | 36 | push {r3, r4} /* save temporary */ | |
37 | #ifndef __ARM_EABI__ | 37 | #ifndef __ARM_EABI__ | |
38 | mov r3, r2 | 38 | mov r3, r2 | |
39 | mov r2, r1 | 39 | mov r2, r1 | |
40 | #endif | 40 | #endif | |
41 | mov ip, r0 /* need r0 for return value */ | 41 | mov ip, r0 /* need r0 for return value */ | |
42 | 1: ldrexd r0, r1, [ip] /* load old value */ | 42 | 1: ldrexd r0, r1, [ip] /* load old value */ | |
43 | ands r0, r0, r2 /* calculate new value */ | 43 | ands r0, r0, r2 /* calculate new value */ | |
44 | ands r1, r1, r3 /* calculate new value */ | 44 | ands r1, r1, r3 /* calculate new value */ | |
45 | strexd r4, r0, r1, [ip] /* try to store */ | 45 | strexd r4, r0, r1, [ip] /* try to store */ | |
46 | cmp r4, #0 /* succeed? */ | 46 | cmp r4, #0 /* succeed? */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_dec_32.S 2013/08/11 04:41:17 1.5
+++ src/common/lib/libc/arch/arm/atomic/atomic_dec_32.S 2021/07/10 06:53:40 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_dec_32.S,v 1.5 2013/08/11 04:41:17 matt Exp $ */ | 1 | /* $NetBSD: atomic_dec_32.S,v 1.6 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_dec_32) | 35 | ENTRY_NP(_atomic_dec_32) | |
36 | 1: ldrex r3, [r0] /* load old value (return value) */ | 36 | 1: ldrex r3, [r0] /* load old value (return value) */ | |
37 | subs r3, r3, #1 /* calculate new value */ | 37 | subs r3, r3, #1 /* calculate new value */ | |
38 | strex r2, r3, [r0] /* try to store */ | 38 | strex r2, r3, [r0] /* try to store */ | |
39 | cmp r2, #0 /* succeed? */ | 39 | cmp r2, #0 /* succeed? */ | |
40 | bne 1b /* no, try again? */ | 40 | bne 1b /* no, try again? */ | |
41 | #ifdef _ARM_ARCH_7 | 41 | #ifdef _ARM_ARCH_7 | |
42 | dmb | 42 | dmb | |
43 | #else | 43 | #else | |
44 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 44 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
45 | #endif | 45 | #endif | |
46 | RET /* return new value */ | 46 | RET /* return new value */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S 2021/06/28 09:00:45 1.5
+++ src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S 2021/07/10 06:53:40 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_nand_64.S,v 1.5 2021/06/28 09:00:45 skrll Exp $ */ | 1 | /* $NetBSD: atomic_nand_64.S,v 1.6 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_nand_64_nv) | 35 | ENTRY_NP(_atomic_nand_64_nv) | |
36 | push {r3, r4} /* save temporary */ | 36 | push {r3, r4} /* save temporary */ | |
37 | #ifndef __ARM_EABI__ | 37 | #ifndef __ARM_EABI__ | |
38 | mov r3, r2 | 38 | mov r3, r2 | |
39 | mov r2, r1 | 39 | mov r2, r1 | |
40 | #endif | 40 | #endif | |
41 | mov ip, r0 /* need r0 for return value */ | 41 | mov ip, r0 /* need r0 for return value */ | |
42 | 1: ldrexd r0, r1, [ip] /* load old value */ | 42 | 1: ldrexd r0, r1, [ip] /* load old value */ | |
43 | ands r0, r0, r2 /* calculate new value step 1 */ | 43 | ands r0, r0, r2 /* calculate new value step 1 */ | |
44 | ands r1, r1, r3 /* calculate new value step 2 */ | 44 | ands r1, r1, r3 /* calculate new value step 2 */ | |
45 | mvns r0, r0 /* ... complement for new value */ | 45 | mvns r0, r0 /* ... complement for new value */ | |
46 | mvns r1, r1 /* ... complement for new value */ | 46 | mvns r1, r1 /* ... complement for new value */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_swap_16.S 2021/04/26 21:40:21 1.5
+++ src/common/lib/libc/arch/arm/atomic/atomic_swap_16.S 2021/07/10 06:53:40 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_swap_16.S,v 1.5 2021/04/26 21:40:21 skrll Exp $ */ | 1 | /* $NetBSD: atomic_swap_16.S,v 1.6 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas of 3am Software Foundry. | 8 | * by Matt Thomas of 3am Software Foundry. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -21,27 +21,28 @@ | @@ -21,27 +21,28 @@ | |||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "atomic_op_asm.h" | 32 | #include "atomic_op_asm.h" | |
33 | 33 | |||
34 | #ifdef _ARM_ARCH_6 | 34 | #if defined(_ARM_ARCH_6) | |
35 | ||||
35 | ENTRY_NP(_atomic_swap_16) | 36 | ENTRY_NP(_atomic_swap_16) | |
36 | mov ip, r0 | 37 | mov ip, r0 | |
37 | 1: | 38 | 1: | |
38 | ldrexh r0, [ip] | 39 | ldrexh r0, [ip] | |
39 | strexh r3, r1, [ip] | 40 | strexh r3, r1, [ip] | |
40 | cmp r3, #0 | 41 | cmp r3, #0 | |
41 | bne 1b | 42 | bne 1b | |
42 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
43 | dmb | 44 | dmb | |
44 | #else | 45 | #else | |
45 | mcr p15, 0, ip, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, ip, c7, c10, 5 /* data memory barrier */ | |
46 | #endif | 47 | #endif | |
47 | RET | 48 | RET |
--- src/common/lib/libc/arch/arm/atomic/atomic_xor_64.S 2021/06/28 09:00:45 1.5
+++ src/common/lib/libc/arch/arm/atomic/atomic_xor_64.S 2021/07/10 06:53:40 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_xor_64.S,v 1.5 2021/06/28 09:00:45 skrll Exp $ */ | 1 | /* $NetBSD: atomic_xor_64.S,v 1.6 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2013 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_xor_64_nv) | 35 | ENTRY_NP(_atomic_xor_64_nv) | |
36 | push {r3, r4} /* save temporary */ | 36 | push {r3, r4} /* save temporary */ | |
37 | #ifndef __ARM_EABI__ | 37 | #ifndef __ARM_EABI__ | |
38 | mov r3, r2 | 38 | mov r3, r2 | |
39 | mov r2, r1 | 39 | mov r2, r1 | |
40 | #endif | 40 | #endif | |
41 | mov ip, r0 /* need r0 for return value */ | 41 | mov ip, r0 /* need r0 for return value */ | |
42 | 1: ldrexd r0, r1, [ip] /* load old value */ | 42 | 1: ldrexd r0, r1, [ip] /* load old value */ | |
43 | eors r0, r0, r2 /* calculate new value (return value) */ | 43 | eors r0, r0, r2 /* calculate new value (return value) */ | |
44 | eors r1, r1, r3 /* calculate new value (return value) */ | 44 | eors r1, r1, r3 /* calculate new value (return value) */ | |
45 | strexd r4, r0, r1, [ip] /* try to store */ | 45 | strexd r4, r0, r1, [ip] /* try to store */ | |
46 | cmp r4, #0 /* succeed? */ | 46 | cmp r4, #0 /* succeed? */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_dec_64.S 2013/11/30 21:09:11 1.7
+++ src/common/lib/libc/arch/arm/atomic/atomic_dec_64.S 2021/07/10 06:53:40 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_dec_64.S,v 1.7 2013/11/30 21:09:11 joerg Exp $ */ | 1 | /* $NetBSD: atomic_dec_64.S,v 1.8 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_dec_64_nv) | 35 | ENTRY_NP(_atomic_dec_64_nv) | |
36 | mov ip, r0 /* need r0 for return value */ | 36 | mov ip, r0 /* need r0 for return value */ | |
37 | 1: ldrexd r0, r1, [ip] /* load old value */ | 37 | 1: ldrexd r0, r1, [ip] /* load old value */ | |
38 | subs LO, LO, #1 /* calculate new value */ | 38 | subs LO, LO, #1 /* calculate new value */ | |
39 | sbcs HI, HI, #0 /* calculate new value */ | 39 | sbcs HI, HI, #0 /* calculate new value */ | |
40 | strexd r2, r0, r1, [ip] /* try to store */ | 40 | strexd r2, r0, r1, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again? */ | 42 | bne 1b /* no, try again? */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S 2013/11/08 22:42:52 1.7
+++ src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S 2021/07/10 06:53:40 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_inc_32.S,v 1.7 2013/11/08 22:42:52 matt Exp $ */ | 1 | /* $NetBSD: atomic_inc_32.S,v 1.8 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_inc_32) | 35 | ENTRY_NP(_atomic_inc_32) | |
36 | 1: ldrex r3, [r0] /* load old value (return value) */ | 36 | 1: ldrex r3, [r0] /* load old value (return value) */ | |
37 | adds r3, r3, #1 /* calculate new value */ | 37 | adds r3, r3, #1 /* calculate new value */ | |
38 | strex r2, r3, [r0] /* try to store */ | 38 | strex r2, r3, [r0] /* try to store */ | |
39 | cmp r2, #0 /* succeed? */ | 39 | cmp r2, #0 /* succeed? */ | |
40 | bne 1b /* no, try again? */ | 40 | bne 1b /* no, try again? */ | |
41 | #ifdef _ARM_ARCH_7 | 41 | #ifdef _ARM_ARCH_7 | |
42 | dmb | 42 | dmb | |
43 | #else | 43 | #else | |
44 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 44 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | |
45 | #endif | 45 | #endif | |
46 | RET /* return new value */ | 46 | RET /* return new value */ |
--- src/common/lib/libc/arch/arm/atomic/membar_ops.S 2021/04/27 05:40:29 1.7
+++ src/common/lib/libc/arch/arm/atomic/membar_ops.S 2021/07/10 06:53:40 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: membar_ops.S,v 1.7 2021/04/27 05:40:29 skrll Exp $ */ | 1 | /* $NetBSD: membar_ops.S,v 1.8 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_membar_producer) | 35 | ENTRY_NP(_membar_producer) | |
36 | #ifdef _ARM_ARCH_7 | 36 | #ifdef _ARM_ARCH_7 | |
37 | dmb ishst | 37 | dmb ishst | |
38 | #else | 38 | #else | |
39 | mov r0, #0 | 39 | mov r0, #0 | |
40 | mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier */ | 40 | mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier */ | |
41 | #endif | 41 | #endif | |
42 | RET | 42 | RET | |
43 | END(_membar_producer) | 43 | END(_membar_producer) | |
44 | ATOMIC_OP_ALIAS(membar_producer,_membar_producer) | 44 | ATOMIC_OP_ALIAS(membar_producer,_membar_producer) | |
45 | ATOMIC_OP_ALIAS(membar_write,_membar_producer) | 45 | ATOMIC_OP_ALIAS(membar_write,_membar_producer) | |
46 | STRONG_ALIAS(_membar_write,_membar_producer) | 46 | STRONG_ALIAS(_membar_write,_membar_producer) |
--- src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S 2013/11/30 21:09:11 1.9
+++ src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S 2021/07/10 06:53:40 1.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_inc_64.S,v 1.9 2013/11/30 21:09:11 joerg Exp $ */ | 1 | /* $NetBSD: atomic_inc_64.S,v 1.10 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas <matt@3am-software.com> | 7 | * by Matt Thomas <matt@3am-software.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include "atomic_op_asm.h" | 31 | #include "atomic_op_asm.h" | |
32 | 32 | |||
33 | #ifdef _ARM_ARCH_6 | 33 | #if defined(_ARM_ARCH_6) | |
34 | 34 | |||
35 | ENTRY_NP(_atomic_inc_64_nv) | 35 | ENTRY_NP(_atomic_inc_64_nv) | |
36 | mov ip, r0 /* need r0 for return value */ | 36 | mov ip, r0 /* need r0 for return value */ | |
37 | 1: ldrexd r0, r1, [ip] /* load old value */ | 37 | 1: ldrexd r0, r1, [ip] /* load old value */ | |
38 | adds LO, LO, #1 /* calculate new value (return value) */ | 38 | adds LO, LO, #1 /* calculate new value (return value) */ | |
39 | adcs HI, HI, #0 /* fold carry into high */ | 39 | adcs HI, HI, #0 /* fold carry into high */ | |
40 | strexd r2, r0, r1, [ip] /* try to store */ | 40 | strexd r2, r0, r1, [ip] /* try to store */ | |
41 | cmp r2, #0 /* succeed? */ | 41 | cmp r2, #0 /* succeed? */ | |
42 | bne 1b /* no, try again? */ | 42 | bne 1b /* no, try again? */ | |
43 | #ifdef _ARM_ARCH_7 | 43 | #ifdef _ARM_ARCH_7 | |
44 | dmb | 44 | dmb | |
45 | #else | 45 | #else | |
46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ | 46 | mcr p15, 0, r2, c7, c10, 5 /* data memory barrier */ |
--- src/common/lib/libc/arch/arm/atomic/atomic_swap.S 2021/04/26 21:40:21 1.17
+++ src/common/lib/libc/arch/arm/atomic/atomic_swap.S 2021/07/10 06:53:40 1.18
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_swap.S,v 1.17 2021/04/26 21:40:21 skrll Exp $ */ | 1 | /* $NetBSD: atomic_swap.S,v 1.18 2021/07/10 06:53:40 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007,2012 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2007,2012 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe and Matt Thomas. | 8 | * by Jason R. Thorpe and Matt Thomas. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -37,27 +37,27 @@ | @@ -37,27 +37,27 @@ | |||
37 | * will actually raise an UNDEFINED exception. | 37 | * will actually raise an UNDEFINED exception. | |
38 | * | 38 | * | |
39 | * So if we use the LDREX/STREX template, but use a SWP instruction followed | 39 | * So if we use the LDREX/STREX template, but use a SWP instruction followed | |
40 | * by a MOV instruction (using a temporary register), that gives a handler | 40 | * by a MOV instruction (using a temporary register), that gives a handler | |
41 | * for the SWP UNDEFINED exception enough information to "patch" this instance | 41 | * for the SWP UNDEFINED exception enough information to "patch" this instance | |
42 | * SWP with correct forms of LDREX/STREX. (note that this would happen even | 42 | * SWP with correct forms of LDREX/STREX. (note that this would happen even | |
43 | * "read-only" pages. If the page gets tossed, we will get another exception | 43 | * "read-only" pages. If the page gets tossed, we will get another exception | |
44 | * and fix yet again). | 44 | * and fix yet again). | |
45 | */ | 45 | */ | |
46 | 46 | |||
47 | ENTRY_NP(_atomic_swap_32) | 47 | ENTRY_NP(_atomic_swap_32) | |
48 | mov ip, r0 | 48 | mov ip, r0 | |
49 | 1: | 49 | 1: | |
50 | #ifdef _ARM_ARCH_6 | 50 | #if defined(_ARM_ARCH_6) | |
51 | ldrex r0, [ip] | 51 | ldrex r0, [ip] | |
52 | cmp r0, r1 | 52 | cmp r0, r1 | |
53 | #ifdef __thumb__ | 53 | #ifdef __thumb__ | |
54 | beq 99f | 54 | beq 99f | |
55 | strex r3, r1, [ip] | 55 | strex r3, r1, [ip] | |
56 | cmp r3, #0 | 56 | cmp r3, #0 | |
57 | #else | 57 | #else | |
58 | strexne r3, r1, [ip] | 58 | strexne r3, r1, [ip] | |
59 | cmpne r3, #0 | 59 | cmpne r3, #0 | |
60 | #endif | 60 | #endif | |
61 | #else | 61 | #else | |
62 | swp r0, r1, [ip] | 62 | swp r0, r1, [ip] | |
63 | cmp r0, r1 | 63 | cmp r0, r1 | |
@@ -90,27 +90,27 @@ ENTRY_NP(__sync_lock_release_4) | @@ -90,27 +90,27 @@ ENTRY_NP(__sync_lock_release_4) | |||
90 | #ifdef _ARM_ARCH_7 | 90 | #ifdef _ARM_ARCH_7 | |
91 | dmb ishst | 91 | dmb ishst | |
92 | #else | 92 | #else | |
93 | mcr p15, 0, r1, c7, c10, 5 /* data memory barrier */ | 93 | mcr p15, 0, r1, c7, c10, 5 /* data memory barrier */ | |
94 | #endif | 94 | #endif | |
95 | str r1, [r0] | 95 | str r1, [r0] | |
96 | RET | 96 | RET | |
97 | END(__sync_lock_release_4) | 97 | END(__sync_lock_release_4) | |
98 | #endif | 98 | #endif | |
99 | 99 | |||
100 | ENTRY_NP(_atomic_swap_8) | 100 | ENTRY_NP(_atomic_swap_8) | |
101 | mov ip, r0 | 101 | mov ip, r0 | |
102 | 1: | 102 | 1: | |
103 | #ifdef _ARM_ARCH_6 | 103 | #if defined(_ARM_ARCH_6) | |
104 | ldrexb r0, [ip] | 104 | ldrexb r0, [ip] | |
105 | strexb r3, r1, [ip] | 105 | strexb r3, r1, [ip] | |
106 | #else | 106 | #else | |
107 | swpb r0, r1, [ip] | 107 | swpb r0, r1, [ip] | |
108 | mov r3, #0 | 108 | mov r3, #0 | |
109 | #endif | 109 | #endif | |
110 | cmp r3, #0 | 110 | cmp r3, #0 | |
111 | bne 1b | 111 | bne 1b | |
112 | #ifdef _ARM_ARCH_7 | 112 | #ifdef _ARM_ARCH_7 | |
113 | dmb | 113 | dmb | |
114 | #else | 114 | #else | |
115 | mcr p15, 0, ip, c7, c10, 5 /* data memory barrier */ | 115 | mcr p15, 0, ip, c7, c10, 5 /* data memory barrier */ | |
116 | #endif | 116 | #endif |