Compare commits
930 Commits
jb-mr1-dev
...
android-4.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
738370d938 | ||
![]() |
262b7384e4 | ||
![]() |
389b5c1ee5 | ||
![]() |
ccaa0fa6e9 | ||
![]() |
7b4d77e400 | ||
![]() |
9b84824dfd | ||
![]() |
a69103ffe4 | ||
![]() |
1fe1137576 | ||
![]() |
309e107f01 | ||
![]() |
e919b116d3 | ||
![]() |
96449b3dc1 | ||
![]() |
b24b6e1419 | ||
![]() |
c01274c4aa | ||
![]() |
d02dd19d51 | ||
![]() |
267290b340 | ||
![]() |
74b324ac09 | ||
![]() |
ce636ca088 | ||
![]() |
887049e46b | ||
![]() |
da2c158645 | ||
![]() |
8a6abe380d | ||
![]() |
bd014c2e42 | ||
![]() |
e6ddfc55c8 | ||
![]() |
999dff0ef3 | ||
![]() |
a850ad4cf4 | ||
![]() |
e51d75a9ac | ||
![]() |
65a8eb606f | ||
![]() |
369f92349f | ||
![]() |
c82b339a7d | ||
![]() |
9386a33ea0 | ||
![]() |
3c1504d9d7 | ||
![]() |
93f3811b74 | ||
![]() |
48f25cef45 | ||
![]() |
a40751185f | ||
![]() |
0c973d7049 | ||
![]() |
3198850ea1 | ||
![]() |
1b91c6c11f | ||
![]() |
ba61bb55c4 | ||
![]() |
a3fe475c9f | ||
![]() |
c019345a3a | ||
![]() |
cda62094ef | ||
![]() |
e0e5b2f6e7 | ||
![]() |
65163750b1 | ||
![]() |
b826ebf41e | ||
![]() |
c37dd59956 | ||
![]() |
85598626f4 | ||
![]() |
890c8ed6ef | ||
![]() |
34895c1bdf | ||
![]() |
b44f9600a3 | ||
![]() |
a0dcecc53e | ||
![]() |
b80a05fa67 | ||
![]() |
bc0d7f736c | ||
![]() |
5c5f303e4c | ||
![]() |
e7cb795cb6 | ||
![]() |
d74a0ffba8 | ||
![]() |
8794ece296 | ||
![]() |
ddda044a81 | ||
![]() |
5686bb3003 | ||
![]() |
56d161bb62 | ||
![]() |
4cdde5f123 | ||
![]() |
3323628d63 | ||
![]() |
5c2772f59d | ||
![]() |
c8ded7c6b1 | ||
![]() |
a316725740 | ||
![]() |
babb72dc29 | ||
![]() |
a41ba2f0bf | ||
![]() |
1e40ace49e | ||
![]() |
17a0d1915f | ||
![]() |
a596aa6abf | ||
![]() |
01c0e19e42 | ||
![]() |
26c815c489 | ||
![]() |
612333f671 | ||
![]() |
9724ce3a09 | ||
![]() |
3077d88347 | ||
![]() |
c48968d268 | ||
![]() |
4453c51c82 | ||
![]() |
8f7120bbac | ||
![]() |
a6cc67c9b5 | ||
![]() |
5c9a25cc23 | ||
![]() |
f977d2dc1d | ||
![]() |
800ad8249a | ||
![]() |
8ecf225827 | ||
![]() |
c9edc07977 | ||
![]() |
39e2a408a6 | ||
![]() |
6eb978c9bf | ||
![]() |
17a8b0db63 | ||
![]() |
f46e14544b | ||
![]() |
9088af19b4 | ||
![]() |
86c3184972 | ||
![]() |
31dea25b8b | ||
![]() |
d7dc414afd | ||
![]() |
987fc5a3c4 | ||
![]() |
adeec09629 | ||
![]() |
12ea800566 | ||
![]() |
5f8292050f | ||
![]() |
ce532721aa | ||
![]() |
c14166477e | ||
![]() |
8f2a5a0b40 | ||
![]() |
e1b0db1392 | ||
![]() |
50d42294bd | ||
![]() |
e23ed8c644 | ||
![]() |
2eb44c5aa4 | ||
![]() |
9ede4549fe | ||
![]() |
f8d689bc56 | ||
![]() |
4d696eb49d | ||
![]() |
af7f2f2fcf | ||
![]() |
f85fc022f5 | ||
![]() |
f694ed1cdb | ||
![]() |
d30b9f0912 | ||
![]() |
306a353825 | ||
![]() |
c9358706c6 | ||
![]() |
2e7b8d6399 | ||
![]() |
f861bc5cc3 | ||
![]() |
e0175ca7e4 | ||
![]() |
f557e90b34 | ||
![]() |
2f44c05bc5 | ||
![]() |
ec706c24ac | ||
![]() |
9aceab5015 | ||
![]() |
b0b974c10c | ||
![]() |
2a66ccf1bb | ||
![]() |
980508b0ea | ||
![]() |
04954a43b3 | ||
![]() |
b4d6f28cc3 | ||
![]() |
a3214c6562 | ||
![]() |
94a34010c1 | ||
![]() |
746f128602 | ||
![]() |
5d998b4a21 | ||
![]() |
cb2069bf69 | ||
![]() |
f21aa3b61e | ||
![]() |
ca0c11bd82 | ||
![]() |
e9cdce33f3 | ||
![]() |
3c9afb5e17 | ||
![]() |
6b4c77f854 | ||
![]() |
fa8c05dc00 | ||
![]() |
8c73f69cf4 | ||
![]() |
36cb88b70c | ||
![]() |
53630c0e5b | ||
![]() |
4a05bef4c0 | ||
![]() |
a60f381814 | ||
![]() |
b2525ba8a0 | ||
![]() |
7915b22e8f | ||
![]() |
60ac09bdb2 | ||
![]() |
a4b20d712b | ||
![]() |
b8e1033c5b | ||
![]() |
e5412a9a95 | ||
![]() |
bf32ffcf02 | ||
![]() |
6d6f5e618e | ||
![]() |
4b032ee9b9 | ||
![]() |
0b765862e1 | ||
![]() |
62c5cd0781 | ||
![]() |
cdb27f239b | ||
![]() |
b6e22482d4 | ||
![]() |
8a01572272 | ||
![]() |
4706606c88 | ||
![]() |
809eed1ded | ||
![]() |
0493a6f7be | ||
![]() |
0a2ee4750a | ||
![]() |
ad7c275e45 | ||
![]() |
c9f8081425 | ||
![]() |
6b3f49a537 | ||
![]() |
c7b9f954a5 | ||
![]() |
91392116ff | ||
![]() |
33031fed84 | ||
![]() |
2d4b9b7cff | ||
![]() |
9c0c056bed | ||
![]() |
6b1aa1b16b | ||
![]() |
db794197cc | ||
![]() |
642331b5dd | ||
![]() |
bac72abae4 | ||
![]() |
50a2cd865e | ||
![]() |
0b4a85bf1e | ||
![]() |
5e2492eb89 | ||
![]() |
2527a8b5a6 | ||
![]() |
9043202b5b | ||
![]() |
20958207d5 | ||
![]() |
43cc7f795b | ||
![]() |
c1a5d20d08 | ||
![]() |
9a0b658c9c | ||
![]() |
c41dcad040 | ||
![]() |
650be4e584 | ||
![]() |
8c65a1e466 | ||
![]() |
a2517de384 | ||
![]() |
036f909720 | ||
![]() |
d4ee82dfa3 | ||
![]() |
97a8217ae1 | ||
![]() |
3f7b1cd3ac | ||
![]() |
be21fe7a59 | ||
![]() |
69af6e61e1 | ||
![]() |
6ad68558ed | ||
![]() |
e5e6e17c5b | ||
![]() |
133d97e4b0 | ||
![]() |
c96ad9bcd2 | ||
![]() |
7b69ac535a | ||
![]() |
cf9a9604ad | ||
![]() |
81e0f35acc | ||
![]() |
2125c15506 | ||
![]() |
eb93ebffba | ||
![]() |
d392e044c7 | ||
![]() |
29cc4946ac | ||
![]() |
f0777843c0 | ||
![]() |
947b3ab02b | ||
![]() |
14283004f5 | ||
![]() |
b9ef7f4e12 | ||
![]() |
ae280bcdbe | ||
![]() |
04190c53e3 | ||
![]() |
52b3aed798 | ||
![]() |
55fc93a909 | ||
![]() |
cc64677342 | ||
![]() |
c5c6cb3f13 | ||
![]() |
8f149da08d | ||
![]() |
305a999589 | ||
![]() |
66273ac2b6 | ||
![]() |
b3b1ab6213 | ||
![]() |
8fa924e5df | ||
![]() |
6524d3cad7 | ||
![]() |
eb149e954e | ||
![]() |
5b349fc22e | ||
![]() |
7c83a1ed81 | ||
![]() |
04766565d3 | ||
![]() |
9c102ccf95 | ||
![]() |
7fe8229b49 | ||
![]() |
9c1912c4bf | ||
![]() |
e255642dc1 | ||
![]() |
30f1622a34 | ||
![]() |
82f4cc5de4 | ||
![]() |
58b997c812 | ||
![]() |
f5f906c184 | ||
![]() |
7c0dd555c0 | ||
![]() |
aa13eaa934 | ||
![]() |
d9cb69881a | ||
![]() |
406968b244 | ||
![]() |
c0e9ddd002 | ||
![]() |
701bec2af3 | ||
![]() |
92ce5cc4bc | ||
![]() |
ed1068c86e | ||
![]() |
7b8bf68133 | ||
![]() |
f6bb5bf498 | ||
![]() |
726642cfa5 | ||
![]() |
dd8439141a | ||
![]() |
440bc83d92 | ||
![]() |
bcedca25d3 | ||
![]() |
41fb968c42 | ||
![]() |
cadc858329 | ||
![]() |
7b2c6385ef | ||
![]() |
bc0e7ee181 | ||
![]() |
5d36baee95 | ||
![]() |
6f1b7a6407 | ||
![]() |
cf820d7e96 | ||
![]() |
b22a684990 | ||
![]() |
bfe0640e41 | ||
![]() |
a6b24b7afb | ||
![]() |
7dfc6a3cd1 | ||
![]() |
e974e95160 | ||
![]() |
2a5b57db8c | ||
![]() |
d470955eb5 | ||
![]() |
580a707376 | ||
![]() |
72e983d628 | ||
![]() |
538f6fc202 | ||
![]() |
398f46dd92 | ||
![]() |
a0259b42eb | ||
![]() |
11ebbc8437 | ||
![]() |
448f1f08c2 | ||
![]() |
caeb0bf53c | ||
![]() |
719d46f8ac | ||
![]() |
a9ff09d1fc | ||
![]() |
fae89fc404 | ||
![]() |
55779c4316 | ||
![]() |
aa96db5ba0 | ||
![]() |
37d6d8e933 | ||
![]() |
818b1423d2 | ||
![]() |
44f8f7b86a | ||
![]() |
cae2173952 | ||
![]() |
77272874f8 | ||
![]() |
ccd403161c | ||
![]() |
c641cafbc3 | ||
![]() |
593abb7b59 | ||
![]() |
5593d50c72 | ||
![]() |
eeecff7293 | ||
![]() |
9d23e04c43 | ||
![]() |
6f55284103 | ||
![]() |
b5862d4d8a | ||
![]() |
aa772a33ba | ||
![]() |
82232f0e6b | ||
![]() |
61ba9b526b | ||
![]() |
4174337525 | ||
![]() |
7f67f78ad5 | ||
![]() |
6af19237b7 | ||
![]() |
081318e355 | ||
![]() |
39804dcde6 | ||
![]() |
40eabe24e4 | ||
![]() |
15c401d4ac | ||
![]() |
3e3b239d2b | ||
![]() |
7fd803cdfa | ||
![]() |
56a007c157 | ||
![]() |
0a2cb81597 | ||
![]() |
f93de61e7b | ||
![]() |
b128f49fd5 | ||
![]() |
fb7eb5e07f | ||
![]() |
0276656daa | ||
![]() |
7331af73f2 | ||
![]() |
c2d26ce745 | ||
![]() |
dc5ec07158 | ||
![]() |
dfa1e59b7d | ||
![]() |
fe33fc790a | ||
![]() |
a261afb7c9 | ||
![]() |
8561261b5e | ||
![]() |
2346559cb4 | ||
![]() |
4c897b692d | ||
![]() |
6b97c7dc03 | ||
![]() |
97f2ec50a7 | ||
![]() |
26a13bcfb8 | ||
![]() |
d2547040a1 | ||
![]() |
5ca3e4a349 | ||
![]() |
a7603ff87a | ||
![]() |
95b1ea1bb3 | ||
![]() |
6719500dbd | ||
![]() |
2fee0340a9 | ||
![]() |
73964c592c | ||
![]() |
8ca1da6e71 | ||
![]() |
627274292e | ||
![]() |
d8213bb573 | ||
![]() |
6aca0ce367 | ||
![]() |
f659b3c90d | ||
![]() |
d3b9d11369 | ||
![]() |
2db16ea38e | ||
![]() |
32a2340067 | ||
![]() |
3002d64bcd | ||
![]() |
9cbe1e63dd | ||
![]() |
d41c26e2d8 | ||
![]() |
b6032515a0 | ||
![]() |
91a9925998 | ||
![]() |
a244e4eb61 | ||
![]() |
baf2c09f3f | ||
![]() |
5227663d2f | ||
![]() |
761b344bff | ||
![]() |
59aeff9417 | ||
![]() |
bc35693e6b | ||
![]() |
d8ceaf5afa | ||
![]() |
07f7e62a25 | ||
![]() |
899d65283d | ||
![]() |
9701d4b701 | ||
![]() |
4b4a882428 | ||
![]() |
dde1d876b1 | ||
![]() |
991ee7d895 | ||
![]() |
6d33918207 | ||
![]() |
f4e258c22e | ||
![]() |
78715fca0b | ||
![]() |
4912782c6a | ||
![]() |
9f878c2fca | ||
![]() |
558a8b1d3b | ||
![]() |
3e898476c7 | ||
![]() |
ac480b422a | ||
![]() |
3fa6746536 | ||
![]() |
1bb43b02ad | ||
![]() |
191f880bdf | ||
![]() |
bfa199ab40 | ||
![]() |
23731e841a | ||
![]() |
a2a9817f4c | ||
![]() |
13478d856a | ||
![]() |
605cc29358 | ||
![]() |
0f6882f43d | ||
![]() |
a2b8b833d2 | ||
![]() |
b940711587 | ||
![]() |
5bb4f54b4d | ||
![]() |
1b21249d5a | ||
![]() |
376bce0097 | ||
![]() |
8e2b28cb6c | ||
![]() |
bdff26df27 | ||
![]() |
c440d24423 | ||
![]() |
03798dd23c | ||
![]() |
6b73d13fa4 | ||
![]() |
e4b08318c1 | ||
![]() |
024246ec27 | ||
![]() |
c087b7a80f | ||
![]() |
63358ae068 | ||
![]() |
8f509e8be1 | ||
![]() |
01cf1678e7 | ||
![]() |
5eef90699d | ||
![]() |
7d2bc92717 | ||
![]() |
636d21f32b | ||
![]() |
f156b901b1 | ||
![]() |
86e4e23408 | ||
![]() |
8c372fc77e | ||
![]() |
dd698ec89a | ||
![]() |
389ebfa16f | ||
![]() |
5bb67760f0 | ||
![]() |
8ddef40dad | ||
![]() |
6f67cd224e | ||
![]() |
a7d9b655e5 | ||
![]() |
c63e59039d | ||
![]() |
ffc807fdb6 | ||
![]() |
4e9d9e4df8 | ||
![]() |
a3e0f95fba | ||
![]() |
001437e861 | ||
![]() |
5dc29e97a6 | ||
![]() |
09559dd046 | ||
![]() |
d2a6d8d77d | ||
![]() |
4b9ed9e153 | ||
![]() |
5fe286618f | ||
![]() |
1c3039301b | ||
![]() |
0e51a86124 | ||
![]() |
a9ebf6c951 | ||
![]() |
6dd470d4d0 | ||
![]() |
df8c72e510 | ||
![]() |
d418c2bd0a | ||
![]() |
303339e8d1 | ||
![]() |
d1f2fafb72 | ||
![]() |
b72952171b | ||
![]() |
3cbcb87bd1 | ||
![]() |
384bdb3776 | ||
![]() |
54a2587446 | ||
![]() |
46b3f0bb97 | ||
![]() |
9cdd76954d | ||
![]() |
96a5819afb | ||
![]() |
fb7a4850b8 | ||
![]() |
ada6de673b | ||
![]() |
37247ae63c | ||
![]() |
16444e0f85 | ||
![]() |
33e4365d87 | ||
![]() |
422c400dd3 | ||
![]() |
322c7edba3 | ||
![]() |
704d9c5b45 | ||
![]() |
ff26e25b51 | ||
![]() |
3c72524611 | ||
![]() |
8db7a4cb20 | ||
![]() |
9743d7fb60 | ||
![]() |
fb55511e71 | ||
![]() |
0243962d20 | ||
![]() |
9d43c07987 | ||
![]() |
4e8825038e | ||
![]() |
4c59597089 | ||
![]() |
8dfe0daf6f | ||
![]() |
5821e11d0b | ||
![]() |
7bc49fcfc0 | ||
![]() |
278c059663 | ||
![]() |
d9397a7c5e | ||
![]() |
a1b8c145cb | ||
![]() |
9d995d6721 | ||
![]() |
0a383883fa | ||
![]() |
a7f44b5afe | ||
![]() |
1cc09402e8 | ||
![]() |
be11de2b52 | ||
![]() |
172e038f9e | ||
![]() |
3638641014 | ||
![]() |
f5d6238c4b | ||
![]() |
3f20ecc204 | ||
![]() |
2a523d1a06 | ||
![]() |
62228694a0 | ||
![]() |
2218b89ca7 | ||
![]() |
d383ac1570 | ||
![]() |
8482fbb691 | ||
![]() |
609ca692a9 | ||
![]() |
d265d36749 | ||
![]() |
f07db75443 | ||
![]() |
ac10757e2a | ||
![]() |
98ce9888b1 | ||
![]() |
85e76a3652 | ||
![]() |
88af723267 | ||
![]() |
2ebcd19cbc | ||
![]() |
7ae998456c | ||
![]() |
27818d2a16 | ||
![]() |
3eaa03df03 | ||
![]() |
0f01df7fc9 | ||
![]() |
ddbb728eff | ||
![]() |
151e91e66c | ||
![]() |
da2d2c618c | ||
![]() |
472fdc95a6 | ||
![]() |
f5b111df06 | ||
![]() |
b8726037ee | ||
![]() |
e7d937b52f | ||
![]() |
d72183aa16 | ||
![]() |
828aaaac5e | ||
![]() |
9d28f5bf4a | ||
![]() |
c08ab018ad | ||
![]() |
ce8732b188 | ||
![]() |
40107623b0 | ||
![]() |
552e02fa9c | ||
![]() |
28fa8e109e | ||
![]() |
a8e0f2b956 | ||
![]() |
b16ec16288 | ||
![]() |
7f0976ef0e | ||
![]() |
5f79f75ba6 | ||
![]() |
57edf36c5f | ||
![]() |
774cef56ee | ||
![]() |
bdd209561e | ||
![]() |
0b9b068b3f | ||
![]() |
f27874740f | ||
![]() |
ad551eaa04 | ||
![]() |
5f7b6b8301 | ||
![]() |
1029364ec5 | ||
![]() |
e8e1f34a33 | ||
![]() |
0dfb2ecaab | ||
![]() |
0609c0fe8d | ||
![]() |
0acf4069e9 | ||
![]() |
98ae1a85b0 | ||
![]() |
e652ed3051 | ||
![]() |
25e3f4a90d | ||
![]() |
8897a9565a | ||
![]() |
f669fdf11e | ||
![]() |
04afcd25a3 | ||
![]() |
8ef83bc46e | ||
![]() |
16f7b78fd1 | ||
![]() |
4cd5703b9e | ||
![]() |
75b64a1b64 | ||
![]() |
5f0de35c3e | ||
![]() |
1136b7d821 | ||
![]() |
b002a2ff77 | ||
![]() |
b1d1a7682f | ||
![]() |
f10c5a2215 | ||
![]() |
c82bc4f472 | ||
![]() |
9468ee53ac | ||
![]() |
f246ae984b | ||
![]() |
f73a885f53 | ||
![]() |
bf1d225593 | ||
![]() |
c5c99adeed | ||
![]() |
8e833972c2 | ||
![]() |
0a0c232167 | ||
![]() |
e230306135 | ||
![]() |
a4723742c1 | ||
![]() |
261e9d08db | ||
![]() |
dbcf3ed458 | ||
![]() |
36c4eb188c | ||
![]() |
3a72fe587f | ||
![]() |
89f9b30e4d | ||
![]() |
ff1c00a29e | ||
![]() |
927d904d52 | ||
![]() |
91bc5865a3 | ||
![]() |
8d01c0557b | ||
![]() |
bcd18c0485 | ||
![]() |
dde6b88a9f | ||
![]() |
31ecd0c342 | ||
![]() |
27ff1ae414 | ||
![]() |
079e435655 | ||
![]() |
de666485b8 | ||
![]() |
30894bdfd6 | ||
![]() |
b989c9ceda | ||
![]() |
b3aff045b2 | ||
![]() |
1a18895ebc | ||
![]() |
e05709b1df | ||
![]() |
e611fad0d0 | ||
![]() |
7cfe0d2602 | ||
![]() |
04aa0fdda6 | ||
![]() |
42c5847d65 | ||
![]() |
0112ee2190 | ||
![]() |
d29c9fc188 | ||
![]() |
6405103a32 | ||
![]() |
4130af46bf | ||
![]() |
9e22af2363 | ||
![]() |
1519690cfb | ||
![]() |
86050b9e92 | ||
![]() |
a4e964d200 | ||
![]() |
7f7f232f4a | ||
![]() |
763d4bb345 | ||
![]() |
1165da8390 | ||
![]() |
32cefdbc7a | ||
![]() |
13bd37160e | ||
![]() |
375db86aea | ||
![]() |
14ab1a63d6 | ||
![]() |
bc3c718346 | ||
![]() |
76c8c61517 | ||
![]() |
8ffe08c86b | ||
![]() |
fdd6dfa863 | ||
![]() |
f1464ff956 | ||
![]() |
07564f2d3a | ||
![]() |
0529a52c60 | ||
![]() |
d0f81466e4 | ||
![]() |
8deebb34d3 | ||
![]() |
376889ad71 | ||
![]() |
73dd37d8fe | ||
![]() |
7e29f81163 | ||
![]() |
801aeefe2d | ||
![]() |
ef06105819 | ||
![]() |
0f9be1eaee | ||
![]() |
34c7a3c2b0 | ||
![]() |
d09bdc7148 | ||
![]() |
4ff6fa97e7 | ||
![]() |
19dd1567a0 | ||
![]() |
0c11611c11 | ||
![]() |
78851f10d1 | ||
![]() |
8868be3a9f | ||
![]() |
5043c376c9 | ||
![]() |
76187899a6 | ||
![]() |
375e10f739 | ||
![]() |
5c5fe07e43 | ||
![]() |
79cecbd421 | ||
![]() |
2458d06fc1 | ||
![]() |
326cb73c58 | ||
![]() |
00ab4eb0db | ||
![]() |
ec1370191e | ||
![]() |
8dd63f31ba | ||
![]() |
81508de3d2 | ||
![]() |
27a7a5c138 | ||
![]() |
c654f4fda8 | ||
![]() |
5c532dc8ee | ||
![]() |
e9d6575e10 | ||
![]() |
1287d106ed | ||
![]() |
803bd660b6 | ||
![]() |
36a9f354c0 | ||
![]() |
0ce87c8984 | ||
![]() |
c0c05ff8ec | ||
![]() |
df5c77c91a | ||
![]() |
2937d9ab54 | ||
![]() |
d020802e37 | ||
![]() |
5fd31f6891 | ||
![]() |
efe3ca7b48 | ||
![]() |
05ab167cf7 | ||
![]() |
a0edecf343 | ||
![]() |
b9cb7ee082 | ||
![]() |
78b90c744d | ||
![]() |
607bd47707 | ||
![]() |
f096529317 | ||
![]() |
42d7a26d23 | ||
![]() |
f822e7f68e | ||
![]() |
d08e76cd35 | ||
![]() |
edb53b3e9d | ||
![]() |
28996f8006 | ||
![]() |
a710682db3 | ||
![]() |
5e6213af54 | ||
![]() |
080210c16a | ||
![]() |
79e1a01e9e | ||
![]() |
439bc8d540 | ||
![]() |
1c88362021 | ||
![]() |
c3d031ee91 | ||
![]() |
8717c3db2f | ||
![]() |
babe7e16a1 | ||
![]() |
ded6e3bfca | ||
![]() |
49dd0409e0 | ||
![]() |
a03b2b075f | ||
![]() |
3960fb602c | ||
![]() |
db11fdef1a | ||
![]() |
43701d68a9 | ||
![]() |
ae7af291e6 | ||
![]() |
59b8677562 | ||
![]() |
4140d90c60 | ||
![]() |
dcb8209409 | ||
![]() |
7beaa5024f | ||
![]() |
2e51dc444f | ||
![]() |
4835e6ef51 | ||
![]() |
3fa99562ea | ||
![]() |
4ef6bc2e62 | ||
![]() |
55210f74c7 | ||
![]() |
4ad0910774 | ||
![]() |
c5861c09d5 | ||
![]() |
e12a238d41 | ||
![]() |
d6d5cbb02a | ||
![]() |
e8be11969f | ||
![]() |
7492875448 | ||
![]() |
3b48de92c7 | ||
![]() |
80a161db5c | ||
![]() |
9ea86011a2 | ||
![]() |
852935b68f | ||
![]() |
56eb0bfedb | ||
![]() |
ef7eea5538 | ||
![]() |
5115d4348e | ||
![]() |
940e4c9d92 | ||
![]() |
f61e50201b | ||
![]() |
d8366eae3b | ||
![]() |
321b545ad9 | ||
![]() |
947f74dc95 | ||
![]() |
4867b00666 | ||
![]() |
03ff63cee0 | ||
![]() |
72f43a929f | ||
![]() |
c16ea16134 | ||
![]() |
8dd20fcd88 | ||
![]() |
3269d63772 | ||
![]() |
3a681c8db1 | ||
![]() |
aec9a254a2 | ||
![]() |
6f3222ea42 | ||
![]() |
5b3aa025f3 | ||
![]() |
da273a17e7 | ||
![]() |
02a6ca7ef5 | ||
![]() |
6aa473274c | ||
![]() |
b3dc5c60aa | ||
![]() |
aad391b8a6 | ||
![]() |
1233104f5e | ||
![]() |
dfaf06ac03 | ||
![]() |
930a507786 | ||
![]() |
2c9590664f | ||
![]() |
bace2c47d3 | ||
![]() |
d15c8737ce | ||
![]() |
d052eb6b47 | ||
![]() |
dc20297f8d | ||
![]() |
da71c7d9a3 | ||
![]() |
5793235ec4 | ||
![]() |
f1566fd692 | ||
![]() |
d752fc0286 | ||
![]() |
1d0129b1b2 | ||
![]() |
80bcf54766 | ||
![]() |
eb15e1d485 | ||
![]() |
ceda36fa12 | ||
![]() |
d781dfdb09 | ||
![]() |
02c3513e5f | ||
![]() |
00fe4a20d7 | ||
![]() |
7a6ae1d667 | ||
![]() |
e892414bd3 | ||
![]() |
a4242290a1 | ||
![]() |
b5b52e73e9 | ||
![]() |
a9b0cd68de | ||
![]() |
8478dbc85f | ||
![]() |
864d48917a | ||
![]() |
08c4e30e23 | ||
![]() |
4d2ea14288 | ||
![]() |
c7358ee57c | ||
![]() |
7d617d0db9 | ||
![]() |
5e805afa79 | ||
![]() |
d4834a217e | ||
![]() |
5ce5edd6cf | ||
![]() |
96b52e104a | ||
![]() |
5b006f3d08 | ||
![]() |
4e0b489a0c | ||
![]() |
a7bb83475b | ||
![]() |
0f96dd8dcb | ||
![]() |
2654447c0e | ||
![]() |
4cdc426207 | ||
![]() |
217e616772 | ||
![]() |
1d212fa6eb | ||
![]() |
1d8b87d2b4 | ||
![]() |
c866dc20bf | ||
![]() |
8b8cc88d39 | ||
![]() |
3135c87ca8 | ||
![]() |
9407c5c126 | ||
![]() |
1b62d4e72e | ||
![]() |
421083359e | ||
![]() |
933746ad7d | ||
![]() |
bde97cf154 | ||
![]() |
18ee86f892 | ||
![]() |
174b6d0e19 | ||
![]() |
a7bc708e0c | ||
![]() |
0f7814264c | ||
![]() |
c0e8400361 | ||
![]() |
c63dda22dd | ||
![]() |
9648b588b4 | ||
![]() |
f190a16e5e | ||
![]() |
9eaa953642 | ||
![]() |
826215bec2 | ||
![]() |
87f487f6ce | ||
![]() |
2734345095 | ||
![]() |
b2d2b30a13 | ||
![]() |
4089dea451 | ||
![]() |
66d71c8f13 | ||
![]() |
aff37491a1 | ||
![]() |
f0f052f28d | ||
![]() |
3622c73cfc | ||
![]() |
9ab8851756 | ||
![]() |
c41e2216f4 | ||
![]() |
5a16e92eb5 | ||
![]() |
ed0570bf0c | ||
![]() |
1cae8da8e7 | ||
![]() |
c34bdc957c | ||
![]() |
2d5d80985e | ||
![]() |
399f54c133 | ||
![]() |
ae554abd41 | ||
![]() |
f0a9cd7847 | ||
![]() |
6cdf8dd025 | ||
![]() |
4fbb1569f5 | ||
![]() |
95114ff5c5 | ||
![]() |
be02504f5f | ||
![]() |
b5d5173139 | ||
![]() |
b28c547aa4 | ||
![]() |
7f1464c03c | ||
![]() |
eab85a379d | ||
![]() |
04373fe6fe | ||
![]() |
4dc7206c94 | ||
![]() |
326e4037e9 | ||
![]() |
2e223d208f | ||
![]() |
4137d67cde | ||
![]() |
6a3d9af46e | ||
![]() |
100e313c75 | ||
![]() |
0a2d31838f | ||
![]() |
1be6e685a5 | ||
![]() |
0147bd2f78 | ||
![]() |
f680b0f404 | ||
![]() |
2fb6457efb | ||
![]() |
23042bab43 | ||
![]() |
a638642f44 | ||
![]() |
51d1a14c80 | ||
![]() |
0647355bef | ||
![]() |
25b3416960 | ||
![]() |
7c7609f95e | ||
![]() |
c08088376a | ||
![]() |
9f3c0d32a4 | ||
![]() |
2b83e0e67e | ||
![]() |
f9355bc5cd | ||
![]() |
e06f77dce0 | ||
![]() |
284de14ebb | ||
![]() |
dcc80e127c | ||
![]() |
73b5a72134 | ||
![]() |
5c5b720d81 | ||
![]() |
41bb2eb806 | ||
![]() |
7379f525be | ||
![]() |
0e4065e8c7 | ||
![]() |
62466a55bf | ||
![]() |
cd1fb029eb | ||
![]() |
07ab5cbbed | ||
![]() |
6a163a1bf1 | ||
![]() |
8631744c49 | ||
![]() |
4aebbf63c3 | ||
![]() |
ce061964f7 | ||
![]() |
9f7d6840da | ||
![]() |
9a78257905 | ||
![]() |
218c7f5dbe | ||
![]() |
b8ceb988ea | ||
![]() |
e290cd1606 | ||
![]() |
20599f5c9e | ||
![]() |
62fd0b699a | ||
![]() |
d203fba8f0 | ||
![]() |
b3cbcb3547 | ||
![]() |
b35a90d682 | ||
![]() |
593315c327 | ||
![]() |
f28d8d7042 | ||
![]() |
c99828169b | ||
![]() |
58deb845c5 | ||
![]() |
1c24c54840 | ||
![]() |
457e60a2f8 | ||
![]() |
bc30d0a798 | ||
![]() |
db18cbdd85 | ||
![]() |
ec0d2a86b7 | ||
![]() |
48468f258a | ||
![]() |
3ee5775a0f | ||
![]() |
6b08ed7937 | ||
![]() |
5f517ce256 | ||
![]() |
839ae785d8 | ||
![]() |
a4e3391db2 | ||
![]() |
6709aba126 | ||
![]() |
35c3408b0d | ||
![]() |
5fe555ecac | ||
![]() |
72758a138e | ||
![]() |
31abfc3a98 | ||
![]() |
230752b861 | ||
![]() |
e59f4c31cb | ||
![]() |
9416782be5 | ||
![]() |
97b9643c5b | ||
![]() |
c64bb00cdf | ||
![]() |
953de64819 | ||
![]() |
47cac977f5 | ||
![]() |
80921057d4 | ||
![]() |
5006660be8 | ||
![]() |
99696a9373 | ||
![]() |
995f8c925f | ||
![]() |
bbe3d3916f | ||
![]() |
b46a1d8890 | ||
![]() |
e2862bb984 | ||
![]() |
2bdfdfbf09 | ||
![]() |
3985fbb348 | ||
![]() |
3487c9b4a8 | ||
![]() |
98b62860cf | ||
![]() |
92042e8b91 | ||
![]() |
0b8770ccbd | ||
![]() |
6acc9d10e2 | ||
![]() |
4beae98ae0 | ||
![]() |
d03266b2b7 | ||
![]() |
758b1c46fb | ||
![]() |
230df050ed | ||
![]() |
1f6639a1bf | ||
![]() |
342e174b24 | ||
![]() |
cd6fd2f14d | ||
![]() |
4b027b381f | ||
![]() |
0a14d9f5c8 | ||
![]() |
4628d2f6bb | ||
![]() |
26145cfc18 | ||
![]() |
1d16b89289 | ||
![]() |
b8d2695c82 | ||
![]() |
0681b2e477 | ||
![]() |
c05ca5f058 | ||
![]() |
cc9f4d56c0 | ||
![]() |
422bb8b5c4 | ||
![]() |
ea4900b89a | ||
![]() |
8af9d9a7d0 | ||
![]() |
6bdc30e923 | ||
![]() |
a10b277de2 | ||
![]() |
0febe091a5 | ||
![]() |
d52075bd97 | ||
![]() |
50b4523380 | ||
![]() |
71c9a05614 | ||
![]() |
66c033868f | ||
![]() |
4a5ab7a191 | ||
![]() |
79f3698f39 | ||
![]() |
5dcf871abb | ||
![]() |
f574ce603a | ||
![]() |
259f4a1503 | ||
![]() |
dd8cd5d6bc | ||
![]() |
c97c5fc788 | ||
![]() |
6a80cc9e08 | ||
![]() |
d7a941f210 | ||
![]() |
4a20a7f77c | ||
![]() |
63c16f85c5 | ||
![]() |
c383a32926 | ||
![]() |
1bb1aea178 | ||
![]() |
c2817899e4 | ||
![]() |
75501a17f2 | ||
![]() |
b17cd156b5 | ||
![]() |
cb221a5cbe | ||
![]() |
444a2bf314 | ||
![]() |
f1e95d935f | ||
![]() |
1ab6f486de | ||
![]() |
a8e76ddf9e | ||
![]() |
40805076f9 | ||
![]() |
baa35efba8 | ||
![]() |
6dd6634bf6 | ||
![]() |
60ca41ebb7 | ||
![]() |
fa844eff32 | ||
![]() |
31096ceb79 | ||
![]() |
6f2e8f9878 | ||
![]() |
dec42d9112 | ||
![]() |
839c4f1eb6 | ||
![]() |
b11eaaed35 | ||
![]() |
15b3aef581 | ||
![]() |
031226a9fd | ||
![]() |
7478b0bfa6 | ||
![]() |
65f12237b8 | ||
![]() |
889a706637 | ||
![]() |
855a3779be | ||
![]() |
36c27b547e | ||
![]() |
967c9f7fcb | ||
![]() |
fccadc38bd | ||
![]() |
963a8fc036 | ||
![]() |
3a6e56534d | ||
![]() |
2a258c9f2d | ||
![]() |
543960121c | ||
![]() |
96ca71a7a6 | ||
![]() |
338d3fbc8b | ||
![]() |
0f004be596 | ||
![]() |
120e7fbeb9 | ||
![]() |
d8b46b7bc4 | ||
![]() |
a68c57ee5f | ||
![]() |
f40c69c259 | ||
![]() |
1e52e79b70 | ||
![]() |
aaba380787 | ||
![]() |
43ef6784df | ||
![]() |
d18f341398 | ||
![]() |
761ba27d62 |
15
ABI-bugs.txt
Normal file
15
ABI-bugs.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
KNOWN ABI BUGS
|
||||
--------------
|
||||
|
||||
time_t is 32-bit. http://b/5819737
|
||||
|
||||
off_t is 32-bit. There is off64_t, but no _FILE_OFFSET_BITS support.
|
||||
|
||||
sigset_t is too small on ARM and x86 (but correct on MIPS), so support
|
||||
for real-time signals is broken. http://b/5828899
|
||||
|
||||
Too few TLS slots mean we can't allocate 128 pthread_key_t instances,
|
||||
which POSIX says should be the minimum.
|
||||
|
||||
atexit(3) handlers registered by a shared library aren't called on
|
||||
dlclose(3); this only affects ARM. http://b/4998315
|
290
libc/Android.mk
290
libc/Android.mk
@@ -11,7 +11,6 @@ libc_common_src_files := \
|
||||
unistd/exec.c \
|
||||
unistd/fnmatch.c \
|
||||
unistd/getopt_long.c \
|
||||
unistd/popen.c \
|
||||
unistd/syslog.c \
|
||||
unistd/system.c \
|
||||
unistd/time.c \
|
||||
@@ -111,35 +110,8 @@ libc_common_src_files := \
|
||||
string/strspn.c \
|
||||
string/strstr.c \
|
||||
string/strtok.c \
|
||||
wchar/wcpcpy.c \
|
||||
wchar/wcpncpy.c \
|
||||
wchar/wcscasecmp.c \
|
||||
wchar/wcscat.c \
|
||||
wchar/wcschr.c \
|
||||
wchar/wcscmp.c \
|
||||
wchar/wcscpy.c \
|
||||
wchar/wcscspn.c \
|
||||
wchar/wcsdup.c \
|
||||
wchar/wcslcat.c \
|
||||
wchar/wcslcpy.c \
|
||||
wchar/wcslen.c \
|
||||
wchar/wcsncasecmp.c \
|
||||
wchar/wcsncat.c \
|
||||
wchar/wcsncmp.c \
|
||||
wchar/wcsncpy.c \
|
||||
wchar/wcsnlen.c \
|
||||
wchar/wcspbrk.c \
|
||||
wchar/wcsrchr.c \
|
||||
wchar/wcsspn.c \
|
||||
wchar/wcsstr.c \
|
||||
wchar/wcstok.c \
|
||||
wchar/wcswidth.c \
|
||||
wchar/wcsxfrm.c \
|
||||
wchar/wmemchr.c \
|
||||
wchar/wmemcmp.c \
|
||||
wchar/wmemcpy.c \
|
||||
wchar/wmemmove.c \
|
||||
wchar/wmemset.c \
|
||||
tzcode/asctime.c \
|
||||
tzcode/difftime.c \
|
||||
tzcode/localtime.c \
|
||||
@@ -177,12 +149,10 @@ libc_common_src_files := \
|
||||
bionic/isatty.c \
|
||||
bionic/issetugid.c \
|
||||
bionic/ldexp.c \
|
||||
bionic/logd_write.c \
|
||||
bionic/lseek64.c \
|
||||
bionic/md5.c \
|
||||
bionic/memchr.c \
|
||||
bionic/memmem.c \
|
||||
bionic/memmove_words.c \
|
||||
bionic/memrchr.c \
|
||||
bionic/memswap.c \
|
||||
bionic/mmap.c \
|
||||
@@ -196,7 +166,6 @@ libc_common_src_files := \
|
||||
bionic/ptsname_r.c \
|
||||
bionic/pututline.c \
|
||||
bionic/pwrite.c \
|
||||
bionic/realpath.c \
|
||||
bionic/reboot.c \
|
||||
bionic/recv.c \
|
||||
bionic/sched_cpualloc.c \
|
||||
@@ -234,7 +203,6 @@ libc_common_src_files := \
|
||||
bionic/unlockpt.c \
|
||||
bionic/usleep.c \
|
||||
bionic/utmp.c \
|
||||
bionic/wait.c \
|
||||
bionic/wcscoll.c \
|
||||
netbsd/gethnamaddr.c \
|
||||
netbsd/inet/nsap_addr.c \
|
||||
@@ -268,20 +236,34 @@ libc_common_src_files := \
|
||||
libc_bionic_src_files := \
|
||||
bionic/assert.cpp \
|
||||
bionic/brk.cpp \
|
||||
bionic/debug_format.cpp \
|
||||
bionic/dirent.cpp \
|
||||
bionic/eventfd.cpp \
|
||||
bionic/__errno.c \
|
||||
bionic/eventfd_read.cpp \
|
||||
bionic/eventfd_write.cpp \
|
||||
bionic/__fgets_chk.cpp \
|
||||
bionic/getauxval.cpp \
|
||||
bionic/getcwd.cpp \
|
||||
bionic/libc_init_common.cpp \
|
||||
bionic/libc_logging.cpp \
|
||||
bionic/libgen.cpp \
|
||||
bionic/__memcpy_chk.cpp \
|
||||
bionic/__memmove_chk.cpp \
|
||||
bionic/__memset_chk.cpp \
|
||||
bionic/pthread_attr.cpp \
|
||||
bionic/pthread_detach.cpp \
|
||||
bionic/pthread_equal.cpp \
|
||||
bionic/pthread_getcpuclockid.cpp \
|
||||
bionic/pthread_getschedparam.cpp \
|
||||
bionic/pthread_internals.cpp \
|
||||
bionic/pthread_join.cpp \
|
||||
bionic/pthread_kill.cpp \
|
||||
bionic/pthread_self.cpp \
|
||||
bionic/pthread_setname_np.cpp \
|
||||
bionic/pthread_setschedparam.cpp \
|
||||
bionic/pthread_sigmask.cpp \
|
||||
bionic/raise.cpp \
|
||||
bionic/sbrk.cpp \
|
||||
bionic/scandir.cpp \
|
||||
bionic/__set_errno.cpp \
|
||||
bionic/setlocale.cpp \
|
||||
bionic/signalfd.cpp \
|
||||
@@ -297,13 +279,45 @@ libc_bionic_src_files := \
|
||||
bionic/__strncpy_chk.cpp \
|
||||
bionic/strsignal.cpp \
|
||||
bionic/stubs.cpp \
|
||||
bionic/sysconf.cpp \
|
||||
bionic/tdestroy.cpp \
|
||||
bionic/tmpfile.cpp \
|
||||
bionic/__umask_chk.cpp \
|
||||
bionic/__vsnprintf_chk.cpp \
|
||||
bionic/__vsprintf_chk.cpp \
|
||||
bionic/wait.cpp \
|
||||
bionic/wchar.cpp \
|
||||
|
||||
libc_upstream_freebsd_src_files := \
|
||||
upstream-freebsd/lib/libc/stdlib/realpath.c \
|
||||
upstream-freebsd/lib/libc/string/wcpcpy.c \
|
||||
upstream-freebsd/lib/libc/string/wcpncpy.c \
|
||||
upstream-freebsd/lib/libc/string/wcscasecmp.c \
|
||||
upstream-freebsd/lib/libc/string/wcscat.c \
|
||||
upstream-freebsd/lib/libc/string/wcschr.c \
|
||||
upstream-freebsd/lib/libc/string/wcscmp.c \
|
||||
upstream-freebsd/lib/libc/string/wcscpy.c \
|
||||
upstream-freebsd/lib/libc/string/wcscspn.c \
|
||||
upstream-freebsd/lib/libc/string/wcsdup.c \
|
||||
upstream-freebsd/lib/libc/string/wcslcat.c \
|
||||
upstream-freebsd/lib/libc/string/wcslcpy.c \
|
||||
upstream-freebsd/lib/libc/string/wcslen.c \
|
||||
upstream-freebsd/lib/libc/string/wcsncasecmp.c \
|
||||
upstream-freebsd/lib/libc/string/wcsncat.c \
|
||||
upstream-freebsd/lib/libc/string/wcsncmp.c \
|
||||
upstream-freebsd/lib/libc/string/wcsncpy.c \
|
||||
upstream-freebsd/lib/libc/string/wcsnlen.c \
|
||||
upstream-freebsd/lib/libc/string/wcspbrk.c \
|
||||
upstream-freebsd/lib/libc/string/wcsrchr.c \
|
||||
upstream-freebsd/lib/libc/string/wcsspn.c \
|
||||
upstream-freebsd/lib/libc/string/wcsstr.c \
|
||||
upstream-freebsd/lib/libc/string/wcstok.c \
|
||||
upstream-freebsd/lib/libc/string/wmemchr.c \
|
||||
upstream-freebsd/lib/libc/string/wmemcmp.c \
|
||||
upstream-freebsd/lib/libc/string/wmemcpy.c \
|
||||
upstream-freebsd/lib/libc/string/wmemmove.c \
|
||||
upstream-freebsd/lib/libc/string/wmemset.c \
|
||||
|
||||
libc_upstream_netbsd_src_files := \
|
||||
upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
|
||||
upstream-netbsd/common/lib/libc/inet/inet_addr.c \
|
||||
@@ -311,6 +325,7 @@ libc_upstream_netbsd_src_files := \
|
||||
upstream-netbsd/libc/gen/ftw.c \
|
||||
upstream-netbsd/libc/gen/nftw.c \
|
||||
upstream-netbsd/libc/gen/nice.c \
|
||||
upstream-netbsd/libc/gen/popen.c \
|
||||
upstream-netbsd/libc/gen/psignal.c \
|
||||
upstream-netbsd/libc/gen/setjmperr.c \
|
||||
upstream-netbsd/libc/gen/utime.c \
|
||||
@@ -347,52 +362,11 @@ libc_upstream_netbsd_src_files := \
|
||||
upstream-netbsd/libc/string/strxfrm.c \
|
||||
upstream-netbsd/libc/unistd/killpg.c \
|
||||
|
||||
# The following files are common, but must be compiled
|
||||
# with different C flags when building a static C library.
|
||||
#
|
||||
# The reason for this is the implementation of __get_tls()
|
||||
# that will differ between the shared and static versions
|
||||
# of the library.
|
||||
#
|
||||
# See comments in private/bionic_tls.h for more details.
|
||||
#
|
||||
# NOTE: bionic/pthread.c is added later to this list
|
||||
# because it needs special handling on ARM, see
|
||||
# below.
|
||||
#
|
||||
libc_static_common_src_files := \
|
||||
bionic/__errno.c \
|
||||
bionic/sysconf.cpp \
|
||||
|
||||
# Architecture specific source files go here
|
||||
# =========================================================
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
libc_common_src_files += \
|
||||
arch-arm/bionic/abort_arm.S \
|
||||
arch-arm/bionic/atomics_arm.c \
|
||||
arch-arm/bionic/clone.S \
|
||||
arch-arm/bionic/eabi.c \
|
||||
arch-arm/bionic/_exit_with_stack_teardown.S \
|
||||
arch-arm/bionic/ffs.S \
|
||||
arch-arm/bionic/futex_arm.S \
|
||||
arch-arm/bionic/__get_sp.S \
|
||||
arch-arm/bionic/kill.S \
|
||||
arch-arm/bionic/libgcc_compat.c \
|
||||
arch-arm/bionic/memcmp16.S \
|
||||
arch-arm/bionic/memcmp.S \
|
||||
arch-arm/bionic/memcpy.S \
|
||||
arch-arm/bionic/memset.S \
|
||||
arch-arm/bionic/_setjmp.S \
|
||||
arch-arm/bionic/setjmp.S \
|
||||
arch-arm/bionic/sigsetjmp.S \
|
||||
arch-arm/bionic/strcmp.S \
|
||||
arch-arm/bionic/strcpy.S \
|
||||
arch-arm/bionic/strlen.c.arm \
|
||||
arch-arm/bionic/syscall.S \
|
||||
arch-arm/bionic/tgkill.S \
|
||||
arch-arm/bionic/tkill.S \
|
||||
bionic/memmove.c.arm \
|
||||
bionic/socketcalls.c \
|
||||
string/bcopy.c \
|
||||
string/strncmp.c \
|
||||
|
||||
@@ -407,79 +381,27 @@ libc_common_src_files += \
|
||||
|
||||
libc_static_common_src_files += \
|
||||
bionic/pthread.c.arm \
|
||||
bionic/pthread_create.cpp.arm \
|
||||
bionic/pthread_key.cpp.arm \
|
||||
|
||||
# these are used by the static and dynamic versions of the libc
|
||||
# respectively
|
||||
libc_arch_static_src_files := \
|
||||
arch-arm/bionic/exidx_static.c
|
||||
|
||||
libc_arch_dynamic_src_files := \
|
||||
arch-arm/bionic/exidx_dynamic.c
|
||||
endif # arm
|
||||
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
libc_common_src_files += \
|
||||
arch-x86/bionic/__get_sp.S \
|
||||
arch-x86/bionic/__get_tls.c \
|
||||
arch-x86/bionic/__set_tls.c \
|
||||
arch-x86/bionic/clone.S \
|
||||
arch-x86/bionic/_exit_with_stack_teardown.S \
|
||||
arch-x86/bionic/futex_x86.S \
|
||||
arch-x86/bionic/setjmp.S \
|
||||
arch-x86/bionic/_setjmp.S \
|
||||
arch-x86/bionic/sigsetjmp.S \
|
||||
arch-x86/bionic/vfork.S \
|
||||
arch-x86/bionic/syscall.S \
|
||||
arch-x86/string/bcopy_wrapper.S \
|
||||
arch-x86/string/memcpy_wrapper.S \
|
||||
arch-x86/string/memmove_wrapper.S \
|
||||
arch-x86/string/bzero_wrapper.S \
|
||||
arch-x86/string/memcmp_wrapper.S \
|
||||
arch-x86/string/memset_wrapper.S \
|
||||
arch-x86/string/strcmp_wrapper.S \
|
||||
arch-x86/string/strncmp_wrapper.S \
|
||||
arch-x86/string/strlen_wrapper.S \
|
||||
string/strcpy.c \
|
||||
bionic/pthread-atfork.c \
|
||||
bionic/pthread-rwlocks.c \
|
||||
bionic/pthread-timers.c \
|
||||
bionic/ptrace.c
|
||||
bionic/pthread-atfork.c \
|
||||
bionic/pthread-rwlocks.c \
|
||||
bionic/pthread-timers.c \
|
||||
bionic/ptrace.c \
|
||||
string/strcpy.c \
|
||||
|
||||
libc_static_common_src_files += \
|
||||
bionic/pthread.c \
|
||||
bionic/pthread_create.cpp \
|
||||
bionic/pthread_key.cpp \
|
||||
|
||||
libc_arch_static_src_files := \
|
||||
bionic/dl_iterate_phdr_static.c
|
||||
|
||||
libc_arch_dynamic_src_files :=
|
||||
endif # x86
|
||||
|
||||
ifeq ($(TARGET_ARCH),mips)
|
||||
libc_common_src_files += \
|
||||
arch-mips/bionic/__get_sp.S \
|
||||
arch-mips/bionic/__get_tls.c \
|
||||
arch-mips/bionic/__set_tls.c \
|
||||
arch-mips/bionic/_exit_with_stack_teardown.S \
|
||||
arch-mips/bionic/_setjmp.S \
|
||||
arch-mips/bionic/futex_mips.S \
|
||||
arch-mips/bionic/bzero.S \
|
||||
arch-mips/bionic/cacheflush.c \
|
||||
arch-mips/bionic/clone.S \
|
||||
arch-mips/bionic/ffs.S \
|
||||
arch-mips/bionic/memcmp16.S \
|
||||
arch-mips/bionic/memmove.c \
|
||||
arch-mips/bionic/pipe.S \
|
||||
arch-mips/bionic/setjmp.S \
|
||||
arch-mips/bionic/sigsetjmp.S \
|
||||
arch-mips/bionic/vfork.S
|
||||
|
||||
libc_common_src_files += \
|
||||
arch-mips/string/memset.S \
|
||||
arch-mips/string/memcpy.S \
|
||||
arch-mips/string/mips_strlen.c
|
||||
|
||||
libc_common_src_files += \
|
||||
bionic/memcmp.c \
|
||||
string/bcopy.c \
|
||||
@@ -495,14 +417,45 @@ libc_common_src_files += \
|
||||
|
||||
libc_static_common_src_files += \
|
||||
bionic/pthread.c \
|
||||
bionic/pthread_create.cpp \
|
||||
bionic/pthread_key.cpp \
|
||||
|
||||
libc_arch_static_src_files := \
|
||||
bionic/dl_iterate_phdr_static.c
|
||||
|
||||
libc_arch_dynamic_src_files :=
|
||||
endif # mips
|
||||
|
||||
ifeq ($(strip $(TARGET_CPU_VARIANT)),)
|
||||
$(warning TARGET_CPU_VARIANT is not defined)
|
||||
endif
|
||||
|
||||
###########################################################
|
||||
## Add cpu specific source files.
|
||||
##
|
||||
## This can be called multiple times, but it will only add
|
||||
## the first source file for each unique $(1).
|
||||
## $(1): Unique identifier to identify the cpu variant
|
||||
## implementation.
|
||||
## $(2): Cpu specific source file.
|
||||
###########################################################
|
||||
|
||||
define libc-add-cpu-variant-src
|
||||
$(if $(filter true,$(_LIBC_ARCH_CPU_VARIANT_HAS_$(1))), \
|
||||
, \
|
||||
$(eval _LIBC_ARCH_CPU_VARIANT_HAS_$(1) := true) \
|
||||
$(eval _LIBC_ARCH_CPU_VARIANT_SRC_FILE.$(1) := $(2)) \
|
||||
$(eval _LIBC_ARCH_CPU_VARIANT_SRC_FILES += $(2)) \
|
||||
)
|
||||
endef
|
||||
|
||||
_LIBC_ARCH_COMMON_SRC_FILES :=
|
||||
_LIBC_ARCH_CPU_VARIANT_SRC_FILES :=
|
||||
_LIBC_ARCH_STATIC_SRC_FILES :=
|
||||
_LIBC_ARCH_DYNAMIC_SRC_FILES :=
|
||||
include bionic/libc/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
|
||||
|
||||
libc_common_src_files += $(_LIBC_ARCH_COMMON_SRC_FILES)
|
||||
libc_common_src_files += $(_LIBC_ARCH_CPU_VARIANT_SRC_FILES)
|
||||
libc_arch_static_src_files := $(_LIBC_ARCH_STATIC_SRC_FILES)
|
||||
libc_arch_dynamic_src_files := $(_LIBC_ARCH_DYNAMIC_SRC_FILES)
|
||||
|
||||
# Define some common cflags
|
||||
# ========================================================
|
||||
libc_common_cflags := \
|
||||
@@ -539,27 +492,6 @@ ifeq ($(TARGET_ARCH),arm)
|
||||
libc_common_cflags += -DSOFTFLOAT
|
||||
libc_common_cflags += -fstrict-aliasing
|
||||
libc_crt_target_cflags := -mthumb-interwork
|
||||
#
|
||||
# Define HAVE_ARM_TLS_REGISTER macro to indicate to the C library
|
||||
# that it should access the hardware TLS register directly in
|
||||
# private/bionic_tls.h
|
||||
#
|
||||
# The value must match your kernel configuration
|
||||
#
|
||||
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
||||
libc_common_cflags += -DHAVE_ARM_TLS_REGISTER
|
||||
endif
|
||||
#
|
||||
# Define HAVE_32_BYTE_CACHE_LINES to indicate to C
|
||||
# library it should use to 32-byte version of memcpy, and not
|
||||
# the 64-byte version.
|
||||
#
|
||||
ifeq ($(ARCH_ARM_HAVE_32_BYTE_CACHE_LINES),true)
|
||||
libc_common_cflags += -DHAVE_32_BYTE_CACHE_LINE
|
||||
endif
|
||||
ifeq ($(ARCH_ARM_USE_NON_NEON_MEMCPY),true)
|
||||
libc_common_cflags += -DARCH_ARM_USE_NON_NEON_MEMCPY
|
||||
endif
|
||||
endif # !arm
|
||||
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
@@ -744,8 +676,8 @@ WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := bionic/ssp.cpp
|
||||
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector
|
||||
LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp
|
||||
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector -Werror
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
LOCAL_MODULE := libbionic_ssp
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||
@@ -754,6 +686,29 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
# ========================================================
|
||||
# libc_freebsd.a - upstream FreeBSD C library code
|
||||
# ========================================================
|
||||
#
|
||||
# These files are built with the freebsd-compat.h header file
|
||||
# automatically included.
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := $(libc_upstream_freebsd_src_files)
|
||||
LOCAL_CFLAGS := \
|
||||
$(libc_common_cflags) \
|
||||
-I$(LOCAL_PATH)/upstream-freebsd \
|
||||
-I$(LOCAL_PATH)/upstream-freebsd/libc/include \
|
||||
-include upstream-freebsd/freebsd-compat.h
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
LOCAL_MODULE := libc_freebsd
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
# ========================================================
|
||||
# libc_netbsd.a - upstream NetBSD C library code
|
||||
# ========================================================
|
||||
@@ -806,9 +761,12 @@ LOCAL_CFLAGS := $(libc_common_cflags) \
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
LOCAL_MODULE := libc_common
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_bionic libc_netbsd
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_bionic libc_freebsd libc_netbsd
|
||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
|
||||
# TODO: split out the asflags.
|
||||
LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
@@ -817,10 +775,10 @@ include $(BUILD_STATIC_LIBRARY)
|
||||
# ========================================================
|
||||
#
|
||||
# This is a version of the static C library that does not
|
||||
# include malloc. It's useful in situations when calling
|
||||
# the user wants to provide their own malloc implementation,
|
||||
# or wants to explicitly disallow the use of the use of malloc,
|
||||
# like the dynamic loader.
|
||||
# include malloc. It's useful in situations when the user wants
|
||||
# to provide their own malloc implementation, or wants to
|
||||
# explicitly disallow the use of the use of malloc,
|
||||
# such as in the dynamic loader.
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
|
28
libc/NOTICE
28
libc/NOTICE
@@ -4030,6 +4030,34 @@ SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2013 ARM Ltd
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the company may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Copyright (c)1999 Citrus Project,
|
||||
All rights reserved.
|
||||
|
||||
|
54
libc/README
54
libc/README
@@ -1,54 +0,0 @@
|
||||
Welcome to Bionic, Android's small and custom C library for the Android
|
||||
platform.
|
||||
|
||||
Bionic is mainly a port of the BSD C library to our Linux kernel with the
|
||||
following additions/changes:
|
||||
|
||||
- no support for locales
|
||||
- no support for wide chars (i.e. multi-byte characters)
|
||||
- its own smallish implementation of pthreads based on Linux futexes
|
||||
- support for x86, ARM and ARM thumb CPU instruction sets and kernel interfaces
|
||||
|
||||
Bionic is released under the standard 3-clause BSD License
|
||||
|
||||
Bionic doesn't want to implement all features of a traditional C library, we only
|
||||
add features to it as we need them, and we try to keep things as simple and small
|
||||
as possible. Our goal is not to support scaling to thousands of concurrent threads
|
||||
on multi-processors machines; we're running this on cell-phones, damnit !!
|
||||
|
||||
Note that Bionic doesn't provide a libthread_db or a libm implementation.
|
||||
|
||||
|
||||
Adding new syscalls:
|
||||
====================
|
||||
|
||||
Bionic provides the gensyscalls.py Python script to automatically generate syscall
|
||||
stubs from the list defined in the file SYSCALLS.TXT. You can thus add a new syscall
|
||||
by doing the following:
|
||||
|
||||
- edit SYSCALLS.TXT
|
||||
- add a new line describing your syscall, it should look like:
|
||||
|
||||
return_type syscall_name(parameters) syscall_number
|
||||
|
||||
- in the event where you want to differentiate the syscall function from its entry name,
|
||||
use the alternate:
|
||||
|
||||
return_type funcname:syscall_name(parameters) syscall_number
|
||||
|
||||
- additionally, if the syscall number is different between ARM and x86, use:
|
||||
|
||||
return_type funcname[:syscall_name](parameters) arm_number,x86_number
|
||||
|
||||
- a syscall number can be -1 to indicate that the syscall is not implemented on
|
||||
a given platform, for example:
|
||||
|
||||
void __set_tls(void*) arm_number,-1
|
||||
|
||||
|
||||
the comments in SYSCALLS.TXT contain more information about the line format
|
||||
|
||||
You can also use the 'checksyscalls.py' script to check that all the syscall
|
||||
numbers you entered are correct. It does so by looking at the values defined in
|
||||
your Linux kernel headers. The script indicates where the values are incorrect
|
||||
and what is expected instead.
|
@@ -1,13 +1,11 @@
|
||||
# this file is used to list all the syscalls that will be supported by
|
||||
# the Bionic C library. It is used to automatically generate the syscall
|
||||
# stubs, the list of syscall constants (__NR_xxxx) and the content of <linux/_unistd.h>
|
||||
# This file is used to automatically generate bionic's the system calls stubs.
|
||||
#
|
||||
# each non comment line has the following format:
|
||||
# Each non comment line has the following format:
|
||||
#
|
||||
# return_type func_name[:syscall_name[:call_id]]([parameter_list]) (syscall_number|"stub")
|
||||
# return_type func_name[:syscall_name[:call_id]]([parameter_list]) (1|-1|"stub")
|
||||
#
|
||||
# note that:
|
||||
# - syscall_name correspond to the name of the syscall, which may differ from
|
||||
# Note that:
|
||||
# - syscall_name corresponds to the name of the syscall, which may differ from
|
||||
# the exported function name (example: the exit syscall is implemented by the _exit()
|
||||
# function, which is not the same as the standard C exit() function which calls it)
|
||||
# The call_id parameter, given that func_name and syscall_name have
|
||||
@@ -18,299 +16,306 @@
|
||||
# - each parameter type is assumed to be stored on 32 bits, there is no plan to support
|
||||
# 64-bit architectures at the moment
|
||||
#
|
||||
# - it there is "stub" instead of a syscall number, the tool will not generate any
|
||||
# assembler template for the syscall; it's up to the bionic implementation to provide
|
||||
# a relevant C stub
|
||||
# - the final field can be "1", meaning: generate a stub for each architecture,
|
||||
# taking the constants from the kernel header files.
|
||||
#
|
||||
# - additionally, if the syscall number is different amoung ARM, and x86, MIPS use:
|
||||
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,mips_number
|
||||
# - the final field can be "stub" meaning: do not generate any stubs ---
|
||||
# in this case, a hand-written custom stub must be provided.
|
||||
# TODO: replace this with something like "custom" or "none", or remove
|
||||
# it entirely.
|
||||
#
|
||||
# the file is processed by a python script named gensyscalls.py
|
||||
# - the final field can be a three-element list of 1s and -1 meaning:
|
||||
# this system call is only available on some of the architectures (1),
|
||||
# and no stub should be generated for those architectures marked with -1.
|
||||
# the order is arm,x86,mips.
|
||||
# TODO: replace this with something more readable like "-arm,-mips" (meaning x86 only).
|
||||
#
|
||||
# This file is processed by a python script named gensyscalls.py.
|
||||
#
|
||||
|
||||
# process management
|
||||
void _exit:exit_group (int) 248,252,246
|
||||
void _exit:exit_group (int) 1
|
||||
void _exit_thread:exit (int) 1
|
||||
pid_t __fork:fork (void) 2
|
||||
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7,7
|
||||
int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284,278
|
||||
pid_t __fork:fork (void) 1
|
||||
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,1,1
|
||||
int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 1
|
||||
pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage) 1
|
||||
|
||||
# NOTE: this system call is never called directly, but we list it there
|
||||
# to have __NR_clone properly defined.
|
||||
#
|
||||
pid_t __sys_clone:clone (int, void*, int*, void*, int*) 120
|
||||
pid_t __sys_clone:clone (int, void*, int*, void*, int*) 1
|
||||
|
||||
int execve (const char*, char* const*, char* const*) 11
|
||||
int execve (const char*, char* const*, char* const*) 1
|
||||
|
||||
int __setuid:setuid32 (uid_t) 213,213,-1
|
||||
int __setuid:setuid (uid_t) -1,-1,23
|
||||
uid_t getuid:getuid32 () 199,199,-1
|
||||
uid_t getuid:getuid () -1,-1,24
|
||||
gid_t getgid:getgid32 () 200,200,-1
|
||||
gid_t getgid:getgid () -1,-1,47
|
||||
uid_t geteuid:geteuid32 () 201,201,-1
|
||||
uid_t geteuid:geteuid () -1,-1,49
|
||||
gid_t getegid:getegid32 () 202,202,-1
|
||||
gid_t getegid:getegid () -1,-1,50
|
||||
uid_t getresuid:getresuid32 (uid_t *ruid, uid_t *euid, uid_t *suid) 209,209,-1
|
||||
uid_t getresuid:getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) -1,-1,186
|
||||
gid_t getresgid:getresgid32 (gid_t *rgid, gid_t *egid, gid_t *sgid) 211,211,-1
|
||||
gid_t getresgid:getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) -1,-1,191
|
||||
pid_t gettid() 224,224,222
|
||||
ssize_t readahead(int, off64_t, size_t) 225,225,223
|
||||
int getgroups:getgroups32(int, gid_t *) 205,205,-1
|
||||
int getgroups:getgroups(int, gid_t *) -1,-1,80
|
||||
pid_t getpgid(pid_t) 132
|
||||
pid_t getppid() 64
|
||||
pid_t getsid(pid_t) 147,147,151
|
||||
pid_t setsid() 66
|
||||
int setgid:setgid32(gid_t) 214,214,-1
|
||||
int setgid:setgid(gid_t) -1,-1,46
|
||||
int __setuid:setuid32 (uid_t) 1,1,-1
|
||||
int __setuid:setuid (uid_t) -1,-1,1
|
||||
uid_t getuid:getuid32 () 1,1,-1
|
||||
uid_t getuid:getuid () -1,-1,1
|
||||
gid_t getgid:getgid32 () 1,1,-1
|
||||
gid_t getgid:getgid () -1,-1,1
|
||||
uid_t geteuid:geteuid32 () 1,1,-1
|
||||
uid_t geteuid:geteuid () -1,-1,1
|
||||
gid_t getegid:getegid32 () 1,1,-1
|
||||
gid_t getegid:getegid () -1,-1,1
|
||||
uid_t getresuid:getresuid32 (uid_t *ruid, uid_t *euid, uid_t *suid) 1,1,-1
|
||||
uid_t getresuid:getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) -1,-1,1
|
||||
gid_t getresgid:getresgid32 (gid_t *rgid, gid_t *egid, gid_t *sgid) 1,1,-1
|
||||
gid_t getresgid:getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) -1,-1,1
|
||||
pid_t gettid() 1
|
||||
ssize_t readahead(int, off64_t, size_t) 1
|
||||
int getgroups:getgroups32(int, gid_t *) 1,1,-1
|
||||
int getgroups:getgroups(int, gid_t *) -1,-1,1
|
||||
pid_t getpgid(pid_t) 1
|
||||
pid_t getppid() 1
|
||||
pid_t getsid(pid_t) 1
|
||||
pid_t setsid() 1
|
||||
int setgid:setgid32(gid_t) 1,1,-1
|
||||
int setgid:setgid(gid_t) -1,-1,1
|
||||
int seteuid:seteuid32(uid_t) stub
|
||||
int __setreuid:setreuid32(uid_t, uid_t) 203,203,-1
|
||||
int __setreuid:setreuid(uid_t, uid_t) -1,-1,70
|
||||
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208,208,-1
|
||||
int __setresuid:setresuid(uid_t, uid_t, uid_t) -1,-1,185
|
||||
int setresgid:setresgid32(gid_t, gid_t, gid_t) 210,210,-1
|
||||
int setresgid:setresgid(gid_t, gid_t, gid_t) -1,-1,190
|
||||
void* __brk:brk(void*) 45
|
||||
int __setreuid:setreuid32(uid_t, uid_t) 1,1,-1
|
||||
int __setreuid:setreuid(uid_t, uid_t) -1,-1,1
|
||||
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 1,1,-1
|
||||
int __setresuid:setresuid(uid_t, uid_t, uid_t) -1,-1,1
|
||||
int setresgid:setresgid32(gid_t, gid_t, gid_t) 1,1,-1
|
||||
int setresgid:setresgid(gid_t, gid_t, gid_t) -1,-1,1
|
||||
void* __brk:brk(void*) 1
|
||||
# see comments in arch-arm/bionic/kill.S to understand why we don't generate an ARM stub for kill/tkill
|
||||
int kill(pid_t, int) -1,37,37
|
||||
int tkill(pid_t tid, int sig) -1,238,236
|
||||
int tgkill(pid_t tgid, pid_t tid, int sig) -1,270,266
|
||||
int __ptrace:ptrace(int request, int pid, void* addr, void* data) 26
|
||||
int __set_thread_area:set_thread_area(void* user_desc) -1,243,283
|
||||
int __getpriority:getpriority(int, int) 96
|
||||
int setpriority(int, int, int) 97
|
||||
int setrlimit(int resource, const struct rlimit *rlp) 75
|
||||
int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 191,191,-1
|
||||
int getrlimit:getrlimit(int resource, struct rlimit *rlp) -1,-1,76
|
||||
int getrusage(int who, struct rusage* r_usage) 77
|
||||
int setgroups:setgroups32(int, const gid_t *) 206,206,-1
|
||||
int setgroups:setgroups(int, const gid_t *) -1,-1,81
|
||||
int kill(pid_t, int) -1,1,1
|
||||
int tkill(pid_t tid, int sig) -1,1,1
|
||||
int tgkill(pid_t tgid, pid_t tid, int sig) -1,1,1
|
||||
int __ptrace:ptrace(int request, int pid, void* addr, void* data) 1
|
||||
int __set_thread_area:set_thread_area(void* user_desc) -1,1,1
|
||||
int __getpriority:getpriority(int, int) 1
|
||||
int setpriority(int, int, int) 1
|
||||
int setrlimit(int resource, const struct rlimit *rlp) 1
|
||||
int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 1,1,-1
|
||||
int getrlimit:getrlimit(int resource, struct rlimit *rlp) -1,-1,1
|
||||
int getrusage(int who, struct rusage* r_usage) 1
|
||||
int setgroups:setgroups32(int, const gid_t *) 1,1,-1
|
||||
int setgroups:setgroups(int, const gid_t *) -1,-1,1
|
||||
pid_t getpgrp(void) stub
|
||||
int setpgid(pid_t, pid_t) 57
|
||||
pid_t vfork(void) 190,-1,-1
|
||||
int setregid:setregid32(gid_t, gid_t) 204,204,-1
|
||||
int setregid:setregid(gid_t, gid_t) -1,-1,71
|
||||
int chroot(const char *) 61
|
||||
int setpgid(pid_t, pid_t) 1
|
||||
pid_t vfork(void) 1,-1,-1
|
||||
int setregid:setregid32(gid_t, gid_t) 1,1,-1
|
||||
int setregid:setregid(gid_t, gid_t) -1,-1,1
|
||||
int chroot(const char *) 1
|
||||
# IMPORTANT: Even though <sys/prctl.h> declares prctl(int,...), the syscall stub must take 6 arguments
|
||||
# to match the kernel implementation.
|
||||
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172,172,192
|
||||
int capget(cap_user_header_t header, cap_user_data_t data) 184,184,204
|
||||
int capset(cap_user_header_t header, const cap_user_data_t data) 185,185,205
|
||||
int sigaltstack(const stack_t*, stack_t*) 186,186,206
|
||||
int acct(const char* filepath) 51
|
||||
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 1
|
||||
int capget(cap_user_header_t header, cap_user_data_t data) 1
|
||||
int capset(cap_user_header_t header, const cap_user_data_t data) 1
|
||||
int sigaltstack(const stack_t*, stack_t*) 1
|
||||
int acct(const char* filepath) 1
|
||||
|
||||
# file descriptors
|
||||
ssize_t read (int, void*, size_t) 3
|
||||
ssize_t write (int, const void*, size_t) 4
|
||||
ssize_t pread64 (int, void *, size_t, off64_t) 180,180,200
|
||||
ssize_t pwrite64 (int, void *, size_t, off64_t) 181,181,201
|
||||
int __open:open (const char*, int, mode_t) 5
|
||||
int __openat:openat (int, const char*, int, mode_t) 322,295,288
|
||||
int close (int) 6
|
||||
ssize_t read (int, void*, size_t) 1
|
||||
ssize_t write (int, const void*, size_t) 1
|
||||
ssize_t pread64 (int, void *, size_t, off64_t) 1
|
||||
ssize_t pwrite64 (int, void *, size_t, off64_t) 1
|
||||
int __open:open (const char*, int, mode_t) 1
|
||||
int __openat:openat (int, const char*, int, mode_t) 1
|
||||
int close (int) 1
|
||||
int creat(const char*, mode_t) stub
|
||||
off_t lseek(int, off_t, int) 19
|
||||
int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 140
|
||||
pid_t getpid () 20
|
||||
off_t lseek(int, off_t, int) 1
|
||||
int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 1
|
||||
pid_t getpid () 1
|
||||
void * mmap(void *, size_t, int, int, int, long) stub
|
||||
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 192,192,210
|
||||
int munmap(void *, size_t) 91
|
||||
void * mremap(void *, size_t, size_t, unsigned long) 163,163,167
|
||||
int msync(const void *, size_t, int) 144
|
||||
int mprotect(const void *, size_t, int) 125
|
||||
int madvise(const void *, size_t, int) 220,219,218
|
||||
int mlock(const void *addr, size_t len) 150,150,154
|
||||
int munlock(const void *addr, size_t len) 151,151,155
|
||||
int mlockall(int flags) 152,152,156
|
||||
int munlockall() 153,153,157
|
||||
int mincore(void* start, size_t length, unsigned char* vec) 219,218,217
|
||||
int __ioctl:ioctl(int, int, void *) 54
|
||||
int readv(int, const struct iovec *, int) 145
|
||||
int writev(int, const struct iovec *, int) 146
|
||||
int __fcntl:fcntl(int, int, void*) 55
|
||||
int flock(int, int) 143
|
||||
int fchmod(int, mode_t) 94
|
||||
int dup(int) 41
|
||||
int pipe(int *) 42,42,-1
|
||||
int pipe2(int *, int) 359,331,328
|
||||
int dup2(int, int) 63
|
||||
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 142
|
||||
int ftruncate(int, off_t) 93
|
||||
int ftruncate64(int, off64_t) 194,194,212
|
||||
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220,219
|
||||
int fsync(int) 118
|
||||
int fdatasync(int) 148,148,152
|
||||
int fchown:fchown32(int, uid_t, gid_t) 207,207,-1
|
||||
int fchown:fchown(int, uid_t, gid_t) -1,-1,95
|
||||
void sync(void) 36
|
||||
int __fcntl64:fcntl64(int, int, void *) 221,221,220
|
||||
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 267,269,256
|
||||
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 187,187,207
|
||||
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 327,300,293
|
||||
int mkdirat(int dirfd, const char *pathname, mode_t mode) 323,296,289
|
||||
int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags) 325,298,291
|
||||
int fchmodat(int dirfd, const char *path, mode_t mode, int flags) 333,306,299
|
||||
int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) 329,302,295
|
||||
int fsetxattr(int, const char *, const void *, size_t, int) 228,228,226
|
||||
ssize_t fgetxattr(int, const char *, void *, size_t) 231,231,229
|
||||
ssize_t flistxattr(int, char *, size_t) 234,234,232
|
||||
int fremovexattr(int, const char *) 237,237,235
|
||||
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 1
|
||||
int munmap(void *, size_t) 1
|
||||
void * mremap(void *, size_t, size_t, unsigned long) 1
|
||||
int msync(const void *, size_t, int) 1
|
||||
int mprotect(const void *, size_t, int) 1
|
||||
int madvise(const void *, size_t, int) 1
|
||||
int mlock(const void *addr, size_t len) 1
|
||||
int munlock(const void *addr, size_t len) 1
|
||||
int mlockall(int flags) 1
|
||||
int munlockall() 1
|
||||
int mincore(void* start, size_t length, unsigned char* vec) 1
|
||||
int __ioctl:ioctl(int, int, void *) 1
|
||||
int readv(int, const struct iovec *, int) 1
|
||||
int writev(int, const struct iovec *, int) 1
|
||||
int __fcntl:fcntl(int, int, void*) 1
|
||||
int flock(int, int) 1
|
||||
int fchmod(int, mode_t) 1
|
||||
int dup(int) 1
|
||||
int pipe(int *) 1,1,-1
|
||||
int pipe2(int *, int) 1
|
||||
int dup2(int, int) 1
|
||||
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 1
|
||||
int ftruncate(int, off_t) 1
|
||||
int ftruncate64(int, off64_t) 1
|
||||
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 1
|
||||
int fsync(int) 1
|
||||
int fdatasync(int) 1
|
||||
int fchown:fchown32(int, uid_t, gid_t) 1,1,-1
|
||||
int fchown:fchown(int, uid_t, gid_t) -1,-1,1
|
||||
void sync(void) 1
|
||||
int __fcntl64:fcntl64(int, int, void *) 1
|
||||
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 1
|
||||
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 1
|
||||
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 1
|
||||
int mkdirat(int dirfd, const char *pathname, mode_t mode) 1
|
||||
int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags) 1
|
||||
int fchmodat(int dirfd, const char *path, mode_t mode, int flags) 1
|
||||
int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) 1
|
||||
int fsetxattr(int, const char *, const void *, size_t, int) 1
|
||||
ssize_t fgetxattr(int, const char *, void *, size_t) 1
|
||||
ssize_t flistxattr(int, char *, size_t) 1
|
||||
int fremovexattr(int, const char *) 1
|
||||
|
||||
# file system
|
||||
int link (const char*, const char*) 9
|
||||
int unlink (const char*) 10
|
||||
int unlinkat (int, const char *, int) 328,301,294
|
||||
int chdir (const char*) 12
|
||||
int mknod (const char*, mode_t, dev_t) 14
|
||||
int chmod (const char*,mode_t) 15
|
||||
int chown:chown32(const char *, uid_t, gid_t) 212,212,-1
|
||||
int chown:chown(const char *, uid_t, gid_t) -1,-1,202
|
||||
int lchown:lchown32 (const char*, uid_t, gid_t) 198,198,-1
|
||||
int lchown:lchown (const char*, uid_t, gid_t) -1,-1,16
|
||||
int mount (const char*, const char*, const char*, unsigned long, const void*) 21
|
||||
int link (const char*, const char*) 1
|
||||
int unlink (const char*) 1
|
||||
int unlinkat (int, const char *, int) 1
|
||||
int chdir (const char*) 1
|
||||
int mknod (const char*, mode_t, dev_t) 1
|
||||
int chmod (const char*,mode_t) 1
|
||||
int chown:chown32(const char *, uid_t, gid_t) 1,1,-1
|
||||
int chown:chown(const char *, uid_t, gid_t) -1,-1,1
|
||||
int lchown:lchown32 (const char*, uid_t, gid_t) 1,1,-1
|
||||
int lchown:lchown (const char*, uid_t, gid_t) -1,-1,1
|
||||
int mount (const char*, const char*, const char*, unsigned long, const void*) 1
|
||||
int umount(const char*) stub
|
||||
int umount2 (const char*, int) 52
|
||||
int fstat:fstat64(int, struct stat*) 197,197,215
|
||||
int stat:stat64(const char *, struct stat *) 195,195,213
|
||||
int lstat:lstat64(const char *, struct stat *) 196,196,214
|
||||
int mkdir(const char *, mode_t) 39
|
||||
int readlink(const char *, char *, size_t) 85
|
||||
int rmdir(const char *) 40
|
||||
int rename(const char *, const char *) 38
|
||||
int __getcwd:getcwd(char * buf, size_t size) 183,183,203
|
||||
int access(const char *, int) 33
|
||||
int faccessat(int, const char *, int, int) 334,307,300
|
||||
int symlink(const char *, const char *) 83
|
||||
int fchdir(int) 133
|
||||
int truncate(const char*, off_t) 92
|
||||
int setxattr(const char *, const char *, const void *, size_t, int) 226,226,224
|
||||
int lsetxattr(const char *, const char *, const void *, size_t, int) 227,227,225
|
||||
ssize_t getxattr(const char *, const char *, void *, size_t) 229,229,227
|
||||
ssize_t lgetxattr(const char *, const char *, void *, size_t) 230,230,228
|
||||
ssize_t listxattr(const char *, char *, size_t) 232,232,230
|
||||
ssize_t llistxattr(const char *, char *, size_t) 233,233,231
|
||||
int removexattr(const char *, const char *) 235,235,233
|
||||
int lremovexattr(const char *, const char *) 236,236,234
|
||||
int __statfs64:statfs64(const char *, size_t, struct statfs *) 266,268,255
|
||||
long unshare(unsigned long) 337,310,303
|
||||
int umount2 (const char*, int) 1
|
||||
int fstat:fstat64(int, struct stat*) 1
|
||||
int stat:stat64(const char *, struct stat *) 1
|
||||
int lstat:lstat64(const char *, struct stat *) 1
|
||||
int mkdir(const char *, mode_t) 1
|
||||
int readlink(const char *, char *, size_t) 1
|
||||
int rmdir(const char *) 1
|
||||
int rename(const char *, const char *) 1
|
||||
int __getcwd:getcwd(char * buf, size_t size) 1
|
||||
int access(const char *, int) 1
|
||||
int faccessat(int, const char *, int, int) 1
|
||||
int symlink(const char *, const char *) 1
|
||||
int fchdir(int) 1
|
||||
int truncate(const char*, off_t) 1
|
||||
int setxattr(const char *, const char *, const void *, size_t, int) 1
|
||||
int lsetxattr(const char *, const char *, const void *, size_t, int) 1
|
||||
ssize_t getxattr(const char *, const char *, void *, size_t) 1
|
||||
ssize_t lgetxattr(const char *, const char *, void *, size_t) 1
|
||||
ssize_t listxattr(const char *, char *, size_t) 1
|
||||
ssize_t llistxattr(const char *, char *, size_t) 1
|
||||
int removexattr(const char *, const char *) 1
|
||||
int lremovexattr(const char *, const char *) 1
|
||||
int __statfs64:statfs64(const char *, size_t, struct statfs *) 1
|
||||
long unshare(unsigned long) 1
|
||||
|
||||
# time
|
||||
int pause () 29
|
||||
int gettimeofday(struct timeval*, struct timezone*) 78
|
||||
int settimeofday(const struct timeval*, const struct timezone*) 79
|
||||
clock_t times(struct tms *) 43
|
||||
int nanosleep(const struct timespec *, struct timespec *) 162,162,166
|
||||
int clock_gettime(clockid_t clk_id, struct timespec *tp) 263,265,263
|
||||
int clock_settime(clockid_t clk_id, const struct timespec *tp) 262,264,262
|
||||
int clock_getres(clockid_t clk_id, struct timespec *res) 264,266,264
|
||||
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *req, struct timespec *rem) 265,267,265
|
||||
int getitimer(int, const struct itimerval *) 105
|
||||
int setitimer(int, const struct itimerval *, struct itimerval *) 104
|
||||
int __timer_create:timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) 257,259,257
|
||||
int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) 258,260,258
|
||||
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 259,261,259
|
||||
int __timer_getoverrun:timer_getoverrun(timer_t) 260,262,260
|
||||
int __timer_delete:timer_delete(timer_t) 261,263,261
|
||||
int utimes(const char*, const struct timeval tvp[2]) 269,271,267
|
||||
int utimensat(int, const char *, const struct timespec times[2], int) 348,320,316
|
||||
int pause () 1
|
||||
int gettimeofday(struct timeval*, struct timezone*) 1
|
||||
int settimeofday(const struct timeval*, const struct timezone*) 1
|
||||
clock_t times(struct tms *) 1
|
||||
int nanosleep(const struct timespec *, struct timespec *) 1
|
||||
int clock_gettime(clockid_t clk_id, struct timespec *tp) 1
|
||||
int clock_settime(clockid_t clk_id, const struct timespec *tp) 1
|
||||
int clock_getres(clockid_t clk_id, struct timespec *res) 1
|
||||
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *req, struct timespec *rem) 1
|
||||
int getitimer(int, const struct itimerval *) 1
|
||||
int setitimer(int, const struct itimerval *, struct itimerval *) 1
|
||||
int __timer_create:timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) 1
|
||||
int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) 1
|
||||
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 1
|
||||
int __timer_getoverrun:timer_getoverrun(timer_t) 1
|
||||
int __timer_delete:timer_delete(timer_t) 1
|
||||
int utimes(const char*, const struct timeval tvp[2]) 1
|
||||
int utimensat(int, const char *, const struct timespec times[2], int) 1
|
||||
|
||||
# signals
|
||||
int sigaction(int, const struct sigaction *, struct sigaction *) 67
|
||||
int sigprocmask(int, const sigset_t *, sigset_t *) 126
|
||||
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72,72,-1
|
||||
int __sigsuspend:sigsuspend(const sigset_t *mask) -1,-1,72
|
||||
int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 174,174,194
|
||||
int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 175,175,195
|
||||
int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 177,177,197
|
||||
int sigpending(sigset_t *) 73
|
||||
int signalfd4(int fd, const sigset_t *mask, size_t sizemask, int flags) 355,327,324
|
||||
int sigaction(int, const struct sigaction *, struct sigaction *) 1
|
||||
int sigprocmask(int, const sigset_t *, sigset_t *) 1
|
||||
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 1,1,-1
|
||||
int __sigsuspend:sigsuspend(const sigset_t *mask) -1,-1,1
|
||||
int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 1
|
||||
int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 1
|
||||
int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 1
|
||||
int sigpending(sigset_t *) 1
|
||||
int signalfd4(int fd, const sigset_t *mask, size_t sizemask, int flags) 1
|
||||
|
||||
# sockets
|
||||
int socket(int, int, int) 281,-1,183
|
||||
int socketpair(int, int, int, int*) 288,-1,184
|
||||
int bind(int, struct sockaddr *, int) 282,-1,169
|
||||
int connect(int, struct sockaddr *, socklen_t) 283,-1,170
|
||||
int listen(int, int) 284,-1,174
|
||||
int accept(int, struct sockaddr *, socklen_t *) 285,-1,168
|
||||
int getsockname(int, struct sockaddr *, socklen_t *) 286,-1,172
|
||||
int getpeername(int, struct sockaddr *, socklen_t *) 287,-1,171
|
||||
int sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t) 290,-1,180
|
||||
int recvfrom(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) 292,-1,176
|
||||
int shutdown(int, int) 293,-1,182
|
||||
int setsockopt(int, int, int, const void *, socklen_t) 294,-1,181
|
||||
int getsockopt(int, int, int, void *, socklen_t *) 295,-1,173
|
||||
int sendmsg(int, const struct msghdr *, unsigned int) 296,-1,179
|
||||
int recvmsg(int, struct msghdr *, unsigned int) 297,-1,177
|
||||
int socket(int, int, int) 1,-1,1
|
||||
int socketpair(int, int, int, int*) 1,-1,1
|
||||
int bind(int, struct sockaddr *, int) 1,-1,1
|
||||
int connect(int, struct sockaddr *, socklen_t) 1,-1,1
|
||||
int listen(int, int) 1,-1,1
|
||||
int accept(int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||
int getsockname(int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||
int getpeername(int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||
int sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t) 1,-1,1
|
||||
int recvfrom(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||
int shutdown(int, int) 1,-1,1
|
||||
int setsockopt(int, int, int, const void *, socklen_t) 1,-1,1
|
||||
int getsockopt(int, int, int, void *, socklen_t *) 1,-1,1
|
||||
int sendmsg(int, const struct msghdr *, unsigned int) 1,-1,1
|
||||
int recvmsg(int, struct msghdr *, unsigned int) 1,-1,1
|
||||
|
||||
# sockets for x86. These are done as an "indexed" call to socketcall syscall.
|
||||
int socket:socketcall:1 (int, int, int) -1,102,-1
|
||||
int bind:socketcall:2 (int, struct sockaddr *, int) -1,102,-1
|
||||
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,102,-1
|
||||
int listen:socketcall:4(int, int) -1,102,-1
|
||||
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int socketpair:socketcall:8(int, int, int, int*) -1,102,-1
|
||||
int sendto:socketcall:11(int, const void *, size_t, int, const struct sockaddr *, socklen_t) -1,102,-1
|
||||
int recvfrom:socketcall:12(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int shutdown:socketcall:13(int, int) -1,102,-1
|
||||
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,102,-1
|
||||
int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1,102,-1
|
||||
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102,-1
|
||||
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102,-1
|
||||
int socket:socketcall:1 (int, int, int) -1,1,-1
|
||||
int bind:socketcall:2 (int, struct sockaddr *, int) -1,1,-1
|
||||
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,1,-1
|
||||
int listen:socketcall:4(int, int) -1,1,-1
|
||||
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,1,-1
|
||||
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,1,-1
|
||||
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,1,-1
|
||||
int socketpair:socketcall:8(int, int, int, int*) -1,1,-1
|
||||
int sendto:socketcall:11(int, const void *, size_t, int, const struct sockaddr *, socklen_t) -1,1,-1
|
||||
int recvfrom:socketcall:12(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) -1,1,-1
|
||||
int shutdown:socketcall:13(int, int) -1,1,-1
|
||||
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,1,-1
|
||||
int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1,1,-1
|
||||
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,1,-1
|
||||
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,1,-1
|
||||
|
||||
# scheduler & real-time
|
||||
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156,156,160
|
||||
int sched_getscheduler(pid_t pid) 157,157,161
|
||||
int sched_yield(void) 158,158,162
|
||||
int sched_setparam(pid_t pid, const struct sched_param *param) 154,154,158
|
||||
int sched_getparam(pid_t pid, struct sched_param *param) 155,155,159
|
||||
int sched_get_priority_max(int policy) 159,159,163
|
||||
int sched_get_priority_min(int policy) 160,160,164
|
||||
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161,161,165
|
||||
int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) 241,241,239
|
||||
int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) 242,242,240
|
||||
int __getcpu:getcpu(unsigned *cpu, unsigned *node, void *unused) 345,318,312
|
||||
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 1
|
||||
int sched_getscheduler(pid_t pid) 1
|
||||
int sched_yield(void) 1
|
||||
int sched_setparam(pid_t pid, const struct sched_param *param) 1
|
||||
int sched_getparam(pid_t pid, struct sched_param *param) 1
|
||||
int sched_get_priority_max(int policy) 1
|
||||
int sched_get_priority_min(int policy) 1
|
||||
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 1
|
||||
int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) 1
|
||||
int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) 1
|
||||
int __getcpu:getcpu(unsigned *cpu, unsigned *node, void *unused) 1
|
||||
|
||||
# io priorities
|
||||
int ioprio_set(int which, int who, int ioprio) 314,289,314
|
||||
int ioprio_get(int which, int who) 315,290,315
|
||||
int ioprio_set(int which, int who, int ioprio) 1
|
||||
int ioprio_get(int which, int who) 1
|
||||
|
||||
# other
|
||||
int uname(struct utsname *) 122
|
||||
pid_t __wait4:wait4(pid_t pid, int *status, int options, struct rusage *rusage) 114
|
||||
mode_t umask(mode_t) 60
|
||||
int __reboot:reboot(int, int, int, void *) 88
|
||||
int __syslog:syslog(int, char *, int) 103
|
||||
int init_module(void *, unsigned long, const char *) 128
|
||||
int delete_module(const char*, unsigned int) 129
|
||||
int klogctl:syslog(int, char *, int) 103
|
||||
int sysinfo(struct sysinfo *) 116
|
||||
int personality(unsigned long) 136
|
||||
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364,336,333
|
||||
int uname(struct utsname *) 1
|
||||
mode_t umask(mode_t) 1
|
||||
int __reboot:reboot(int, int, int, void *) 1
|
||||
int __syslog:syslog(int, char *, int) 1
|
||||
int init_module(void *, unsigned long, const char *) 1
|
||||
int delete_module(const char*, unsigned int) 1
|
||||
int klogctl:syslog(int, char *, int) 1
|
||||
int sysinfo(struct sysinfo *) 1
|
||||
int personality(unsigned long) 1
|
||||
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 1
|
||||
|
||||
# futex
|
||||
int futex(void *, int, int, void *, void *, int) 240,240,238
|
||||
int futex(void *, int, int, void *, void *, int) 1
|
||||
|
||||
# epoll
|
||||
int epoll_create(int size) 250,254,248
|
||||
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255,249
|
||||
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 252,256,250
|
||||
int epoll_create(int size) 1
|
||||
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 1
|
||||
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 1
|
||||
|
||||
int inotify_init(void) 316,291,284
|
||||
int inotify_add_watch(int, const char *, unsigned int) 317,292,285
|
||||
int inotify_rm_watch(int, unsigned int) 318,293,286
|
||||
int inotify_init(void) 1
|
||||
int inotify_add_watch(int, const char *, unsigned int) 1
|
||||
int inotify_rm_watch(int, unsigned int) 1
|
||||
|
||||
int poll(struct pollfd *, unsigned int, long) 168,168,188
|
||||
int poll(struct pollfd *, unsigned int, long) 1
|
||||
|
||||
int eventfd:eventfd2(unsigned int, int) 356,328,325
|
||||
int eventfd:eventfd2(unsigned int, int) 1
|
||||
|
||||
# ARM-specific ARM_NR_BASE == 0x0f0000 == 983040
|
||||
int __set_tls:ARM_set_tls(void*) 983045,-1,-1
|
||||
int cacheflush:ARM_cacheflush(long start, long end, long flags) 983042,-1,-1
|
||||
int __set_tls:__ARM_NR_set_tls(void*) 1,-1,-1
|
||||
int cacheflush:__ARM_NR_cacheflush(long start, long end, long flags) 1,-1,-1
|
||||
|
||||
# MIPS-specific
|
||||
int _flush_cache:cacheflush(char *addr, const int nbytes, const int op) -1,-1,147
|
||||
int syscall(int number,...) -1,-1,0
|
||||
int _flush_cache:cacheflush(char *addr, const int nbytes, const int op) -1,-1,1
|
||||
int syscall(int number,...) -1,-1,1
|
||||
|
35
libc/arch-arm/arm.mk
Normal file
35
libc/arch-arm/arm.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
_LIBC_ARCH_COMMON_SRC_FILES := \
|
||||
arch-arm/bionic/abort_arm.S \
|
||||
arch-arm/bionic/atomics_arm.c \
|
||||
arch-arm/bionic/clone.S \
|
||||
arch-arm/bionic/eabi.c \
|
||||
arch-arm/bionic/_exit_with_stack_teardown.S \
|
||||
arch-arm/bionic/ffs.S \
|
||||
arch-arm/bionic/futex_arm.S \
|
||||
arch-arm/bionic/__get_sp.S \
|
||||
arch-arm/bionic/kill.S \
|
||||
arch-arm/bionic/libgcc_compat.c \
|
||||
arch-arm/bionic/memcmp16.S \
|
||||
arch-arm/bionic/memcmp.S \
|
||||
arch-arm/bionic/_setjmp.S \
|
||||
arch-arm/bionic/setjmp.S \
|
||||
arch-arm/bionic/sigsetjmp.S \
|
||||
arch-arm/bionic/strcpy.S \
|
||||
arch-arm/bionic/strlen.c.arm \
|
||||
arch-arm/bionic/syscall.S \
|
||||
arch-arm/bionic/tgkill.S \
|
||||
arch-arm/bionic/tkill.S \
|
||||
|
||||
# These are used by the static and dynamic versions of the libc
|
||||
# respectively.
|
||||
_LIBC_ARCH_STATIC_SRC_FILES := \
|
||||
arch-arm/bionic/exidx_static.c
|
||||
|
||||
_LIBC_ARCH_DYNAMIC_SRC_FILES := \
|
||||
arch-arm/bionic/exidx_dynamic.c
|
||||
|
||||
ifeq ($(strip $(wildcard bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk)),)
|
||||
$(error "TARGET_CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a9, cortex-a15, krait. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.")
|
||||
endif
|
||||
|
||||
include bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk
|
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
// void _exit_with_stack_teardown(void* stackBase, int stackSize, int retCode)
|
||||
ENTRY(_exit_with_stack_teardown)
|
||||
|
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <private/logd.h>
|
||||
#include <private/libc_logging.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
@@ -52,7 +52,7 @@ atexit(void (*func)(void))
|
||||
*/
|
||||
static char const warning[] = "WARNING: generic atexit() called from legacy shared library\n";
|
||||
|
||||
__libc_android_log_write(ANDROID_LOG_WARN, "libc", warning);
|
||||
__libc_format_log(ANDROID_LOG_WARN, "libc", warning);
|
||||
fprintf(stderr, warning);
|
||||
|
||||
return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
|
||||
|
@@ -26,13 +26,14 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
// int __pthread_clone(int (*fn)(void*), void* child_stack, int flags, void* arg);
|
||||
// int __pthread_clone(void* (*fn)(void*), void* child_stack, int flags, void* arg);
|
||||
ENTRY(__pthread_clone)
|
||||
# Copy the args onto the new stack.
|
||||
stmdb r1!, {r0, r3}
|
||||
stmdb r1!, {r0, r3}
|
||||
|
||||
# The sys_clone system call only takes two arguments: 'flags' and 'child_stack'.
|
||||
# 'child_stack' is already in r1, but we need to move 'flags' into position.
|
||||
@@ -45,10 +46,12 @@ ENTRY(__pthread_clone)
|
||||
movs r0, r0
|
||||
beq 1f
|
||||
|
||||
# In parent, reload saved registers then either exit or set errno.
|
||||
# In parent, reload saved registers then either return or set errno.
|
||||
ldmfd sp!, {r4, r7}
|
||||
bxne lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
|
||||
1: # The child.
|
||||
# pick the function arg and call address off the stack and jump
|
||||
@@ -94,10 +97,12 @@ ENTRY(__bionic_clone)
|
||||
movs r0, r0
|
||||
beq 1f
|
||||
|
||||
# In the parent, reload saved registers then either exit or set errno.
|
||||
# In the parent, reload saved registers then either return or set errno.
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
bxne lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
|
||||
1: # The child.
|
||||
ldr r0, [sp, #-4]
|
||||
|
@@ -31,55 +31,11 @@
|
||||
#include <machine/asm.h>
|
||||
#include <machine/cpu-features.h>
|
||||
|
||||
/*
|
||||
* ffs - find first set bit, this algorithm isolates the first set
|
||||
* bit, then multiplies the number by 0x0450fbaf which leaves the top
|
||||
* 6 bits as an index into the table. This algorithm should be a win
|
||||
* over the checking each bit in turn as per the C compiled version.
|
||||
*
|
||||
* Some newer ARM architectures have an instruction named
|
||||
* CLZ (count leading Zero's) that is used
|
||||
*
|
||||
* This is the ffs algorithm devised by d.seal and posted to comp.sys.arm on
|
||||
* 16 Feb 1994.
|
||||
*/
|
||||
|
||||
ENTRY(ffs)
|
||||
/* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */
|
||||
rsb r1, r0, #0
|
||||
ands r0, r0, r1
|
||||
#ifndef __ARM_HAVE_CLZ
|
||||
/*
|
||||
* now r0 has at most one set bit, call this X
|
||||
* if X = 0, all further instructions are skipped
|
||||
*/
|
||||
adrne r2, .L_ffs_table
|
||||
orrne r0, r0, r0, lsl #4 /* r0 = X * 0x11 */
|
||||
orrne r0, r0, r0, lsl #6 /* r0 = X * 0x451 */
|
||||
rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */
|
||||
|
||||
/* now lookup in table indexed on top 6 bits of r0 */
|
||||
ldrneb r0, [ r2, r0, lsr #26 ]
|
||||
|
||||
bx lr
|
||||
END(ffs)
|
||||
|
||||
.text;
|
||||
.type .L_ffs_table, _ASM_TYPE_OBJECT;
|
||||
.L_ffs_table:
|
||||
/* 0 1 2 3 4 5 6 7 */
|
||||
.byte 0, 1, 2, 13, 3, 7, 0, 14 /* 0- 7 */
|
||||
.byte 4, 0, 8, 0, 0, 0, 0, 15 /* 8-15 */
|
||||
.byte 11, 5, 0, 0, 9, 0, 0, 26 /* 16-23 */
|
||||
.byte 0, 0, 0, 0, 0, 22, 28, 16 /* 24-31 */
|
||||
.byte 32, 12, 6, 0, 0, 0, 0, 0 /* 32-39 */
|
||||
.byte 10, 0, 0, 25, 0, 0, 21, 27 /* 40-47 */
|
||||
.byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */
|
||||
.byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */
|
||||
#else /* !defined(__ARM_HAVE_CLZ) */
|
||||
clzne r0, r0
|
||||
rsbne r0, r0, #32
|
||||
bx lr
|
||||
END(ffs)
|
||||
#endif /* !defined(__ARM_HAVE_CLZ) */
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#define FUTEX_WAIT 0
|
||||
|
@@ -25,6 +25,11 @@
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* unlike our auto-generated syscall stubs, this code saves lr
|
||||
on the stack, as well as a few other registers. this makes
|
||||
our stack unwinder happy, when we generate debug stack
|
||||
@@ -32,19 +37,14 @@
|
||||
abort due to a fatal runtime error (e.g. detection
|
||||
of a corrupted malloc heap).
|
||||
*/
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#ifndef __NR_kill
|
||||
#define __NR_kill 37
|
||||
#endif
|
||||
|
||||
ENTRY(kill)
|
||||
stmfd sp!, {r4-r7, ip, lr}
|
||||
ldr r7, =__NR_kill
|
||||
swi #0
|
||||
ldmfd sp!, {r4-r7, ip, lr}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(kill)
|
||||
|
@@ -115,7 +115,7 @@ ENTRY(memcmp)
|
||||
* pointer somewhere else
|
||||
*/
|
||||
mov r4, r0
|
||||
|
||||
|
||||
/* align first pointer to word boundary
|
||||
* offset = -src & 3
|
||||
*/
|
||||
@@ -151,7 +151,7 @@ ENTRY(memcmp)
|
||||
ldr ip, [r1]
|
||||
subs r2, r2, #(32 + 4)
|
||||
bmi 1f
|
||||
|
||||
|
||||
0: pld [r4, #(CACHE_LINE_SIZE * 2)]
|
||||
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||
ldr r0, [r4], #4
|
||||
@@ -178,14 +178,14 @@ ENTRY(memcmp)
|
||||
ldreq r0, [r4], #4
|
||||
ldreq ip, [r1, #4]!
|
||||
eoreqs r0, r0, lr
|
||||
bne 2f
|
||||
bne 2f
|
||||
subs r2, r2, #32
|
||||
bhs 0b
|
||||
|
||||
/* do we have at least 4 bytes left? */
|
||||
1: adds r2, r2, #(32 - 4 + 4)
|
||||
bmi 4f
|
||||
|
||||
|
||||
/* finish off 4 bytes at a time */
|
||||
3: ldr r0, [r4], #4
|
||||
ldr ip, [r1], #4
|
||||
@@ -233,17 +233,14 @@ ENTRY(memcmp)
|
||||
subs r2, r2, #1
|
||||
bne 11b
|
||||
bx lr
|
||||
END(memcmp)
|
||||
|
||||
|
||||
|
||||
5: /*************** non-congruent case ***************/
|
||||
and r0, r1, #3
|
||||
and r0, r1, #3
|
||||
cmp r0, #2
|
||||
bne 4f
|
||||
|
||||
/* here, offset is 2 (16-bits aligned, special cased) */
|
||||
|
||||
|
||||
/* make sure we have at least 16 bytes to process */
|
||||
subs r2, r2, #16
|
||||
addmi r2, r2, #16
|
||||
@@ -341,3 +338,4 @@ END(memcmp)
|
||||
mov r2, #4
|
||||
ldmfd sp!, {r5, r6, r7}
|
||||
b 8b
|
||||
END(memcmp)
|
||||
|
406
libc/arch-arm/bionic/memcpy.a15.S
Normal file
406
libc/arch-arm/bionic/memcpy.a15.S
Normal file
@@ -0,0 +1,406 @@
|
||||
/*
|
||||
* Copyright (c) 2013 ARM Ltd
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the company may not be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Prototype: void *memcpy (void *dst, const void *src, size_t count). */
|
||||
|
||||
/* Use the version of memcpy implemented using LDRD and STRD.
|
||||
This version is tuned for Cortex-A15.
|
||||
This might not be the best for other ARMv7-A CPUs,
|
||||
but there is no predefine to distinguish between
|
||||
different CPUs in the same architecture,
|
||||
and this version is better than the plain memcpy provided in newlib.
|
||||
|
||||
Therefore, we use this version for all ARMv7-A CPUS. */
|
||||
|
||||
/* To make the same code compile for both ARM and Thumb instruction
|
||||
sets, switch to unified syntax at the beginning of this function.
|
||||
However, by using the same code, we may be missing optimization
|
||||
opportunities. For instance, in LDRD/STRD instructions, the first
|
||||
destination register must be even and the second consecutive in
|
||||
ARM state, but not in Thumb state. */
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
.syntax unified
|
||||
|
||||
ENTRY(memcpy)
|
||||
|
||||
/* Assumes that n >= 0, and dst, src are valid pointers.
|
||||
If there is at least 8 bytes to copy, use LDRD/STRD.
|
||||
If src and dst are misaligned with different offsets,
|
||||
first copy byte by byte until dst is aligned,
|
||||
and then copy using LDRD/STRD and shift if needed.
|
||||
When less than 8 left, copy a word and then byte by byte. */
|
||||
|
||||
/* Save registers (r0 holds the return value):
|
||||
optimized push {r0, r4, r5, r6, r7, lr}.
|
||||
To try and improve performance, stack layout changed,
|
||||
i.e., not keeping the stack looking like users expect
|
||||
(highest numbered register at highest address). */
|
||||
.save {r0, lr}
|
||||
push {r0, lr}
|
||||
.save {r4, r5}
|
||||
strd r4, r5, [sp, #-8]!
|
||||
.save {r6, r7}
|
||||
strd r6, r7, [sp, #-8]!
|
||||
|
||||
/* TODO: Add debug frame directives.
|
||||
We don't need exception unwind directives, because the code below
|
||||
does not throw any exceptions and does not call any other functions.
|
||||
Generally, newlib functions like this lack debug information for
|
||||
assembler source. */
|
||||
|
||||
/* Get copying of tiny blocks out of the way first. */
|
||||
/* Is there at least 4 bytes to copy? */
|
||||
subs r2, r2, #4
|
||||
blt copy_less_than_4 /* If n < 4. */
|
||||
|
||||
/* Check word alignment. */
|
||||
ands ip, r0, #3 /* ip = last 2 bits of dst. */
|
||||
bne dst_not_word_aligned /* If dst is not word-aligned. */
|
||||
|
||||
/* Get here if dst is word-aligned. */
|
||||
ands ip, r1, #3 /* ip = last 2 bits of src. */
|
||||
bne src_not_word_aligned /* If src is not word-aligned. */
|
||||
word_aligned:
|
||||
/* Get here if source and dst both are word-aligned.
|
||||
The number of bytes remaining to copy is r2+4. */
|
||||
|
||||
/* Is there is at least 64 bytes to copy? */
|
||||
subs r2, r2, #60
|
||||
blt copy_less_than_64 /* If r2 + 4 < 64. */
|
||||
|
||||
/* First, align the destination buffer to 8-bytes,
|
||||
to make sure double loads and stores don't cross cache line boundary,
|
||||
as they are then more expensive even if the data is in the cache
|
||||
(require two load/store issue cycles instead of one).
|
||||
If only one of the buffers is not 8-bytes aligned,
|
||||
then it's more important to align dst than src,
|
||||
because there is more penalty for stores
|
||||
than loads that cross cacheline boundary.
|
||||
This check and realignment are only worth doing
|
||||
if there is a lot to copy. */
|
||||
|
||||
/* Get here if dst is word aligned,
|
||||
i.e., the 2 least significant bits are 0.
|
||||
If dst is not 2w aligned (i.e., the 3rd bit is not set in dst),
|
||||
then copy 1 word (4 bytes). */
|
||||
ands r3, r0, #4
|
||||
beq 11f /* If dst already two-word aligned. */
|
||||
ldr r3, [r1], #4
|
||||
str r3, [r0], #4
|
||||
subs r2, r2, #4
|
||||
blt copy_less_than_64
|
||||
|
||||
11:
|
||||
/* TODO: Align to cacheline (useful for PLD optimization). */
|
||||
|
||||
/* Every loop iteration copies 64 bytes. */
|
||||
1:
|
||||
.irp offset, #0, #8, #16, #24, #32, #40, #48, #56
|
||||
ldrd r4, r5, [r1, \offset]
|
||||
strd r4, r5, [r0, \offset]
|
||||
.endr
|
||||
|
||||
add r0, r0, #64
|
||||
add r1, r1, #64
|
||||
subs r2, r2, #64
|
||||
bge 1b /* If there is more to copy. */
|
||||
|
||||
copy_less_than_64:
|
||||
|
||||
/* Get here if less than 64 bytes to copy, -64 <= r2 < 0.
|
||||
Restore the count if there is more than 7 bytes to copy. */
|
||||
adds r2, r2, #56
|
||||
blt copy_less_than_8
|
||||
|
||||
/* Copy 8 bytes at a time. */
|
||||
2:
|
||||
ldrd r4, r5, [r1], #8
|
||||
strd r4, r5, [r0], #8
|
||||
subs r2, r2, #8
|
||||
bge 2b /* If there is more to copy. */
|
||||
|
||||
copy_less_than_8:
|
||||
|
||||
/* Get here if less than 8 bytes to copy, -8 <= r2 < 0.
|
||||
Check if there is more to copy. */
|
||||
cmn r2, #8
|
||||
beq return /* If r2 + 8 == 0. */
|
||||
|
||||
/* Restore the count if there is more than 3 bytes to copy. */
|
||||
adds r2, r2, #4
|
||||
blt copy_less_than_4
|
||||
|
||||
/* Copy 4 bytes. */
|
||||
ldr r3, [r1], #4
|
||||
str r3, [r0], #4
|
||||
|
||||
copy_less_than_4:
|
||||
/* Get here if less than 4 bytes to copy, -4 <= r2 < 0. */
|
||||
|
||||
/* Restore the count, check if there is more to copy. */
|
||||
adds r2, r2, #4
|
||||
beq return /* If r2 == 0. */
|
||||
|
||||
/* Get here with r2 is in {1,2,3}={01,10,11}. */
|
||||
/* Logical shift left r2, insert 0s, update flags. */
|
||||
lsls r2, r2, #31
|
||||
|
||||
/* Copy byte by byte.
|
||||
Condition ne means the last bit of r2 is 0.
|
||||
Condition cs means the second to last bit of r2 is set,
|
||||
i.e., r2 is 1 or 3. */
|
||||
itt ne
|
||||
ldrbne r3, [r1], #1
|
||||
strbne r3, [r0], #1
|
||||
|
||||
itttt cs
|
||||
ldrbcs r4, [r1], #1
|
||||
ldrbcs r5, [r1]
|
||||
strbcs r4, [r0], #1
|
||||
strbcs r5, [r0]
|
||||
|
||||
return:
|
||||
/* Restore registers: optimized pop {r0, r4, r5, r6, r7, pc} */
|
||||
/* This is the only return point of memcpy. */
|
||||
ldrd r6, r7, [sp], #8
|
||||
ldrd r4, r5, [sp], #8
|
||||
pop {r0, pc}
|
||||
|
||||
#ifndef __ARM_FEATURE_UNALIGNED
|
||||
|
||||
/* The following assembly macro implements misaligned copy in software.
|
||||
Assumes that dst is word aligned, src is at offset "pull" bits from
|
||||
word, push = 32 - pull, and the number of bytes that remain to copy
|
||||
is r2 + 4, r2 >= 0. */
|
||||
|
||||
/* In the code below, r2 is the number of bytes that remain to be
|
||||
written. The number of bytes read is always larger, because we have
|
||||
partial words in the shift queue. */
|
||||
|
||||
.macro miscopy pull push shiftleft shiftright
|
||||
|
||||
/* Align src to the previous word boundary. */
|
||||
bic r1, r1, #3
|
||||
|
||||
/* Initialize the shift queue. */
|
||||
ldr r5, [r1], #4 /* Load a word from source. */
|
||||
|
||||
subs r2, r2, #4
|
||||
blt 6f /* Go to misaligned copy of less than 8 bytes. */
|
||||
|
||||
/* Get here if there is more than 8 bytes to copy.
|
||||
The number of bytes to copy is r2+8, r2 >= 0. */
|
||||
|
||||
subs r2, r2, #56
|
||||
blt 4f /* Go to misaligned copy of less than 64 bytes. */
|
||||
|
||||
3:
|
||||
/* Get here if there is more than 64 bytes to copy.
|
||||
The number of bytes to copy is r2+64, r2 >= 0. */
|
||||
|
||||
/* Copy 64 bytes in every iteration.
|
||||
Use a partial word from the shift queue. */
|
||||
.irp offset, #0, #8, #16, #24, #32, #40, #48, #56
|
||||
mov r6, r5, \shiftleft #\pull
|
||||
ldrd r4, r5, [r1, \offset]
|
||||
orr r6, r6, r4, \shiftright #\push
|
||||
mov r7, r4, \shiftleft #\pull
|
||||
orr r7, r7, r5, \shiftright #\push
|
||||
strd r6, r7, [r0, \offset]
|
||||
.endr
|
||||
|
||||
add r1, r1, #64
|
||||
add r0, r0, #64
|
||||
subs r2, r2, #64
|
||||
bge 3b
|
||||
|
||||
4:
|
||||
/* Get here if there is less than 64 bytes to copy (-64 <= r2 < 0)
|
||||
and they are misaligned. */
|
||||
|
||||
/* Restore the count if there is more than 7 bytes to copy. */
|
||||
adds r2, r2, #56
|
||||
|
||||
blt 6f /* Go to misaligned copy of less than 8 bytes. */
|
||||
|
||||
5:
|
||||
/* Copy 8 bytes at a time.
|
||||
Use a partial word from the shift queue. */
|
||||
mov r6, r5, \shiftleft #\pull
|
||||
ldrd r4, r5, [r1], #8
|
||||
orr r6, r6, r4, \shiftright #\push
|
||||
mov r7, r4, \shiftleft #\pull
|
||||
orr r7, r7, r5, \shiftright #\push
|
||||
strd r6, r7, [r0], #8
|
||||
|
||||
subs r2, r2, #8
|
||||
bge 5b /* If there is more to copy. */
|
||||
|
||||
6:
|
||||
/* Get here if there less than 8 bytes to copy (-8 <= r2 < 0)
|
||||
and they are misaligned. */
|
||||
|
||||
/* Check if there is more to copy. */
|
||||
cmn r2, #8
|
||||
beq return
|
||||
|
||||
/* Check if there is less than 4 bytes to copy. */
|
||||
cmn r2, #4
|
||||
|
||||
itt lt
|
||||
/* Restore src offset from word-align. */
|
||||
sublt r1, r1, #(\push / 8)
|
||||
blt copy_less_than_4
|
||||
|
||||
/* Use a partial word from the shift queue. */
|
||||
mov r3, r5, \shiftleft #\pull
|
||||
/* Load a word from src, but without writeback
|
||||
(this word is not fully written to dst). */
|
||||
ldr r5, [r1]
|
||||
|
||||
/* Restore src offset from word-align. */
|
||||
add r1, r1, #(\pull / 8)
|
||||
|
||||
/* Shift bytes to create one dst word and store it. */
|
||||
orr r3, r3, r5, \shiftright #\push
|
||||
str r3, [r0], #4
|
||||
|
||||
/* Use single byte copying of the remaining bytes. */
|
||||
b copy_less_than_4
|
||||
|
||||
.endm
|
||||
|
||||
#endif /* not __ARM_FEATURE_UNALIGNED */
|
||||
|
||||
dst_not_word_aligned:
|
||||
|
||||
/* Get here when dst is not aligned and ip has the last 2 bits of dst,
|
||||
i.e., ip is the offset of dst from word.
|
||||
The number of bytes that remains to copy is r2 + 4,
|
||||
i.e., there are at least 4 bytes to copy.
|
||||
Write a partial word (0 to 3 bytes), such that dst becomes
|
||||
word-aligned. */
|
||||
|
||||
/* If dst is at ip bytes offset from a word (with 0 < ip < 4),
|
||||
then there are (4 - ip) bytes to fill up to align dst to the next
|
||||
word. */
|
||||
rsb ip, ip, #4 /* ip = #4 - ip. */
|
||||
cmp ip, #2
|
||||
|
||||
/* Copy byte by byte with conditionals. */
|
||||
itt gt
|
||||
ldrbgt r3, [r1], #1
|
||||
strbgt r3, [r0], #1
|
||||
|
||||
itt ge
|
||||
ldrbge r4, [r1], #1
|
||||
strbge r4, [r0], #1
|
||||
|
||||
ldrb lr, [r1], #1
|
||||
strb lr, [r0], #1
|
||||
|
||||
/* Update the count.
|
||||
ip holds the number of bytes we have just copied. */
|
||||
subs r2, r2, ip /* r2 = r2 - ip. */
|
||||
blt copy_less_than_4 /* If r2 < ip. */
|
||||
|
||||
/* Get here if there are more than 4 bytes to copy.
|
||||
Check if src is aligned. If beforehand src and dst were not word
|
||||
aligned but congruent (same offset), then now they are both
|
||||
word-aligned, and we can copy the rest efficiently (without
|
||||
shifting). */
|
||||
ands ip, r1, #3 /* ip = last 2 bits of src. */
|
||||
beq word_aligned /* If r1 is word-aligned. */
|
||||
|
||||
src_not_word_aligned:
|
||||
/* Get here when src is not word-aligned, but dst is word-aligned.
|
||||
The number of bytes that remains to copy is r2+4. */
|
||||
|
||||
#ifdef __ARM_FEATURE_UNALIGNED
|
||||
/* Copy word by word using LDR when alignment can be done in hardware,
|
||||
i.e., SCTLR.A is set, supporting unaligned access in LDR and STR. */
|
||||
subs r2, r2, #60
|
||||
blt 8f
|
||||
|
||||
7:
|
||||
/* Copy 64 bytes in every loop iteration. */
|
||||
.irp offset, #0, #4, #8, #12, #16, #20, #24, #28, #32, #36, #40, #44, #48, #52, #56, #60
|
||||
ldr r3, [r1, \offset]
|
||||
str r3, [r0, \offset]
|
||||
.endr
|
||||
|
||||
add r0, r0, #64
|
||||
add r1, r1, #64
|
||||
subs r2, r2, #64
|
||||
bge 7b
|
||||
|
||||
8:
|
||||
/* Get here if less than 64 bytes to copy, -64 <= r2 < 0.
|
||||
Check if there is more than 3 bytes to copy. */
|
||||
adds r2, r2, #60
|
||||
blt copy_less_than_4
|
||||
|
||||
9:
|
||||
/* Get here if there is less than 64 but at least 4 bytes to copy,
|
||||
where the number of bytes to copy is r2+4. */
|
||||
ldr r3, [r1], #4
|
||||
str r3, [r0], #4
|
||||
subs r2, r2, #4
|
||||
bge 9b
|
||||
|
||||
b copy_less_than_4
|
||||
|
||||
#else /* not __ARM_FEATURE_UNALIGNED */
|
||||
|
||||
/* ip has last 2 bits of src,
|
||||
i.e., ip is the offset of src from word, and ip > 0.
|
||||
Compute shifts needed to copy from src to dst. */
|
||||
cmp ip, #2
|
||||
beq miscopy_16_16 /* If ip == 2. */
|
||||
bge miscopy_24_8 /* If ip == 3. */
|
||||
|
||||
/* Get here if ip == 1. */
|
||||
|
||||
/* Endian independent macros for shifting bytes within registers. */
|
||||
|
||||
#ifndef __ARMEB__
|
||||
miscopy_8_24: miscopy pull=8 push=24 shiftleft=lsr shiftright=lsl
|
||||
miscopy_16_16: miscopy pull=16 push=16 shiftleft=lsr shiftright=lsl
|
||||
miscopy_24_8: miscopy pull=24 push=8 shiftleft=lsr shiftright=lsl
|
||||
#else /* not __ARMEB__ */
|
||||
miscopy_8_24: miscopy pull=8 push=24 shiftleft=lsl shiftright=lsr
|
||||
miscopy_16_16: miscopy pull=16 push=16 shiftleft=lsl shiftright=lsr
|
||||
miscopy_24_8: miscopy pull=24 push=8 shiftleft=lsl shiftright=lsr
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
#endif /* not __ARM_FEATURE_UNALIGNED */
|
||||
|
||||
END(memcpy)
|
@@ -42,6 +42,7 @@
|
||||
ENTRY(bzero)
|
||||
mov r2, r1
|
||||
mov r1, #0
|
||||
// Fall through to memset...
|
||||
END(bzero)
|
||||
|
||||
ENTRY(memset)
|
||||
|
787
libc/arch-arm/bionic/strcmp.a15.S
Normal file
787
libc/arch-arm/bionic/strcmp.a15.S
Normal file
@@ -0,0 +1,787 @@
|
||||
/*
|
||||
* Copyright (c) 2013 ARM Ltd
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the company may not be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "arm_asm.h"
|
||||
|
||||
#ifdef __ARMEB__
|
||||
#define S2LOMEM lsl
|
||||
#define S2LOMEMEQ lsleq
|
||||
#define S2HIMEM lsr
|
||||
#define MSB 0x000000ff
|
||||
#define LSB 0xff000000
|
||||
#define BYTE0_OFFSET 24
|
||||
#define BYTE1_OFFSET 16
|
||||
#define BYTE2_OFFSET 8
|
||||
#define BYTE3_OFFSET 0
|
||||
#else /* not __ARMEB__ */
|
||||
#define S2LOMEM lsr
|
||||
#define S2LOMEMEQ lsreq
|
||||
#define S2HIMEM lsl
|
||||
#define BYTE0_OFFSET 0
|
||||
#define BYTE1_OFFSET 8
|
||||
#define BYTE2_OFFSET 16
|
||||
#define BYTE3_OFFSET 24
|
||||
#define MSB 0xff000000
|
||||
#define LSB 0x000000ff
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
.syntax unified
|
||||
|
||||
#if defined (__thumb__)
|
||||
.thumb
|
||||
.thumb_func
|
||||
#endif
|
||||
.global strcmp
|
||||
.type strcmp, %function
|
||||
strcmp:
|
||||
|
||||
#if (defined (__thumb__) && !defined (__thumb2__))
|
||||
1:
|
||||
ldrb r2, [r0]
|
||||
ldrb r3, [r1]
|
||||
adds r0, r0, #1
|
||||
adds r1, r1, #1
|
||||
cmp r2, #0
|
||||
beq 2f
|
||||
cmp r2, r3
|
||||
beq 1b
|
||||
2:
|
||||
subs r0, r2, r3
|
||||
bx lr
|
||||
#elif (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
|
||||
1:
|
||||
ldrb r2, [r0], #1
|
||||
ldrb r3, [r1], #1
|
||||
cmp r2, #1
|
||||
it cs
|
||||
cmpcs r2, r3
|
||||
beq 1b
|
||||
subs r0, r2, r3
|
||||
RETURN
|
||||
|
||||
|
||||
#elif (defined (_ISA_THUMB_2) || defined (_ISA_ARM_6))
|
||||
/* Use LDRD whenever possible. */
|
||||
|
||||
/* The main thing to look out for when comparing large blocks is that
|
||||
the loads do not cross a page boundary when loading past the index
|
||||
of the byte with the first difference or the first string-terminator.
|
||||
|
||||
For example, if the strings are identical and the string-terminator
|
||||
is at index k, byte by byte comparison will not load beyond address
|
||||
s1+k and s2+k; word by word comparison may load up to 3 bytes beyond
|
||||
k; double word - up to 7 bytes. If the load of these bytes crosses
|
||||
a page boundary, it might cause a memory fault (if the page is not mapped)
|
||||
that would not have happened in byte by byte comparison.
|
||||
|
||||
If an address is (double) word aligned, then a load of a (double) word
|
||||
from that address will not cross a page boundary.
|
||||
Therefore, the algorithm below considers word and double-word alignment
|
||||
of strings separately. */
|
||||
|
||||
/* High-level description of the algorithm.
|
||||
|
||||
* The fast path: if both strings are double-word aligned,
|
||||
use LDRD to load two words from each string in every loop iteration.
|
||||
* If the strings have the same offset from a word boundary,
|
||||
use LDRB to load and compare byte by byte until
|
||||
the first string is aligned to a word boundary (at most 3 bytes).
|
||||
This is optimized for quick return on short unaligned strings.
|
||||
* If the strings have the same offset from a double-word boundary,
|
||||
use LDRD to load two words from each string in every loop iteration, as in the fast path.
|
||||
* If the strings do not have the same offset from a double-word boundary,
|
||||
load a word from the second string before the loop to initialize the queue.
|
||||
Use LDRD to load two words from every string in every loop iteration.
|
||||
Inside the loop, load the second word from the second string only after comparing
|
||||
the first word, using the queued value, to guarantee safety across page boundaries.
|
||||
* If the strings do not have the same offset from a word boundary,
|
||||
use LDR and a shift queue. Order of loads and comparisons matters,
|
||||
similarly to the previous case.
|
||||
|
||||
* Use UADD8 and SEL to compare words, and use REV and CLZ to compute the return value.
|
||||
* The only difference between ARM and Thumb modes is the use of CBZ instruction.
|
||||
* The only difference between big and little endian is the use of REV in little endian
|
||||
to compute the return value, instead of MOV.
|
||||
* No preload. [TODO.]
|
||||
*/
|
||||
|
||||
.macro m_cbz reg label
|
||||
#ifdef __thumb2__
|
||||
cbz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
beq \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbz */
|
||||
|
||||
.macro m_cbnz reg label
|
||||
#ifdef __thumb2__
|
||||
cbnz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
bne \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbnz */
|
||||
|
||||
.macro init
|
||||
/* Macro to save temporary registers and prepare magic values. */
|
||||
subs sp, sp, #16
|
||||
strd r4, r5, [sp, #8]
|
||||
strd r6, r7, [sp]
|
||||
mvn r6, #0 /* all F */
|
||||
mov r7, #0 /* all 0 */
|
||||
.endm /* init */
|
||||
|
||||
.macro magic_compare_and_branch w1 w2 label
|
||||
/* Macro to compare registers w1 and w2 and conditionally branch to label. */
|
||||
cmp \w1, \w2 /* Are w1 and w2 the same? */
|
||||
magic_find_zero_bytes \w1
|
||||
it eq
|
||||
cmpeq ip, #0 /* Is there a zero byte in w1? */
|
||||
bne \label
|
||||
.endm /* magic_compare_and_branch */
|
||||
|
||||
.macro magic_find_zero_bytes w1
|
||||
/* Macro to find all-zero bytes in w1, result is in ip. */
|
||||
#if (defined (__ARM_FEATURE_DSP))
|
||||
uadd8 ip, \w1, r6
|
||||
sel ip, r7, r6
|
||||
#else /* not defined (__ARM_FEATURE_DSP) */
|
||||
/* __ARM_FEATURE_DSP is not defined for some Cortex-M processors.
|
||||
Coincidently, these processors only have Thumb-2 mode, where we can use the
|
||||
the (large) magic constant available directly as an immediate in instructions.
|
||||
Note that we cannot use the magic constant in ARM mode, where we need
|
||||
to create the constant in a register. */
|
||||
sub ip, \w1, #0x01010101
|
||||
bic ip, ip, \w1
|
||||
and ip, ip, #0x80808080
|
||||
#endif /* not defined (__ARM_FEATURE_DSP) */
|
||||
.endm /* magic_find_zero_bytes */
|
||||
|
||||
.macro setup_return w1 w2
|
||||
#ifdef __ARMEB__
|
||||
mov r1, \w1
|
||||
mov r2, \w2
|
||||
#else /* not __ARMEB__ */
|
||||
rev r1, \w1
|
||||
rev r2, \w2
|
||||
#endif /* not __ARMEB__ */
|
||||
.endm /* setup_return */
|
||||
|
||||
/*
|
||||
optpld r0, #0
|
||||
optpld r1, #0
|
||||
*/
|
||||
|
||||
/* Are both strings double-word aligned? */
|
||||
orr ip, r0, r1
|
||||
tst ip, #7
|
||||
bne do_align
|
||||
|
||||
/* Fast path. */
|
||||
init
|
||||
|
||||
doubleword_aligned:
|
||||
|
||||
/* Get here when the strings to compare are double-word aligned. */
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
2:
|
||||
/*
|
||||
optpld r0, #16
|
||||
optpld r1, #16
|
||||
*/
|
||||
|
||||
/* Load the next double-word from each string. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
ldrd r4, r5, [r1], #8
|
||||
|
||||
magic_compare_and_branch w1=r2, w2=r4, label=return_24
|
||||
magic_compare_and_branch w1=r3, w2=r5, label=return_35
|
||||
b 2b
|
||||
|
||||
do_align:
|
||||
/* Is the first string word-aligned? */
|
||||
ands ip, r0, #3
|
||||
beq word_aligned_r0
|
||||
|
||||
/* Fast compare byte by byte until the first string is word-aligned. */
|
||||
/* The offset of r0 from a word boundary is in ip. Thus, the number of bytes
|
||||
to read until the next word boudnary is 4-ip. */
|
||||
bic r0, r0, #3
|
||||
ldr r2, [r0], #4
|
||||
lsls ip, ip, #31
|
||||
beq byte2
|
||||
bcs byte3
|
||||
|
||||
byte1:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE1_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte2:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE2_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte3:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE3_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbnz reg=r3, label=word_aligned_r0
|
||||
|
||||
fast_return:
|
||||
mov r0, ip
|
||||
bx lr
|
||||
|
||||
word_aligned_r0:
|
||||
init
|
||||
/* The first string is word-aligned. */
|
||||
/* Is the second string word-aligned? */
|
||||
ands ip, r1, #3
|
||||
bne strcmp_unaligned
|
||||
|
||||
word_aligned:
|
||||
/* The strings are word-aligned. */
|
||||
/* Is the first string double-word aligned? */
|
||||
tst r0, #4
|
||||
beq doubleword_aligned_r0
|
||||
|
||||
/* If r0 is not double-word aligned yet, align it by loading
|
||||
and comparing the next word from each string. */
|
||||
ldr r2, [r0], #4
|
||||
ldr r4, [r1], #4
|
||||
magic_compare_and_branch w1=r2 w2=r4 label=return_24
|
||||
|
||||
doubleword_aligned_r0:
|
||||
/* Get here when r0 is double-word aligned. */
|
||||
/* Is r1 doubleword_aligned? */
|
||||
tst r1, #4
|
||||
beq doubleword_aligned
|
||||
|
||||
/* Get here when the strings to compare are word-aligned,
|
||||
r0 is double-word aligned, but r1 is not double-word aligned. */
|
||||
|
||||
/* Initialize the queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
3:
|
||||
/*
|
||||
optpld r0, #16
|
||||
optpld r1, #16
|
||||
*/
|
||||
|
||||
/* Load the next double-word from each string and compare. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
magic_compare_and_branch w1=r2 w2=r5 label=return_25
|
||||
ldrd r4, r5, [r1], #8
|
||||
magic_compare_and_branch w1=r3 w2=r4 label=return_34
|
||||
b 3b
|
||||
|
||||
.macro miscmp_word offsetlo offsethi
|
||||
/* Macro to compare misaligned strings. */
|
||||
/* r0, r1 are word-aligned, and at least one of the strings
|
||||
is not double-word aligned. */
|
||||
/* Compare one word in every loop iteration. */
|
||||
/* OFFSETLO is the original bit-offset of r1 from a word-boundary,
|
||||
OFFSETHI is 32 - OFFSETLO (i.e., offset from the next word). */
|
||||
|
||||
/* Initialize the shift queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare one word from each string in every loop iteration. */
|
||||
.p2align 2
|
||||
7:
|
||||
ldr r3, [r0], #4
|
||||
S2LOMEM r5, r5, #\offsetlo
|
||||
magic_find_zero_bytes w1=r3
|
||||
cmp r7, ip, S2HIMEM #\offsetlo
|
||||
and r2, r3, r6, S2LOMEM #\offsetlo
|
||||
it eq
|
||||
cmpeq r2, r5
|
||||
bne return_25
|
||||
ldr r5, [r1], #4
|
||||
cmp ip, #0
|
||||
eor r3, r2, r3
|
||||
S2HIMEM r2, r5, #\offsethi
|
||||
it eq
|
||||
cmpeq r3, r2
|
||||
bne return_32
|
||||
b 7b
|
||||
.endm /* miscmp_word */
|
||||
|
||||
strcmp_unaligned:
|
||||
/* r0 is word-aligned, r1 is at offset ip from a word. */
|
||||
/* Align r1 to the (previous) word-boundary. */
|
||||
bic r1, r1, #3
|
||||
|
||||
/* Unaligned comparison word by word using LDRs. */
|
||||
cmp ip, #2
|
||||
beq miscmp_word_16 /* If ip == 2. */
|
||||
bge miscmp_word_24 /* If ip == 3. */
|
||||
miscmp_word offsetlo=8 offsethi=24 /* If ip == 1. */
|
||||
miscmp_word_16: miscmp_word offsetlo=16 offsethi=16
|
||||
miscmp_word_24: miscmp_word offsetlo=24 offsethi=8
|
||||
|
||||
|
||||
return_32:
|
||||
setup_return w1=r3, w2=r2
|
||||
b do_return
|
||||
return_34:
|
||||
setup_return w1=r3, w2=r4
|
||||
b do_return
|
||||
return_25:
|
||||
setup_return w1=r2, w2=r5
|
||||
b do_return
|
||||
return_35:
|
||||
setup_return w1=r3, w2=r5
|
||||
b do_return
|
||||
return_24:
|
||||
setup_return w1=r2, w2=r4
|
||||
|
||||
do_return:
|
||||
|
||||
#ifdef __ARMEB__
|
||||
mov r0, ip
|
||||
#else /* not __ARMEB__ */
|
||||
rev r0, ip
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
/* Restore temporaries early, before computing the return value. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
/* There is a zero or a different byte between r1 and r2. */
|
||||
/* r0 contains a mask of all-zero bytes in r1. */
|
||||
/* Using r0 and not ip here because cbz requires low register. */
|
||||
m_cbz reg=r0, label=compute_return_value
|
||||
clz r0, r0
|
||||
/* r0 contains the number of bits on the left of the first all-zero byte in r1. */
|
||||
rsb r0, r0, #24
|
||||
/* Here, r0 contains the number of bits on the right of the first all-zero byte in r1. */
|
||||
lsr r1, r1, r0
|
||||
lsr r2, r2, r0
|
||||
|
||||
compute_return_value:
|
||||
movs r0, #1
|
||||
cmp r1, r2
|
||||
/* The return value is computed as follows.
|
||||
If r1>r2 then (C==1 and Z==0) and LS doesn't hold and r0 is #1 at return.
|
||||
If r1<r2 then (C==0 and Z==0) and we execute SBC with carry_in=0,
|
||||
which means r0:=r0-r0-1 and r0 is #-1 at return.
|
||||
If r1=r2 then (C==1 and Z==1) and we execute SBC with carry_in=1,
|
||||
which means r0:=r0-r0 and r0 is #0 at return.
|
||||
(C==0 and Z==1) cannot happen because the carry bit is "not borrow". */
|
||||
it ls
|
||||
sbcls r0, r0, r0
|
||||
bx lr
|
||||
|
||||
|
||||
#else /* !(defined (_ISA_THUMB_2) || defined (_ISA_ARM_6)
|
||||
defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) ||
|
||||
(defined (__thumb__) && !defined (__thumb2__))) */
|
||||
|
||||
/* Use LDR whenever possible. */
|
||||
|
||||
#ifdef __thumb2__
|
||||
#define magic1(REG) 0x01010101
|
||||
#define magic2(REG) 0x80808080
|
||||
#else
|
||||
#define magic1(REG) REG
|
||||
#define magic2(REG) REG, lsl #7
|
||||
#endif
|
||||
|
||||
optpld r0
|
||||
optpld r1
|
||||
eor r2, r0, r1
|
||||
tst r2, #3
|
||||
/* Strings not at same byte offset from a word boundary. */
|
||||
bne strcmp_unaligned
|
||||
ands r2, r0, #3
|
||||
bic r0, r0, #3
|
||||
bic r1, r1, #3
|
||||
ldr ip, [r0], #4
|
||||
it eq
|
||||
ldreq r3, [r1], #4
|
||||
beq 1f
|
||||
/* Although s1 and s2 have identical initial alignment, they are
|
||||
not currently word aligned. Rather than comparing bytes,
|
||||
make sure that any bytes fetched from before the addressed
|
||||
bytes are forced to 0xff. Then they will always compare
|
||||
equal. */
|
||||
eor r2, r2, #3
|
||||
lsl r2, r2, #3
|
||||
mvn r3, MSB
|
||||
S2LOMEM r2, r3, r2
|
||||
ldr r3, [r1], #4
|
||||
orr ip, ip, r2
|
||||
orr r3, r3, r2
|
||||
1:
|
||||
#ifndef __thumb2__
|
||||
/* Load the 'magic' constant 0x01010101. */
|
||||
str r4, [sp, #-4]!
|
||||
mov r4, #1
|
||||
orr r4, r4, r4, lsl #8
|
||||
orr r4, r4, r4, lsl #16
|
||||
#endif
|
||||
.p2align 2
|
||||
4:
|
||||
optpld r0, #8
|
||||
optpld r1, #8
|
||||
sub r2, ip, magic1(r4)
|
||||
cmp ip, r3
|
||||
itttt eq
|
||||
/* check for any zero bytes in first word */
|
||||
biceq r2, r2, ip
|
||||
tsteq r2, magic2(r4)
|
||||
ldreq ip, [r0], #4
|
||||
ldreq r3, [r1], #4
|
||||
beq 4b
|
||||
2:
|
||||
/* There's a zero or a different byte in the word */
|
||||
S2HIMEM r0, ip, #24
|
||||
S2LOMEM ip, ip, #8
|
||||
cmp r0, #1
|
||||
it cs
|
||||
cmpcs r0, r3, S2HIMEM #24
|
||||
it eq
|
||||
S2LOMEMEQ r3, r3, #8
|
||||
beq 2b
|
||||
/* On a big-endian machine, r0 contains the desired byte in bits
|
||||
0-7; on a little-endian machine they are in bits 24-31. In
|
||||
both cases the other bits in r0 are all zero. For r3 the
|
||||
interesting byte is at the other end of the word, but the
|
||||
other bits are not necessarily zero. We need a signed result
|
||||
representing the differnece in the unsigned bytes, so for the
|
||||
little-endian case we can't just shift the interesting bits
|
||||
up. */
|
||||
#ifdef __ARMEB__
|
||||
sub r0, r0, r3, lsr #24
|
||||
#else
|
||||
and r3, r3, #255
|
||||
#ifdef __thumb2__
|
||||
/* No RSB instruction in Thumb2 */
|
||||
lsr r0, r0, #24
|
||||
sub r0, r0, r3
|
||||
#else
|
||||
rsb r0, r3, r0, lsr #24
|
||||
#endif
|
||||
#endif
|
||||
#ifndef __thumb2__
|
||||
ldr r4, [sp], #4
|
||||
#endif
|
||||
RETURN
|
||||
|
||||
|
||||
strcmp_unaligned:
|
||||
|
||||
#if 0
|
||||
/* The assembly code below is based on the following alogrithm. */
|
||||
#ifdef __ARMEB__
|
||||
#define RSHIFT <<
|
||||
#define LSHIFT >>
|
||||
#else
|
||||
#define RSHIFT >>
|
||||
#define LSHIFT <<
|
||||
#endif
|
||||
|
||||
#define body(shift) \
|
||||
mask = 0xffffffffU RSHIFT shift; \
|
||||
w1 = *wp1++; \
|
||||
w2 = *wp2++; \
|
||||
do \
|
||||
{ \
|
||||
t1 = w1 & mask; \
|
||||
if (__builtin_expect(t1 != w2 RSHIFT shift, 0)) \
|
||||
{ \
|
||||
w2 RSHIFT= shift; \
|
||||
break; \
|
||||
} \
|
||||
if (__builtin_expect(((w1 - b1) & ~w1) & (b1 << 7), 0)) \
|
||||
{ \
|
||||
/* See comment in assembler below re syndrome on big-endian */\
|
||||
if ((((w1 - b1) & ~w1) & (b1 << 7)) & mask) \
|
||||
w2 RSHIFT= shift; \
|
||||
else \
|
||||
{ \
|
||||
w2 = *wp2; \
|
||||
t1 = w1 RSHIFT (32 - shift); \
|
||||
w2 = (w2 LSHIFT (32 - shift)) RSHIFT (32 - shift); \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
w2 = *wp2++; \
|
||||
t1 ^= w1; \
|
||||
if (__builtin_expect(t1 != w2 LSHIFT (32 - shift), 0)) \
|
||||
{ \
|
||||
t1 = w1 >> (32 - shift); \
|
||||
w2 = (w2 << (32 - shift)) RSHIFT (32 - shift); \
|
||||
break; \
|
||||
} \
|
||||
w1 = *wp1++; \
|
||||
} while (1)
|
||||
|
||||
const unsigned* wp1;
|
||||
const unsigned* wp2;
|
||||
unsigned w1, w2;
|
||||
unsigned mask;
|
||||
unsigned shift;
|
||||
unsigned b1 = 0x01010101;
|
||||
char c1, c2;
|
||||
unsigned t1;
|
||||
|
||||
while (((unsigned) s1) & 3)
|
||||
{
|
||||
c1 = *s1++;
|
||||
c2 = *s2++;
|
||||
if (c1 == 0 || c1 != c2)
|
||||
return c1 - (int)c2;
|
||||
}
|
||||
wp1 = (unsigned*) (((unsigned)s1) & ~3);
|
||||
wp2 = (unsigned*) (((unsigned)s2) & ~3);
|
||||
t1 = ((unsigned) s2) & 3;
|
||||
if (t1 == 1)
|
||||
{
|
||||
body(8);
|
||||
}
|
||||
else if (t1 == 2)
|
||||
{
|
||||
body(16);
|
||||
}
|
||||
else
|
||||
{
|
||||
body (24);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
#ifdef __ARMEB__
|
||||
c1 = (char) t1 >> 24;
|
||||
c2 = (char) w2 >> 24;
|
||||
#else /* not __ARMEB__ */
|
||||
c1 = (char) t1;
|
||||
c2 = (char) w2;
|
||||
#endif /* not __ARMEB__ */
|
||||
t1 RSHIFT= 8;
|
||||
w2 RSHIFT= 8;
|
||||
} while (c1 != 0 && c1 == c2);
|
||||
return c1 - c2;
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
wp1 .req r0
|
||||
wp2 .req r1
|
||||
b1 .req r2
|
||||
w1 .req r4
|
||||
w2 .req r5
|
||||
t1 .req ip
|
||||
@ r3 is scratch
|
||||
|
||||
/* First of all, compare bytes until wp1(sp1) is word-aligned. */
|
||||
1:
|
||||
tst wp1, #3
|
||||
beq 2f
|
||||
ldrb r2, [wp1], #1
|
||||
ldrb r3, [wp2], #1
|
||||
cmp r2, #1
|
||||
it cs
|
||||
cmpcs r2, r3
|
||||
beq 1b
|
||||
sub r0, r2, r3
|
||||
RETURN
|
||||
|
||||
2:
|
||||
str r5, [sp, #-4]!
|
||||
str r4, [sp, #-4]!
|
||||
//stmfd sp!, {r4, r5}
|
||||
mov b1, #1
|
||||
orr b1, b1, b1, lsl #8
|
||||
orr b1, b1, b1, lsl #16
|
||||
|
||||
and t1, wp2, #3
|
||||
bic wp2, wp2, #3
|
||||
ldr w1, [wp1], #4
|
||||
ldr w2, [wp2], #4
|
||||
cmp t1, #2
|
||||
beq 2f
|
||||
bhi 3f
|
||||
|
||||
/* Critical inner Loop: Block with 3 bytes initial overlap */
|
||||
.p2align 2
|
||||
1:
|
||||
bic t1, w1, MSB
|
||||
cmp t1, w2, S2LOMEM #8
|
||||
sub r3, w1, b1
|
||||
bic r3, r3, w1
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, S2HIMEM #24
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 1b
|
||||
4:
|
||||
S2LOMEM w2, w2, #8
|
||||
b 8f
|
||||
|
||||
5:
|
||||
#ifdef __ARMEB__
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
with the bytes 0x01 0x00 */
|
||||
tst w1, #0xff000000
|
||||
itt ne
|
||||
tstne w1, #0x00ff0000
|
||||
tstne w1, #0x0000ff00
|
||||
beq 7f
|
||||
#else
|
||||
bics r3, r3, #0xff000000
|
||||
bne 7f
|
||||
#endif
|
||||
ldrb w2, [wp2]
|
||||
S2LOMEM t1, w1, #24
|
||||
#ifdef __ARMEB__
|
||||
lsl w2, w2, #24
|
||||
#endif
|
||||
b 8f
|
||||
|
||||
6:
|
||||
S2LOMEM t1, w1, #24
|
||||
and w2, w2, LSB
|
||||
b 8f
|
||||
|
||||
/* Critical inner Loop: Block with 2 bytes initial overlap */
|
||||
.p2align 2
|
||||
2:
|
||||
S2HIMEM t1, w1, #16
|
||||
sub r3, w1, b1
|
||||
S2LOMEM t1, t1, #16
|
||||
bic r3, r3, w1
|
||||
cmp t1, w2, S2LOMEM #16
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, S2HIMEM #16
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 2b
|
||||
|
||||
5:
|
||||
#ifdef __ARMEB__
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
with the bytes 0x01 0x00 */
|
||||
tst w1, #0xff000000
|
||||
it ne
|
||||
tstne w1, #0x00ff0000
|
||||
beq 7f
|
||||
#else
|
||||
lsls r3, r3, #16
|
||||
bne 7f
|
||||
#endif
|
||||
ldrh w2, [wp2]
|
||||
S2LOMEM t1, w1, #16
|
||||
#ifdef __ARMEB__
|
||||
lsl w2, w2, #16
|
||||
#endif
|
||||
b 8f
|
||||
|
||||
6:
|
||||
S2HIMEM w2, w2, #16
|
||||
S2LOMEM t1, w1, #16
|
||||
4:
|
||||
S2LOMEM w2, w2, #16
|
||||
b 8f
|
||||
|
||||
/* Critical inner Loop: Block with 1 byte initial overlap */
|
||||
.p2align 2
|
||||
3:
|
||||
and t1, w1, LSB
|
||||
cmp t1, w2, S2LOMEM #24
|
||||
sub r3, w1, b1
|
||||
bic r3, r3, w1
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, S2HIMEM #8
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 3b
|
||||
4:
|
||||
S2LOMEM w2, w2, #24
|
||||
b 8f
|
||||
5:
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
with the bytes 0x01 0x00 */
|
||||
tst w1, LSB
|
||||
beq 7f
|
||||
ldr w2, [wp2], #4
|
||||
6:
|
||||
S2LOMEM t1, w1, #8
|
||||
bic w2, w2, MSB
|
||||
b 8f
|
||||
7:
|
||||
mov r0, #0
|
||||
//ldmfd sp!, {r4, r5}
|
||||
ldr r4, [sp], #4
|
||||
ldr r5, [sp], #4
|
||||
RETURN
|
||||
8:
|
||||
and r2, t1, LSB
|
||||
and r0, w2, LSB
|
||||
cmp r0, #1
|
||||
it cs
|
||||
cmpcs r0, r2
|
||||
itt eq
|
||||
S2LOMEMEQ t1, t1, #8
|
||||
S2LOMEMEQ w2, w2, #8
|
||||
beq 8b
|
||||
sub r0, r2, r0
|
||||
//ldmfd sp!, {r4, r5}
|
||||
ldr r4, [sp], #4
|
||||
ldr r5, [sp], #4
|
||||
RETURN
|
||||
|
||||
#endif /* !(defined (_ISA_THUMB_2) || defined (_ISA_ARM_6)
|
||||
defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) ||
|
||||
(defined (__thumb__) && !defined (__thumb2__))) */
|
@@ -26,8 +26,8 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(syscall)
|
||||
mov ip, sp
|
||||
@@ -39,7 +39,8 @@ ENTRY(syscall)
|
||||
ldmfd ip, {r3, r4, r5, r6}
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(syscall)
|
||||
|
@@ -25,6 +25,11 @@
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* unlike our auto-generated syscall stubs, this code saves lr
|
||||
on the stack, as well as a few other registers. this makes
|
||||
our stack unwinder happy, when we generate debug stack
|
||||
@@ -33,19 +38,13 @@
|
||||
of a corrupted malloc heap).
|
||||
*/
|
||||
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#ifndef __NR_tgkill
|
||||
#define __NR_tgkill 268
|
||||
#endif
|
||||
|
||||
ENTRY(tgkill)
|
||||
stmfd sp!, {r4-r7, ip, lr}
|
||||
ldr r7, =__NR_tgkill
|
||||
swi #0
|
||||
ldmfd sp!, {r4-r7, ip, lr}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(tgkill)
|
||||
|
@@ -25,6 +25,11 @@
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/* unlike our auto-generated syscall stubs, this code saves lr
|
||||
on the stack, as well as a few other registers. this makes
|
||||
our stack unwinder happy, when we generate debug stack
|
||||
@@ -33,19 +38,13 @@
|
||||
of a corrupted malloc heap).
|
||||
*/
|
||||
|
||||
#include <sys/linux-syscalls.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#ifndef __NR_tkill
|
||||
#define __NR_tkill 238
|
||||
#endif
|
||||
|
||||
ENTRY(tkill)
|
||||
stmfd sp!, {r4-r7, ip, lr}
|
||||
ldr r7, =__NR_tkill
|
||||
swi #0
|
||||
ldmfd sp!, {r4-r7, ip, lr}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(tkill)
|
||||
|
146
libc/arch-arm/cortex-a15/bionic/memcpy.S
Normal file
146
libc/arch-arm/cortex-a15/bionic/memcpy.S
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Assumes neon instructions and a cache line size of 64 bytes. */
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* This code assumes it is running on a processor that supports all arm v7
|
||||
* instructions, that supports neon instructions, and that has a 64 byte
|
||||
* cache line.
|
||||
*/
|
||||
|
||||
.text
|
||||
.fpu neon
|
||||
|
||||
#define CACHE_LINE_SIZE 64
|
||||
|
||||
ENTRY(memcpy)
|
||||
.save {r0, lr}
|
||||
/* start preloading as early as possible */
|
||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
||||
stmfd sp!, {r0, lr}
|
||||
pld [r1, #(CACHE_LINE_SIZE*1)]
|
||||
|
||||
/* do we have at least 16-bytes to copy (needed for alignment below) */
|
||||
cmp r2, #16
|
||||
blo 5f
|
||||
|
||||
/* align destination to cache-line for the write-buffer */
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0xF
|
||||
beq 0f
|
||||
|
||||
/* copy up to 15-bytes (count in r3) */
|
||||
sub r2, r2, r3
|
||||
movs ip, r3, lsl #31
|
||||
ldrmib lr, [r1], #1
|
||||
strmib lr, [r0], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
movs ip, r3, lsl #29
|
||||
bge 1f
|
||||
// copies 4 bytes, destination 32-bits aligned
|
||||
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
|
||||
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]!
|
||||
1: bcc 2f
|
||||
// copies 8 bytes, destination 64-bits aligned
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0, :64]!
|
||||
2:
|
||||
|
||||
0: /* preload immediately the next cache line, which we may need */
|
||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*1)]
|
||||
|
||||
/* make sure we have at least 64 bytes to copy */
|
||||
subs r2, r2, #64
|
||||
blo 2f
|
||||
|
||||
/* Preload all the cache lines we need.
|
||||
* NOTE: The number of pld below depends on CACHE_LINE_SIZE,
|
||||
* ideally we would increase the distance in the main loop to
|
||||
* avoid the goofy code below. In practice this doesn't seem to make
|
||||
* a big difference.
|
||||
* NOTE: The value CACHE_LINE_SIZE * 4 was chosen through
|
||||
* experimentation.
|
||||
*/
|
||||
pld [r1, #(CACHE_LINE_SIZE*2)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*3)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*4)]
|
||||
|
||||
1: /* The main loop copies 64 bytes at a time */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
vld1.8 {d4 - d7}, [r1]!
|
||||
pld [r1, #(CACHE_LINE_SIZE*4)]
|
||||
subs r2, r2, #64
|
||||
vst1.8 {d0 - d3}, [r0, :128]!
|
||||
vst1.8 {d4 - d7}, [r0, :128]!
|
||||
bhs 1b
|
||||
|
||||
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
|
||||
add r2, r2, #64
|
||||
subs r2, r2, #32
|
||||
blo 4f
|
||||
|
||||
3: /* 32 bytes at a time. These cache lines were already preloaded */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
subs r2, r2, #32
|
||||
vst1.8 {d0 - d3}, [r0, :128]!
|
||||
bhs 3b
|
||||
4: /* less than 32 left */
|
||||
add r2, r2, #32
|
||||
tst r2, #0x10
|
||||
beq 5f
|
||||
// copies 16 bytes, 128-bits aligned
|
||||
vld1.8 {d0, d1}, [r1]!
|
||||
vst1.8 {d0, d1}, [r0, :128]!
|
||||
|
||||
5: /* copy up to 15-bytes (count in r2) */
|
||||
movs ip, r2, lsl #29
|
||||
bcc 1f
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0]!
|
||||
1: bge 2f
|
||||
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
|
||||
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]!
|
||||
2: movs ip, r2, lsl #31
|
||||
ldrmib r3, [r1], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strmib r3, [r0], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
|
||||
ldmfd sp!, {r0, lr}
|
||||
bx lr
|
||||
END(memcpy)
|
106
libc/arch-arm/cortex-a15/bionic/memset.S
Normal file
106
libc/arch-arm/cortex-a15/bionic/memset.S
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* Optimized memset() for ARM.
|
||||
*
|
||||
* memset() returns its first argument.
|
||||
*/
|
||||
|
||||
.fpu neon
|
||||
|
||||
ENTRY(bzero)
|
||||
mov r2, r1
|
||||
mov r1, #0
|
||||
// Fall through to memset...
|
||||
END(bzero)
|
||||
|
||||
ENTRY(memset)
|
||||
.save {r0}
|
||||
stmfd sp!, {r0}
|
||||
|
||||
vdup.8 q0, r1
|
||||
|
||||
/* do we have at least 16-bytes to write (needed for alignment below) */
|
||||
cmp r2, #16
|
||||
blo 3f
|
||||
|
||||
/* align destination to 16 bytes for the write-buffer */
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0xF
|
||||
beq 2f
|
||||
|
||||
/* write up to 15-bytes (count in r3) */
|
||||
sub r2, r2, r3
|
||||
movs ip, r3, lsl #31
|
||||
strmib r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
movs ip, r3, lsl #29
|
||||
bge 1f
|
||||
|
||||
// writes 4 bytes, 32-bits aligned
|
||||
vst1.32 {d0[0]}, [r0, :32]!
|
||||
1: bcc 2f
|
||||
|
||||
// writes 8 bytes, 64-bits aligned
|
||||
vst1.8 {d0}, [r0, :64]!
|
||||
2:
|
||||
/* make sure we have at least 32 bytes to write */
|
||||
subs r2, r2, #32
|
||||
blo 2f
|
||||
vmov q1, q0
|
||||
|
||||
1: /* The main loop writes 32 bytes at a time */
|
||||
subs r2, r2, #32
|
||||
vst1.8 {d0 - d3}, [r0, :128]!
|
||||
bhs 1b
|
||||
|
||||
2: /* less than 32 left */
|
||||
add r2, r2, #32
|
||||
tst r2, #0x10
|
||||
beq 3f
|
||||
|
||||
// writes 16 bytes, 128-bits aligned
|
||||
vst1.8 {d0, d1}, [r0, :128]!
|
||||
3: /* write up to 15-bytes (count in r2) */
|
||||
movs ip, r2, lsl #29
|
||||
bcc 1f
|
||||
vst1.8 {d0}, [r0]!
|
||||
1: bge 2f
|
||||
vst1.32 {d0[0]}, [r0]!
|
||||
2: movs ip, r2, lsl #31
|
||||
strmib r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
ldmfd sp!, {r0}
|
||||
bx lr
|
||||
END(memset)
|
377
libc/arch-arm/cortex-a15/bionic/strcmp.S
Normal file
377
libc/arch-arm/cortex-a15/bionic/strcmp.S
Normal file
@@ -0,0 +1,377 @@
|
||||
/*
|
||||
* Copyright (c) 2013 ARM Ltd
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the company may not be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#ifdef __ARMEB__
|
||||
#define S2LOMEM lsl
|
||||
#define S2LOMEMEQ lsleq
|
||||
#define S2HIMEM lsr
|
||||
#define MSB 0x000000ff
|
||||
#define LSB 0xff000000
|
||||
#define BYTE0_OFFSET 24
|
||||
#define BYTE1_OFFSET 16
|
||||
#define BYTE2_OFFSET 8
|
||||
#define BYTE3_OFFSET 0
|
||||
#else /* not __ARMEB__ */
|
||||
#define S2LOMEM lsr
|
||||
#define S2LOMEMEQ lsreq
|
||||
#define S2HIMEM lsl
|
||||
#define BYTE0_OFFSET 0
|
||||
#define BYTE1_OFFSET 8
|
||||
#define BYTE2_OFFSET 16
|
||||
#define BYTE3_OFFSET 24
|
||||
#define MSB 0xff000000
|
||||
#define LSB 0x000000ff
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
.syntax unified
|
||||
|
||||
#if defined (__thumb__)
|
||||
.thumb
|
||||
.thumb_func
|
||||
#endif
|
||||
|
||||
ENTRY(strcmp)
|
||||
/* Use LDRD whenever possible. */
|
||||
|
||||
/* The main thing to look out for when comparing large blocks is that
|
||||
the loads do not cross a page boundary when loading past the index
|
||||
of the byte with the first difference or the first string-terminator.
|
||||
|
||||
For example, if the strings are identical and the string-terminator
|
||||
is at index k, byte by byte comparison will not load beyond address
|
||||
s1+k and s2+k; word by word comparison may load up to 3 bytes beyond
|
||||
k; double word - up to 7 bytes. If the load of these bytes crosses
|
||||
a page boundary, it might cause a memory fault (if the page is not mapped)
|
||||
that would not have happened in byte by byte comparison.
|
||||
|
||||
If an address is (double) word aligned, then a load of a (double) word
|
||||
from that address will not cross a page boundary.
|
||||
Therefore, the algorithm below considers word and double-word alignment
|
||||
of strings separately. */
|
||||
|
||||
/* High-level description of the algorithm.
|
||||
|
||||
* The fast path: if both strings are double-word aligned,
|
||||
use LDRD to load two words from each string in every loop iteration.
|
||||
* If the strings have the same offset from a word boundary,
|
||||
use LDRB to load and compare byte by byte until
|
||||
the first string is aligned to a word boundary (at most 3 bytes).
|
||||
This is optimized for quick return on short unaligned strings.
|
||||
* If the strings have the same offset from a double-word boundary,
|
||||
use LDRD to load two words from each string in every loop iteration, as in the fast path.
|
||||
* If the strings do not have the same offset from a double-word boundary,
|
||||
load a word from the second string before the loop to initialize the queue.
|
||||
Use LDRD to load two words from every string in every loop iteration.
|
||||
Inside the loop, load the second word from the second string only after comparing
|
||||
the first word, using the queued value, to guarantee safety across page boundaries.
|
||||
* If the strings do not have the same offset from a word boundary,
|
||||
use LDR and a shift queue. Order of loads and comparisons matters,
|
||||
similarly to the previous case.
|
||||
|
||||
* Use UADD8 and SEL to compare words, and use REV and CLZ to compute the return value.
|
||||
* The only difference between ARM and Thumb modes is the use of CBZ instruction.
|
||||
* The only difference between big and little endian is the use of REV in little endian
|
||||
to compute the return value, instead of MOV.
|
||||
*/
|
||||
|
||||
.macro m_cbz reg label
|
||||
#ifdef __thumb2__
|
||||
cbz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
beq \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbz */
|
||||
|
||||
.macro m_cbnz reg label
|
||||
#ifdef __thumb2__
|
||||
cbnz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
bne \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbnz */
|
||||
|
||||
.macro init
|
||||
/* Macro to save temporary registers and prepare magic values. */
|
||||
subs sp, sp, #16
|
||||
strd r4, r5, [sp, #8]
|
||||
strd r6, r7, [sp]
|
||||
mvn r6, #0 /* all F */
|
||||
mov r7, #0 /* all 0 */
|
||||
.endm /* init */
|
||||
|
||||
.macro magic_compare_and_branch w1 w2 label
|
||||
/* Macro to compare registers w1 and w2 and conditionally branch to label. */
|
||||
cmp \w1, \w2 /* Are w1 and w2 the same? */
|
||||
magic_find_zero_bytes \w1
|
||||
it eq
|
||||
cmpeq ip, #0 /* Is there a zero byte in w1? */
|
||||
bne \label
|
||||
.endm /* magic_compare_and_branch */
|
||||
|
||||
.macro magic_find_zero_bytes w1
|
||||
/* Macro to find all-zero bytes in w1, result is in ip. */
|
||||
#if (defined (__ARM_FEATURE_DSP))
|
||||
uadd8 ip, \w1, r6
|
||||
sel ip, r7, r6
|
||||
#else /* not defined (__ARM_FEATURE_DSP) */
|
||||
/* __ARM_FEATURE_DSP is not defined for some Cortex-M processors.
|
||||
Coincidently, these processors only have Thumb-2 mode, where we can use the
|
||||
the (large) magic constant available directly as an immediate in instructions.
|
||||
Note that we cannot use the magic constant in ARM mode, where we need
|
||||
to create the constant in a register. */
|
||||
sub ip, \w1, #0x01010101
|
||||
bic ip, ip, \w1
|
||||
and ip, ip, #0x80808080
|
||||
#endif /* not defined (__ARM_FEATURE_DSP) */
|
||||
.endm /* magic_find_zero_bytes */
|
||||
|
||||
.macro setup_return w1 w2
|
||||
#ifdef __ARMEB__
|
||||
mov r1, \w1
|
||||
mov r2, \w2
|
||||
#else /* not __ARMEB__ */
|
||||
rev r1, \w1
|
||||
rev r2, \w2
|
||||
#endif /* not __ARMEB__ */
|
||||
.endm /* setup_return */
|
||||
|
||||
pld [r0, #0]
|
||||
pld [r1, #0]
|
||||
|
||||
/* Are both strings double-word aligned? */
|
||||
orr ip, r0, r1
|
||||
tst ip, #7
|
||||
bne do_align
|
||||
|
||||
/* Fast path. */
|
||||
init
|
||||
|
||||
doubleword_aligned:
|
||||
|
||||
/* Get here when the strings to compare are double-word aligned. */
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
2:
|
||||
pld [r0, #16]
|
||||
pld [r1, #16]
|
||||
|
||||
/* Load the next double-word from each string. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
ldrd r4, r5, [r1], #8
|
||||
|
||||
magic_compare_and_branch w1=r2, w2=r4, label=return_24
|
||||
magic_compare_and_branch w1=r3, w2=r5, label=return_35
|
||||
b 2b
|
||||
|
||||
do_align:
|
||||
/* Is the first string word-aligned? */
|
||||
ands ip, r0, #3
|
||||
beq word_aligned_r0
|
||||
|
||||
/* Fast compare byte by byte until the first string is word-aligned. */
|
||||
/* The offset of r0 from a word boundary is in ip. Thus, the number of bytes
|
||||
to read until the next word boundary is 4-ip. */
|
||||
bic r0, r0, #3
|
||||
ldr r2, [r0], #4
|
||||
lsls ip, ip, #31
|
||||
beq byte2
|
||||
bcs byte3
|
||||
|
||||
byte1:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE1_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte2:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE2_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte3:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE3_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbnz reg=r3, label=word_aligned_r0
|
||||
|
||||
fast_return:
|
||||
mov r0, ip
|
||||
bx lr
|
||||
|
||||
word_aligned_r0:
|
||||
init
|
||||
/* The first string is word-aligned. */
|
||||
/* Is the second string word-aligned? */
|
||||
ands ip, r1, #3
|
||||
bne strcmp_unaligned
|
||||
|
||||
word_aligned:
|
||||
/* The strings are word-aligned. */
|
||||
/* Is the first string double-word aligned? */
|
||||
tst r0, #4
|
||||
beq doubleword_aligned_r0
|
||||
|
||||
/* If r0 is not double-word aligned yet, align it by loading
|
||||
and comparing the next word from each string. */
|
||||
ldr r2, [r0], #4
|
||||
ldr r4, [r1], #4
|
||||
magic_compare_and_branch w1=r2 w2=r4 label=return_24
|
||||
|
||||
doubleword_aligned_r0:
|
||||
/* Get here when r0 is double-word aligned. */
|
||||
/* Is r1 doubleword_aligned? */
|
||||
tst r1, #4
|
||||
beq doubleword_aligned
|
||||
|
||||
/* Get here when the strings to compare are word-aligned,
|
||||
r0 is double-word aligned, but r1 is not double-word aligned. */
|
||||
|
||||
/* Initialize the queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
3:
|
||||
pld [r0, #16]
|
||||
pld [r1, #16]
|
||||
|
||||
/* Load the next double-word from each string and compare. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
magic_compare_and_branch w1=r2 w2=r5 label=return_25
|
||||
ldrd r4, r5, [r1], #8
|
||||
magic_compare_and_branch w1=r3 w2=r4 label=return_34
|
||||
b 3b
|
||||
|
||||
.macro miscmp_word offsetlo offsethi
|
||||
/* Macro to compare misaligned strings. */
|
||||
/* r0, r1 are word-aligned, and at least one of the strings
|
||||
is not double-word aligned. */
|
||||
/* Compare one word in every loop iteration. */
|
||||
/* OFFSETLO is the original bit-offset of r1 from a word-boundary,
|
||||
OFFSETHI is 32 - OFFSETLO (i.e., offset from the next word). */
|
||||
|
||||
/* Initialize the shift queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare one word from each string in every loop iteration. */
|
||||
.p2align 2
|
||||
7:
|
||||
ldr r3, [r0], #4
|
||||
S2LOMEM r5, r5, #\offsetlo
|
||||
magic_find_zero_bytes w1=r3
|
||||
cmp r7, ip, S2HIMEM #\offsetlo
|
||||
and r2, r3, r6, S2LOMEM #\offsetlo
|
||||
it eq
|
||||
cmpeq r2, r5
|
||||
bne return_25
|
||||
ldr r5, [r1], #4
|
||||
cmp ip, #0
|
||||
eor r3, r2, r3
|
||||
S2HIMEM r2, r5, #\offsethi
|
||||
it eq
|
||||
cmpeq r3, r2
|
||||
bne return_32
|
||||
b 7b
|
||||
.endm /* miscmp_word */
|
||||
|
||||
strcmp_unaligned:
|
||||
/* r0 is word-aligned, r1 is at offset ip from a word. */
|
||||
/* Align r1 to the (previous) word-boundary. */
|
||||
bic r1, r1, #3
|
||||
|
||||
/* Unaligned comparison word by word using LDRs. */
|
||||
cmp ip, #2
|
||||
beq miscmp_word_16 /* If ip == 2. */
|
||||
bge miscmp_word_24 /* If ip == 3. */
|
||||
miscmp_word offsetlo=8 offsethi=24 /* If ip == 1. */
|
||||
miscmp_word_16: miscmp_word offsetlo=16 offsethi=16
|
||||
miscmp_word_24: miscmp_word offsetlo=24 offsethi=8
|
||||
|
||||
|
||||
return_32:
|
||||
setup_return w1=r3, w2=r2
|
||||
b do_return
|
||||
return_34:
|
||||
setup_return w1=r3, w2=r4
|
||||
b do_return
|
||||
return_25:
|
||||
setup_return w1=r2, w2=r5
|
||||
b do_return
|
||||
return_35:
|
||||
setup_return w1=r3, w2=r5
|
||||
b do_return
|
||||
return_24:
|
||||
setup_return w1=r2, w2=r4
|
||||
|
||||
do_return:
|
||||
|
||||
#ifdef __ARMEB__
|
||||
mov r0, ip
|
||||
#else /* not __ARMEB__ */
|
||||
rev r0, ip
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
/* Restore temporaries early, before computing the return value. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
/* There is a zero or a different byte between r1 and r2. */
|
||||
/* r0 contains a mask of all-zero bytes in r1. */
|
||||
/* Using r0 and not ip here because cbz requires low register. */
|
||||
m_cbz reg=r0, label=compute_return_value
|
||||
clz r0, r0
|
||||
/* r0 contains the number of bits on the left of the first all-zero byte in r1. */
|
||||
rsb r0, r0, #24
|
||||
/* Here, r0 contains the number of bits on the right of the first all-zero byte in r1. */
|
||||
lsr r1, r1, r0
|
||||
lsr r2, r2, r0
|
||||
|
||||
compute_return_value:
|
||||
movs r0, #1
|
||||
cmp r1, r2
|
||||
/* The return value is computed as follows.
|
||||
If r1>r2 then (C==1 and Z==0) and LS doesn't hold and r0 is #1 at return.
|
||||
If r1<r2 then (C==0 and Z==0) and we execute SBC with carry_in=0,
|
||||
which means r0:=r0-r0-1 and r0 is #-1 at return.
|
||||
If r1=r2 then (C==1 and Z==1) and we execute SBC with carry_in=1,
|
||||
which means r0:=r0-r0 and r0 is #0 at return.
|
||||
(C==0 and Z==1) cannot happen because the carry bit is "not borrow". */
|
||||
it ls
|
||||
sbcls r0, r0, r0
|
||||
bx lr
|
||||
END(strcmp)
|
5
libc/arch-arm/cortex-a15/cortex-a15.mk
Normal file
5
libc/arch-arm/cortex-a15/cortex-a15.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a15/bionic/memcpy.S)
|
||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a15/bionic/memset.S)
|
||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a15/bionic/strcmp.S)
|
||||
|
||||
include bionic/libc/arch-arm/generic/generic.mk
|
1
libc/arch-arm/cortex-a7/cortex-a7.mk
Normal file
1
libc/arch-arm/cortex-a7/cortex-a7.mk
Normal file
@@ -0,0 +1 @@
|
||||
include bionic/libc/arch-arm/cortex-a15/cortex-a15.mk
|
211
libc/arch-arm/cortex-a9/bionic/memcpy.S
Normal file
211
libc/arch-arm/cortex-a9/bionic/memcpy.S
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* This code assumes it is running on a processor that supports all arm v7
|
||||
* instructions, that supports neon instructions, and that has a 32 byte
|
||||
* cache line.
|
||||
*/
|
||||
|
||||
.text
|
||||
.fpu neon
|
||||
|
||||
#define CACHE_LINE_SIZE 32
|
||||
|
||||
ENTRY(memcpy)
|
||||
.save {r0, lr}
|
||||
/* start preloading as early as possible */
|
||||
pld [r1, #(CACHE_LINE_SIZE * 0)]
|
||||
stmfd sp!, {r0, lr}
|
||||
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||
|
||||
// Check so divider is at least 16 bytes, needed for alignment code.
|
||||
cmp r2, #16
|
||||
blo 5f
|
||||
|
||||
|
||||
/* check if buffers are aligned. If so, run arm-only version */
|
||||
eor r3, r0, r1
|
||||
ands r3, r3, #0x3
|
||||
beq 11f
|
||||
|
||||
/* Check the upper size limit for Neon unaligned memory access in memcpy */
|
||||
cmp r2, #224
|
||||
blo 3f
|
||||
|
||||
/* align destination to 16 bytes for the write-buffer */
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0xF
|
||||
beq 3f
|
||||
|
||||
/* copy up to 15-bytes (count in r3) */
|
||||
sub r2, r2, r3
|
||||
movs ip, r3, lsl #31
|
||||
ldrmib lr, [r1], #1
|
||||
strmib lr, [r0], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
movs ip, r3, lsl #29
|
||||
bge 1f
|
||||
// copies 4 bytes, destination 32-bits aligned
|
||||
vld1.32 {d0[0]}, [r1]!
|
||||
vst1.32 {d0[0]}, [r0, :32]!
|
||||
1: bcc 2f
|
||||
// copies 8 bytes, destination 64-bits aligned
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0, :64]!
|
||||
2:
|
||||
/* preload immediately the next cache line, which we may need */
|
||||
pld [r1, #(CACHE_LINE_SIZE * 0)]
|
||||
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||
3:
|
||||
/* make sure we have at least 64 bytes to copy */
|
||||
subs r2, r2, #64
|
||||
blo 2f
|
||||
|
||||
/* preload all the cache lines we need */
|
||||
pld [r1, #(CACHE_LINE_SIZE * 4)]
|
||||
pld [r1, #(CACHE_LINE_SIZE * 6)]
|
||||
|
||||
1: /* The main loop copies 64 bytes at a time */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
vld1.8 {d4 - d7}, [r1]!
|
||||
pld [r1, #(CACHE_LINE_SIZE * 6)]
|
||||
subs r2, r2, #64
|
||||
vst1.8 {d0 - d3}, [r0]!
|
||||
vst1.8 {d4 - d7}, [r0]!
|
||||
bhs 1b
|
||||
|
||||
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
|
||||
add r2, r2, #64
|
||||
subs r2, r2, #32
|
||||
blo 4f
|
||||
|
||||
3: /* 32 bytes at a time. These cache lines were already preloaded */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
subs r2, r2, #32
|
||||
vst1.8 {d0 - d3}, [r0]!
|
||||
bhs 3b
|
||||
|
||||
4: /* less than 32 left */
|
||||
add r2, r2, #32
|
||||
tst r2, #0x10
|
||||
beq 5f
|
||||
// copies 16 bytes, 128-bits aligned
|
||||
vld1.8 {d0, d1}, [r1]!
|
||||
vst1.8 {d0, d1}, [r0]!
|
||||
5: /* copy up to 15-bytes (count in r2) */
|
||||
movs ip, r2, lsl #29
|
||||
bcc 1f
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0]!
|
||||
1: bge 2f
|
||||
vld1.32 {d0[0]}, [r1]!
|
||||
vst1.32 {d0[0]}, [r0]!
|
||||
2: movs ip, r2, lsl #31
|
||||
ldrmib r3, [r1], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strmib r3, [r0], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
|
||||
ldmfd sp!, {r0, lr}
|
||||
bx lr
|
||||
11:
|
||||
/* Simple arm-only copy loop to handle aligned copy operations */
|
||||
stmfd sp!, {r4, r5, r6, r7, r8}
|
||||
pld [r1, #(CACHE_LINE_SIZE * 4)]
|
||||
|
||||
/* Check alignment */
|
||||
rsb r3, r1, #0
|
||||
ands r3, #3
|
||||
beq 2f
|
||||
|
||||
/* align source to 32 bits. We need to insert 2 instructions between
|
||||
* a ldr[b|h] and str[b|h] because byte and half-word instructions
|
||||
* stall 2 cycles.
|
||||
*/
|
||||
movs r12, r3, lsl #31
|
||||
sub r2, r2, r3 /* we know that r3 <= r2 because r2 >= 4 */
|
||||
ldrmib r3, [r1], #1
|
||||
ldrcsb r4, [r1], #1
|
||||
ldrcsb r5, [r1], #1
|
||||
strmib r3, [r0], #1
|
||||
strcsb r4, [r0], #1
|
||||
strcsb r5, [r0], #1
|
||||
|
||||
2:
|
||||
subs r2, r2, #64
|
||||
blt 4f
|
||||
|
||||
3: /* Main copy loop, copying 64 bytes at a time */
|
||||
pld [r1, #(CACHE_LINE_SIZE * 8)]
|
||||
ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||
stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||
ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||
stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||
subs r2, r2, #64
|
||||
bge 3b
|
||||
|
||||
4: /* Check if there are > 32 bytes left */
|
||||
adds r2, r2, #64
|
||||
subs r2, r2, #32
|
||||
blt 5f
|
||||
|
||||
/* Copy 32 bytes */
|
||||
ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||
stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||
subs r2, #32
|
||||
|
||||
5: /* Handle any remaining bytes */
|
||||
adds r2, #32
|
||||
beq 6f
|
||||
|
||||
movs r12, r2, lsl #28
|
||||
ldmcsia r1!, {r3, r4, r5, r6} /* 16 bytes */
|
||||
ldmmiia r1!, {r7, r8} /* 8 bytes */
|
||||
stmcsia r0!, {r3, r4, r5, r6}
|
||||
stmmiia r0!, {r7, r8}
|
||||
movs r12, r2, lsl #30
|
||||
ldrcs r3, [r1], #4 /* 4 bytes */
|
||||
ldrmih r4, [r1], #2 /* 2 bytes */
|
||||
strcs r3, [r0], #4
|
||||
strmih r4, [r0], #2
|
||||
tst r2, #0x1
|
||||
ldrneb r3, [r1] /* last byte */
|
||||
strneb r3, [r0]
|
||||
6:
|
||||
ldmfd sp!, {r4, r5, r6, r7, r8}
|
||||
ldmfd sp!, {r0, pc}
|
||||
END(memcpy)
|
152
libc/arch-arm/cortex-a9/bionic/memset.S
Normal file
152
libc/arch-arm/cortex-a9/bionic/memset.S
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* This code assumes it is running on a processor that supports all arm v7
|
||||
* instructions and that supports neon instructions.
|
||||
*/
|
||||
|
||||
.fpu neon
|
||||
|
||||
ENTRY(bzero)
|
||||
mov r2, r1
|
||||
mov r1, #0
|
||||
END(bzero)
|
||||
|
||||
/* memset() returns its first argument. */
|
||||
ENTRY(memset)
|
||||
# The neon memset only wins for less than 132.
|
||||
cmp r2, #132
|
||||
bhi 11f
|
||||
|
||||
.save {r0}
|
||||
stmfd sp!, {r0}
|
||||
|
||||
vdup.8 q0, r1
|
||||
|
||||
/* make sure we have at least 32 bytes to write */
|
||||
subs r2, r2, #32
|
||||
blo 2f
|
||||
vmov q1, q0
|
||||
|
||||
1: /* The main loop writes 32 bytes at a time */
|
||||
subs r2, r2, #32
|
||||
vst1.8 {d0 - d3}, [r0]!
|
||||
bhs 1b
|
||||
|
||||
2: /* less than 32 left */
|
||||
add r2, r2, #32
|
||||
tst r2, #0x10
|
||||
beq 3f
|
||||
|
||||
// writes 16 bytes, 128-bits aligned
|
||||
vst1.8 {d0, d1}, [r0]!
|
||||
3: /* write up to 15-bytes (count in r2) */
|
||||
movs ip, r2, lsl #29
|
||||
bcc 1f
|
||||
vst1.8 {d0}, [r0]!
|
||||
1: bge 2f
|
||||
vst1.32 {d0[0]}, [r0]!
|
||||
2: movs ip, r2, lsl #31
|
||||
strmib r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
ldmfd sp!, {r0}
|
||||
bx lr
|
||||
11:
|
||||
/* compute the offset to align the destination
|
||||
* offset = (4-(src&3))&3 = -src & 3
|
||||
*/
|
||||
|
||||
.save {r0, r4-r7, lr}
|
||||
stmfd sp!, {r0, r4-r7, lr}
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #3
|
||||
cmp r3, r2
|
||||
movhi r3, r2
|
||||
|
||||
/* splat r1 */
|
||||
mov r1, r1, lsl #24
|
||||
orr r1, r1, r1, lsr #8
|
||||
orr r1, r1, r1, lsr #16
|
||||
|
||||
movs r12, r3, lsl #31
|
||||
strcsb r1, [r0], #1 /* can't use strh (alignment unknown) */
|
||||
strcsb r1, [r0], #1
|
||||
strmib r1, [r0], #1
|
||||
subs r2, r2, r3
|
||||
ldmlsfd sp!, {r0, r4-r7, lr} /* return */
|
||||
bxls lr
|
||||
|
||||
/* align the destination to a cache-line */
|
||||
mov r12, r1
|
||||
mov lr, r1
|
||||
mov r4, r1
|
||||
mov r5, r1
|
||||
mov r6, r1
|
||||
mov r7, r1
|
||||
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0x1C
|
||||
beq 3f
|
||||
cmp r3, r2
|
||||
andhi r3, r2, #0x1C
|
||||
sub r2, r2, r3
|
||||
|
||||
/* conditionally writes 0 to 7 words (length in r3) */
|
||||
movs r3, r3, lsl #28
|
||||
stmcsia r0!, {r1, lr}
|
||||
stmcsia r0!, {r1, lr}
|
||||
stmmiia r0!, {r1, lr}
|
||||
movs r3, r3, lsl #2
|
||||
strcs r1, [r0], #4
|
||||
|
||||
3:
|
||||
subs r2, r2, #32
|
||||
mov r3, r1
|
||||
bmi 2f
|
||||
1: subs r2, r2, #32
|
||||
stmia r0!, {r1,r3,r4,r5,r6,r7,r12,lr}
|
||||
bhs 1b
|
||||
2: add r2, r2, #32
|
||||
|
||||
/* conditionally stores 0 to 31 bytes */
|
||||
movs r2, r2, lsl #28
|
||||
stmcsia r0!, {r1,r3,r12,lr}
|
||||
stmmiia r0!, {r1, lr}
|
||||
movs r2, r2, lsl #2
|
||||
strcs r1, [r0], #4
|
||||
strmih r1, [r0], #2
|
||||
movs r2, r2, lsl #2
|
||||
strcsb r1, [r0]
|
||||
ldmfd sp!, {r0, r4-r7, lr}
|
||||
bx lr
|
||||
END(memset)
|
544
libc/arch-arm/cortex-a9/bionic/strcmp.S
Normal file
544
libc/arch-arm/cortex-a9/bionic/strcmp.S
Normal file
@@ -0,0 +1,544 @@
|
||||
/*
|
||||
* Copyright (c) 2013 ARM Ltd
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the company may not be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#ifdef __ARMEB__
|
||||
#define S2LOMEM lsl
|
||||
#define S2LOMEMEQ lsleq
|
||||
#define S2HIMEM lsr
|
||||
#define MSB 0x000000ff
|
||||
#define LSB 0xff000000
|
||||
#define BYTE0_OFFSET 24
|
||||
#define BYTE1_OFFSET 16
|
||||
#define BYTE2_OFFSET 8
|
||||
#define BYTE3_OFFSET 0
|
||||
#else /* not __ARMEB__ */
|
||||
#define S2LOMEM lsr
|
||||
#define S2LOMEMEQ lsreq
|
||||
#define S2HIMEM lsl
|
||||
#define BYTE0_OFFSET 0
|
||||
#define BYTE1_OFFSET 8
|
||||
#define BYTE2_OFFSET 16
|
||||
#define BYTE3_OFFSET 24
|
||||
#define MSB 0xff000000
|
||||
#define LSB 0x000000ff
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
.syntax unified
|
||||
|
||||
#if defined (__thumb__)
|
||||
.thumb
|
||||
.thumb_func
|
||||
#endif
|
||||
|
||||
ENTRY(strcmp)
|
||||
/* Use LDRD whenever possible. */
|
||||
|
||||
/* The main thing to look out for when comparing large blocks is that
|
||||
the loads do not cross a page boundary when loading past the index
|
||||
of the byte with the first difference or the first string-terminator.
|
||||
|
||||
For example, if the strings are identical and the string-terminator
|
||||
is at index k, byte by byte comparison will not load beyond address
|
||||
s1+k and s2+k; word by word comparison may load up to 3 bytes beyond
|
||||
k; double word - up to 7 bytes. If the load of these bytes crosses
|
||||
a page boundary, it might cause a memory fault (if the page is not mapped)
|
||||
that would not have happened in byte by byte comparison.
|
||||
|
||||
If an address is (double) word aligned, then a load of a (double) word
|
||||
from that address will not cross a page boundary.
|
||||
Therefore, the algorithm below considers word and double-word alignment
|
||||
of strings separately. */
|
||||
|
||||
/* High-level description of the algorithm.
|
||||
|
||||
* The fast path: if both strings are double-word aligned,
|
||||
use LDRD to load two words from each string in every loop iteration.
|
||||
* If the strings have the same offset from a word boundary,
|
||||
use LDRB to load and compare byte by byte until
|
||||
the first string is aligned to a word boundary (at most 3 bytes).
|
||||
This is optimized for quick return on short unaligned strings.
|
||||
* If the strings have the same offset from a double-word boundary,
|
||||
use LDRD to load two words from each string in every loop iteration, as in the fast path.
|
||||
* If the strings do not have the same offset from a double-word boundary,
|
||||
load a word from the second string before the loop to initialize the queue.
|
||||
Use LDRD to load two words from every string in every loop iteration.
|
||||
Inside the loop, load the second word from the second string only after comparing
|
||||
the first word, using the queued value, to guarantee safety across page boundaries.
|
||||
* If the strings do not have the same offset from a word boundary,
|
||||
use LDR and a shift queue. Order of loads and comparisons matters,
|
||||
similarly to the previous case.
|
||||
|
||||
* Use UADD8 and SEL to compare words, and use REV and CLZ to compute the return value.
|
||||
* The only difference between ARM and Thumb modes is the use of CBZ instruction.
|
||||
* The only difference between big and little endian is the use of REV in little endian
|
||||
to compute the return value, instead of MOV.
|
||||
*/
|
||||
|
||||
.macro m_cbz reg label
|
||||
#ifdef __thumb2__
|
||||
cbz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
beq \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbz */
|
||||
|
||||
.macro m_cbnz reg label
|
||||
#ifdef __thumb2__
|
||||
cbnz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
bne \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbnz */
|
||||
|
||||
.macro init
|
||||
/* Macro to save temporary registers and prepare magic values. */
|
||||
subs sp, sp, #16
|
||||
strd r4, r5, [sp, #8]
|
||||
strd r6, r7, [sp]
|
||||
mvn r6, #0 /* all F */
|
||||
mov r7, #0 /* all 0 */
|
||||
.endm /* init */
|
||||
|
||||
.macro magic_compare_and_branch w1 w2 label
|
||||
/* Macro to compare registers w1 and w2 and conditionally branch to label. */
|
||||
cmp \w1, \w2 /* Are w1 and w2 the same? */
|
||||
magic_find_zero_bytes \w1
|
||||
it eq
|
||||
cmpeq ip, #0 /* Is there a zero byte in w1? */
|
||||
bne \label
|
||||
.endm /* magic_compare_and_branch */
|
||||
|
||||
.macro magic_find_zero_bytes w1
|
||||
/* Macro to find all-zero bytes in w1, result is in ip. */
|
||||
#if (defined (__ARM_FEATURE_DSP))
|
||||
uadd8 ip, \w1, r6
|
||||
sel ip, r7, r6
|
||||
#else /* not defined (__ARM_FEATURE_DSP) */
|
||||
/* __ARM_FEATURE_DSP is not defined for some Cortex-M processors.
|
||||
Coincidently, these processors only have Thumb-2 mode, where we can use the
|
||||
the (large) magic constant available directly as an immediate in instructions.
|
||||
Note that we cannot use the magic constant in ARM mode, where we need
|
||||
to create the constant in a register. */
|
||||
sub ip, \w1, #0x01010101
|
||||
bic ip, ip, \w1
|
||||
and ip, ip, #0x80808080
|
||||
#endif /* not defined (__ARM_FEATURE_DSP) */
|
||||
.endm /* magic_find_zero_bytes */
|
||||
|
||||
.macro setup_return w1 w2
|
||||
#ifdef __ARMEB__
|
||||
mov r1, \w1
|
||||
mov r2, \w2
|
||||
#else /* not __ARMEB__ */
|
||||
rev r1, \w1
|
||||
rev r2, \w2
|
||||
#endif /* not __ARMEB__ */
|
||||
.endm /* setup_return */
|
||||
|
||||
pld [r0, #0]
|
||||
pld [r1, #0]
|
||||
|
||||
/* Are both strings double-word aligned? */
|
||||
orr ip, r0, r1
|
||||
tst ip, #7
|
||||
bne do_align
|
||||
|
||||
/* Fast path. */
|
||||
init
|
||||
|
||||
doubleword_aligned:
|
||||
|
||||
/* Get here when the strings to compare are double-word aligned. */
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
2:
|
||||
pld [r0, #16]
|
||||
pld [r1, #16]
|
||||
|
||||
/* Load the next double-word from each string. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
ldrd r4, r5, [r1], #8
|
||||
|
||||
magic_compare_and_branch w1=r2, w2=r4, label=return_24
|
||||
magic_compare_and_branch w1=r3, w2=r5, label=return_35
|
||||
b 2b
|
||||
|
||||
do_align:
|
||||
/* Is the first string word-aligned? */
|
||||
ands ip, r0, #3
|
||||
beq word_aligned_r0
|
||||
|
||||
/* Fast compare byte by byte until the first string is word-aligned. */
|
||||
/* The offset of r0 from a word boundary is in ip. Thus, the number of bytes
|
||||
to read until the next word boundary is 4-ip. */
|
||||
bic r0, r0, #3
|
||||
ldr r2, [r0], #4
|
||||
lsls ip, ip, #31
|
||||
beq byte2
|
||||
bcs byte3
|
||||
|
||||
byte1:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE1_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte2:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE2_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte3:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE3_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbnz reg=r3, label=word_aligned_r0
|
||||
|
||||
fast_return:
|
||||
mov r0, ip
|
||||
bx lr
|
||||
|
||||
word_aligned_r0:
|
||||
init
|
||||
/* The first string is word-aligned. */
|
||||
/* Is the second string word-aligned? */
|
||||
ands ip, r1, #3
|
||||
bne strcmp_unaligned
|
||||
|
||||
word_aligned:
|
||||
/* The strings are word-aligned. */
|
||||
/* Is the first string double-word aligned? */
|
||||
tst r0, #4
|
||||
beq doubleword_aligned_r0
|
||||
|
||||
/* If r0 is not double-word aligned yet, align it by loading
|
||||
and comparing the next word from each string. */
|
||||
ldr r2, [r0], #4
|
||||
ldr r4, [r1], #4
|
||||
magic_compare_and_branch w1=r2 w2=r4 label=return_24
|
||||
|
||||
doubleword_aligned_r0:
|
||||
/* Get here when r0 is double-word aligned. */
|
||||
/* Is r1 doubleword_aligned? */
|
||||
tst r1, #4
|
||||
beq doubleword_aligned
|
||||
|
||||
/* Get here when the strings to compare are word-aligned,
|
||||
r0 is double-word aligned, but r1 is not double-word aligned. */
|
||||
|
||||
/* Initialize the queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
3:
|
||||
pld [r0, #16]
|
||||
pld [r1, #16]
|
||||
|
||||
/* Load the next double-word from each string and compare. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
magic_compare_and_branch w1=r2 w2=r5 label=return_25
|
||||
ldrd r4, r5, [r1], #8
|
||||
magic_compare_and_branch w1=r3 w2=r4 label=return_34
|
||||
b 3b
|
||||
|
||||
.macro miscmp_word offsetlo offsethi
|
||||
/* Macro to compare misaligned strings. */
|
||||
/* r0, r1 are word-aligned, and at least one of the strings
|
||||
is not double-word aligned. */
|
||||
/* Compare one word in every loop iteration. */
|
||||
/* OFFSETLO is the original bit-offset of r1 from a word-boundary,
|
||||
OFFSETHI is 32 - OFFSETLO (i.e., offset from the next word). */
|
||||
|
||||
/* Initialize the shift queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare one word from each string in every loop iteration. */
|
||||
.p2align 2
|
||||
7:
|
||||
ldr r3, [r0], #4
|
||||
S2LOMEM r5, r5, #\offsetlo
|
||||
magic_find_zero_bytes w1=r3
|
||||
cmp r7, ip, S2HIMEM #\offsetlo
|
||||
and r2, r3, r6, S2LOMEM #\offsetlo
|
||||
it eq
|
||||
cmpeq r2, r5
|
||||
bne return_25
|
||||
ldr r5, [r1], #4
|
||||
cmp ip, #0
|
||||
eor r3, r2, r3
|
||||
S2HIMEM r2, r5, #\offsethi
|
||||
it eq
|
||||
cmpeq r3, r2
|
||||
bne return_32
|
||||
b 7b
|
||||
.endm /* miscmp_word */
|
||||
|
||||
return_32:
|
||||
setup_return w1=r3, w2=r2
|
||||
b do_return
|
||||
return_34:
|
||||
setup_return w1=r3, w2=r4
|
||||
b do_return
|
||||
return_25:
|
||||
setup_return w1=r2, w2=r5
|
||||
b do_return
|
||||
return_35:
|
||||
setup_return w1=r3, w2=r5
|
||||
b do_return
|
||||
return_24:
|
||||
setup_return w1=r2, w2=r4
|
||||
|
||||
do_return:
|
||||
|
||||
#ifdef __ARMEB__
|
||||
mov r0, ip
|
||||
#else /* not __ARMEB__ */
|
||||
rev r0, ip
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
/* Restore temporaries early, before computing the return value. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
/* There is a zero or a different byte between r1 and r2. */
|
||||
/* r0 contains a mask of all-zero bytes in r1. */
|
||||
/* Using r0 and not ip here because cbz requires low register. */
|
||||
m_cbz reg=r0, label=compute_return_value
|
||||
clz r0, r0
|
||||
/* r0 contains the number of bits on the left of the first all-zero byte in r1. */
|
||||
rsb r0, r0, #24
|
||||
/* Here, r0 contains the number of bits on the right of the first all-zero byte in r1. */
|
||||
lsr r1, r1, r0
|
||||
lsr r2, r2, r0
|
||||
|
||||
compute_return_value:
|
||||
movs r0, #1
|
||||
cmp r1, r2
|
||||
/* The return value is computed as follows.
|
||||
If r1>r2 then (C==1 and Z==0) and LS doesn't hold and r0 is #1 at return.
|
||||
If r1<r2 then (C==0 and Z==0) and we execute SBC with carry_in=0,
|
||||
which means r0:=r0-r0-1 and r0 is #-1 at return.
|
||||
If r1=r2 then (C==1 and Z==1) and we execute SBC with carry_in=1,
|
||||
which means r0:=r0-r0 and r0 is #0 at return.
|
||||
(C==0 and Z==1) cannot happen because the carry bit is "not borrow". */
|
||||
it ls
|
||||
sbcls r0, r0, r0
|
||||
bx lr
|
||||
|
||||
/* The code from the previous version of strcmp.S handles all of the
|
||||
* cases where the first string and seconds string cannot both be
|
||||
* aligned to a word boundary faster than the new algorithm. See
|
||||
* bionic/libc/arch-arm/cortex-a15/bionic/strcmp.S for the unedited
|
||||
* version of the code.
|
||||
*/
|
||||
strcmp_unaligned:
|
||||
wp1 .req r0
|
||||
wp2 .req r1
|
||||
b1 .req r2
|
||||
w1 .req r4
|
||||
w2 .req r5
|
||||
t1 .req ip
|
||||
@ r3 is scratch
|
||||
|
||||
2:
|
||||
mov b1, #1
|
||||
orr b1, b1, b1, lsl #8
|
||||
orr b1, b1, b1, lsl #16
|
||||
|
||||
and t1, wp2, #3
|
||||
bic wp2, wp2, #3
|
||||
ldr w1, [wp1], #4
|
||||
ldr w2, [wp2], #4
|
||||
cmp t1, #2
|
||||
beq 2f
|
||||
bhi 3f
|
||||
|
||||
/* Critical inner Loop: Block with 3 bytes initial overlap */
|
||||
.p2align 2
|
||||
1:
|
||||
bic t1, w1, #MSB
|
||||
cmp t1, w2, S2LOMEM #8
|
||||
sub r3, w1, b1
|
||||
bic r3, r3, w1
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, S2HIMEM #24
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 1b
|
||||
4:
|
||||
S2LOMEM w2, w2, #8
|
||||
b 8f
|
||||
|
||||
5:
|
||||
#ifdef __ARMEB__
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
* with the bytes 0x01 0x00
|
||||
*/
|
||||
tst w1, #0xff000000
|
||||
itt ne
|
||||
tstne w1, #0x00ff0000
|
||||
tstne w1, #0x0000ff00
|
||||
beq 7f
|
||||
#else
|
||||
bics r3, r3, #0xff000000
|
||||
bne 7f
|
||||
#endif
|
||||
ldrb w2, [wp2]
|
||||
S2LOMEM t1, w1, #24
|
||||
#ifdef __ARMEB__
|
||||
lsl w2, w2, #24
|
||||
#endif
|
||||
b 8f
|
||||
|
||||
6:
|
||||
S2LOMEM t1, w1, #24
|
||||
and w2, w2, #LSB
|
||||
b 8f
|
||||
|
||||
/* Critical inner Loop: Block with 2 bytes initial overlap */
|
||||
.p2align 2
|
||||
2:
|
||||
S2HIMEM t1, w1, #16
|
||||
sub r3, w1, b1
|
||||
S2LOMEM t1, t1, #16
|
||||
bic r3, r3, w1
|
||||
cmp t1, w2, S2LOMEM #16
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, S2HIMEM #16
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 2b
|
||||
|
||||
5:
|
||||
#ifdef __ARMEB__
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
* with the bytes 0x01 0x00
|
||||
*/
|
||||
tst w1, #0xff000000
|
||||
it ne
|
||||
tstne w1, #0x00ff0000
|
||||
beq 7f
|
||||
#else
|
||||
lsls r3, r3, #16
|
||||
bne 7f
|
||||
#endif
|
||||
ldrh w2, [wp2]
|
||||
S2LOMEM t1, w1, #16
|
||||
#ifdef __ARMEB__
|
||||
lsl w2, w2, #16
|
||||
#endif
|
||||
b 8f
|
||||
|
||||
6:
|
||||
S2HIMEM w2, w2, #16
|
||||
S2LOMEM t1, w1, #16
|
||||
4:
|
||||
S2LOMEM w2, w2, #16
|
||||
b 8f
|
||||
|
||||
/* Critical inner Loop: Block with 1 byte initial overlap */
|
||||
.p2align 2
|
||||
3:
|
||||
and t1, w1, #LSB
|
||||
cmp t1, w2, S2LOMEM #24
|
||||
sub r3, w1, b1
|
||||
bic r3, r3, w1
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, S2HIMEM #8
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 3b
|
||||
4:
|
||||
S2LOMEM w2, w2, #24
|
||||
b 8f
|
||||
5:
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
* with the bytes 0x01 0x00
|
||||
*/
|
||||
tst w1, #LSB
|
||||
beq 7f
|
||||
ldr w2, [wp2], #4
|
||||
6:
|
||||
S2LOMEM t1, w1, #8
|
||||
bic w2, w2, #MSB
|
||||
b 8f
|
||||
7:
|
||||
mov r0, #0
|
||||
|
||||
/* Restore registers and stack. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
bx lr
|
||||
|
||||
8:
|
||||
and r2, t1, #LSB
|
||||
and r0, w2, #LSB
|
||||
cmp r0, #1
|
||||
it cs
|
||||
cmpcs r0, r2
|
||||
itt eq
|
||||
S2LOMEMEQ t1, t1, #8
|
||||
S2LOMEMEQ w2, w2, #8
|
||||
beq 8b
|
||||
sub r0, r2, r0
|
||||
|
||||
/* Restore registers and stack. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
bx lr
|
||||
END(strcmp)
|
5
libc/arch-arm/cortex-a9/cortex-a9.mk
Normal file
5
libc/arch-arm/cortex-a9/cortex-a9.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a9/bionic/memcpy.S)
|
||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a9/bionic/memset.S)
|
||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a9/bionic/strcmp.S)
|
||||
|
||||
include bionic/libc/arch-arm/generic/generic.mk
|
380
libc/arch-arm/generic/bionic/memcpy.S
Normal file
380
libc/arch-arm/generic/bionic/memcpy.S
Normal file
@@ -0,0 +1,380 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* Optimized memcpy() for ARM.
|
||||
*
|
||||
* note that memcpy() always returns the destination pointer,
|
||||
* so we have to preserve R0.
|
||||
*/
|
||||
|
||||
ENTRY(memcpy)
|
||||
/* The stack must always be 64-bits aligned to be compliant with the
|
||||
* ARM ABI. Since we have to save R0, we might as well save R4
|
||||
* which we can use for better pipelining of the reads below
|
||||
*/
|
||||
.save {r0, r4, lr}
|
||||
stmfd sp!, {r0, r4, lr}
|
||||
/* Making room for r5-r11 which will be spilled later */
|
||||
.pad #28
|
||||
sub sp, sp, #28
|
||||
|
||||
// preload the destination because we'll align it to a cache line
|
||||
// with small writes. Also start the source "pump".
|
||||
PLD (r0, #0)
|
||||
PLD (r1, #0)
|
||||
PLD (r1, #32)
|
||||
|
||||
/* it simplifies things to take care of len<4 early */
|
||||
cmp r2, #4
|
||||
blo copy_last_3_and_return
|
||||
|
||||
/* compute the offset to align the source
|
||||
* offset = (4-(src&3))&3 = -src & 3
|
||||
*/
|
||||
rsb r3, r1, #0
|
||||
ands r3, r3, #3
|
||||
beq src_aligned
|
||||
|
||||
/* align source to 32 bits. We need to insert 2 instructions between
|
||||
* a ldr[b|h] and str[b|h] because byte and half-word instructions
|
||||
* stall 2 cycles.
|
||||
*/
|
||||
movs r12, r3, lsl #31
|
||||
sub r2, r2, r3 /* we know that r3 <= r2 because r2 >= 4 */
|
||||
ldrmib r3, [r1], #1
|
||||
ldrcsb r4, [r1], #1
|
||||
ldrcsb r12,[r1], #1
|
||||
strmib r3, [r0], #1
|
||||
strcsb r4, [r0], #1
|
||||
strcsb r12,[r0], #1
|
||||
|
||||
src_aligned:
|
||||
|
||||
/* see if src and dst are aligned together (congruent) */
|
||||
eor r12, r0, r1
|
||||
tst r12, #3
|
||||
bne non_congruent
|
||||
|
||||
/* Use post-incriment mode for stm to spill r5-r11 to reserved stack
|
||||
* frame. Don't update sp.
|
||||
*/
|
||||
stmea sp, {r5-r11}
|
||||
|
||||
/* align the destination to a cache-line */
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0x1C
|
||||
beq congruent_aligned32
|
||||
cmp r3, r2
|
||||
andhi r3, r2, #0x1C
|
||||
|
||||
/* conditionally copies 0 to 7 words (length in r3) */
|
||||
movs r12, r3, lsl #28
|
||||
ldmcsia r1!, {r4, r5, r6, r7} /* 16 bytes */
|
||||
ldmmiia r1!, {r8, r9} /* 8 bytes */
|
||||
stmcsia r0!, {r4, r5, r6, r7}
|
||||
stmmiia r0!, {r8, r9}
|
||||
tst r3, #0x4
|
||||
ldrne r10,[r1], #4 /* 4 bytes */
|
||||
strne r10,[r0], #4
|
||||
sub r2, r2, r3
|
||||
|
||||
congruent_aligned32:
|
||||
/*
|
||||
* here source is aligned to 32 bytes.
|
||||
*/
|
||||
|
||||
cached_aligned32:
|
||||
subs r2, r2, #32
|
||||
blo less_than_32_left
|
||||
|
||||
/*
|
||||
* We preload a cache-line up to 64 bytes ahead. On the 926, this will
|
||||
* stall only until the requested world is fetched, but the linefill
|
||||
* continues in the the background.
|
||||
* While the linefill is going, we write our previous cache-line
|
||||
* into the write-buffer (which should have some free space).
|
||||
* When the linefill is done, the writebuffer will
|
||||
* start dumping its content into memory
|
||||
*
|
||||
* While all this is going, we then load a full cache line into
|
||||
* 8 registers, this cache line should be in the cache by now
|
||||
* (or partly in the cache).
|
||||
*
|
||||
* This code should work well regardless of the source/dest alignment.
|
||||
*
|
||||
*/
|
||||
|
||||
// Align the preload register to a cache-line because the cpu does
|
||||
// "critical word first" (the first word requested is loaded first).
|
||||
bic r12, r1, #0x1F
|
||||
add r12, r12, #64
|
||||
|
||||
1: ldmia r1!, { r4-r11 }
|
||||
PLD (r12, #64)
|
||||
subs r2, r2, #32
|
||||
|
||||
// NOTE: if r12 is more than 64 ahead of r1, the following ldrhi
|
||||
// for ARM9 preload will not be safely guarded by the preceding subs.
|
||||
// When it is safely guarded the only possibility to have SIGSEGV here
|
||||
// is because the caller overstates the length.
|
||||
ldrhi r3, [r12], #32 /* cheap ARM9 preload */
|
||||
stmia r0!, { r4-r11 }
|
||||
bhs 1b
|
||||
|
||||
add r2, r2, #32
|
||||
|
||||
|
||||
|
||||
|
||||
less_than_32_left:
|
||||
/*
|
||||
* less than 32 bytes left at this point (length in r2)
|
||||
*/
|
||||
|
||||
/* skip all this if there is nothing to do, which should
|
||||
* be a common case (if not executed the code below takes
|
||||
* about 16 cycles)
|
||||
*/
|
||||
tst r2, #0x1F
|
||||
beq 1f
|
||||
|
||||
/* conditionnaly copies 0 to 31 bytes */
|
||||
movs r12, r2, lsl #28
|
||||
ldmcsia r1!, {r4, r5, r6, r7} /* 16 bytes */
|
||||
ldmmiia r1!, {r8, r9} /* 8 bytes */
|
||||
stmcsia r0!, {r4, r5, r6, r7}
|
||||
stmmiia r0!, {r8, r9}
|
||||
movs r12, r2, lsl #30
|
||||
ldrcs r3, [r1], #4 /* 4 bytes */
|
||||
ldrmih r4, [r1], #2 /* 2 bytes */
|
||||
strcs r3, [r0], #4
|
||||
strmih r4, [r0], #2
|
||||
tst r2, #0x1
|
||||
ldrneb r3, [r1] /* last byte */
|
||||
strneb r3, [r0]
|
||||
|
||||
/* we're done! restore everything and return */
|
||||
1: ldmfd sp!, {r5-r11}
|
||||
ldmfd sp!, {r0, r4, lr}
|
||||
bx lr
|
||||
|
||||
/********************************************************************/
|
||||
|
||||
non_congruent:
|
||||
/*
|
||||
* here source is aligned to 4 bytes
|
||||
* but destination is not.
|
||||
*
|
||||
* in the code below r2 is the number of bytes read
|
||||
* (the number of bytes written is always smaller, because we have
|
||||
* partial words in the shift queue)
|
||||
*/
|
||||
cmp r2, #4
|
||||
blo copy_last_3_and_return
|
||||
|
||||
/* Use post-incriment mode for stm to spill r5-r11 to reserved stack
|
||||
* frame. Don't update sp.
|
||||
*/
|
||||
stmea sp, {r5-r11}
|
||||
|
||||
/* compute shifts needed to align src to dest */
|
||||
rsb r5, r0, #0
|
||||
and r5, r5, #3 /* r5 = # bytes in partial words */
|
||||
mov r12, r5, lsl #3 /* r12 = right */
|
||||
rsb lr, r12, #32 /* lr = left */
|
||||
|
||||
/* read the first word */
|
||||
ldr r3, [r1], #4
|
||||
sub r2, r2, #4
|
||||
|
||||
/* write a partial word (0 to 3 bytes), such that destination
|
||||
* becomes aligned to 32 bits (r5 = nb of words to copy for alignment)
|
||||
*/
|
||||
movs r5, r5, lsl #31
|
||||
strmib r3, [r0], #1
|
||||
movmi r3, r3, lsr #8
|
||||
strcsb r3, [r0], #1
|
||||
movcs r3, r3, lsr #8
|
||||
strcsb r3, [r0], #1
|
||||
movcs r3, r3, lsr #8
|
||||
|
||||
cmp r2, #4
|
||||
blo partial_word_tail
|
||||
|
||||
/* Align destination to 32 bytes (cache line boundary) */
|
||||
1: tst r0, #0x1c
|
||||
beq 2f
|
||||
ldr r5, [r1], #4
|
||||
sub r2, r2, #4
|
||||
orr r4, r3, r5, lsl lr
|
||||
mov r3, r5, lsr r12
|
||||
str r4, [r0], #4
|
||||
cmp r2, #4
|
||||
bhs 1b
|
||||
blo partial_word_tail
|
||||
|
||||
/* copy 32 bytes at a time */
|
||||
2: subs r2, r2, #32
|
||||
blo less_than_thirtytwo
|
||||
|
||||
/* Use immediate mode for the shifts, because there is an extra cycle
|
||||
* for register shifts, which could account for up to 50% of
|
||||
* performance hit.
|
||||
*/
|
||||
|
||||
cmp r12, #24
|
||||
beq loop24
|
||||
cmp r12, #8
|
||||
beq loop8
|
||||
|
||||
loop16:
|
||||
ldr r12, [r1], #4
|
||||
1: mov r4, r12
|
||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||
PLD (r1, #64)
|
||||
subs r2, r2, #32
|
||||
ldrhs r12, [r1], #4
|
||||
orr r3, r3, r4, lsl #16
|
||||
mov r4, r4, lsr #16
|
||||
orr r4, r4, r5, lsl #16
|
||||
mov r5, r5, lsr #16
|
||||
orr r5, r5, r6, lsl #16
|
||||
mov r6, r6, lsr #16
|
||||
orr r6, r6, r7, lsl #16
|
||||
mov r7, r7, lsr #16
|
||||
orr r7, r7, r8, lsl #16
|
||||
mov r8, r8, lsr #16
|
||||
orr r8, r8, r9, lsl #16
|
||||
mov r9, r9, lsr #16
|
||||
orr r9, r9, r10, lsl #16
|
||||
mov r10, r10, lsr #16
|
||||
orr r10, r10, r11, lsl #16
|
||||
stmia r0!, {r3,r4,r5,r6, r7,r8,r9,r10}
|
||||
mov r3, r11, lsr #16
|
||||
bhs 1b
|
||||
b less_than_thirtytwo
|
||||
|
||||
loop8:
|
||||
ldr r12, [r1], #4
|
||||
1: mov r4, r12
|
||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||
PLD (r1, #64)
|
||||
subs r2, r2, #32
|
||||
ldrhs r12, [r1], #4
|
||||
orr r3, r3, r4, lsl #24
|
||||
mov r4, r4, lsr #8
|
||||
orr r4, r4, r5, lsl #24
|
||||
mov r5, r5, lsr #8
|
||||
orr r5, r5, r6, lsl #24
|
||||
mov r6, r6, lsr #8
|
||||
orr r6, r6, r7, lsl #24
|
||||
mov r7, r7, lsr #8
|
||||
orr r7, r7, r8, lsl #24
|
||||
mov r8, r8, lsr #8
|
||||
orr r8, r8, r9, lsl #24
|
||||
mov r9, r9, lsr #8
|
||||
orr r9, r9, r10, lsl #24
|
||||
mov r10, r10, lsr #8
|
||||
orr r10, r10, r11, lsl #24
|
||||
stmia r0!, {r3,r4,r5,r6, r7,r8,r9,r10}
|
||||
mov r3, r11, lsr #8
|
||||
bhs 1b
|
||||
b less_than_thirtytwo
|
||||
|
||||
loop24:
|
||||
ldr r12, [r1], #4
|
||||
1: mov r4, r12
|
||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||
PLD (r1, #64)
|
||||
subs r2, r2, #32
|
||||
ldrhs r12, [r1], #4
|
||||
orr r3, r3, r4, lsl #8
|
||||
mov r4, r4, lsr #24
|
||||
orr r4, r4, r5, lsl #8
|
||||
mov r5, r5, lsr #24
|
||||
orr r5, r5, r6, lsl #8
|
||||
mov r6, r6, lsr #24
|
||||
orr r6, r6, r7, lsl #8
|
||||
mov r7, r7, lsr #24
|
||||
orr r7, r7, r8, lsl #8
|
||||
mov r8, r8, lsr #24
|
||||
orr r8, r8, r9, lsl #8
|
||||
mov r9, r9, lsr #24
|
||||
orr r9, r9, r10, lsl #8
|
||||
mov r10, r10, lsr #24
|
||||
orr r10, r10, r11, lsl #8
|
||||
stmia r0!, {r3,r4,r5,r6, r7,r8,r9,r10}
|
||||
mov r3, r11, lsr #24
|
||||
bhs 1b
|
||||
|
||||
|
||||
less_than_thirtytwo:
|
||||
/* copy the last 0 to 31 bytes of the source */
|
||||
rsb r12, lr, #32 /* we corrupted r12, recompute it */
|
||||
add r2, r2, #32
|
||||
cmp r2, #4
|
||||
blo partial_word_tail
|
||||
|
||||
1: ldr r5, [r1], #4
|
||||
sub r2, r2, #4
|
||||
orr r4, r3, r5, lsl lr
|
||||
mov r3, r5, lsr r12
|
||||
str r4, [r0], #4
|
||||
cmp r2, #4
|
||||
bhs 1b
|
||||
|
||||
partial_word_tail:
|
||||
/* we have a partial word in the input buffer */
|
||||
movs r5, lr, lsl #(31-3)
|
||||
strmib r3, [r0], #1
|
||||
movmi r3, r3, lsr #8
|
||||
strcsb r3, [r0], #1
|
||||
movcs r3, r3, lsr #8
|
||||
strcsb r3, [r0], #1
|
||||
|
||||
/* Refill spilled registers from the stack. Don't update sp. */
|
||||
ldmfd sp, {r5-r11}
|
||||
|
||||
copy_last_3_and_return:
|
||||
movs r2, r2, lsl #31 /* copy remaining 0, 1, 2 or 3 bytes */
|
||||
ldrmib r2, [r1], #1
|
||||
ldrcsb r3, [r1], #1
|
||||
ldrcsb r12,[r1]
|
||||
strmib r2, [r0], #1
|
||||
strcsb r3, [r0], #1
|
||||
strcsb r12,[r0]
|
||||
|
||||
/* we're done! restore sp and spilled registers and return */
|
||||
add sp, sp, #28
|
||||
ldmfd sp!, {r0, r4, lr}
|
||||
bx lr
|
||||
END(memcpy)
|
109
libc/arch-arm/generic/bionic/memset.S
Normal file
109
libc/arch-arm/generic/bionic/memset.S
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* Optimized memset() for ARM.
|
||||
*
|
||||
* memset() returns its first argument.
|
||||
*/
|
||||
|
||||
ENTRY(bzero)
|
||||
mov r2, r1
|
||||
mov r1, #0
|
||||
END(bzero)
|
||||
|
||||
ENTRY(memset)
|
||||
/* compute the offset to align the destination
|
||||
* offset = (4-(src&3))&3 = -src & 3
|
||||
*/
|
||||
.save {r0, r4-r7, lr}
|
||||
stmfd sp!, {r0, r4-r7, lr}
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #3
|
||||
cmp r3, r2
|
||||
movhi r3, r2
|
||||
|
||||
/* splat r1 */
|
||||
mov r1, r1, lsl #24
|
||||
orr r1, r1, r1, lsr #8
|
||||
orr r1, r1, r1, lsr #16
|
||||
|
||||
movs r12, r3, lsl #31
|
||||
strcsb r1, [r0], #1 /* can't use strh (alignment unknown) */
|
||||
strcsb r1, [r0], #1
|
||||
strmib r1, [r0], #1
|
||||
subs r2, r2, r3
|
||||
ldmlsfd sp!, {r0, r4-r7, lr} /* return */
|
||||
bxls lr
|
||||
|
||||
/* align the destination to a cache-line */
|
||||
mov r12, r1
|
||||
mov lr, r1
|
||||
mov r4, r1
|
||||
mov r5, r1
|
||||
mov r6, r1
|
||||
mov r7, r1
|
||||
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0x1C
|
||||
beq 3f
|
||||
cmp r3, r2
|
||||
andhi r3, r2, #0x1C
|
||||
sub r2, r2, r3
|
||||
|
||||
/* conditionally writes 0 to 7 words (length in r3) */
|
||||
movs r3, r3, lsl #28
|
||||
stmcsia r0!, {r1, lr}
|
||||
stmcsia r0!, {r1, lr}
|
||||
stmmiia r0!, {r1, lr}
|
||||
movs r3, r3, lsl #2
|
||||
strcs r1, [r0], #4
|
||||
|
||||
3:
|
||||
subs r2, r2, #32
|
||||
mov r3, r1
|
||||
bmi 2f
|
||||
1: subs r2, r2, #32
|
||||
stmia r0!, {r1,r3,r4,r5,r6,r7,r12,lr}
|
||||
bhs 1b
|
||||
2: add r2, r2, #32
|
||||
|
||||
/* conditionally stores 0 to 31 bytes */
|
||||
movs r2, r2, lsl #28
|
||||
stmcsia r0!, {r1,r3,r12,lr}
|
||||
stmmiia r0!, {r1, lr}
|
||||
movs r2, r2, lsl #2
|
||||
strcs r1, [r0], #4
|
||||
strmih r1, [r0], #2
|
||||
movs r2, r2, lsl #2
|
||||
strcsb r1, [r0]
|
||||
ldmfd sp!, {r0, r4-r7, lr}
|
||||
bx lr
|
||||
END(memset)
|
317
libc/arch-arm/generic/bionic/strcmp.S
Normal file
317
libc/arch-arm/generic/bionic/strcmp.S
Normal file
@@ -0,0 +1,317 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The Android Open Source Project
|
||||
* Copyright (c) 2008 ARM Ltd
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the company may not be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
.text
|
||||
|
||||
#ifdef __ARMEB__
|
||||
#define SHFT2LSB lsl
|
||||
#define SHFT2LSBEQ lsleq
|
||||
#define SHFT2MSB lsr
|
||||
#define SHFT2MSBEQ lsreq
|
||||
#define MSB 0x000000ff
|
||||
#define LSB 0xff000000
|
||||
#else
|
||||
#define SHFT2LSB lsr
|
||||
#define SHFT2LSBEQ lsreq
|
||||
#define SHFT2MSB lsl
|
||||
#define SHFT2MSBEQ lsleq
|
||||
#define MSB 0xff000000
|
||||
#define LSB 0x000000ff
|
||||
#endif
|
||||
|
||||
#define magic1(REG) REG
|
||||
#define magic2(REG) REG, lsl #7
|
||||
|
||||
ENTRY(strcmp)
|
||||
PLD(r0, #0)
|
||||
PLD(r1, #0)
|
||||
eor r2, r0, r1
|
||||
tst r2, #3
|
||||
|
||||
/* Strings not at same byte offset from a word boundary. */
|
||||
bne .Lstrcmp_unaligned
|
||||
ands r2, r0, #3
|
||||
bic r0, r0, #3
|
||||
bic r1, r1, #3
|
||||
ldr ip, [r0], #4
|
||||
it eq
|
||||
ldreq r3, [r1], #4
|
||||
beq 1f
|
||||
|
||||
/* Although s1 and s2 have identical initial alignment, they are
|
||||
* not currently word aligned. Rather than comparing bytes,
|
||||
* make sure that any bytes fetched from before the addressed
|
||||
* bytes are forced to 0xff. Then they will always compare
|
||||
* equal.
|
||||
*/
|
||||
eor r2, r2, #3
|
||||
lsl r2, r2, #3
|
||||
mvn r3, #MSB
|
||||
SHFT2LSB r2, r3, r2
|
||||
ldr r3, [r1], #4
|
||||
orr ip, ip, r2
|
||||
orr r3, r3, r2
|
||||
1:
|
||||
/* Load the 'magic' constant 0x01010101. */
|
||||
str r4, [sp, #-4]!
|
||||
mov r4, #1
|
||||
orr r4, r4, r4, lsl #8
|
||||
orr r4, r4, r4, lsl #16
|
||||
.p2align 2
|
||||
4:
|
||||
PLD(r0, #8)
|
||||
PLD(r1, #8)
|
||||
sub r2, ip, magic1(r4)
|
||||
cmp ip, r3
|
||||
itttt eq
|
||||
|
||||
/* check for any zero bytes in first word */
|
||||
biceq r2, r2, ip
|
||||
tsteq r2, magic2(r4)
|
||||
ldreq ip, [r0], #4
|
||||
ldreq r3, [r1], #4
|
||||
beq 4b
|
||||
2:
|
||||
/* There's a zero or a different byte in the word */
|
||||
SHFT2MSB r0, ip, #24
|
||||
SHFT2LSB ip, ip, #8
|
||||
cmp r0, #1
|
||||
it cs
|
||||
cmpcs r0, r3, SHFT2MSB #24
|
||||
it eq
|
||||
SHFT2LSBEQ r3, r3, #8
|
||||
beq 2b
|
||||
/* On a big-endian machine, r0 contains the desired byte in bits
|
||||
* 0-7; on a little-endian machine they are in bits 24-31. In
|
||||
* both cases the other bits in r0 are all zero. For r3 the
|
||||
* interesting byte is at the other end of the word, but the
|
||||
* other bits are not necessarily zero. We need a signed result
|
||||
* representing the differnece in the unsigned bytes, so for the
|
||||
* little-endian case we can't just shift the interesting bits up.
|
||||
*/
|
||||
#ifdef __ARMEB__
|
||||
sub r0, r0, r3, lsr #24
|
||||
#else
|
||||
and r3, r3, #255
|
||||
/* No RSB instruction in Thumb2 */
|
||||
#ifdef __thumb2__
|
||||
lsr r0, r0, #24
|
||||
sub r0, r0, r3
|
||||
#else
|
||||
rsb r0, r3, r0, lsr #24
|
||||
#endif
|
||||
#endif
|
||||
ldr r4, [sp], #4
|
||||
bx lr
|
||||
|
||||
.Lstrcmp_unaligned:
|
||||
wp1 .req r0
|
||||
wp2 .req r1
|
||||
b1 .req r2
|
||||
w1 .req r4
|
||||
w2 .req r5
|
||||
t1 .req ip
|
||||
@ r3 is scratch
|
||||
|
||||
/* First of all, compare bytes until wp1(sp1) is word-aligned. */
|
||||
1:
|
||||
tst wp1, #3
|
||||
beq 2f
|
||||
ldrb r2, [wp1], #1
|
||||
ldrb r3, [wp2], #1
|
||||
cmp r2, #1
|
||||
it cs
|
||||
cmpcs r2, r3
|
||||
beq 1b
|
||||
sub r0, r2, r3
|
||||
bx lr
|
||||
|
||||
2:
|
||||
str r5, [sp, #-4]!
|
||||
str r4, [sp, #-4]!
|
||||
mov b1, #1
|
||||
orr b1, b1, b1, lsl #8
|
||||
orr b1, b1, b1, lsl #16
|
||||
|
||||
and t1, wp2, #3
|
||||
bic wp2, wp2, #3
|
||||
ldr w1, [wp1], #4
|
||||
ldr w2, [wp2], #4
|
||||
cmp t1, #2
|
||||
beq 2f
|
||||
bhi 3f
|
||||
|
||||
/* Critical inner Loop: Block with 3 bytes initial overlap */
|
||||
.p2align 2
|
||||
1:
|
||||
bic t1, w1, #MSB
|
||||
cmp t1, w2, SHFT2LSB #8
|
||||
sub r3, w1, b1
|
||||
bic r3, r3, w1
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, SHFT2MSB #24
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 1b
|
||||
4:
|
||||
SHFT2LSB w2, w2, #8
|
||||
b 8f
|
||||
|
||||
5:
|
||||
#ifdef __ARMEB__
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
* with the bytes 0x01 0x00
|
||||
*/
|
||||
tst w1, #0xff000000
|
||||
itt ne
|
||||
tstne w1, #0x00ff0000
|
||||
tstne w1, #0x0000ff00
|
||||
beq 7f
|
||||
#else
|
||||
bics r3, r3, #0xff000000
|
||||
bne 7f
|
||||
#endif
|
||||
ldrb w2, [wp2]
|
||||
SHFT2LSB t1, w1, #24
|
||||
#ifdef __ARMEB__
|
||||
lsl w2, w2, #24
|
||||
#endif
|
||||
b 8f
|
||||
|
||||
6:
|
||||
SHFT2LSB t1, w1, #24
|
||||
and w2, w2, #LSB
|
||||
b 8f
|
||||
|
||||
/* Critical inner Loop: Block with 2 bytes initial overlap */
|
||||
.p2align 2
|
||||
2:
|
||||
SHFT2MSB t1, w1, #16
|
||||
sub r3, w1, b1
|
||||
SHFT2LSB t1, t1, #16
|
||||
bic r3, r3, w1
|
||||
cmp t1, w2, SHFT2LSB #16
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, SHFT2MSB #16
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 2b
|
||||
|
||||
5:
|
||||
#ifdef __ARMEB__
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
* with the bytes 0x01 0x00
|
||||
*/
|
||||
tst w1, #0xff000000
|
||||
it ne
|
||||
tstne w1, #0x00ff0000
|
||||
beq 7f
|
||||
#else
|
||||
lsls r3, r3, #16
|
||||
bne 7f
|
||||
#endif
|
||||
ldrh w2, [wp2]
|
||||
SHFT2LSB t1, w1, #16
|
||||
#ifdef __ARMEB__
|
||||
lsl w2, w2, #16
|
||||
#endif
|
||||
b 8f
|
||||
|
||||
6:
|
||||
SHFT2MSB w2, w2, #16
|
||||
SHFT2LSB t1, w1, #16
|
||||
4:
|
||||
SHFT2LSB w2, w2, #16
|
||||
b 8f
|
||||
|
||||
/* Critical inner Loop: Block with 1 byte initial overlap */
|
||||
.p2align 2
|
||||
3:
|
||||
and t1, w1, #LSB
|
||||
cmp t1, w2, SHFT2LSB #24
|
||||
sub r3, w1, b1
|
||||
bic r3, r3, w1
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, SHFT2MSB #8
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 3b
|
||||
4:
|
||||
SHFT2LSB w2, w2, #24
|
||||
b 8f
|
||||
5:
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
* with the bytes 0x01 0x00
|
||||
*/
|
||||
tst w1, #LSB
|
||||
beq 7f
|
||||
ldr w2, [wp2], #4
|
||||
6:
|
||||
SHFT2LSB t1, w1, #8
|
||||
bic w2, w2, #MSB
|
||||
b 8f
|
||||
7:
|
||||
mov r0, #0
|
||||
ldr r4, [sp], #4
|
||||
ldr r5, [sp], #4
|
||||
bx lr
|
||||
|
||||
8:
|
||||
and r2, t1, #LSB
|
||||
and r0, w2, #LSB
|
||||
cmp r0, #1
|
||||
it cs
|
||||
cmpcs r0, r2
|
||||
itt eq
|
||||
SHFT2LSBEQ t1, t1, #8
|
||||
SHFT2LSBEQ w2, w2, #8
|
||||
beq 8b
|
||||
sub r0, r2, r0
|
||||
ldr r4, [sp], #4
|
||||
ldr r5, [sp], #4
|
||||
bx lr
|
||||
END(strcmp)
|
3
libc/arch-arm/generic/generic.mk
Normal file
3
libc/arch-arm/generic/generic.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/generic/bionic/memcpy.S)
|
||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/generic/bionic/memset.S)
|
||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/generic/bionic/strcmp.S)
|
146
libc/arch-arm/krait/bionic/memcpy.S
Normal file
146
libc/arch-arm/krait/bionic/memcpy.S
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Assumes neon instructions and a cache line size of 32 bytes. */
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* This code assumes it is running on a processor that supports all arm v7
|
||||
* instructions, that supports neon instructions, and that has a 32 byte
|
||||
* cache line.
|
||||
*/
|
||||
|
||||
.text
|
||||
.fpu neon
|
||||
|
||||
#define CACHE_LINE_SIZE 32
|
||||
|
||||
ENTRY(memcpy)
|
||||
.save {r0, lr}
|
||||
/* start preloading as early as possible */
|
||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
||||
stmfd sp!, {r0, lr}
|
||||
pld [r1, #(CACHE_LINE_SIZE*2)]
|
||||
|
||||
/* do we have at least 16-bytes to copy (needed for alignment below) */
|
||||
cmp r2, #16
|
||||
blo 5f
|
||||
|
||||
/* align destination to cache-line for the write-buffer */
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0xF
|
||||
beq 0f
|
||||
|
||||
/* copy up to 15-bytes (count in r3) */
|
||||
sub r2, r2, r3
|
||||
movs ip, r3, lsl #31
|
||||
ldrmib lr, [r1], #1
|
||||
strmib lr, [r0], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
movs ip, r3, lsl #29
|
||||
bge 1f
|
||||
// copies 4 bytes, destination 32-bits aligned
|
||||
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
|
||||
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]!
|
||||
1: bcc 2f
|
||||
// copies 8 bytes, destination 64-bits aligned
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0, :64]!
|
||||
2:
|
||||
|
||||
0: /* preload immediately the next cache line, which we may need */
|
||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*2)]
|
||||
|
||||
/* make sure we have at least 64 bytes to copy */
|
||||
subs r2, r2, #64
|
||||
blo 2f
|
||||
|
||||
/* Preload all the cache lines we need.
|
||||
* NOTE: The number of pld below depends on CACHE_LINE_SIZE,
|
||||
* ideally we would increase the distance in the main loop to
|
||||
* avoid the goofy code below. In practice this doesn't seem to make
|
||||
* a big difference.
|
||||
* NOTE: The value CACHE_LINE_SIZE * 8 was chosen through
|
||||
* experimentation.
|
||||
*/
|
||||
pld [r1, #(CACHE_LINE_SIZE*4)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*6)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*8)]
|
||||
|
||||
1: /* The main loop copies 64 bytes at a time */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
vld1.8 {d4 - d7}, [r1]!
|
||||
pld [r1, #(CACHE_LINE_SIZE*8)]
|
||||
subs r2, r2, #64
|
||||
vst1.8 {d0 - d3}, [r0, :128]!
|
||||
vst1.8 {d4 - d7}, [r0, :128]!
|
||||
bhs 1b
|
||||
|
||||
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
|
||||
add r2, r2, #64
|
||||
subs r2, r2, #32
|
||||
blo 4f
|
||||
|
||||
3: /* 32 bytes at a time. These cache lines were already preloaded */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
subs r2, r2, #32
|
||||
vst1.8 {d0 - d3}, [r0, :128]!
|
||||
bhs 3b
|
||||
4: /* less than 32 left */
|
||||
add r2, r2, #32
|
||||
tst r2, #0x10
|
||||
beq 5f
|
||||
// copies 16 bytes, 128-bits aligned
|
||||
vld1.8 {d0, d1}, [r1]!
|
||||
vst1.8 {d0, d1}, [r0, :128]!
|
||||
|
||||
5: /* copy up to 15-bytes (count in r2) */
|
||||
movs ip, r2, lsl #29
|
||||
bcc 1f
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0]!
|
||||
1: bge 2f
|
||||
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
|
||||
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]!
|
||||
2: movs ip, r2, lsl #31
|
||||
ldrmib r3, [r1], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strmib r3, [r0], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
|
||||
ldmfd sp!, {r0, lr}
|
||||
bx lr
|
||||
END(memcpy)
|
81
libc/arch-arm/krait/bionic/memset.S
Normal file
81
libc/arch-arm/krait/bionic/memset.S
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
/*
|
||||
* This code assumes it is running on a processor that supports all arm v7
|
||||
* instructions, that supports neon instructions, and that supports
|
||||
* unaligned neon instruction accesses to memory.
|
||||
*/
|
||||
|
||||
.fpu neon
|
||||
|
||||
ENTRY(bzero)
|
||||
mov r2, r1
|
||||
mov r1, #0
|
||||
END(bzero)
|
||||
|
||||
/* memset() returns its first argument. */
|
||||
ENTRY(memset)
|
||||
.save {r0}
|
||||
stmfd sp!, {r0}
|
||||
|
||||
vdup.8 q0, r1
|
||||
|
||||
/* make sure we have at least 32 bytes to write */
|
||||
subs r2, r2, #32
|
||||
blo 2f
|
||||
vmov q1, q0
|
||||
|
||||
1: /* The main loop writes 32 bytes at a time */
|
||||
subs r2, r2, #32
|
||||
vst1.8 {d0 - d3}, [r0]!
|
||||
bhs 1b
|
||||
|
||||
2: /* less than 32 left */
|
||||
add r2, r2, #32
|
||||
tst r2, #0x10
|
||||
beq 3f
|
||||
|
||||
// writes 16 bytes, 128-bits aligned
|
||||
vst1.8 {d0, d1}, [r0]!
|
||||
3: /* write up to 15-bytes (count in r2) */
|
||||
movs ip, r2, lsl #29
|
||||
bcc 1f
|
||||
vst1.8 {d0}, [r0]!
|
||||
1: bge 2f
|
||||
vst1.32 {d0[0]}, [r0]!
|
||||
2: movs ip, r2, lsl #31
|
||||
strmib r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
strcsb r1, [r0], #1
|
||||
ldmfd sp!, {r0}
|
||||
bx lr
|
||||
END(memset)
|
477
libc/arch-arm/krait/bionic/strcmp.S
Normal file
477
libc/arch-arm/krait/bionic/strcmp.S
Normal file
@@ -0,0 +1,477 @@
|
||||
/*
|
||||
* Copyright (c) 2013 ARM Ltd
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the company may not be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#ifdef __ARMEB__
|
||||
#define S2LOMEM lsl
|
||||
#define S2LOMEMEQ lsleq
|
||||
#define S2HIMEM lsr
|
||||
#define MSB 0x000000ff
|
||||
#define LSB 0xff000000
|
||||
#define BYTE0_OFFSET 24
|
||||
#define BYTE1_OFFSET 16
|
||||
#define BYTE2_OFFSET 8
|
||||
#define BYTE3_OFFSET 0
|
||||
#else /* not __ARMEB__ */
|
||||
#define S2LOMEM lsr
|
||||
#define S2LOMEMEQ lsreq
|
||||
#define S2HIMEM lsl
|
||||
#define BYTE0_OFFSET 0
|
||||
#define BYTE1_OFFSET 8
|
||||
#define BYTE2_OFFSET 16
|
||||
#define BYTE3_OFFSET 24
|
||||
#define MSB 0xff000000
|
||||
#define LSB 0x000000ff
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
.syntax unified
|
||||
|
||||
#if defined (__thumb__)
|
||||
.thumb
|
||||
.thumb_func
|
||||
#endif
|
||||
|
||||
ENTRY(strcmp)
|
||||
/* Use LDRD whenever possible. */
|
||||
|
||||
/* The main thing to look out for when comparing large blocks is that
|
||||
the loads do not cross a page boundary when loading past the index
|
||||
of the byte with the first difference or the first string-terminator.
|
||||
|
||||
For example, if the strings are identical and the string-terminator
|
||||
is at index k, byte by byte comparison will not load beyond address
|
||||
s1+k and s2+k; word by word comparison may load up to 3 bytes beyond
|
||||
k; double word - up to 7 bytes. If the load of these bytes crosses
|
||||
a page boundary, it might cause a memory fault (if the page is not mapped)
|
||||
that would not have happened in byte by byte comparison.
|
||||
|
||||
If an address is (double) word aligned, then a load of a (double) word
|
||||
from that address will not cross a page boundary.
|
||||
Therefore, the algorithm below considers word and double-word alignment
|
||||
of strings separately. */
|
||||
|
||||
/* High-level description of the algorithm.
|
||||
|
||||
* The fast path: if both strings are double-word aligned,
|
||||
use LDRD to load two words from each string in every loop iteration.
|
||||
* If the strings have the same offset from a word boundary,
|
||||
use LDRB to load and compare byte by byte until
|
||||
the first string is aligned to a word boundary (at most 3 bytes).
|
||||
This is optimized for quick return on short unaligned strings.
|
||||
* If the strings have the same offset from a double-word boundary,
|
||||
use LDRD to load two words from each string in every loop iteration, as in the fast path.
|
||||
* If the strings do not have the same offset from a double-word boundary,
|
||||
load a word from the second string before the loop to initialize the queue.
|
||||
Use LDRD to load two words from every string in every loop iteration.
|
||||
Inside the loop, load the second word from the second string only after comparing
|
||||
the first word, using the queued value, to guarantee safety across page boundaries.
|
||||
* If the strings do not have the same offset from a word boundary,
|
||||
use LDR and a shift queue. Order of loads and comparisons matters,
|
||||
similarly to the previous case.
|
||||
|
||||
* Use UADD8 and SEL to compare words, and use REV and CLZ to compute the return value.
|
||||
* The only difference between ARM and Thumb modes is the use of CBZ instruction.
|
||||
* The only difference between big and little endian is the use of REV in little endian
|
||||
to compute the return value, instead of MOV.
|
||||
*/
|
||||
|
||||
.macro m_cbz reg label
|
||||
#ifdef __thumb2__
|
||||
cbz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
beq \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbz */
|
||||
|
||||
.macro m_cbnz reg label
|
||||
#ifdef __thumb2__
|
||||
cbnz \reg, \label
|
||||
#else /* not defined __thumb2__ */
|
||||
cmp \reg, #0
|
||||
bne \label
|
||||
#endif /* not defined __thumb2__ */
|
||||
.endm /* m_cbnz */
|
||||
|
||||
.macro init
|
||||
/* Macro to save temporary registers and prepare magic values. */
|
||||
subs sp, sp, #16
|
||||
strd r4, r5, [sp, #8]
|
||||
strd r6, r7, [sp]
|
||||
mvn r6, #0 /* all F */
|
||||
mov r7, #0 /* all 0 */
|
||||
.endm /* init */
|
||||
|
||||
.macro magic_compare_and_branch w1 w2 label
|
||||
/* Macro to compare registers w1 and w2 and conditionally branch to label. */
|
||||
cmp \w1, \w2 /* Are w1 and w2 the same? */
|
||||
magic_find_zero_bytes \w1
|
||||
it eq
|
||||
cmpeq ip, #0 /* Is there a zero byte in w1? */
|
||||
bne \label
|
||||
.endm /* magic_compare_and_branch */
|
||||
|
||||
.macro magic_find_zero_bytes w1
|
||||
/* Macro to find all-zero bytes in w1, result is in ip. */
|
||||
#if (defined (__ARM_FEATURE_DSP))
|
||||
uadd8 ip, \w1, r6
|
||||
sel ip, r7, r6
|
||||
#else /* not defined (__ARM_FEATURE_DSP) */
|
||||
/* __ARM_FEATURE_DSP is not defined for some Cortex-M processors.
|
||||
Coincidently, these processors only have Thumb-2 mode, where we can use the
|
||||
the (large) magic constant available directly as an immediate in instructions.
|
||||
Note that we cannot use the magic constant in ARM mode, where we need
|
||||
to create the constant in a register. */
|
||||
sub ip, \w1, #0x01010101
|
||||
bic ip, ip, \w1
|
||||
and ip, ip, #0x80808080
|
||||
#endif /* not defined (__ARM_FEATURE_DSP) */
|
||||
.endm /* magic_find_zero_bytes */
|
||||
|
||||
.macro setup_return w1 w2
|
||||
#ifdef __ARMEB__
|
||||
mov r1, \w1
|
||||
mov r2, \w2
|
||||
#else /* not __ARMEB__ */
|
||||
rev r1, \w1
|
||||
rev r2, \w2
|
||||
#endif /* not __ARMEB__ */
|
||||
.endm /* setup_return */
|
||||
|
||||
pld [r0, #0]
|
||||
pld [r1, #0]
|
||||
|
||||
/* Are both strings double-word aligned? */
|
||||
orr ip, r0, r1
|
||||
tst ip, #7
|
||||
bne do_align
|
||||
|
||||
/* Fast path. */
|
||||
init
|
||||
|
||||
doubleword_aligned:
|
||||
|
||||
/* Get here when the strings to compare are double-word aligned. */
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
2:
|
||||
pld [r0, #16]
|
||||
pld [r1, #16]
|
||||
|
||||
/* Load the next double-word from each string. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
ldrd r4, r5, [r1], #8
|
||||
|
||||
magic_compare_and_branch w1=r2, w2=r4, label=return_24
|
||||
magic_compare_and_branch w1=r3, w2=r5, label=return_35
|
||||
b 2b
|
||||
|
||||
do_align:
|
||||
/* Is the first string word-aligned? */
|
||||
ands ip, r0, #3
|
||||
beq word_aligned_r0
|
||||
|
||||
/* Fast compare byte by byte until the first string is word-aligned. */
|
||||
/* The offset of r0 from a word boundary is in ip. Thus, the number of bytes
|
||||
to read until the next word boundary is 4-ip. */
|
||||
bic r0, r0, #3
|
||||
ldr r2, [r0], #4
|
||||
lsls ip, ip, #31
|
||||
beq byte2
|
||||
bcs byte3
|
||||
|
||||
byte1:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE1_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte2:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE2_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbz reg=r3, label=fast_return
|
||||
|
||||
byte3:
|
||||
ldrb ip, [r1], #1
|
||||
uxtb r3, r2, ror #BYTE3_OFFSET
|
||||
subs ip, r3, ip
|
||||
bne fast_return
|
||||
m_cbnz reg=r3, label=word_aligned_r0
|
||||
|
||||
fast_return:
|
||||
mov r0, ip
|
||||
bx lr
|
||||
|
||||
word_aligned_r0:
|
||||
init
|
||||
/* The first string is word-aligned. */
|
||||
/* Is the second string word-aligned? */
|
||||
ands ip, r1, #3
|
||||
bne strcmp_unaligned
|
||||
|
||||
word_aligned:
|
||||
/* The strings are word-aligned. */
|
||||
/* Is the first string double-word aligned? */
|
||||
tst r0, #4
|
||||
beq doubleword_aligned_r0
|
||||
|
||||
/* If r0 is not double-word aligned yet, align it by loading
|
||||
and comparing the next word from each string. */
|
||||
ldr r2, [r0], #4
|
||||
ldr r4, [r1], #4
|
||||
magic_compare_and_branch w1=r2 w2=r4 label=return_24
|
||||
|
||||
doubleword_aligned_r0:
|
||||
/* Get here when r0 is double-word aligned. */
|
||||
/* Is r1 doubleword_aligned? */
|
||||
tst r1, #4
|
||||
beq doubleword_aligned
|
||||
|
||||
/* Get here when the strings to compare are word-aligned,
|
||||
r0 is double-word aligned, but r1 is not double-word aligned. */
|
||||
|
||||
/* Initialize the queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare two words in every iteration. */
|
||||
.p2align 2
|
||||
3:
|
||||
pld [r0, #16]
|
||||
pld [r1, #16]
|
||||
|
||||
/* Load the next double-word from each string and compare. */
|
||||
ldrd r2, r3, [r0], #8
|
||||
magic_compare_and_branch w1=r2 w2=r5 label=return_25
|
||||
ldrd r4, r5, [r1], #8
|
||||
magic_compare_and_branch w1=r3 w2=r4 label=return_34
|
||||
b 3b
|
||||
|
||||
.macro miscmp_word offsetlo offsethi
|
||||
/* Macro to compare misaligned strings. */
|
||||
/* r0, r1 are word-aligned, and at least one of the strings
|
||||
is not double-word aligned. */
|
||||
/* Compare one word in every loop iteration. */
|
||||
/* OFFSETLO is the original bit-offset of r1 from a word-boundary,
|
||||
OFFSETHI is 32 - OFFSETLO (i.e., offset from the next word). */
|
||||
|
||||
/* Initialize the shift queue. */
|
||||
ldr r5, [r1], #4
|
||||
|
||||
/* Compare one word from each string in every loop iteration. */
|
||||
.p2align 2
|
||||
7:
|
||||
ldr r3, [r0], #4
|
||||
S2LOMEM r5, r5, #\offsetlo
|
||||
magic_find_zero_bytes w1=r3
|
||||
cmp r7, ip, S2HIMEM #\offsetlo
|
||||
and r2, r3, r6, S2LOMEM #\offsetlo
|
||||
it eq
|
||||
cmpeq r2, r5
|
||||
bne return_25
|
||||
ldr r5, [r1], #4
|
||||
cmp ip, #0
|
||||
eor r3, r2, r3
|
||||
S2HIMEM r2, r5, #\offsethi
|
||||
it eq
|
||||
cmpeq r3, r2
|
||||
bne return_32
|
||||
b 7b
|
||||
.endm /* miscmp_word */
|
||||
|
||||
strcmp_unaligned:
|
||||
/* r0 is word-aligned, r1 is at offset ip from a word. */
|
||||
/* Align r1 to the (previous) word-boundary. */
|
||||
bic r1, r1, #3
|
||||
|
||||
/* Unaligned comparison word by word using LDRs. */
|
||||
cmp ip, #2
|
||||
beq miscmp_word_16 /* If ip == 2. */
|
||||
bge miscmp_word_24 /* If ip == 3. */
|
||||
miscmp_word offsetlo=8 offsethi=24 /* If ip == 1. */
|
||||
miscmp_word_24: miscmp_word offsetlo=24 offsethi=8
|
||||
|
||||
|
||||
return_32:
|
||||
setup_return w1=r3, w2=r2
|
||||
b do_return
|
||||
return_34:
|
||||
setup_return w1=r3, w2=r4
|
||||
b do_return
|
||||
return_25:
|
||||
setup_return w1=r2, w2=r5
|
||||
b do_return
|
||||
return_35:
|
||||
setup_return w1=r3, w2=r5
|
||||
b do_return
|
||||
return_24:
|
||||
setup_return w1=r2, w2=r4
|
||||
|
||||
do_return:
|
||||
|
||||
#ifdef __ARMEB__
|
||||
mov r0, ip
|
||||
#else /* not __ARMEB__ */
|
||||
rev r0, ip
|
||||
#endif /* not __ARMEB__ */
|
||||
|
||||
/* Restore temporaries early, before computing the return value. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
/* There is a zero or a different byte between r1 and r2. */
|
||||
/* r0 contains a mask of all-zero bytes in r1. */
|
||||
/* Using r0 and not ip here because cbz requires low register. */
|
||||
m_cbz reg=r0, label=compute_return_value
|
||||
clz r0, r0
|
||||
/* r0 contains the number of bits on the left of the first all-zero byte in r1. */
|
||||
rsb r0, r0, #24
|
||||
/* Here, r0 contains the number of bits on the right of the first all-zero byte in r1. */
|
||||
lsr r1, r1, r0
|
||||
lsr r2, r2, r0
|
||||
|
||||
compute_return_value:
|
||||
movs r0, #1
|
||||
cmp r1, r2
|
||||
/* The return value is computed as follows.
|
||||
If r1>r2 then (C==1 and Z==0) and LS doesn't hold and r0 is #1 at return.
|
||||
If r1<r2 then (C==0 and Z==0) and we execute SBC with carry_in=0,
|
||||
which means r0:=r0-r0-1 and r0 is #-1 at return.
|
||||
If r1=r2 then (C==1 and Z==1) and we execute SBC with carry_in=1,
|
||||
which means r0:=r0-r0 and r0 is #0 at return.
|
||||
(C==0 and Z==1) cannot happen because the carry bit is "not borrow". */
|
||||
it ls
|
||||
sbcls r0, r0, r0
|
||||
bx lr
|
||||
|
||||
/* The code from the previous version of strcmp.S handles this
|
||||
* particular case (the second string is 2 bytes off a word alignment)
|
||||
* faster than any current version. In this very specific case, use the
|
||||
* previous version. See bionic/libc/arch-arm/cortex-a15/bionic/strcmp.S
|
||||
* for the unedited version of this code.
|
||||
*/
|
||||
miscmp_word_16:
|
||||
wp1 .req r0
|
||||
wp2 .req r1
|
||||
b1 .req r2
|
||||
w1 .req r4
|
||||
w2 .req r5
|
||||
t1 .req ip
|
||||
@ r3 is scratch
|
||||
|
||||
/* At this point, wp1 (r0) has already been word-aligned. */
|
||||
2:
|
||||
mov b1, #1
|
||||
orr b1, b1, b1, lsl #8
|
||||
orr b1, b1, b1, lsl #16
|
||||
|
||||
and t1, wp2, #3
|
||||
bic wp2, wp2, #3
|
||||
ldr w1, [wp1], #4
|
||||
ldr w2, [wp2], #4
|
||||
|
||||
/* Critical inner Loop: Block with 2 bytes initial overlap */
|
||||
.p2align 2
|
||||
2:
|
||||
S2HIMEM t1, w1, #16
|
||||
sub r3, w1, b1
|
||||
S2LOMEM t1, t1, #16
|
||||
bic r3, r3, w1
|
||||
cmp t1, w2, S2LOMEM #16
|
||||
bne 4f
|
||||
ands r3, r3, b1, lsl #7
|
||||
it eq
|
||||
ldreq w2, [wp2], #4
|
||||
bne 5f
|
||||
eor t1, t1, w1
|
||||
cmp t1, w2, S2HIMEM #16
|
||||
bne 6f
|
||||
ldr w1, [wp1], #4
|
||||
b 2b
|
||||
|
||||
5:
|
||||
#ifdef __ARMEB__
|
||||
/* The syndrome value may contain false ones if the string ends
|
||||
* with the bytes 0x01 0x00
|
||||
*/
|
||||
tst w1, #0xff000000
|
||||
it ne
|
||||
tstne w1, #0x00ff0000
|
||||
beq 7f
|
||||
#else
|
||||
lsls r3, r3, #16
|
||||
bne 7f
|
||||
#endif
|
||||
ldrh w2, [wp2]
|
||||
S2LOMEM t1, w1, #16
|
||||
#ifdef __ARMEB__
|
||||
lsl w2, w2, #16
|
||||
#endif
|
||||
b 8f
|
||||
|
||||
6:
|
||||
S2HIMEM w2, w2, #16
|
||||
S2LOMEM t1, w1, #16
|
||||
4:
|
||||
S2LOMEM w2, w2, #16
|
||||
b 8f
|
||||
|
||||
7:
|
||||
mov r0, #0
|
||||
|
||||
/* Restore registers and stack. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
bx lr
|
||||
|
||||
8:
|
||||
and r2, t1, #LSB
|
||||
and r0, w2, #LSB
|
||||
cmp r0, #1
|
||||
it cs
|
||||
cmpcs r0, r2
|
||||
itt eq
|
||||
S2LOMEMEQ t1, t1, #8
|
||||
S2LOMEMEQ w2, w2, #8
|
||||
beq 8b
|
||||
sub r0, r2, r0
|
||||
|
||||
/* Restore registers and stack. */
|
||||
ldrd r6, r7, [sp]
|
||||
ldrd r4, r5, [sp, #8]
|
||||
adds sp, sp, #16
|
||||
|
||||
bx lr
|
||||
END(strcmp)
|
5
libc/arch-arm/krait/krait.mk
Normal file
5
libc/arch-arm/krait/krait.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/krait/bionic/memcpy.S)
|
||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/krait/bionic/memset.S)
|
||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/krait/bionic/strcmp.S)
|
||||
|
||||
include bionic/libc/arch-arm/generic/generic.mk
|
@@ -4,6 +4,7 @@ syscall_src += arch-arm/syscalls/_exit.S
|
||||
syscall_src += arch-arm/syscalls/_exit_thread.S
|
||||
syscall_src += arch-arm/syscalls/__fork.S
|
||||
syscall_src += arch-arm/syscalls/__waitid.S
|
||||
syscall_src += arch-arm/syscalls/wait4.S
|
||||
syscall_src += arch-arm/syscalls/__sys_clone.S
|
||||
syscall_src += arch-arm/syscalls/execve.S
|
||||
syscall_src += arch-arm/syscalls/__setuid.S
|
||||
@@ -180,7 +181,6 @@ syscall_src += arch-arm/syscalls/__getcpu.S
|
||||
syscall_src += arch-arm/syscalls/ioprio_set.S
|
||||
syscall_src += arch-arm/syscalls/ioprio_get.S
|
||||
syscall_src += arch-arm/syscalls/uname.S
|
||||
syscall_src += arch-arm/syscalls/__wait4.S
|
||||
syscall_src += arch-arm/syscalls/umask.S
|
||||
syscall_src += arch-arm/syscalls/__reboot.S
|
||||
syscall_src += arch-arm/syscalls/__syslog.S
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__brk)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_brk
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__brk)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__fcntl)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_fcntl
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__fcntl)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__fcntl64)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_fcntl64
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__fcntl64)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__fork)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_fork
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__fork)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__fstatfs64)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_fstatfs64
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__fstatfs64)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__getcpu)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_getcpu
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__getcpu)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__getcwd)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_getcwd
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__getcwd)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__getpriority)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_getpriority
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__getpriority)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__ioctl)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_ioctl
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__ioctl)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__llseek)
|
||||
mov ip, sp
|
||||
@@ -10,7 +11,8 @@ ENTRY(__llseek)
|
||||
ldr r7, =__NR__llseek
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__llseek)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__mmap2)
|
||||
mov ip, sp
|
||||
@@ -10,7 +11,8 @@ ENTRY(__mmap2)
|
||||
ldr r7, =__NR_mmap2
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__mmap2)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__open)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_open
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__open)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__openat)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_openat
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__openat)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__ptrace)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_ptrace
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__ptrace)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__reboot)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_reboot
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__reboot)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__rt_sigaction)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_rt_sigaction
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__rt_sigaction)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__rt_sigprocmask)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_rt_sigprocmask
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__rt_sigprocmask)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__rt_sigtimedwait)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_rt_sigtimedwait
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__rt_sigtimedwait)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__sched_getaffinity)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_sched_getaffinity
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__sched_getaffinity)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__set_tls)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_ARM_set_tls
|
||||
ldr r7, =__ARM_NR_set_tls
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__set_tls)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__setresuid)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_setresuid32
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__setresuid)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__setreuid)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_setreuid32
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__setreuid)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__setuid)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_setuid32
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__setuid)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__sigsuspend)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_sigsuspend
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__sigsuspend)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__statfs64)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_statfs64
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__statfs64)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__sys_clone)
|
||||
mov ip, sp
|
||||
@@ -10,7 +11,8 @@ ENTRY(__sys_clone)
|
||||
ldr r7, =__NR_clone
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__sys_clone)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__syslog)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_syslog
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__syslog)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__timer_create)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timer_create
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__timer_create)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__timer_delete)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timer_delete
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__timer_delete)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__timer_getoverrun)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timer_getoverrun
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__timer_getoverrun)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__timer_gettime)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timer_gettime
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__timer_gettime)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__timer_settime)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_timer_settime
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__timer_settime)
|
||||
|
@@ -1,13 +0,0 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__wait4)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_wait4
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
END(__wait4)
|
@@ -1,6 +1,7 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(__waitid)
|
||||
mov ip, sp
|
||||
@@ -10,7 +11,8 @@ ENTRY(__waitid)
|
||||
ldr r7, =__NR_waitid
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(__waitid)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(_exit)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_exit_group
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(_exit)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(_exit_thread)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_exit
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(_exit_thread)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(accept)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_accept
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(accept)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(access)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_access
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(access)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(acct)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_acct
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(acct)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(bind)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_bind
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(bind)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(cacheflush)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_ARM_cacheflush
|
||||
ldr r7, =__ARM_NR_cacheflush
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(cacheflush)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(capget)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_capget
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(capget)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(capset)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_capset
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(capset)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(chdir)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_chdir
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(chdir)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(chmod)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_chmod
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(chmod)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(chown)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_chown32
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(chown)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(chroot)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_chroot
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(chroot)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(clock_getres)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_clock_getres
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(clock_getres)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(clock_gettime)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_clock_gettime
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(clock_gettime)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(clock_nanosleep)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_clock_nanosleep
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(clock_nanosleep)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(clock_settime)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_clock_settime
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(clock_settime)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(close)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_close
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(close)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(connect)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_connect
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(connect)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(delete_module)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_delete_module
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(delete_module)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(dup)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_dup
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(dup)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(dup2)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_dup2
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(dup2)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(epoll_create)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_epoll_create
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(epoll_create)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(epoll_ctl)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_epoll_ctl
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(epoll_ctl)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(epoll_wait)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_epoll_wait
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(epoll_wait)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(eventfd)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_eventfd2
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(eventfd)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(execve)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_execve
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(execve)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(faccessat)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_faccessat
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(faccessat)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/err.h>
|
||||
#include <machine/asm.h>
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
ENTRY(fchdir)
|
||||
mov ip, r7
|
||||
ldr r7, =__NR_fchdir
|
||||
swi #0
|
||||
mov r7, ip
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
cmn r0, #(MAX_ERRNO + 1)
|
||||
bxls lr
|
||||
neg r0, r0
|
||||
b __set_errno
|
||||
END(fchdir)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user