CVS commit: src/common/lib/libc/arch/m68k/gen

2020-05-31 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun May 31 12:37:07 UTC 2020

Modified Files:
src/common/lib/libc/arch/m68k/gen: muldi3.S

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/m68k/gen/muldi3.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/gen/muldi3.S
diff -u src/common/lib/libc/arch/m68k/gen/muldi3.S:1.1 src/common/lib/libc/arch/m68k/gen/muldi3.S:1.2
--- src/common/lib/libc/arch/m68k/gen/muldi3.S:1.1	Sun May 31 11:43:37 2020
+++ src/common/lib/libc/arch/m68k/gen/muldi3.S	Sun May 31 12:37:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: muldi3.S,v 1.1 2020/05/31 11:43:37 rin Exp $	*/
+/*	$NetBSD: muldi3.S,v 1.2 2020/05/31 12:37:07 rin Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-RCSID("$NetBSD: muldi3.S,v 1.1 2020/05/31 11:43:37 rin Exp $")
+RCSID("$NetBSD: muldi3.S,v 1.2 2020/05/31 12:37:07 rin Exp $")
 
 | int64_t __muldi3(int64_t X, int64_t Y);
 |
@@ -110,6 +110,6 @@ ENTRY(__muldi3)
 	addl	%d2, %d0	| E += C
 	addl	%d3, %d0	| %d0 = E + F
 
-	moveml	(%sp)+, %d2-%d4	| pop %d2-%d6
+	moveml	(%sp)+, %d2-%d4	| pop %d2-%d4
 	rts
 END(__muldi3)



CVS commit: src/common/lib/libc/arch/m68k/string

2020-03-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Mar 10 08:15:44 UTC 2020

Modified Files:
src/common/lib/libc/arch/m68k/string: ffs.S

Log Message:
For kernel, rename ffs to __ffssi2 rather than having a weak symbol.
This enables us to load modules depended to __ffssi2.

It is difficult to deal with weak symbols consistently in in-kernel
linker. See explanation by pgoyette on tech-kern:

http://mail-index.netbsd.org/tech-kern/2020/03/09/msg026148.html

Also, we do not currently provide ffs(9) as a kernel routine.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/m68k/string/ffs.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/string/ffs.S
diff -u src/common/lib/libc/arch/m68k/string/ffs.S:1.7 src/common/lib/libc/arch/m68k/string/ffs.S:1.8
--- src/common/lib/libc/arch/m68k/string/ffs.S:1.7	Mon Mar  9 13:36:10 2020
+++ src/common/lib/libc/arch/m68k/string/ffs.S	Tue Mar 10 08:15:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.S,v 1.7 2020/03/09 13:36:10 rin Exp $	*/
+/*	$NetBSD: ffs.S,v 1.8 2020/03/10 08:15:44 rin Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -39,13 +39,22 @@
 #if 0
 	RCSID("from: @(#)ffs.s	5.1 (Berkeley) 5/12/90")
 #else
-	RCSID("$NetBSD: ffs.S,v 1.7 2020/03/09 13:36:10 rin Exp $")
+	RCSID("$NetBSD: ffs.S,v 1.8 2020/03/10 08:15:44 rin Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
 /* bit = ffs(value) */
 
+#ifdef _LIBC
 WEAK_ALIAS(__ffssi2,ffs)
+#else /* KERNEL */
+/*
+ * Our in-kernel linker does not understand weak references, which
+ * prevents modules depended on __ffssi2 from being loaded. Also,
+ * we do not provide ffs(9) as a kernel routine. Let's rename it!
+ */
+#define ffs __ffssi2
+#endif
 
 #if (!defined(__mc68010__) && !defined(__mcoldfire__)) || defined(__mcfisac__)
 



CVS commit: src/common/lib/libc/arch/m68k/string

2020-03-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Mar  9 13:36:10 UTC 2020

Modified Files:
src/common/lib/libc/arch/m68k/string: ffs.S

