diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2020-05-12 04:34:26 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2020-05-12 04:34:26 +0000 |
commit | 051fc58cb368b8d1670f2728e1c07103cae812dd (patch) | |
tree | 65ed3fcad1ba7f0e13d8ccb44e800e0be2b10274 /sys/arm | |
parent | 43f12c5b662543e2074b6839790830d6e8e4fa98 (diff) | |
download | src-051fc58cb368b8d1670f2728e1c07103cae812dd.tar.gz src-051fc58cb368b8d1670f2728e1c07103cae812dd.zip |
Revert r360944 and r360946 until reported issues can be resolved
Reported by: cy
Notes
Notes:
svn path=/head/; revision=360955
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/copystr.S | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/arm/arm/copystr.S b/sys/arm/arm/copystr.S index 15caf85bdfc3..6a7a3518ea5f 100644 --- a/sys/arm/arm/copystr.S +++ b/sys/arm/arm/copystr.S @@ -60,6 +60,39 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lpcb #endif +/* + * r0 - from + * r1 - to + * r2 - maxlens + * r3 - lencopied + * + * Copy string from r0 to r1 + */ +ENTRY(copystr) + stmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + teq r2, #0x00000000 + mov r5, #0x00000000 + moveq r0, #ENAMETOOLONG + beq 2f + +1: ldrb r4, [r0], #0x0001 + add r5, r5, #0x00000001 + teq r4, #0x00000000 + strb r4, [r1], #0x0001 + teqne r5, r2 + bne 1b + + teq r4, #0x00000000 + moveq r0, #0x00000000 + movne r0, #ENAMETOOLONG + +2: teq r3, #0x00000000 + strne r5, [r3] + + ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + RET +END(copystr) + #define SAVE_REGS stmfd sp!, {r4-r6} #define RESTORE_REGS ldmfd sp!, {r4-r6} |