svn commit: r332654 - in head: share/man/man9 sys/arm/arm sys/mips/mips

Brooks Davis brooks at FreeBSD.org
Tue Apr 17 17:20:07 UTC 2018


Author: brooks
Date: Tue Apr 17 17:20:04 2018
New Revision: 332654
URL: https://svnweb.freebsd.org/changeset/base/332654

Log:
  Remove unused implementations of copyoutstr().
  
  Also remove the commented out documentation.  The documentation arrived
  with the import of the copy.9 manpage.  I suspect the implementations
  came from NetBSD while bootstrapping the Arm and MIPS ports.
  
  Reviewed by:	andrew, jmallett
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D15108

Modified:
  head/share/man/man9/copy.9
  head/sys/arm/arm/copystr.S
  head/sys/mips/mips/support.S

Modified: head/share/man/man9/copy.9
==============================================================================
--- head/share/man/man9/copy.9	Tue Apr 17 16:51:27 2018	(r332653)
+++ head/share/man/man9/copy.9	Tue Apr 17 17:20:04 2018	(r332654)
@@ -61,8 +61,6 @@
 .Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done"
 .Ft int
 .Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done"
-.\" .Ft int
-.\" .Fn copyoutstr "const void *kaddr" "void *uaddr" "size_t len" "size_t *done"
 .Sh DESCRIPTION
 The
 .Nm
@@ -135,15 +133,6 @@ NUL, is returned in
 .Fa done
 is
 .No non- Ns Dv NULL ) .
-.\" .It Fn copyoutstr
-.\" Copies a NUL-terminated string, at most
-.\" bytes long, from kernel-space address
-.\" .Fa kaddr
-.\" to user-space address
-.\" .Fa uaddr .
-.\" The number of bytes actually copied, including the terminating
-.\" NUL, is returned in
-.\" .Fa *done .
 .Sh RETURN VALUES
 The
 .Nm
@@ -164,9 +153,6 @@ The
 .Fn copystr
 and
 .Fn copyinstr
-.\" .Fn copyinstr ,
-.\" and
-.\" .Fn copyoutstr
 functions return
 .Er ENAMETOOLONG
 if the string is longer than

Modified: head/sys/arm/arm/copystr.S
==============================================================================
--- head/sys/arm/arm/copystr.S	Tue Apr 17 16:51:27 2018	(r332653)
+++ head/sys/arm/arm/copystr.S	Tue Apr 17 17:20:04 2018	(r332654)
@@ -149,59 +149,6 @@ ENTRY(copyinstr)
 	RET
 END(copyinstr)
 
-/*
- * r0 - kernel space address
- * r1 - user space address
- * r2 - maxlens
- * r3 - lencopied
- *
- * Copy string from kernel space to user space
- */
-ENTRY(copyoutstr)
-	SAVE_REGS
-
-	teq	r2, #0x00000000
-	mov	r6, #0x00000000
-	moveq	r0, #ENAMETOOLONG
-	beq	2f
-
-	ldr	r12, =VM_MAXUSER_ADDRESS
-
-	GET_PCB(r4)
-	ldr	r4, [r4]
-
-#ifdef DIAGNOSTIC
-	teq	r4, #0x00000000
-	beq	.Lcopystrpcbfault
-#endif
-
-	adr	r5, .Lcopystrfault
-	str	r5, [r4, #PCB_ONFAULT]
-
-1:
-	cmp	r0, r12
-	bcs	.Lcopystrfault
-	ldrb	r5, [r0], #0x0001
-	add	r6, r6, #0x00000001
-	teq	r5, #0x00000000
-	strbt	r5, [r1], #0x0001
-	teqne	r6, r2
-	bne	1b
-
-	mov	r0, #0x00000000
-	str	r0, [r4, #PCB_ONFAULT]
-
-	teq	r5, #0x00000000
-	moveq	r0, #0x00000000
-	movne	r0, #ENAMETOOLONG
-
-2:	teq	r3, #0x00000000
-	strne	r6, [r3]
-
-	RESTORE_REGS
-	RET
-END(copyoutstr)
-
 /* A fault occurred during the copy */
 .Lcopystrfault:
 	mov	r1, #0x00000000

Modified: head/sys/mips/mips/support.S
==============================================================================
--- head/sys/mips/mips/support.S	Tue Apr 17 16:51:27 2018	(r332653)
+++ head/sys/mips/mips/support.S	Tue Apr 17 17:20:04 2018	(r332654)
@@ -162,34 +162,6 @@ NESTED(copyinstr, CALLFRAME_SIZ, ra)
 END(copyinstr)
 
 /*
- * Copy a null terminated string from the kernel address space into
- * the user address space.
- *
- *	copyoutstr(fromaddr, toaddr, maxlength, &lencopied)
- *		caddr_t fromaddr;
- *		caddr_t toaddr;
- *		u_int maxlength;
- *		u_int *lencopied;
- */
-NESTED(copyoutstr, CALLFRAME_SIZ, ra)
-	PTR_SUBU	sp, sp, CALLFRAME_SIZ
-	.mask	0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
-	PTR_LA	v0, copyerr
-	blt	a1, zero, _C_LABEL(copyerr)  # make sure address is in user space
-	REG_S	ra, CALLFRAME_RA(sp)
-	GET_CPU_PCPU(v1)
-	PTR_L	v1, PC_CURPCB(v1)
-	jal	_C_LABEL(copystr)
-	PTR_S	v0, U_PCB_ONFAULT(v1)
-	REG_L	ra, CALLFRAME_RA(sp)
-	GET_CPU_PCPU(v1)
-	PTR_L	v1, PC_CURPCB(v1)
-	PTR_S	zero, U_PCB_ONFAULT(v1)
-	j	ra
-	PTR_ADDU	sp, sp, CALLFRAME_SIZ
-END(copyoutstr)
-
-/*
  * Copy specified amount of data from user space into the kernel
  *	copyin(from, to, len)
  *		caddr_t *from;	(user source address)


More information about the svn-src-head mailing list