svn commit: r268360 - projects/arm64/sys/arm64/arm64

Andrew Turner andrew at FreeBSD.org
Mon Jul 7 08:42:05 UTC 2014


Author: andrew
Date: Mon Jul  7 08:42:04 2014
New Revision: 268360
URL: http://svnweb.freebsd.org/changeset/base/268360

Log:
  Implement copystr in C. With this I can get to the mountroot prompt.

Modified:
  projects/arm64/sys/arm64/arm64/copystr.c

Modified: projects/arm64/sys/arm64/arm64/copystr.c
==============================================================================
--- projects/arm64/sys/arm64/arm64/copystr.c	Mon Jul  7 08:22:39 2014	(r268359)
+++ projects/arm64/sys/arm64/arm64/copystr.c	Mon Jul  7 08:42:04 2014	(r268360)
@@ -35,7 +35,25 @@ int
 copystr(const void * __restrict kfaddr, void * __restrict kdaddr, size_t len,
     size_t * __restrict lencopied)
 {
+	const char *src;
+	size_t pos;
+	char *dst;
+	int error;
 
-	panic("copystr");
+	error = ENAMETOOLONG;
+	src = kfaddr;
+	dst = kdaddr;
+	for (pos = 0; pos < len; pos++) {
+		dst[pos] = src[pos];
+		if (src[pos] == '\0') {
+			error = 0;
+			break;
+		}
+	}
+
+	if (lencopied != NULL)
+		*lencopied = pos;
+
+	return (0);
 }
 


More information about the svn-src-projects mailing list