Log Message:
Add missing END() for coldfire.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/m68k/string/ffs.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/string/ffs.S
diff -u src/common/lib/libc/arch/m68k/string/ffs.S:1.6 src/common/lib/libc/arch/m68k/string/ffs.S:1.7
--- src/common/lib/libc/arch/m68k/string/ffs.S:1.6	Sat Sep  7 19:06:29 2013
+++ src/common/lib/libc/arch/m68k/string/ffs.S	Mon Mar  9 13:36:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.S,v 1.6 2013/09/07 19:06:29 chs Exp $	*/
+/*	$NetBSD: ffs.S,v 1.7 2020/03/09 13:36:10 rin Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
 #if 0
 	RCSID("from: @(#)ffs.s	5.1 (Berkeley) 5/12/90")
 #else
-	RCSID("$NetBSD: ffs.S,v 1.6 2013/09/07 19:06:29 chs Exp $")
+	RCSID("$NetBSD: ffs.S,v 1.7 2020/03/09 13:36:10 rin Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -76,6 +76,7 @@ ENTRY(ffs)
 	jcc	.L1		| keep looping while carry is clear.
 .L2:
 	rts
+END(ffs)
 
 #else	/* __mc68010__ */
 



CVS commit: src/common/lib/libc/arch/m68k/gen

2020-03-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Mar  9 08:29:12 UTC 2020

Modified Files:
src/common/lib/libc/arch/m68k/gen: mulsi3.S

