~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/csky/abiv2/strcpy.S

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
  3 
  4 #include <linux/linkage.h>
  5 #include "sysdep.h"
  6 
  7 ENTRY(strcpy)
  8         mov     a3, a0
  9         /* Check if the src addr is aligned.  */
 10         andi    t0, a1, 3
 11         bnez    t0, 11f
 12 1:
 13         /* Check if all the bytes in the word are not zero.  */
 14         ldw     a2, (a1)
 15         tstnbz  a2
 16         bf      9f
 17         stw     a2, (a3)
 18 
 19         ldw     a2, (a1, 4)
 20         tstnbz  a2
 21         bf      2f
 22         stw     a2, (a3, 4)
 23 
 24         ldw     a2, (a1, 8)
 25         tstnbz  a2
 26         bf      3f
 27         stw     a2, (a3, 8)
 28 
 29         ldw     a2, (a1, 12)
 30         tstnbz  a2
 31         bf      4f
 32         stw     a2, (a3, 12)
 33 
 34         ldw     a2, (a1, 16)
 35         tstnbz  a2
 36         bf      5f
 37         stw     a2, (a3, 16)
 38 
 39         ldw     a2, (a1, 20)
 40         tstnbz  a2
 41         bf      6f
 42         stw     a2, (a3, 20)
 43 
 44         ldw     a2, (a1, 24)
 45         tstnbz  a2
 46         bf      7f
 47         stw     a2, (a3, 24)
 48 
 49         ldw     a2, (a1, 28)
 50         tstnbz  a2
 51         bf      8f
 52         stw     a2, (a3, 28)
 53 
 54         addi    a3, 32
 55         addi    a1, 32
 56         br      1b
 57 
 58 
 59 2:
 60         addi    a3, 4
 61         br      9f
 62 
 63 3:
 64         addi    a3, 8
 65         br      9f
 66 
 67 4:
 68         addi    a3, 12
 69         br      9f
 70 
 71 5:
 72         addi    a3, 16
 73         br      9f
 74 
 75 6:
 76         addi    a3, 20
 77         br      9f
 78 
 79 7:
 80         addi    a3, 24
 81         br      9f
 82 
 83 8:
 84         addi    a3, 28
 85 9:
 86 # ifdef __CSKYBE__
 87         xtrb0   t0, a2
 88         st.b    t0, (a3)
 89         bez     t0, 10f
 90         xtrb1   t0, a2
 91         st.b    t0, (a3, 1)
 92         bez     t0, 10f
 93         xtrb2   t0, a2
 94         st.b    t0, (a3, 2)
 95         bez     t0, 10f
 96         stw     a2, (a3)
 97 # else
 98         xtrb3   t0, a2
 99         st.b    t0, (a3)
100         bez     t0, 10f
101         xtrb2   t0, a2
102         st.b    t0, (a3, 1)
103         bez     t0, 10f
104         xtrb1   t0, a2
105         st.b    t0, (a3, 2)
106         bez     t0, 10f
107         stw     a2, (a3)
108 # endif /* !__CSKYBE__ */
109 10:
110         jmp     lr
111 
112 11:
113         subi    t0, 4
114 12:
115         ld.b    a2, (a1)
116         st.b    a2, (a3)
117         bez     a2, 10b
118         addi    t0, 1
119         addi    a1, a1, 1
120         addi    a3, a3, 1
121         bnez    t0, 12b
122         jbr     1b
123 ENDPROC(strcpy)

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php