summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2023-01-06 19:10:19 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2023-01-06 19:10:19 +0000
commit41600a956e7003933e85b9ee75c6ea767d618229 (patch)
tree4291fae575885b471230ce40573937674d5178fa /sys/arch/i386
parentb1981eac4b47846cb3c6ce2e5b0197c4f7e52e4d (diff)
Remove copystr(9), unless used internally by copy{in,out}str.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/locore.s51
1 files changed, 1 insertions, 50 deletions
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index 75a7dd91298..f561c47a7cb 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.198 2022/12/08 01:25:44 guenther Exp $ */
+/* $OpenBSD: locore.s,v 1.199 2023/01/06 19:10:18 miod Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
@@ -702,55 +702,6 @@ copystr_return:
#endif
ret
-/*
- * copystr(caddr_t from, caddr_t to, size_t maxlen, size_t *lencopied);
- * Copy a NUL-terminated string, at most maxlen characters long. Return the
- * number of characters copied (including the NUL) in *lencopied. If the
- * string is too long, return ENAMETOOLONG; else return 0.
- */
-ENTRY(copystr)
-#ifdef DDB
- pushl %ebp
- movl %esp,%ebp
-#endif
- pushl %esi
- pushl %edi
-
- movl 12+FPADD(%esp),%esi # esi = from
- movl 16+FPADD(%esp),%edi # edi = to
- movl 20+FPADD(%esp),%edx # edx = maxlen
- incl %edx
-
-1: decl %edx
- jz 4f
- lodsb
- stosb
- testb %al,%al
- jnz 1b
-
- /* Success -- 0 byte reached. */
- decl %edx
- xorl %eax,%eax
- jmp 6f
-
-4: /* edx is zero -- return ENAMETOOLONG. */
- movl $ENAMETOOLONG,%eax
-
-6: /* Set *lencopied and return %eax. */
- movl 20+FPADD(%esp),%ecx
- subl %edx,%ecx
- movl 24+FPADD(%esp),%edx
- testl %edx,%edx
- jz 7f
- movl %ecx,(%edx)
-
-7: popl %edi
- popl %esi
-#ifdef DDB
- leave
-#endif
- ret
-
/*****************************************************************************/
/*