Log Message:
Remove wrong comment (copy-paste from somewhere);
__mulsi3 does not depend on __udivsi3.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/gen/mulsi3.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/gen/mulsi3.S
diff -u src/common/lib/libc/arch/m68k/gen/mulsi3.S:1.4 src/common/lib/libc/arch/m68k/gen/mulsi3.S:1.5
--- src/common/lib/libc/arch/m68k/gen/mulsi3.S:1.4	Tue Jul 16 23:24:18 2013
+++ src/common/lib/libc/arch/m68k/gen/mulsi3.S	Mon Mar  9 08:29:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mulsi3.S,v 1.4 2013/07/16 23:24:18 matt Exp $	*/
+/*	$NetBSD: mulsi3.S,v 1.5 2020/03/09 08:29:11 rin Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
 #if 0
 	RCSID("from: @(#)mulsi3.s	5.1 (Berkeley) 6/7/90")
 #else
-	RCSID("$NetBSD: mulsi3.S,v 1.4 2013/07/16 23:24:18 matt Exp $")
+	RCSID("$NetBSD: mulsi3.S,v 1.5 2020/03/09 08:29:11 rin Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -49,8 +49,6 @@ ENTRY(__mulsi3)
 	movel	4(%sp),%d0
 	mulsl	8(%sp),%d0
 #else
-| NB: this requires that __udivsi3 preserve %a0 and return
-| the modulus in %d1:
 	movew	6(%sp), %d0
 	movel	%d0, %a0	| save B
 	muluw	8(%sp), %d0	| %d0 holds B * C



CVS commit: src/common/lib/libc/arch/m68k/atomic

2015-07-10 Thread Michael van Elst
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

2015-07-04 Thread Tetsuya Isaki
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

2015-07-04 Thread Tetsuya Isaki
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

2014-11-19 Thread Matt Thomas
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/gen

2014-03-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Mar  4 04:03:49 UTC 2014

Modified Files:
src/common/lib/libc/arch/m68k/gen: modsi3.S

Log Message:
Make this coldfire compatible


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/m68k/gen/modsi3.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/gen/modsi3.S
diff -u src/common/lib/libc/arch/m68k/gen/modsi3.S:1.6 src/common/lib/libc/arch/m68k/gen/modsi3.S:1.7
--- src/common/lib/libc/arch/m68k/gen/modsi3.S:1.6	Sat Sep  7 19:06:29 2013
+++ src/common/lib/libc/arch/m68k/gen/modsi3.S	Tue Mar  4 04:03:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: modsi3.S,v 1.6 2013/09/07 19:06:29 chs Exp $	*/
+/*	$NetBSD: modsi3.S,v 1.7 2014/03/04 04:03:49 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
 #if 0
 	RCSID(from: @(#)modsi3.s	5.1 (Berkeley) 6/7/90)
 #else
-	RCSID($NetBSD: modsi3.S,v 1.6 2013/09/07 19:06:29 chs Exp $)
+	RCSID($NetBSD: modsi3.S,v 1.7 2014/03/04 04:03:49 matt Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -47,7 +47,12 @@
 #ifndef __mc68010__
 ENTRY(__modsi3)
 	movel	4(%sp),%d1
+#ifdef __mcoldfire__
+	remsl	8(%sp),%d0:%d1
+	divsl	8(%sp),%d1
+#else
 	divsll	8(%sp),%d0:%d1
+#endif
 	rts
 END(__modsi3)
 #else



CVS commit: src/common/lib/libc/arch/m68k/gen

2014-03-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Mar  4 06:15:33 UTC 2014

Modified Files:
src/common/lib/libc/arch/m68k/gen: umodsi3.S

Log Message:
Make this work with coldfire.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/gen/umodsi3.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/gen/umodsi3.S
diff -u src/common/lib/libc/arch/m68k/gen/umodsi3.S:1.4 src/common/lib/libc/arch/m68k/gen/umodsi3.S:1.5
--- src/common/lib/libc/arch/m68k/gen/umodsi3.S:1.4	Tue Jul 16 23:24:18 2013
+++ src/common/lib/libc/arch/m68k/gen/umodsi3.S	Tue Mar  4 06:15:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: umodsi3.S,v 1.4 2013/07/16 23:24:18 matt Exp $	*/
+/*	$NetBSD: umodsi3.S,v 1.5 2014/03/04 06:15:33 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,7 @@
 #if 0
 	RCSID(from: @(#)umodsi3.s	5.1 (Berkeley) 6/7/90)(
 #else
-	RCSID($NetBSD: umodsi3.S,v 1.4 2013/07/16 23:24:18 matt Exp $)
+	RCSID($NetBSD: umodsi3.S,v 1.5 2014/03/04 06:15:33 matt Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -47,7 +47,12 @@
 #ifndef __mc68010__
 ENTRY(__umodsi3)
 	movel	4(%sp),%d1
+#ifdef __mcoldfire__
+	remul	8(%sp),%d0:%d1
+	divul	8(%sp),%d1
+#else
 	divull	8(%sp),%d0:%d1
+#endif
 	rts
 END(__umodsi3)
 #else



CVS commit: src/common/lib/libc/arch/m68k/atomic

2014-02-22 Thread Martin Husemann
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

2014-02-22 Thread Martin Husemann
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

2014-02-20 Thread Martin Husemann
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

2014-02-20 Thread Martin Husemann
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

2014-02-18 Thread Martin Husemann
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

2014-01-29 Thread Martin Husemann
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/string

2013-07-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 19 16:42:12 UTC 2013

Modified Files:
src/common/lib/libc/arch/m68k/string: memset.S strcmp.S strncmp.S

Log Message:
With these changes, they now produce identical binary as before the coldfire
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/m68k/string/memset.S \
src/common/lib/libc/arch/m68k/string/strcmp.S \
src/common/lib/libc/arch/m68k/string/strncmp.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/string/memset.S
diff -u src/common/lib/libc/arch/m68k/string/memset.S:1.5 src/common/lib/libc/arch/m68k/string/memset.S:1.6
--- src/common/lib/libc/arch/m68k/string/memset.S:1.5	Thu Jul 18 22:42:50 2013
+++ src/common/lib/libc/arch/m68k/string/memset.S	Fri Jul 19 16:42:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: memset.S,v 1.5 2013/07/18 22:42:50 matt Exp $	*/
+/*	$NetBSD: memset.S,v 1.6 2013/07/19 16:42:12 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 #if 0
 	RCSID(from: @(#)bzero.s	5.1 (Berkeley) 5/12/90)
 #else
-	RCSID($NetBSD: memset.S,v 1.5 2013/07/18 22:42:50 matt Exp $)
+	RCSID($NetBSD: memset.S,v 1.6 2013/07/19 16:42:12 matt Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -76,11 +76,7 @@ ENTRY(memset)
 	movl	%d2,-(%sp)
 	movl	8(%sp),%a0		| destination
 	movl	16(%sp),%d1		| count
-#ifdef __mcoldfire__
-	mvzb	15(%sp),%d2		| zero extend fill character
-#else
 	movb	15(%sp),%d2		| get fill character
-#endif
 
 	/* 
 	 * It isn't worth the overhead of aligning to {long}word boundries
@@ -89,15 +85,15 @@ ENTRY(memset)
 	cmpl	#15,%d1
 	jlt	Lbzbyte
 
-#ifndef __mcoldfire__
-	andb	0xff,%d2		| clear high bytes
-#endif
-	movl	%d2,%d0
-	lsll	#8,%d0			| shift to 8-15
-	orl	%d0,%d2			| merge so low word is done
-	movl	%d2,%d0 		| copy word
-	swap	%d0			| swap it
-	orl	%d0,%d2			| put it upper half
+	clrl %d0
+	moveb	%d2,%d0
+	movel	%d0,%d2
+	lsll	#8,%d0
+	orl	%d0,%d2
+	lsll	#8,%d0	
+	orl	%d0,%d2	
+	lsll	#8,%d0	
+	orl	%d0,%d2	
 
 	/* word align */
 	movl	%a0,%d0
