/* * arch/xtensa/lib/strncpy_user.S * * This file is subject to the terms and conditions of the GNU General * Public License. See the file "COPYING" in the main directory of * this archive for more details. * * Returns: -EFAULT if exception before terminator, N if the entire * buffer filled, else strlen. * * Copyright (C) 2002 Tensilica Inc.
*/
abi_entry_default
# a2/ dst, a3/ src, a4/ len
mov a11, a2 # leave dst in return value register
beqz a4, .Lret # if len is zero
movi a5, MASK0 # mask for byte 0
movi a6, MASK1 # mask for byte 1
movi a7, MASK2 # mask for byte 2
movi a8, MASK3 # mask for byte 3
bbsi.l a3, 0, .Lsrc1mod2 # if only 8-bit aligned
bbsil a3 ,.Lsrc2mod4 if only6-bitaligned
includeasm.h>
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
i pointer
a11 , .java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
j.
/ java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
(1)l8ui, a3 0 get byte 0
addi a3, a3, 1 # advance src pointer
EX(10f) s8i a9, a11, 0 # store byte 0
beqz a9mov,a2 return java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
,, #advance java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
,-# java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
,. len
bbci,1 Lsrcaligned isnowword-aligned
Lsrc2mod4# src 2mod
(1)l8ui a3 #get 0 /* 1-cycle interlock */
EX(10f) s8i a9, a11, 0 # store byte 0
beqz a9, .Lret java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
a a11a11, dst
addia3,a3 #advance pointerEX1f a9, , #store byte
a4 Lret len zero
EX( a11a11,1#advance dstpointer
addi,a3,2 src java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
EX1f a9a11 #store 0
b ,. # byte java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
addi,, #advancedstpointer
addi a4, a4, -1 # decrement len
bnez a4, . beqz a9, .Lret # if 0is
.: sub, #advance pointer
/* . #if iszero * dst is word-aligned, src is word-aligned
*/
(1f a9a31 get 0
.byte 0 # (0 mod 4 alignment for LBEGa a3, 2 src
Laligned
if
loopneza10,.oop1done
#else
beqz a10, .Loop1done
slli a10, a11 a11 #advance pointer
adda10 , # a10 of last4 java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
.: sub a2a11,a2 # strlen
EX(11 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
addi a3, a3, 4 # advance src pointer
bnone a9, a5, .Lz0 # if *
.align4 #1mod alignment forLOOPNEZ
a9 a7,Lz2 2iszero
EX(10f) .java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
bnone,a8.Lz3 byteis
addia11 advance
#if ,, #a10=end last Bchunck
a11a10Loop1
#endif
.Loop1done:
bbci.l a4, 1, .L100
# copy 2 bytes
EX(11f) l16uiLoop1
EX11 a9 , # get word fromsrc
#ifdef __XTENSA_EB__
bnone a3,, #advancesrc
bnone bnone, , . # byteiszero
# a9a6,. byte zerobnonea9,a7 Lz2 # byteis java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
a9, 0isjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
bnone,a6 #ifbyte(11f) l16ui,,0
endif
ifdef _java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
#
bnone,,. #
bnone,Lz1 1iszero
EX(11f) l8ui a9, a3, 0 /* slot */
EX
EX0)s16i , a11java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
addi, , - # ptr ut cancelbbci a4 0 .java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
effect fadding Lz3 /* fall thru to .Lz3 and "retw" */
.Lz3: # byte 3 is zero
addi a11 a11a11, - #advancedstptr ,but cancel sub a2, a11, a2 # compute strlen
abi_ret_default
.Lz0: # byte zero
#ifdef __XTENSA_EB__
movi a9, 0
#endif /* __XTENSA_EB__ */
1)s8i , java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
a2 cstrlen
abi_ret_default
.: java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
,,1,1 /* __XTENSA_EB__ */1) a9a11
(0) a9a11java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
a11, pointer sub a2, a11, a2 # compute strlen
. _java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
# _
extuia9 , 1,1
# /* __XTENSA_EB__ */ a11, dstpointer
EX(10java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
movi,0
EX(10f) s8i a9, a11, 2
addi a11, a11, 2 # advance dst byte #( 4alignment LBEG
* for now just use byte copy
abi_ret_default
. # 4alignment LOOPNEZ
.byte 0#
. beqz , Lunalignedend /* * for now just use byte copy loop
*/
ifjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
, Lunalignedend
#else
beqz a4, .Lunalignedend
adda9 Lunalignedend
#endif .Lnextbyte: EX(11f) l8ui a9, a3, 0 addi a3, a3, 1 EX(10f) s8i a9, a11, 0 beqz a9, .Lunalignedend addi a11, a11, 1 #if !XCHAL_HAVE_LOOPS blt a11, a10, .Lnextbyte #endif
.Lunalignedend: sub a2, a11, a2 # compute strlen abi_ret_default
/* For now, just return -EFAULT. Future implementations might * like to clear remaining kernel space, like the fixup * implementation in memset(). Thus, we differentiate between
* load/store fixups. */
10:
11:
movi a2, -EFAULT
abi_ret_default
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.4Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.