Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add memset to libkern on vax, moving existing memset.S to sr...
details: https://anonhg.NetBSD.org/src/rev/0a62fe65d1e8
branches: trunk
changeset: 752941:0a62fe65d1e8
user: uwe <uwe%NetBSD.org@localhost>
date: Fri Mar 12 09:12:34 2010 +0000
description:
Add memset to libkern on vax, moving existing memset.S to src/common.
While kernel source code is supposed to use <machine/macros.h> via
<sys/param.h> and pick an inline asm version from there, gcc itself
can generate direct calls to memset() for structure initialization, so
the symbol must be provided.
Fixes INSTALL kernel, for which -Os caused gcc to use memset() call to
initialize a struct in uvm_fault_internal().
diffstat:
common/lib/libc/arch/vax/string/memset.S | 52 ++++++++++++++++++++++++++++++++
lib/libc/arch/vax/string/Makefile.inc | 6 +-
lib/libc/arch/vax/string/memset.S | 52 --------------------------------
3 files changed, 55 insertions(+), 55 deletions(-)
diffs (123 lines):
diff -r 58e3e20dd0b1 -r 0a62fe65d1e8 common/lib/libc/arch/vax/string/memset.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/vax/string/memset.S Fri Mar 12 09:12:34 2010 +0000
@@ -0,0 +1,52 @@
+/* $NetBSD: memset.S,v 1.1 2010/03/12 09:12:34 uwe Exp $ */
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .asciz "@(#)memset.s 8.1 (Berkeley) 6/4/93"
+#endif /* LIBC_SCCS and not lint */
+
+/* void *memset(base, c, length) */
+
+#include <machine/asm.h>
+
+ENTRY(memset, 0)
+ movl 4(%ap),%r3
+1:
+ movzwl $65535,%r0
+ movq 8(%ap),%r1
+ cmpl %r2,%r0
+ jgtru 2f
+ movc5 $0,(%r3),%r1,%r2,(%r3)
+ movl %r1,%r0
+ ret
+2:
+ subl2 %r0,12(%ap)
+ movc5 $0,(%r3),%r1,%r0,(%r3)
+ jbr 1b
diff -r 58e3e20dd0b1 -r 0a62fe65d1e8 lib/libc/arch/vax/string/Makefile.inc
--- a/lib/libc/arch/vax/string/Makefile.inc Fri Mar 12 09:02:15 2010 +0000
+++ b/lib/libc/arch/vax/string/Makefile.inc Fri Mar 12 09:12:34 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.4 2009/07/30 20:57:17 dsl Exp $
+# $NetBSD: Makefile.inc,v 1.5 2010/03/12 09:12:35 uwe Exp $
-SRCS+= bcmp.S bcopy.S bzero.S ffs.S memcmp.S memset.S
-SRCS+= memcpy.S memmove.S
+SRCS+= bcmp.S bcopy.S bzero.S ffs.S memcmp.S
+SRCS+= memcpy.S memmove.S memset.S
diff -r 58e3e20dd0b1 -r 0a62fe65d1e8 lib/libc/arch/vax/string/memset.S
--- a/lib/libc/arch/vax/string/memset.S Fri Mar 12 09:02:15 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/* $NetBSD: memset.S,v 1.3 2003/08/07 16:42:32 agc Exp $ */
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
- .asciz "@(#)memset.s 8.1 (Berkeley) 6/4/93"
-#endif /* LIBC_SCCS and not lint */
-
-/* void *memset(base, c, length) */
-
-#include "DEFS.h"
-
-ENTRY(memset, 0)
- movl 4(%ap),%r3
-1:
- movzwl $65535,%r0
- movq 8(%ap),%r1
- cmpl %r2,%r0
- jgtru 2f
- movc5 $0,(%r3),%r1,%r2,(%r3)
- movl %r1,%r0
- ret
-2:
- subl2 %r0,12(%ap)
- movc5 $0,(%r3),%r1,%r0,(%r3)
- jbr 1b
Home |
Main Index |
Thread Index |
Old Index