CVS commit: src/common/lib/libc/arch/m68k/string
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
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/string
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/string
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
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.