Index: src/common/lib/libc/arch/m68k/string/strcmp.S
diff -u src/common/lib/libc/arch/m68k/string/strcmp.S:1.5 src/common/lib/libc/arch/m68k/string/strcmp.S:1.6
--- src/common/lib/libc/arch/m68k/string/strcmp.S:1.5	Thu Jul 18 22:42:50 2013
+++ src/common/lib/libc/arch/m68k/string/strcmp.S	Fri Jul 19 16:42:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: strcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $	*/
+/*	$NetBSD: strcmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include machine/asm.h
 
 #if defined(LIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: strcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $)
+	RCSID($NetBSD: strcmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $)
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef __mcoldfire__
@@ -69,10 +69,13 @@ L1:/* unrolled by 4 for 680[23]0's *
 	jeq	L1
 
 L3:
-#ifndef __mcoldfire__
-	EXTBL(%d1)
-#endif
+#ifdef __mcoldfire__
 	movl	%d1,%d0
+#else
+	scs	%d0
+	EXTBL(%d0)
+	movb	%d1,%d0
+#endif
 	rts
 
 L2:	movq	#0,%d0
Index: src/common/lib/libc/arch/m68k/string/strncmp.S
diff -u src/common/lib/libc/arch/m68k/string/strncmp.S:1.5 src/common/lib/libc/arch/m68k/string/strncmp.S:1.6
--- src/common/lib/libc/arch/m68k/string/strncmp.S:1.5	Thu Jul 18 22:42:50 2013
+++ src/common/lib/libc/arch/m68k/string/strncmp.S	Fri Jul 19 16:42:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: strncmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $	*/
+/*	$NetBSD: strncmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include machine/asm.h
 
 #if defined(LIBC_SCCS)  !defined(lint)
-	RCSID($NetBSD: strncmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $)
+	RCSID($NetBSD: strncmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $)
 #endif /* LIBC_SCCS and not lint */
 
 
@@ -50,7 +50,9 @@ ENTRY(strncmp)
 	jeq	L4
 	movl	4(%sp),%a0
 	movl	8(%sp),%a1
