CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: mlelstv Date: Fri Jul 10 20:16:01 UTC 2015 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: fix comment To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: mlelstv Date: Fri Jul 10 20:16:01 UTC 2015 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: fix comment To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/atomic_cas.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.12 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.13 --- src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.12 Sat Jul 4 07:11:45 2015 +++ src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Fri Jul 10 20:16:01 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas.S,v 1.12 2015/07/04 07:11:45 isaki Exp $ */ +/* $NetBSD: atomic_cas.S,v 1.13 2015/07/10 20:16:01 mlelstv Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ ENTRY(__sync_bool_compare_and_swap_2) movw 8+2(%sp), %d0 /* lower word */ movw 12+2(%sp), %d1 /* lower word */ casw %d0, %d1, (%a0) - /* %d3 now contains the old value */ + /* %d0 now contains the old value */ beqs 1f clrl %d0 /* return failure */ rts @@ -116,7 +116,7 @@ ENTRY(__sync_bool_compare_and_swap_1) movb 8+3(%sp), %d0 /* lower byte */ movb 12+3(%sp), %d1 /* lower byte */ casb %d0, %d1, (%a0) - /* %d3 now contains the old value */ + /* %d0 now contains the old value */ beqs 1f clrl %d0 /* return failure */ rts
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: isaki Date: Sat Jul 4 06:56:29 UTC 2015 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: atomic_cas_{8,16}: - Correct the wrong offset in stack. __sync_bool_compare_and_swap_{1,2,4}: - Correct the wrong offset in stack. - D3 must be preserved in subroutines. PR/49995. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/atomic_cas.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.10 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.11 --- src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.10 Sat Feb 22 17:08:30 2014 +++ src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Sat Jul 4 06:56:29 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas.S,v 1.10 2014/02/22 17:08:30 martin Exp $ */ +/* $NetBSD: atomic_cas.S,v 1.11 2015/07/04 06:56:29 isaki Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -63,11 +63,9 @@ STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_ ENTRY(__sync_bool_compare_and_swap_4) movl 4(%sp), %a0 - movl 8(%sp), %d3 - movl %d3, %d2 + movl 8(%sp), %d0 movl 12(%sp), %d1 - casl %d3, %d1, (%a0) - /* %d3 now contains the old value */ + casl %d0, %d1, (%a0) beq 1f clrl %d0 /* return false */ rts @@ -77,8 +75,8 @@ END(__sync_bool_compare_and_swap_4) ENTRY(_atomic_cas_16) movl 4(%sp), %a0 - movw 8(%sp), %d0 - movw 10(%sp), %d1 + movw 8+2(%sp), %d0 /* lower word */ + movw 12+2(%sp), %d1 /* lower word */ casw %d0, %d1, (%a0) /* %d0 now contains the old value */ rts @@ -89,10 +87,9 @@ CRT_ALIAS(__sync_val_compare_and_swap_2, ENTRY(__sync_bool_compare_and_swap_2) movl 4(%sp), %a0 - movw 8(%sp), %d3 - movw %d3, %d2 - movw 10(%sp), %d1 - casw %d3, %d1, (%a0) + movw 8+2(%sp), %d0 /* lower word */ + movw 12+2(%sp), %d1 /* lower word */ + casw %d0, %d1, (%a0) /* %d3 now contains the old value */ beq 1f clrl %d0 /* return failure */ @@ -103,8 +100,8 @@ END(__sync_bool_compare_and_swap_2) ENTRY(_atomic_cas_8) movl 4(%sp), %a0 - movb 8(%sp), %d0 - movb 9(%sp), %d1 + movb 8+3(%sp), %d0 /* lower byte */ + movb 12+3(%sp), %d1 /* lower byte */ casb %d0, %d1, (%a0) /* %d0 now contains the old value */ rts @@ -116,10 +113,9 @@ CRT_ALIAS(__sync_val_compare_and_swap_1, ENTRY(__sync_bool_compare_and_swap_1) movl 4(%sp), %a0 - movb 8(%sp), %d3 - movb %d3, %d2 - movb 9(%sp), %d1 - casb %d3, %d1, (%a0) + movb 8+3(%sp), %d0 /* lower byte */ + movb 12+3(%sp), %d1 /* lower byte */ + casb %d0, %d1, (%a0) /* %d3 now contains the old value */ beq 1f clrl %d0 /* return failure */
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: isaki Date: Sat Jul 4 06:56:29 UTC 2015 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: atomic_cas_{8,16}: - Correct the wrong offset in stack. __sync_bool_compare_and_swap_{1,2,4}: - Correct the wrong offset in stack. - D3 must be preserved in subroutines. PR/49995. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: isaki Date: Sat Jul 4 07:11:45 UTC 2015 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: Improve the code in __sync_bool_compare_and_swap_{1,2,4}. - bccs is smaller and faster than bcc(.w) in this case. - it can be used movql in this case (assembler optimise it though). To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/atomic_cas.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.11 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.12 --- src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.11 Sat Jul 4 06:56:29 2015 +++ src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Sat Jul 4 07:11:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas.S,v 1.11 2015/07/04 06:56:29 isaki Exp $ */ +/* $NetBSD: atomic_cas.S,v 1.12 2015/07/04 07:11:45 isaki Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -66,10 +66,10 @@ ENTRY(__sync_bool_compare_and_swap_4) movl 8(%sp), %d0 movl 12(%sp), %d1 casl %d0, %d1, (%a0) - beq 1f + beqs 1f clrl %d0 /* return false */ rts -1: movl #1, %d0 /* return success */ +1: movql #1, %d0 /* return success */ rts END(__sync_bool_compare_and_swap_4) @@ -91,10 +91,10 @@ ENTRY(__sync_bool_compare_and_swap_2) movw 12+2(%sp), %d1 /* lower word */ casw %d0, %d1, (%a0) /* %d3 now contains the old value */ - beq 1f + beqs 1f clrl %d0 /* return failure */ rts -1: movl #1, %d0 /* return success */ +1: movql #1, %d0 /* return success */ rts END(__sync_bool_compare_and_swap_2) @@ -117,10 +117,10 @@ ENTRY(__sync_bool_compare_and_swap_1) movb 12+3(%sp), %d1 /* lower byte */ casb %d0, %d1, (%a0) /* %d3 now contains the old value */ - beq 1f + beqs 1f clrl %d0 /* return failure */ rts -1: movl #1, %d0 /* return success */ +1: movql #1, %d0 /* return success */ rts END(__sync_bool_compare_and_swap_1)
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: isaki Date: Sat Jul 4 07:11:45 UTC 2015 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: Improve the code in __sync_bool_compare_and_swap_{1,2,4}. - bccs is smaller and faster than bcc(.w) in this case. - it can be used movql in this case (assembler optimise it though). To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: matt Date: Thu Nov 20 07:07:13 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc Log Message: Add atomic_c11_compare_exchange_cas_{8,16,32}.c To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/common/lib/libc/arch/m68k/atomic/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/Makefile.inc diff -u src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.13 src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.14 --- src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.13 Sat Feb 22 14:51:34 2014 +++ src/common/lib/libc/arch/m68k/atomic/Makefile.inc Thu Nov 20 07:07:13 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.13 2014/02/22 14:51:34 martin Exp $ +# $NetBSD: Makefile.inc,v 1.14 2014/11/20 07:07:13 matt Exp $ # # Note: The atomic operations here in these assembly files are atomic @@ -33,6 +33,10 @@ SRCS+= atomic_add_16_cas.c atomic_add_8 atomic_or_32_cas.c atomic_or_16_cas.c atomic_or_8_cas.c \ atomic_cas_32_cas.c atomic_cas_16_cas.c atomic_cas_8_cas.c \ atomic_swap_32_cas.c atomic_swap_16_cas.c atomic_swap_8_cas.c + +SRCS+= atomic_c11_compare_exchange_cas_8.c \ + atomic_c11_compare_exchange_cas_16.c \ + atomic_c11_compare_exchange_cas_32.c .endif .endif
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: matt Date: Thu Nov 20 07:07:13 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc Log Message: Add atomic_c11_compare_exchange_cas_{8,16,32}.c To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/common/lib/libc/arch/m68k/atomic/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Sat Feb 22 14:51:34 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc Log Message: Add missing __sunc_* ops for sun2 To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/common/lib/libc/arch/m68k/atomic/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/Makefile.inc diff -u src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.12 src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.13 --- src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.12 Thu Feb 20 20:39:01 2014 +++ src/common/lib/libc/arch/m68k/atomic/Makefile.inc Sat Feb 22 14:51:34 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.12 2014/02/20 20:39:01 martin Exp $ +# $NetBSD: Makefile.inc,v 1.13 2014/02/22 14:51:34 martin Exp $ # # Note: The atomic operations here in these assembly files are atomic @@ -24,6 +24,17 @@ SRCS+= atomic_add_32_cas.c atomic_add_3 atomic_inc_32_cas.c atomic_inc_32_nv_cas.c atomic_or_32_cas.c \ atomic_or_32_nv_cas.c atomic_swap_32_cas.c membar_ops_nop.c +.if ${LIB} == c +SRCS+= atomic_add_16_cas.c atomic_add_8_cas.c \ + atomic_sub_32_cas.c atomic_sub_16_cas.c atomic_sub_8_cas.c \ + atomic_nand_32_cas.c atomic_nand_16_cas.c atomic_nand_8_cas.c \ + atomic_xor_32_cas.c atomic_xor_16_cas.c atomic_xor_8_cas.c \ + atomic_and_32_cas.c atomic_and_16_cas.c atomic_and_8_cas.c \ + atomic_or_32_cas.c atomic_or_16_cas.c atomic_or_8_cas.c \ + atomic_cas_32_cas.c atomic_cas_16_cas.c atomic_cas_8_cas.c \ + atomic_swap_32_cas.c atomic_swap_16_cas.c atomic_swap_8_cas.c +.endif + .endif .endif
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Sun Feb 23 07:43:38 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_op_asm.h Log Message: Remove misplaced #endif To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h diff -u src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h:1.4 src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h:1.5 --- src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h:1.4 Sat Feb 22 17:08:30 2014 +++ src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h Sun Feb 23 07:43:38 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_op_asm.h,v 1.4 2014/02/22 17:08:30 martin Exp $ */ +/* $NetBSD: atomic_op_asm.h,v 1.5 2014/02/23 07:43:38 martin Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -47,7 +47,6 @@ #ifdef _LIBC #define CRT_ALIAS(a,s) STRONG_ALIAS(a,s) #endif -#endif #endif /* _KERNEL */
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Sat Feb 22 14:51:34 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc Log Message: Add missing __sunc_* ops for sun2 To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/common/lib/libc/arch/m68k/atomic/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Sun Feb 23 07:43:38 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_op_asm.h Log Message: Remove misplaced #endif To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Thu Feb 20 16:33:23 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: Simplify the variants returning a bool To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/atomic_cas.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.8 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.9 --- src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.8 Tue Feb 18 16:19:28 2014 +++ src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Thu Feb 20 16:33:23 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas.S,v 1.8 2014/02/18 16:19:28 martin Exp $ */ +/* $NetBSD: atomic_cas.S,v 1.9 2014/02/20 16:33:23 martin Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -68,11 +68,11 @@ ENTRY(__sync_bool_compare_and_swap_4) movl 12(%sp), %d1 casl %d3, %d1, (%a0) /* %d3 now contains the old value */ - clrl %d0 /* assume it did not work */ - cmpl %d3, %d2 - bne 1f - movl #1, %d0 /* return success */ -1: rts + beq 1f + clrl %d0 /* return false */ + rts +1: movl #1, %d0 /* return success */ + rts END(__sync_bool_compare_and_swap_4) ENTRY(_atomic_cas_16) @@ -94,11 +94,11 @@ ENTRY(__sync_bool_compare_and_swap_2) movw 10(%sp), %d1 casw %d3, %d1, (%a0) /* %d3 now contains the old value */ - clrl %d0 /* assume it did not work */ - cmpw %d3, %d2 - bne 1f - movl #1, %d0 /* return success */ -1: rts + beq 1f + clrl %d0 /* return failure */ + rts +1: movl #1, %d0 /* return success */ + rts END(__sync_bool_compare_and_swap_2) ENTRY(_atomic_cas_8) @@ -121,10 +121,10 @@ ENTRY(__sync_bool_compare_and_swap_1) movb 9(%sp), %d1 casb %d3, %d1, (%a0) /* %d3 now contains the old value */ - clrl %d0 /* assume it did not work */ - cmpb %d3, %d2 - bne 1f - movl #1, %d0 /* return success */ -1: rts + beq 1f + clrl %d0 /* return failure */ + rts +1: movl #1, %d0 /* return success */ + rts END(__sync_bool_compare_and_swap_1)
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Thu Feb 20 20:39:01 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc atomic_add.S atomic_and.S atomic_or.S Added Files: src/common/lib/libc/arch/m68k/atomic: atomic_nand.S atomic_sub.S atomic_xor.S Log Message: Add missing __sync_* ops To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/m68k/atomic/Makefile.inc cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/m68k/atomic/atomic_add.S cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/m68k/atomic/atomic_and.S \ src/common/lib/libc/arch/m68k/atomic/atomic_or.S cvs rdiff -u -r0 -r1.1 src/common/lib/libc/arch/m68k/atomic/atomic_nand.S \ src/common/lib/libc/arch/m68k/atomic/atomic_sub.S \ src/common/lib/libc/arch/m68k/atomic/atomic_xor.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/Makefile.inc diff -u src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.11 src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.12 --- src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.11 Wed Jan 29 10:20:11 2014 +++ src/common/lib/libc/arch/m68k/atomic/Makefile.inc Thu Feb 20 20:39:01 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.11 2014/01/29 10:20:11 martin Exp $ +# $NetBSD: Makefile.inc,v 1.12 2014/02/20 20:39:01 martin Exp $ # # Note: The atomic operations here in these assembly files are atomic @@ -14,7 +14,8 @@ .if ${MACHINE_ARCH} == m68k SRCS+= atomic_add.S atomic_and.S atomic_cas.S atomic_dec.S \ - atomic_inc.S atomic_or.S atomic_swap.S membar_ops_nop.c + atomic_inc.S atomic_or.S atomic_swap.S membar_ops_nop.c \ + atomic_sub.S atomic_xor.S atomic_nand.S .else Index: src/common/lib/libc/arch/m68k/atomic/atomic_add.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.7 src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.8 --- src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.7 Tue Feb 18 16:19:28 2014 +++ src/common/lib/libc/arch/m68k/atomic/atomic_add.S Thu Feb 20 20:39:01 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_add.S,v 1.7 2014/02/18 16:19:28 martin Exp $ */ +/* $NetBSD: atomic_add.S,v 1.8 2014/02/20 20:39:01 martin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -68,6 +68,17 @@ ATOMIC_OP_ALIAS(atomic_add_ptr_nv,_atomi STRONG_ALIAS(_atomic_add_ptr_nv,_atomic_add_32_nv) STRONG_ALIAS(__sync_add_and_fetch_4,_atomic_add_32_nv) +ENTRY(__sync_fetch_and_add_4) + movl 4(%sp), %a0 +1: movl (%a0), %d0 + movl %d0, %d1 + addl 8(%sp), %d1 + casl %d0, %d1, (%a0) + bne 1b + movl %d0, %a0 /* pointers return also in %a0 */ + rts +END(__sync_fetch_and_add_4) + ENTRY(_atomic_add_16_nv) movl 4(%sp), %a0 1: movw (%a0), %d0 @@ -80,6 +91,16 @@ END(_atomic_add_16_nv) STRONG_ALIAS(__sync_add_and_fetch_2,_atomic_add_16_nv) +ENTRY(__sync_fetch_and_add_2) + movl 4(%sp), %a0 +1: movw (%a0), %d0 + movw %d0, %d1 + addw 8(%sp), %d1 + casw %d0, %d1, (%a0) + bne 1b + rts +END(__sync_fetch_and_add_2) + ENTRY(_atomic_add_8_nv) movl 4(%sp), %a0 1: movb (%a0), %d0 @@ -91,3 +112,13 @@ ENTRY(_atomic_add_8_nv) END(_atomic_add_8_nv) STRONG_ALIAS(__sync_add_and_fetch_1,_atomic_add_8_nv) + +ENTRY(__sync_fetch_and_add_1) + movl 4(%sp), %a0 +1: movb (%a0), %d0 + movb %d0, %d1 + addb 8(%sp), %d1 + casb %d0, %d1, (%a0) + bne 1b + rts +END(__sync_fetch_and_add_1) Index: src/common/lib/libc/arch/m68k/atomic/atomic_and.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_and.S:1.8 src/common/lib/libc/arch/m68k/atomic/atomic_and.S:1.9 --- src/common/lib/libc/arch/m68k/atomic/atomic_and.S:1.8 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/atomic/atomic_and.S Thu Feb 20 20:39:01 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_and.S,v 1.8 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: atomic_and.S,v 1.9 2014/02/20 20:39:01 martin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -54,6 +54,7 @@ ENTRY(_atomic_and_32_nv) andl 8(%sp), %d0 casl %d1, %d0, (%a0) bne 1b + movl %d0, %a0 rts END(_atomic_and_32_nv) ATOMIC_OP_ALIAS(atomic_and_32_nv,_atomic_and_32_nv) @@ -63,3 +64,63 @@ ATOMIC_OP_ALIAS(atomic_and_ulong_nv,_ato STRONG_ALIAS(_atomic_and_ulong_nv,_atomic_and_32_nv) ATOMIC_OP_ALIAS(atomic_and_ptr_nv,_atomic_and_32_nv) STRONG_ALIAS(_atomic_and_ptr_nv,_atomic_and_32_nv) +STRONG_ALIAS(__sync_and_and_fetch_4,_atomic_and_32_nv) + +ENTRY(__sync_fetch_and_and_4) + movl 4(%sp), %a0 +1: movl (%a0), %d0 + movl %d0, %d1 + andl 8(%sp), %d1 + casl %d0, %d1, (%a0) + bne 1b + movl %d0, %a0 + rts +END(__sync_fetch_and_and_4) + + +ENTRY(_atomic_and_16_nv) + movl 4(%sp), %a0 +1: movw (%a0), %d0 + movw %d0, %d1 + andw 8(%sp), %d0 + casw %d1, %d0, (%a0) + bne 1b + rts +END(_atomic_and_16_nv) + +STRONG_ALIAS(__sync_and_and_fetch_2,_atomic_and_16_nv) + +ENTRY(__sync_fetch_and_and_2) + movl 4(%sp), %a0 +1: movw (%a0), %d0 + movw %d0, %d1
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Thu Feb 20 16:33:23 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_cas.S Log Message: Simplify the variants returning a bool To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Thu Feb 20 20:39:01 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc atomic_add.S atomic_and.S atomic_or.S Added Files: src/common/lib/libc/arch/m68k/atomic: atomic_nand.S atomic_sub.S atomic_xor.S Log Message: Add missing __sync_* ops To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/m68k/atomic/Makefile.inc cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/m68k/atomic/atomic_add.S cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/m68k/atomic/atomic_and.S \ src/common/lib/libc/arch/m68k/atomic/atomic_or.S cvs rdiff -u -r0 -r1.1 src/common/lib/libc/arch/m68k/atomic/atomic_nand.S \ src/common/lib/libc/arch/m68k/atomic/atomic_sub.S \ src/common/lib/libc/arch/m68k/atomic/atomic_xor.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Tue Feb 18 16:19:28 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_add.S atomic_cas.S atomic_swap.S Log Message: Add a few __sync_* and atomic functions. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/m68k/atomic/atomic_add.S \ src/common/lib/libc/arch/m68k/atomic/atomic_swap.S cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/atomic_add.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.6 src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.7 --- src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.6 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/atomic/atomic_add.S Tue Feb 18 16:19:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_add.S,v 1.6 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: atomic_add.S,v 1.7 2014/02/18 16:19:28 martin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -66,3 +66,28 @@ ATOMIC_OP_ALIAS(atomic_add_long_nv,_atom STRONG_ALIAS(_atomic_add_long_nv,_atomic_add_32_nv) ATOMIC_OP_ALIAS(atomic_add_ptr_nv,_atomic_add_32_nv) STRONG_ALIAS(_atomic_add_ptr_nv,_atomic_add_32_nv) +STRONG_ALIAS(__sync_add_and_fetch_4,_atomic_add_32_nv) + +ENTRY(_atomic_add_16_nv) + movl 4(%sp), %a0 +1: movw (%a0), %d0 + movw %d0, %d1 + addw 8(%sp), %d0 + casw %d1, %d0, (%a0) + bne 1b + rts +END(_atomic_add_16_nv) + +STRONG_ALIAS(__sync_add_and_fetch_2,_atomic_add_16_nv) + +ENTRY(_atomic_add_8_nv) + movl 4(%sp), %a0 +1: movb (%a0), %d0 + movb %d0, %d1 + addb 8(%sp), %d0 + casb %d1, %d0, (%a0) + bne 1b + rts +END(_atomic_add_8_nv) + +STRONG_ALIAS(__sync_add_and_fetch_1,_atomic_add_8_nv) Index: src/common/lib/libc/arch/m68k/atomic/atomic_swap.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_swap.S:1.6 src/common/lib/libc/arch/m68k/atomic/atomic_swap.S:1.7 --- src/common/lib/libc/arch/m68k/atomic/atomic_swap.S:1.6 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/atomic/atomic_swap.S Tue Feb 18 16:19:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_swap.S,v 1.6 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: atomic_swap.S,v 1.7 2014/02/18 16:19:28 martin Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -50,3 +50,29 @@ ATOMIC_OP_ALIAS(atomic_swap_ulong,_atomi STRONG_ALIAS(_atomic_swap_ulong,_atomic_swap_32) ATOMIC_OP_ALIAS(atomic_swap_ptr,_atomic_swap_32) STRONG_ALIAS(_atomic_swap_ptr,_atomic_swap_32) +STRONG_ALIAS(__sync_lock_test_and_set_4,_atomic_swap_32) + + +ENTRY(_atomic_swap_16) + movl 4(%sp), %a0 +1: movw (%a0), %d0 + movw 8(%sp), %d1 + casw %d0, %d1, (%a0) + bne 1b + /* %d0 now contains the old value */ + rts +END(_atomic_swap_16) +ATOMIC_OP_ALIAS(atomic_swap_16,_atomic_swap_16) +STRONG_ALIAS(__sync_lock_test_and_set_2,_atomic_swap_16) + +ENTRY(_atomic_swap_8) + movl 4(%sp), %a0 +1: movb (%a0), %d0 + movb 8(%sp), %d1 + casb %d0, %d1, (%a0) + bne 1b + /* %d0 now contains the old value */ + rts +END(_atomic_swap_8) +ATOMIC_OP_ALIAS(atomic_swap_8,_atomic_swap_8) +STRONG_ALIAS(__sync_lock_test_and_set_1,_atomic_swap_8) Index: src/common/lib/libc/arch/m68k/atomic/atomic_cas.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.7 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.8 --- src/common/lib/libc/arch/m68k/atomic/atomic_cas.S:1.7 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Tue Feb 18 16:19:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas.S,v 1.7 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: atomic_cas.S,v 1.8 2014/02/18 16:19:28 martin Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -50,6 +50,7 @@ ATOMIC_OP_ALIAS(atomic_cas_ulong,_atomic STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_32) ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_32) STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_32) +STRONG_ALIAS(__sync_val_compare_and_swap_4,_atomic_cas_32) ATOMIC_OP_ALIAS(atomic_cas_32_ni,_atomic_cas_32) STRONG_ALIAS(_atomic_cas_32_ni,_atomic_cas_32) @@ -59,3 +60,71 @@ ATOMIC_OP_ALIAS(atomic_cas_ulong_ni,_ato STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_32) ATOMIC_OP_ALIAS(atomic_cas_ptr_ni,_atomic_cas_32) STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_32) + +ENTRY(__sync_bool_compare_and_swap_4) + movl 4(%sp), %a0 + movl 8(%sp), %d3 + movl %d3, %d2 + movl 12(%sp), %d1 + casl %d3, %d1, (%a0) + /* %d3 now contains the old value */ + clrl %d0 /* assume it did not work */ + cmpl %d3, %d2 + bne 1f + movl #1, %d0 /* return success */ +1: rts +END(__sync_bool_compare_and_swap_4) + +ENTRY(_atomic_cas_16) + movl 4(%sp), %a0 + movw 8(%sp), %d0 + movw 10(%sp), %d1 + casw %d0, %d1, (%a0) + /* %d0 now contains the old value */ + rts +END(_atomic_cas_16) + +ATOMIC_OP_ALIAS(atomic_cas_16,_atomic_cas_16)
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Tue Feb 18 16:19:28 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: atomic_add.S atomic_cas.S atomic_swap.S Log Message: Add a few __sync_* and atomic functions. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/m68k/atomic/atomic_add.S \ src/common/lib/libc/arch/m68k/atomic/atomic_swap.S cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Wed Jan 29 10:20:11 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc atomic_cas_68000.S Log Message: Provide _atomic_cas_8_up and _atomic_cas_16_up as assembler functions To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/m68k/atomic/Makefile.inc cvs rdiff -u -r1.5 -r1.6 \ src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/Makefile.inc diff -u src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.10 src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.11 --- src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.10 Thu Jul 18 19:49:00 2013 +++ src/common/lib/libc/arch/m68k/atomic/Makefile.inc Wed Jan 29 10:20:11 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.10 2013/07/18 19:49:00 matt Exp $ +# $NetBSD: Makefile.inc,v 1.11 2014/01/29 10:20:11 martin Exp $ # # Note: The atomic operations here in these assembly files are atomic @@ -35,7 +35,8 @@ SRCS+= atomic_init_cas.c SRCS+= atomic_init_testset.c SRCS+= atomic_cas_68000.S -CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP +CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP -D__HAVE_ASM_ATOMIC_CAS_16_UP \ + -D__HAVE_ASM_ATOMIC_CAS_8_UP .endif .endif Index: src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S diff -u src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S:1.5 src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S:1.6 --- src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S:1.5 Tue Jul 16 23:24:18 2013 +++ src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S Wed Jan 29 10:20:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas_68000.S,v 1.5 2013/07/16 23:24:18 matt Exp $ */ +/* $NetBSD: atomic_cas_68000.S,v 1.6 2014/01/29 10:20:11 martin Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -47,3 +47,32 @@ RAS_START_ASM_HIDDEN(_atomic_cas) RAS_END_ASM_HIDDEN(_atomic_cas) 1: rts END(_atomic_cas_up) + +ENTRY(_atomic_cas_16_up) + .hidden _C_LABEL(_atomic_cas_16_up) + + movl 4(%sp), %a0 /* Fetch ptr */ + +RAS_START_ASM_HIDDEN(_atomic_cas_16) + movw (%a0), %d0 /* d0 = *ptr */ + cmpw 8(%sp), %d0 /* Same as old? */ + jne 1f /* Nope */ + movw 12(%sp), (%a0) /* *ptr = new */ +RAS_END_ASM_HIDDEN(_atomic_cas_16) +1: rts +END(_atomic_cas_16_up) + + +ENTRY(_atomic_cas_8_up) + .hidden _C_LABEL(_atomic_cas_8_up) + + movl 4(%sp), %a0 /* Fetch ptr */ + +RAS_START_ASM_HIDDEN(_atomic_cas_8) + movb (%a0), %d0 /* d0 = *ptr */ + cmpb 8(%sp), %d0 /* Same as old? */ + jne 1f /* Nope */ + movb 12(%sp), (%a0) /* *ptr = new */ +RAS_END_ASM_HIDDEN(_atomic_cas_8) +1: rts +END(_atomic_cas_8_up)
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: martin Date: Wed Jan 29 10:20:11 UTC 2014 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc atomic_cas_68000.S Log Message: Provide _atomic_cas_8_up and _atomic_cas_16_up as assembler functions To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/m68k/atomic/Makefile.inc cvs rdiff -u -r1.5 -r1.6 \ src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: matt Date: Thu Jul 18 19:49:01 UTC 2013 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc Log Message: invert tests ${MACHINE} != m68000 - ${MACHINE} == m68k To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/m68k/atomic/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/m68k/atomic/Makefile.inc diff -u src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.9 src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.10 --- src/common/lib/libc/arch/m68k/atomic/Makefile.inc:1.9 Sun Jan 4 17:54:29 2009 +++ src/common/lib/libc/arch/m68k/atomic/Makefile.inc Thu Jul 18 19:49:00 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.9 2009/01/04 17:54:29 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.10 2013/07/18 19:49:00 matt Exp $ # # Note: The atomic operations here in these assembly files are atomic @@ -11,7 +11,7 @@ .if defined(LIB) (${LIB} == kern || ${LIB} == c || ${LIB} == pthread \ || ${LIB} == rump) -.if ${MACHINE_ARCH} != m68000 +.if ${MACHINE_ARCH} == m68k SRCS+= atomic_add.S atomic_and.S atomic_cas.S atomic_dec.S \ atomic_inc.S atomic_or.S atomic_swap.S membar_ops_nop.c @@ -27,7 +27,7 @@ SRCS+= atomic_add_32_cas.c atomic_add_3 .endif .if defined(LIB) (${LIB} == c || ${LIB} == pthread) -.if ${MACHINE_ARCH} != m68000 +.if ${MACHINE_ARCH} == m68k SRCS+= atomic_init_cas.c
CVS commit: src/common/lib/libc/arch/m68k/atomic
Module Name:src Committed By: matt Date: Thu Jul 18 19:49:01 UTC 2013 Modified Files: src/common/lib/libc/arch/m68k/atomic: Makefile.inc Log Message: invert tests ${MACHINE} != m68000 - ${MACHINE} == m68k To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/m68k/atomic/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.