diff options
Diffstat (limited to 'newlib/libc/machine/rx/strlen.S')
-rw-r--r-- | newlib/libc/machine/rx/strlen.S | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/newlib/libc/machine/rx/strlen.S b/newlib/libc/machine/rx/strlen.S index c07b429b2..bf12c0ce1 100644 --- a/newlib/libc/machine/rx/strlen.S +++ b/newlib/libc/machine/rx/strlen.S @@ -5,6 +5,17 @@ .global _strlen .type _strlen,@function _strlen: +#ifdef __RX_DISALLOW_STRING_INSNS__ + mov r1, r4 + +1: mov.b [r1+], r5 + cmp #0, r5 + bne 1b + + sub #1, r1 + sub r4, r1 + rts +#else add #0, r1, r4 ; Save a copy of the string start address and set the condition flags. beq null_string ; Test for a NULL pointer. mov #-1, r3 ; Set a limit on the number of bytes examined. @@ -14,3 +25,5 @@ _strlen: null_string: sub r4, r1 ; Compute the length. rts +#endif + .size _strlen, . - _strlen |