+#ifdef __coldfire__
 	movl	%d2,-(%sp)	| save temp
+#endif
 L1:/* unroll by 4 for m680[23]0's */
 	GETC((%a0)+,%d1)
 	jeq	L2
@@ -88,9 +90,11 @@ L2:	SUBC((%a1),%d1)
 L3:	
 #ifdef __mcoldfire__
 	movl	(%sp)+,%d2		| restore temp
+	movl	%d1,%d0
 #else
-	EXTBL(%d1)
+	scs	%d0
+	EXTBL(%d0)
+	moveb	%d1,%d0
 #endif
-	movl	%d1,%d0
 	rts
 END(strncmp)



CVS commit: src/common/lib/libc/arch/m68k/atomic

2013-07-18 Thread Matt Thomas
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

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 22:42:51 UTC 2013

Modified Files:
src/common/lib/libc/arch/m68k/gen: bswap16.S bswap32.S bswap64.S
src/common/lib/libc/arch/m68k/string: bcmp.S bcopy.S bzero.S ffs.S
memcmp.S memset.S strcmp.S strncmp.S strncpy.S

Log Message:
Adjust for Coldfire


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/gen/bswap16.S \
src/common/lib/libc/arch/m68k/gen/bswap32.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/gen/bswap64.S
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/string/bcmp.S \
src/common/lib/libc/arch/m68k/string/bcopy.S \
src/common/lib/libc/arch/m68k/string/bzero.S \
src/common/lib/libc/arch/m68k/string/ffs.S \
src/common/lib/libc/arch/m68k/string/memset.S \
src/common/lib/libc/arch/m68k/string/strcmp.S \
src/common/lib/libc/arch/m68k/string/strncmp.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/string/memcmp.S \
src/common/lib/libc/arch/m68k/string/strncpy.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/gen/bswap16.S
diff -u src/common/lib/libc/arch/m68k/gen/bswap16.S:1.4 src/common/lib/libc/arch/m68k/gen/bswap16.S:1.5
--- src/common/lib/libc/arch/m68k/gen/bswap16.S:1.4	Tue Jul 16 23:24:18 2013
+++ src/common/lib/libc/arch/m68k/gen/bswap16.S	Thu Jul 18 22:42:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bswap16.S,v 1.4 2013/07/16 23:24:18 matt Exp $	*/
+/*	$NetBSD: bswap16.S,v 1.5 2013/07/18 22:42:50 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Scott Reynolds.  All rights reserved.
@@ -35,7 +35,20 @@
 #endif /* defined(_KERNEL) || defined(_STANDALONE) */
 
 _ENTRY(BSWAP16)
+#ifdef __mcfisac__
+	mvzw	6(%sp),%d0
+	swap	%d0
+	byterev	%d0
+#elif defined(__mcoldfire__)
+	mvzw	6(%sp),%d0
+	movl	%d0,%d1
+	mvzb	%d0,%d0
+	lsll	#8,%d0
+	lsrl	#8,%d1
+	orl	%d1,%d0
+#else
 	movl	4(%sp),%d0
 	rolw	#8,%d0
+#endif
 	rts
 END(BSWAP16)
