Page MenuHomeFreeBSD

D15108.id41556.diff
No OneTemporary

D15108.id41556.diff

Index: share/man/man9/copy.9
===================================================================
--- share/man/man9/copy.9
+++ share/man/man9/copy.9
@@ -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 @@
.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 @@
.Fn copystr
and
.Fn copyinstr
-.\" .Fn copyinstr ,
-.\" and
-.\" .Fn copyoutstr
functions return
.Er ENAMETOOLONG
if the string is longer than
Index: sys/arm/arm/copystr.S
===================================================================
--- sys/arm/arm/copystr.S
+++ sys/arm/arm/copystr.S
@@ -149,59 +149,6 @@
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
Index: sys/mips/mips/support.S
===================================================================
--- sys/mips/mips/support.S
+++ sys/mips/mips/support.S
@@ -193,34 +193,6 @@
PTR_ADDU sp, sp, CALLFRAME_SIZ
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)

File Metadata

Mime Type
text/plain
Expires
Sat, Feb 21, 11:22 AM (15 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28921963
Default Alt Text
D15108.id41556.diff (3 KB)

Event Timeline