Module Name: src Committed By: maxv Date: Tue Jun 30 16:20:03 UTC 2020
Modified Files: src/sys/arch/aarch64/aarch64: copyinout.S src/sys/arch/alpha/alpha: locore.s src/sys/arch/amd64/amd64: copy.S src/sys/arch/arm/arm: copystr.S src/sys/arch/hppa/hppa: copy.S src/sys/arch/i386/i386: copy.S src/sys/arch/ia64/ia64: support.S src/sys/arch/m68k/m68k: copy.s src/sys/arch/mips/mips: copy.S src/sys/arch/powerpc/conf: files.powerpc src/sys/arch/riscv/riscv: trap.c src/sys/arch/sh3/sh3: locore_c.c src/sys/arch/sparc/sparc: locore.s src/sys/arch/sparc64/sparc64: copy.S src/sys/arch/usermode/usermode: copy.c src/sys/arch/vax/vax: subr.S src/sys/kern: subr_asan.c subr_csan.c subr_msan.c src/sys/lib/libkern: Makefile.libkern src/sys/sys: systm.h Added Files: src/sys/lib/libkern: copystr.c Removed Files: src/sys/arch/powerpc/powerpc: copystr.c Log Message: Make copystr() a MI C function, part of libkern and shared on all architectures. Notes: - On alpha and ia64 the function is kept but gets renamed locally to avoid symbol collision. This is because on these two arches, I am not sure whether the ASM callers do not rely on fixed registers, so I prefer to keep the ASM body for now. - On Vax, only the symbol is removed, because the body is used from other functions. - On RISC-V, this change fixes a bug: copystr() was just a wrapper around strlcpy(), but strlcpy() makes the operation less safe (strlen on the source beyond its size). - The kASan, kCSan and kMSan wrappers are removed, because now that copystr() is in C, the compiler transformations are applied to it, without the need for manual wrappers. Could test on amd64 only, but should be fine. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/aarch64/copyinout.S cvs rdiff -u -r1.124 -r1.125 src/sys/arch/alpha/alpha/locore.s cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/amd64/copy.S cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/arm/copystr.S cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hppa/hppa/copy.S cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/i386/copy.S cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/ia64/support.S cvs rdiff -u -r1.48 -r1.49 src/sys/arch/m68k/m68k/copy.s cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/mips/copy.S cvs rdiff -u -r1.93 -r1.94 src/sys/arch/powerpc/conf/files.powerpc cvs rdiff -u -r1.6 -r0 src/sys/arch/powerpc/powerpc/copystr.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/riscv/trap.c cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sh3/sh3/locore_c.c cvs rdiff -u -r1.277 -r1.278 src/sys/arch/sparc/sparc/locore.s cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/sparc64/copy.S cvs rdiff -u -r1.11 -r1.12 src/sys/arch/usermode/usermode/copy.c cvs rdiff -u -r1.37 -r1.38 src/sys/arch/vax/vax/subr.S cvs rdiff -u -r1.21 -r1.22 src/sys/kern/subr_asan.c cvs rdiff -u -r1.8 -r1.9 src/sys/kern/subr_csan.c cvs rdiff -u -r1.11 -r1.12 src/sys/kern/subr_msan.c cvs rdiff -u -r1.48 -r1.49 src/sys/lib/libkern/Makefile.libkern cvs rdiff -u -r0 -r1.1 src/sys/lib/libkern/copystr.c cvs rdiff -u -r1.294 -r1.295 src/sys/sys/systm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.