Index: src/common/lib/libc/arch/m68k/gen/bswap32.S
diff -u src/common/lib/libc/arch/m68k/gen/bswap32.S:1.4 src/common/lib/libc/arch/m68k/gen/bswap32.S:1.5
--- src/common/lib/libc/arch/m68k/gen/bswap32.S:1.4	Tue Jul 16 23:24:18 2013
+++ src/common/lib/libc/arch/m68k/gen/bswap32.S	Thu Jul 18 22:42:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bswap32.S,v 1.4 2013/07/16 23:24:18 matt Exp $	*/
+/*	$NetBSD: bswap32.S,v 1.5 2013/07/18 22:42:50 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Scott Reynolds.  All rights reserved.
@@ -36,8 +36,20 @@
 
 _ENTRY(BSWAP32)
 	movl	4(%sp),%d0
+#ifdef __mcfisac__
+	byterev	%d0
+#elif defined(__mcoldfire__)
+	movl	%d0,%d1
+	lsrl	#8,%d0		| ABCD - 0ABC
+	andl	#0x00ff00ff,%d0	| 0ABC - 0A0C
+	andl	#0x00ff00ff,%d1	| ABCD - 0B0D
+	lsll	#8,%d1		| 0B0D - B0D0
+	orl	%d1,%d0		| 0A0C | B0D0 - BADC
+	swap	%d0		| BADC - DCBA
+#else
+ 	rolw	#8,%d0
+ 	swap	%d0
 	rolw	#8,%d0
-	swap	%d0
-	rolw	#8,%d0
+#endif
 	rts
 END(BSWAP32)

Index: src/common/lib/libc/arch/m68k/gen/bswap64.S
diff -u src/common/lib/libc/arch/m68k/gen/bswap64.S:1.3 src/common/lib/libc/arch/m68k/gen/bswap64.S:1.4
--- src/common/lib/libc/arch/m68k/gen/bswap64.S:1.3	Tue Jul 16 23:24:18 2013
+++ src/common/lib/libc/arch/m68k/gen/bswap64.S	Thu Jul 18 22:42:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bswap64.S,v 1.3 2013/07/16 23:24:18 matt Exp $	*/
+/*	$NetBSD: bswap64.S,v 1.4 2013/07/18 22:42:50 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Scott Reynolds.  All rights reserved.
@@ -31,11 +31,34 @@
 ENTRY(bswap64)
 	movl	4(%sp),%d1
 	movl	8(%sp),%d0
+#ifdef __mcfisac__
+	byterev	%d0
+	byterev	%d1
+#elif defined(__mcoldfire__)
+	movl	%d3,-(%sp)
+	movl	%d2,-(%sp)
+	movl	#0x00ff00ff, %d3
+	movl	%d0,%d2
+	andl	%d3,%d2
+	lsll	#8,%d2
+	lsrl	#8,%d0
+	andl	%d3,%d0
+	orl	%d2,%d0
+	movl	%d1,%d2
+	andl	%d3,%d2
+	lsll	#8,%d2
+	lsrl	#8,%d1
+	andl	%d3,%d1
+	orl	%d2,%d1
+	movl	(%sp)+,%d2
+	movl	(%sp)+,%d3
+#else
 	rolw	#8,%d1
 	rolw	#8,%d0
 	swap	%d1
 	swap	%d0
 	rolw	#8,%d0
 	rolw	#8,%d1
+#endif
 	rts
 END(bswap64)

Index: src/common/lib/libc/arch/m68k/string/bcmp.S
diff -u src/common/lib/libc/arch/m68k/string/bcmp.S:1.4 src/common/lib/libc/arch/m68k/string/bcmp.S:1.5
--- src/common/lib/libc/arch/m68k/string/bcmp.S:1.4	Tue Jul 16 23:24:19 2013
+++ src/common/lib/libc/arch/m68k/string/bcmp.S	Thu Jul 18 22:42:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcmp.S,v 1.4 2013/07/16 23:24:19 matt Exp $	*/
+/*	$NetBSD: bcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -68,14 +68,27 @@
 #if 0
 	RCSID(from: @(#)bcmp.s 5.1 (Berkeley) 5/12/90)
 #else
-	RCSID($NetBSD: bcmp.S,v 1.4 2013/07/16 23:24:19 matt Exp $)
+	RCSID($NetBSD: bcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
+#ifdef __mcoldfire__
+#define	CMPMB(a,b)	movb b,%d2; cmpb a,%d2
+#define	CMPMW(a,b)	movw b,%d2; cmpw a,%d2
+#define	CMPML(a,b)	movl b,%d2; cmpl a,%d2
+#else
+#define	CMPMB(a,b)	cmpmb a,b

CVS commit: src/common/lib/libc/arch/m68k

2013-07-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 16 23:24:19 UTC 2013

Modified Files:
src/common/lib/libc/arch/m68k/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_cas_68000.S atomic_dec.S atomic_inc.S
atomic_or.S atomic_swap.S
src/common/lib/libc/arch/m68k/gen: bswap16.S bswap32.S bswap64.S
divsi3.S modsi3.S mulsi3.S udivsi3.S umodsi3.S
src/common/lib/libc/arch/m68k/net: htonl.S htons.S ntohl.S ntohs.S
src/common/lib/libc/arch/m68k/string: bcmp.S bcopy.S bzero.S ffs.S
memcmp.S memset.S strcat.S strchr.S strcmp.S strcpy.S strlen.S
strncmp.S strncpy.S strrchr.S

Log Message:
Add END(func)
Fix some straggling %r@eol to (%r)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/m68k/atomic/atomic_add.S \
src/common/lib/libc/arch/m68k/atomic/atomic_dec.S \
src/common/lib/libc/arch/m68k/atomic/atomic_inc.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_and.S \
src/common/lib/libc/arch/m68k/atomic/atomic_or.S
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S
cvs rdiff -u -r1.4 -r1.5 \
src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/gen/bswap16.S \
src/common/lib/libc/arch/m68k/gen/bswap32.S \
src/common/lib/libc/arch/m68k/gen/divsi3.S \
src/common/lib/libc/arch/m68k/gen/mulsi3.S \
src/common/lib/libc/arch/m68k/gen/udivsi3.S \
src/common/lib/libc/arch/m68k/gen/umodsi3.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/m68k/gen/bswap64.S
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/m68k/gen/modsi3.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/m68k/net/htonl.S \
src/common/lib/libc/arch/m68k/net/htons.S \
src/common/lib/libc/arch/m68k/net/ntohl.S \
src/common/lib/libc/arch/m68k/net/ntohs.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/string/bcmp.S \
src/common/lib/libc/arch/m68k/string/bcopy.S \
src/common/lib/libc/arch/m68k/string/bzero.S \
src/common/lib/libc/arch/m68k/string/ffs.S \
src/common/lib/libc/arch/m68k/string/memset.S \
src/common/lib/libc/arch/m68k/string/strchr.S \
src/common/lib/libc/arch/m68k/string/strcmp.S \
src/common/lib/libc/arch/m68k/string/strncmp.S \
src/common/lib/libc/arch/m68k/string/strrchr.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/m68k/string/memcmp.S \
src/common/lib/libc/arch/m68k/string/strcat.S \
src/common/lib/libc/arch/m68k/string/strcpy.S \
src/common/lib/libc/arch/m68k/string/strlen.S \
src/common/lib/libc/arch/m68k/string/strncpy.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.5 src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.6
--- src/common/lib/libc/arch/m68k/atomic/atomic_add.S:1.5	Tue Jul 16 20:49:41 2013
+++ src/common/lib/libc/arch/m68k/atomic/atomic_add.S	Tue Jul 16 23:24:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_add.S,v 1.5 2013/07/16 20:49:41 matt Exp $	*/
+/*	$NetBSD: atomic_add.S,v 1.6 2013/07/16 23:24:18 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -37,8 +37,9 @@
 ENTRY(_atomic_add_32)
 	movl	4(%sp), %a0
 	movl	8(%sp), %d0
-	addl	%d0, %a0@
+	addl	%d0, (%a0)
 	rts
+END(_atomic_add_32)
 ATOMIC_OP_ALIAS(atomic_add_32,_atomic_add_32)
 ATOMIC_OP_ALIAS(atomic_add_int,_atomic_add_32)
 STRONG_ALIAS(_atomic_add_int,_atomic_add_32)
@@ -52,10 +53,12 @@ ENTRY(_atomic_add_32_nv)
 1:	movl	(%a0), %d0
 	movl	%d0, %d1
 	addl	8(%sp), %d0
-	casl	%d1, %d0, %a0@
+	casl	%d1, %d0, (%a0)
 	bne	1b
 	movl	%d0, %a0	/* pointers return also in %a0 */
 	rts
