Module Name:    src
Committed By:   uwe
Date:           Fri Mar 12 09:12:35 UTC 2010

Modified Files:
        src/lib/libc/arch/vax/string: Makefile.inc
Added Files:
        src/common/lib/libc/arch/vax/string: memset.S
Removed Files:
        src/lib/libc/arch/vax/string: memset.S

Log Message:
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().


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/common/lib/libc/arch/vax/string/memset.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/string/Makefile.inc
cvs rdiff -u -r1.3 -r0 src/lib/libc/arch/vax/string/memset.S

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

Modified files:

Index: src/lib/libc/arch/vax/string/Makefile.inc
diff -u src/lib/libc/arch/vax/string/Makefile.inc:1.4 src/lib/libc/arch/vax/string/Makefile.inc:1.5
--- src/lib/libc/arch/vax/string/Makefile.inc:1.4	Thu Jul 30 20:57:17 2009
+++ src/lib/libc/arch/vax/string/Makefile.inc	Fri Mar 12 09:12:35 2010
@@ -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

Added files:

Index: src/common/lib/libc/arch/vax/string/memset.S
diff -u /dev/null src/common/lib/libc/arch/vax/string/memset.S:1.1
--- /dev/null	Fri Mar 12 09:12:35 2010
+++ src/common/lib/libc/arch/vax/string/memset.S	Fri Mar 12 09:12:34 2010
@@ -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

Reply via email to