+END(_atomic_add_32_nv)
+
 ATOMIC_OP_ALIAS(atomic_add_32_nv,_atomic_add_32_nv)
 ATOMIC_OP_ALIAS(atomic_add_int_nv,_atomic_add_32_nv)
 STRONG_ALIAS(_atomic_add_int_nv,_atomic_add_32_nv)
Index: src/common/lib/libc/arch/m68k/atomic/atomic_dec.S
diff -u src/common/lib/libc/arch/m68k/atomic/atomic_dec.S:1.5 src/common/lib/libc/arch/m68k/atomic/atomic_dec.S:1.6
--- src/common/lib/libc/arch/m68k/atomic/atomic_dec.S:1.5	Tue Jul 16 20:49:41 2013
+++ src/common/lib/libc/arch/m68k/atomic/atomic_dec.S	Tue Jul 16 23:24:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_dec.S,v 1.5 2013/07/16 20:49:41 matt Exp $	*/
+/*	$NetBSD: atomic_dec.S,v 1.6 2013/07/16 23:24:18 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -35,8 +35,9 @@
 
 ENTRY(_atomic_dec_32)
 	movl	4(%sp), %a0
-	subql	#1, %a0@
+	subql	#1, (%a0)
 	rts
+END(_atomic_dec_32)
 ATOMIC_OP_ALIAS(atomic_dec_32,_atomic_dec_32)
 ATOMIC_OP_ALIAS(atomic_dec_uint,_atomic_dec_32)
 STRONG_ALIAS(_atomic_dec_uint,_atomic_dec_32)
@@ -50,10 +51,11 @@ ENTRY(_atomic_dec_32_nv)
 1:	movl	(%a0), %d0
 	movl	%d0, %d1
 	subql	#1, %d0

CVS commit: src/common/lib/libc/arch/m68k/string

2011-07-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jul  9 14:57:29 UTC 2011

Modified Files:
src/common/lib/libc/arch/m68k/string: ffs.S

Log Message:
add a weak alias for __ffssi2


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/m68k/string/ffs.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/string/ffs.S
diff -u src/common/lib/libc/arch/m68k/string/ffs.S:1.1 src/common/lib/libc/arch/m68k/string/ffs.S:1.2
--- src/common/lib/libc/arch/m68k/string/ffs.S:1.1	Tue Dec 20 19:28:49 2005
+++ src/common/lib/libc/arch/m68k/string/ffs.S	Sat Jul  9 14:57:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.S,v 1.1 2005/12/20 19:28:49 christos Exp $	*/
+/*	$NetBSD: ffs.S,v 1.2 2011/07/09 14:57:29 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -39,12 +39,14 @@
 #if 0
 	RCSID(from: @(#)ffs.s	5.1 (Berkeley) 5/12/90)
 #else
-	RCSID($NetBSD: ffs.S,v 1.1 2005/12/20 19:28:49 christos Exp $)
+	RCSID($NetBSD: ffs.S,v 1.2 2011/07/09 14:57:29 mrg Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
 /* bit = ffs(value) */
 
+WEAK_ALIAS(__ffssi2,ffs)
+
 #ifndef	__mc68010__
 
 ENTRY(ffs)



CVS commit: src/common/lib/libc/arch/m68k/string

2009-07-17 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Fri Jul 17 19:42:45 UTC 2009

Removed Files:
src/common/lib/libc/arch/m68k/string: index.S rindex.S

Log Message:
Delete files that are no longer needed.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/common/lib/libc/arch/m68k/string/index.S \
src/common/lib/libc/arch/m68k/string/rindex.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.