Compare commits
1033 Commits
android-ct
...
tools_r22
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff220f7003 | ||
|
|
63dd03cced | ||
|
|
b9256adab3 | ||
|
|
52171b9bdc | ||
|
|
d541ba1719 | ||
|
|
1c462b7a04 | ||
|
|
b01f7afd5f | ||
|
|
532d6f09b1 | ||
|
|
e4ac8feb58 | ||
|
|
4f40e511b0 | ||
|
|
5e3b502b6b | ||
|
|
277226bf43 | ||
|
|
8c00c91aa0 | ||
|
|
80541922e3 | ||
|
|
bee0ab16e4 | ||
|
|
3b2e6bc9ac | ||
|
|
c46871302e | ||
|
|
9020fd503c | ||
|
|
b94b2851d7 | ||
|
|
78d6d9888c | ||
|
|
382a775378 | ||
|
|
1aae9bd170 | ||
|
|
c6dc62f09c | ||
|
|
e66ad7809e | ||
|
|
f7153fd13f | ||
|
|
9ff1ffd805 | ||
|
|
e7aaad8b83 | ||
|
|
5f28fde8ae | ||
|
|
8d3e91d4f8 | ||
|
|
e8f46e8edd | ||
|
|
87efcd2e63 | ||
|
|
85aeb49144 | ||
|
|
c705daa0a2 | ||
|
|
21da42ea91 | ||
|
|
2c60c18c50 | ||
|
|
bda2fb5efa | ||
|
|
676e66db25 | ||
|
|
2379088a90 | ||
|
|
70e0bd3a44 | ||
|
|
f8dff7d449 | ||
|
|
8c181aa8fe | ||
|
|
516a897053 | ||
|
|
b3c8c4d865 | ||
|
|
796cbe249b | ||
|
|
ea489745dc | ||
|
|
0b25f633a2 | ||
|
|
ed36d95fac | ||
|
|
6b05c8e280 | ||
|
|
b632857a50 | ||
|
|
4ca685e36e | ||
|
|
fc76c7d394 | ||
|
|
bf0d1ad72b | ||
|
|
68fd78efa0 | ||
|
|
185ce72d00 | ||
|
|
240fb8623b | ||
|
|
0d787c1fa1 | ||
|
|
014c75c78b | ||
|
|
8baa929d5d | ||
|
|
14c840df90 | ||
|
|
a51916b58b | ||
|
|
162b4411fc | ||
|
|
4ace92c62a | ||
|
|
7a29f404e1 | ||
|
|
378b0e1ea2 | ||
|
|
6bb17dfad3 | ||
|
|
cfa089df23 | ||
|
|
74b324ac09 | ||
|
|
ce636ca088 | ||
|
|
bd014c2e42 | ||
|
|
e6ddfc55c8 | ||
|
|
e51d75a9ac | ||
|
|
65a8eb606f | ||
|
|
48f25cef45 | ||
|
|
a40751185f | ||
|
|
3198850ea1 | ||
|
|
1b91c6c11f | ||
|
|
c019345a3a | ||
|
|
cda62094ef | ||
|
|
c37dd59956 | ||
|
|
890c8ed6ef | ||
|
|
34895c1bdf | ||
|
|
5c5f303e4c | ||
|
|
e7cb795cb6 | ||
|
|
8794ece296 | ||
|
|
56d161bb62 | ||
|
|
4cdde5f123 | ||
|
|
3323628d63 | ||
|
|
5c2772f59d | ||
|
|
babb72dc29 | ||
|
|
a41ba2f0bf | ||
|
|
26c815c489 | ||
|
|
612333f671 | ||
|
|
9724ce3a09 | ||
|
|
4453c51c82 | ||
|
|
8f7120bbac | ||
|
|
a6cc67c9b5 | ||
|
|
800ad8249a | ||
|
|
8ecf225827 | ||
|
|
6eb978c9bf | ||
|
|
17a8b0db63 | ||
|
|
86c3184972 | ||
|
|
31dea25b8b | ||
|
|
adeec09629 | ||
|
|
ce532721aa | ||
|
|
c14166477e | ||
|
|
8f2a5a0b40 | ||
|
|
e23ed8c644 | ||
|
|
2eb44c5aa4 | ||
|
|
4d696eb49d | ||
|
|
af7f2f2fcf | ||
|
|
d30b9f0912 | ||
|
|
306a353825 | ||
|
|
f861bc5cc3 | ||
|
|
e0175ca7e4 | ||
|
|
ec706c24ac | ||
|
|
9aceab5015 | ||
|
|
980508b0ea | ||
|
|
04954a43b3 | ||
|
|
94a34010c1 | ||
|
|
cb2069bf69 | ||
|
|
f21aa3b61e | ||
|
|
ca0c11bd82 | ||
|
|
6b4c77f854 | ||
|
|
fa8c05dc00 | ||
|
|
53630c0e5b | ||
|
|
4a05bef4c0 | ||
|
|
4b032ee9b9 | ||
|
|
62c5cd0781 | ||
|
|
cdb27f239b | ||
|
|
b6e22482d4 | ||
|
|
809eed1ded | ||
|
|
0493a6f7be | ||
|
|
c9f8081425 | ||
|
|
6b3f49a537 | ||
|
|
33031fed84 | ||
|
|
2d4b9b7cff | ||
|
|
db794197cc | ||
|
|
642331b5dd | ||
|
|
0b4a85bf1e | ||
|
|
5e2492eb89 | ||
|
|
20958207d5 | ||
|
|
43cc7f795b | ||
|
|
c41dcad040 | ||
|
|
650be4e584 | ||
|
|
036f909720 | ||
|
|
d4ee82dfa3 | ||
|
|
be21fe7a59 | ||
|
|
69af6e61e1 | ||
|
|
133d97e4b0 | ||
|
|
cf9a9604ad | ||
|
|
eb93ebffba | ||
|
|
d392e044c7 | ||
|
|
f0777843c0 | ||
|
|
14283004f5 | ||
|
|
c5c6cb3f13 | ||
|
|
8f149da08d | ||
|
|
305a999589 | ||
|
|
66273ac2b6 | ||
|
|
b3b1ab6213 | ||
|
|
8fa924e5df | ||
|
|
6524d3cad7 | ||
|
|
eb149e954e | ||
|
|
5b349fc22e | ||
|
|
7fe8229b49 | ||
|
|
9c1912c4bf | ||
|
|
e255642dc1 | ||
|
|
58b997c812 | ||
|
|
f5f906c184 | ||
|
|
7c0dd555c0 | ||
|
|
406968b244 | ||
|
|
c0e9ddd002 | ||
|
|
701bec2af3 | ||
|
|
7b8bf68133 | ||
|
|
f6bb5bf498 | ||
|
|
440bc83d92 | ||
|
|
cadc858329 | ||
|
|
7b2c6385ef | ||
|
|
bc0e7ee181 | ||
|
|
6f1b7a6407 | ||
|
|
cf820d7e96 | ||
|
|
b22a684990 | ||
|
|
2a5b57db8c | ||
|
|
580a707376 | ||
|
|
538f6fc202 | ||
|
|
398f46dd92 | ||
|
|
a0259b42eb | ||
|
|
11ebbc8437 | ||
|
|
719d46f8ac | ||
|
|
a9ff09d1fc | ||
|
|
fae89fc404 | ||
|
|
818b1423d2 | ||
|
|
ccd403161c | ||
|
|
c641cafbc3 | ||
|
|
593abb7b59 | ||
|
|
eeecff7293 | ||
|
|
9d23e04c43 | ||
|
|
b5862d4d8a | ||
|
|
aa772a33ba | ||
|
|
61ba9b526b | ||
|
|
7f67f78ad5 | ||
|
|
081318e355 | ||
|
|
39804dcde6 | ||
|
|
40eabe24e4 | ||
|
|
3e3b239d2b | ||
|
|
7fd803cdfa | ||
|
|
0a2cb81597 | ||
|
|
b128f49fd5 | ||
|
|
fb7eb5e07f | ||
|
|
0276656daa | ||
|
|
c2d26ce745 | ||
|
|
dc5ec07158 | ||
|
|
fe33fc790a | ||
|
|
a261afb7c9 | ||
|
|
6b97c7dc03 | ||
|
|
97f2ec50a7 | ||
|
|
26a13bcfb8 | ||
|
|
d2547040a1 | ||
|
|
95b1ea1bb3 | ||
|
|
6719500dbd | ||
|
|
2fee0340a9 | ||
|
|
73964c592c | ||
|
|
627274292e | ||
|
|
d8213bb573 | ||
|
|
f659b3c90d | ||
|
|
d3b9d11369 | ||
|
|
3002d64bcd | ||
|
|
9cbe1e63dd | ||
|
|
b6032515a0 | ||
|
|
91a9925998 | ||
|
|
baf2c09f3f | ||
|
|
5227663d2f | ||
|
|
59aeff9417 | ||
|
|
07f7e62a25 | ||
|
|
899d65283d | ||
|
|
9701d4b701 | ||
|
|
4b4a882428 | ||
|
|
991ee7d895 | ||
|
|
6d33918207 | ||
|
|
4912782c6a | ||
|
|
9f878c2fca | ||
|
|
558a8b1d3b | ||
|
|
3e898476c7 | ||
|
|
3fa6746536 | ||
|
|
bfa199ab40 | ||
|
|
fcaf4e9f9b | ||
|
|
6f94de3ca4 | ||
|
|
a2a9817f4c | ||
|
|
85f491f96d | ||
|
|
605cc29358 | ||
|
|
83bf28e6a3 | ||
|
|
ba342c11ad | ||
|
|
8e2b28cb6c | ||
|
|
bdff26df27 | ||
|
|
c56be54a18 | ||
|
|
d7a3a403c1 | ||
|
|
c440d24423 | ||
|
|
cae7b2cfb5 | ||
|
|
5e3fc43dde | ||
|
|
03798dd23c | ||
|
|
1fea0f258a | ||
|
|
f94fd3ccc6 | ||
|
|
2a1bb4e646 | ||
|
|
6b73d13fa4 | ||
|
|
2d3e72336e | ||
|
|
e4b08318c1 | ||
|
|
44b53ad681 | ||
|
|
8397cdba94 | ||
|
|
6260553d48 | ||
|
|
024246ec27 | ||
|
|
09e89c3ced | ||
|
|
ad59322ae4 | ||
|
|
8f509e8be1 | ||
|
|
9a9bb243b5 | ||
|
|
d3920b3a99 | ||
|
|
636d21f32b | ||
|
|
03579da2d9 | ||
|
|
170dbe25d6 | ||
|
|
f156b901b1 | ||
|
|
fa75fce566 | ||
|
|
b184d3ba33 | ||
|
|
86e4e23408 | ||
|
|
964886afa3 | ||
|
|
cd6780b167 | ||
|
|
5bb67760f0 | ||
|
|
8ddef40dad | ||
|
|
f6afd3b670 | ||
|
|
59e9a496b4 | ||
|
|
646e058136 | ||
|
|
e4ccf5a138 | ||
|
|
6f67cd224e | ||
|
|
2f41531ff9 | ||
|
|
42b2c6a5ee | ||
|
|
4e9d9e4df8 | ||
|
|
d4187efd7f | ||
|
|
7582a9c119 | ||
|
|
09559dd046 | ||
|
|
d32fdbaf03 | ||
|
|
926a307ce1 | ||
|
|
d2a6d8d77d | ||
|
|
c9ab32e4e9 | ||
|
|
9edb3e004b | ||
|
|
5fe286618f | ||
|
|
d10a5a02d1 | ||
|
|
0e51a86124 | ||
|
|
ef545a29ad | ||
|
|
4fc2a74b29 | ||
|
|
d2b1a7311f | ||
|
|
df8c72e510 | ||
|
|
d7ff139fec | ||
|
|
428f5567be | ||
|
|
3cbcb87bd1 | ||
|
|
a4f88fdcf0 | ||
|
|
24fad01755 | ||
|
|
384bdb3776 | ||
|
|
a3120aaf2f | ||
|
|
b16b72248b | ||
|
|
ada6de673b | ||
|
|
a1821f0153 | ||
|
|
3fac8f7f49 | ||
|
|
16444e0f85 | ||
|
|
3dc6b57cf5 | ||
|
|
9c81892c2e | ||
|
|
33e4365d87 | ||
|
|
1bf835558a | ||
|
|
422c400dd3 | ||
|
|
9b05df325c | ||
|
|
ae70b94674 | ||
|
|
704d9c5b45 | ||
|
|
d65bd8400e | ||
|
|
a9dd36702f | ||
|
|
a48e1b2aac | ||
|
|
ff26e25b51 | ||
|
|
44badc70cc | ||
|
|
a0ee07829a | ||
|
|
9743d7fb60 | ||
|
|
fb55511e71 | ||
|
|
e1a124e5c9 | ||
|
|
1d12d57416 | ||
|
|
9d43c07987 | ||
|
|
4e8825038e | ||
|
|
a990cf5b33 | ||
|
|
c95eb57405 | ||
|
|
5821e11d0b | ||
|
|
7bc49fcfc0 | ||
|
|
323287ea7f | ||
|
|
6fe67c3cf2 | ||
|
|
9d995d6721 | ||
|
|
0a383883fa | ||
|
|
a7f44b5afe | ||
|
|
1cc09402e8 | ||
|
|
be11de2b52 | ||
|
|
f67219783f | ||
|
|
d070df4c74 | ||
|
|
5fb409b7b0 | ||
|
|
172e038f9e | ||
|
|
448080d372 | ||
|
|
f09f6db5dd | ||
|
|
a6a3ac5924 | ||
|
|
f5d6238c4b | ||
|
|
3f20ecc204 | ||
|
|
3db2fc5acb | ||
|
|
35b621c5f4 | ||
|
|
2218b89ca7 | ||
|
|
d383ac1570 | ||
|
|
a0151cbfba | ||
|
|
41b3179c9e | ||
|
|
d265d36749 | ||
|
|
f07db75443 | ||
|
|
0a91b11d28 | ||
|
|
239e7a0756 | ||
|
|
88af723267 | ||
|
|
2ebcd19cbc | ||
|
|
7ae998456c | ||
|
|
27818d2a16 | ||
|
|
6a94cb748b | ||
|
|
b871e5d6b3 | ||
|
|
c16961b8c3 | ||
|
|
151e91e66c | ||
|
|
da2d2c618c | ||
|
|
82ef8296dc | ||
|
|
8e70b0d5c3 | ||
|
|
b8726037ee | ||
|
|
e7d937b52f | ||
|
|
b3351f1204 | ||
|
|
32417fb376 | ||
|
|
c08ab018ad | ||
|
|
ce8732b188 | ||
|
|
40107623b0 | ||
|
|
552e02fa9c | ||
|
|
778a68e1e5 | ||
|
|
5c8f75ef8b | ||
|
|
848247a972 | ||
|
|
84f8b5f401 | ||
|
|
a8e0f2b956 | ||
|
|
b16ec16288 | ||
|
|
28f82b260c | ||
|
|
5f79f75ba6 | ||
|
|
57edf36c5f | ||
|
|
8d6302cdcf | ||
|
|
2b47307012 | ||
|
|
ad551eaa04 | ||
|
|
5f7b6b8301 | ||
|
|
547eba0a63 | ||
|
|
1029364ec5 | ||
|
|
e8e1f34a33 | ||
|
|
c51cd764a2 | ||
|
|
85597e2b59 | ||
|
|
0dfb2ecaab | ||
|
|
0609c0fe8d | ||
|
|
7af7895eeb | ||
|
|
ce4cf90d79 | ||
|
|
6b8e321e61 | ||
|
|
98ae1a85b0 | ||
|
|
e652ed3051 | ||
|
|
244bee5bb6 | ||
|
|
abc21c8056 | ||
|
|
04afcd25a3 | ||
|
|
8ef83bc46e | ||
|
|
02f96b9db0 | ||
|
|
f90b95ea1a | ||
|
|
4cd5703b9e | ||
|
|
75b64a1b64 | ||
|
|
ca483765bd | ||
|
|
f373b11f9f | ||
|
|
1e980b6bc8 | ||
|
|
9468ee53ac | ||
|
|
f246ae984b | ||
|
|
5496bbf6a3 | ||
|
|
4df577fef7 | ||
|
|
8e833972c2 | ||
|
|
0a0c232167 | ||
|
|
a4723742c1 | ||
|
|
4bfaf1e5f6 | ||
|
|
261e9d08db | ||
|
|
e4ca88d9fa | ||
|
|
a44e9afdd1 | ||
|
|
a864c2c234 | ||
|
|
36c4eb188c | ||
|
|
3a72fe587f | ||
|
|
f3fe19459f | ||
|
|
d89ce40d8e | ||
|
|
91bc5865a3 | ||
|
|
8d01c0557b | ||
|
|
1271cdc1c9 | ||
|
|
27ff1ae414 | ||
|
|
079e435655 | ||
|
|
36bd371e26 | ||
|
|
de666485b8 | ||
|
|
ba117e4172 | ||
|
|
30894bdfd6 | ||
|
|
1b34228bb2 | ||
|
|
b989c9ceda | ||
|
|
e3a49a8661 | ||
|
|
e05709b1df | ||
|
|
e611fad0d0 | ||
|
|
14e1975e13 | ||
|
|
f193b9fc21 | ||
|
|
faa0fdb119 | ||
|
|
a0f64756a4 | ||
|
|
04aa0fdda6 | ||
|
|
42c5847d65 | ||
|
|
791e26d959 | ||
|
|
d29c9fc188 | ||
|
|
acb907fb0d | ||
|
|
b59e358bb9 | ||
|
|
606058933c | ||
|
|
4130af46bf | ||
|
|
b09d7d8600 | ||
|
|
35f5385aa5 | ||
|
|
1519690cfb | ||
|
|
29fe857ec8 | ||
|
|
a67e4de662 | ||
|
|
763d4bb345 | ||
|
|
68fa57f000 | ||
|
|
13bd37160e | ||
|
|
bb897fa9f7 | ||
|
|
375db86aea | ||
|
|
09d13c393e | ||
|
|
99c32055cb | ||
|
|
bc3c718346 | ||
|
|
48c632a381 | ||
|
|
cf23905a4b | ||
|
|
9fb48ac257 | ||
|
|
8921060253 | ||
|
|
fdd6dfa863 | ||
|
|
2c5153b043 | ||
|
|
07564f2d3a | ||
|
|
d0f81466e4 | ||
|
|
69c89942db | ||
|
|
dcab1b2c76 | ||
|
|
801aeefe2d | ||
|
|
a12c54454f | ||
|
|
0f9be1eaee | ||
|
|
bfde0b6fd9 | ||
|
|
e6e60065ff | ||
|
|
34c7a3c2b0 | ||
|
|
0d3700d957 | ||
|
|
c5d028fc91 | ||
|
|
4ff6fa97e7 | ||
|
|
2bbb8fac61 | ||
|
|
a4b2dc016f | ||
|
|
5c5fe07e43 | ||
|
|
364d9ee62f | ||
|
|
a43e906221 | ||
|
|
79cecbd421 | ||
|
|
7e22db037e | ||
|
|
fb5e5cbdd4 | ||
|
|
2458d06fc1 | ||
|
|
26c5b2d460 | ||
|
|
d199017101 | ||
|
|
ec1370191e | ||
|
|
63dc592789 | ||
|
|
81508de3d2 | ||
|
|
d73c0b300e | ||
|
|
f0036944a1 | ||
|
|
db492b3ca7 | ||
|
|
c654f4fda8 | ||
|
|
b1b5317799 | ||
|
|
7cbff41ba3 | ||
|
|
1287d106ed | ||
|
|
fb62558bb4 | ||
|
|
a55f63083f | ||
|
|
c0c05ff8ec | ||
|
|
918d776f7e | ||
|
|
df5c77c91a | ||
|
|
f6524f8bda | ||
|
|
eababde214 | ||
|
|
cade4c36e7 | ||
|
|
5fd31f6891 | ||
|
|
a0edecf343 | ||
|
|
4b58214205 | ||
|
|
45288c5ce3 | ||
|
|
a4ebdcf5bd | ||
|
|
e66190d2a9 | ||
|
|
607bd47707 | ||
|
|
4c4b08a32e | ||
|
|
4fa35d8ae8 | ||
|
|
f822e7f68e | ||
|
|
0521ff8234 | ||
|
|
d8a5a6f513 | ||
|
|
28996f8006 | ||
|
|
6fcf1770e5 | ||
|
|
03e1ebbdd6 | ||
|
|
080210c16a | ||
|
|
79e1a01e9e | ||
|
|
c8354f501e | ||
|
|
5787475390 | ||
|
|
5dfdb70129 | ||
|
|
8b6fea59ac | ||
|
|
8717c3db2f | ||
|
|
7a34ed2bb3 | ||
|
|
326ea5413d | ||
|
|
ded6e3bfca | ||
|
|
db79e827eb | ||
|
|
9a4d305340 | ||
|
|
3960fb602c | ||
|
|
60fb68338b | ||
|
|
43701d68a9 | ||
|
|
46d64ed2e5 | ||
|
|
4140d90c60 | ||
|
|
3acc908c79 | ||
|
|
da73f655fc | ||
|
|
049e58369c | ||
|
|
7beaa5024f | ||
|
|
16c61f0885 | ||
|
|
4a9e837840 | ||
|
|
4835e6ef51 | ||
|
|
97b70b2bda | ||
|
|
20c4a3a8ee | ||
|
|
55210f74c7 | ||
|
|
07c0b73a7f | ||
|
|
3975cec694 | ||
|
|
c5861c09d5 | ||
|
|
50e62e4051 | ||
|
|
d6d5cbb02a | ||
|
|
9ea86011a2 | ||
|
|
852935b68f | ||
|
|
99ea84b12d | ||
|
|
56eb0bfedb | ||
|
|
5d4b8421b3 | ||
|
|
7811422080 | ||
|
|
ef7eea5538 | ||
|
|
5115d4348e | ||
|
|
940e4c9d92 | ||
|
|
58aaaa730b | ||
|
|
285b02582b | ||
|
|
f27b7fb056 | ||
|
|
dea13da340 | ||
|
|
b15c58bb0f | ||
|
|
f2de6b0f6e | ||
|
|
20a24403bc | ||
|
|
429b05a1df | ||
|
|
5d2ef8724d | ||
|
|
a437bff914 | ||
|
|
635df850e5 | ||
|
|
8784709a2c | ||
|
|
c5db969aa4 | ||
|
|
fe07ca04e4 | ||
|
|
170168cdf3 | ||
|
|
83697b8b76 | ||
|
|
ac3de8d080 | ||
|
|
c079dfe415 | ||
|
|
6542ac0380 | ||
|
|
d86d713b63 | ||
|
|
b62e2770e7 | ||
|
|
884e4f839b | ||
|
|
fbe44ec043 | ||
|
|
0b25791a28 | ||
|
|
49677deca2 | ||
|
|
6d0bcdc832 | ||
|
|
6181aead7b | ||
|
|
c213291515 | ||
|
|
66eada9632 | ||
|
|
7aca310306 | ||
|
|
7be369d4c6 | ||
|
|
70827cc85a | ||
|
|
d460f3f1af | ||
|
|
e4180f85b7 | ||
|
|
5408ac3c8d | ||
|
|
6e33b0296d | ||
|
|
036154b0c2 | ||
|
|
92b7fbf872 | ||
|
|
414aadc79d | ||
|
|
8baaf6ff96 | ||
|
|
604a163e4c | ||
|
|
062240853d | ||
|
|
bb91e9fb96 | ||
|
|
ce876bebf2 | ||
|
|
a41e642607 | ||
|
|
9c94fc9fbe | ||
|
|
e3063f4e55 | ||
|
|
90e10d41c4 | ||
|
|
bc35807fc6 | ||
|
|
cfb47daf4e | ||
|
|
9df2e000b5 | ||
|
|
01271b1812 | ||
|
|
61a9ccb41e | ||
|
|
0894b2c5d3 | ||
|
|
cdc5a17cef | ||
|
|
ed537239a9 | ||
|
|
c77c434149 | ||
|
|
e109930e9f | ||
|
|
dc77a22850 | ||
|
|
6971fe4ca5 | ||
|
|
7f7ac8cd19 | ||
|
|
e3c7b5192e | ||
|
|
4f251bee5d | ||
|
|
6db8f5bb75 | ||
|
|
d30116cf4a | ||
|
|
d23736e4f2 | ||
|
|
65ba5b62c5 | ||
|
|
064f862d55 | ||
|
|
1a6961650c | ||
|
|
3bb62578be | ||
|
|
0be1819b22 | ||
|
|
ba98d9237b | ||
|
|
1de3af51d4 | ||
|
|
c0ac7eba93 | ||
|
|
124fae9eab | ||
|
|
f510fc789a | ||
|
|
b46530bd3e | ||
|
|
0f7809d5c3 | ||
|
|
089111a80a | ||
|
|
3cd7a1653a | ||
|
|
084be59192 | ||
|
|
5ae44f302b | ||
|
|
914112ea21 | ||
|
|
155e8d1df5 | ||
|
|
18a206c81d | ||
|
|
b0ac82e9ba | ||
|
|
bd8ee3d35e | ||
|
|
4569ab9773 | ||
|
|
06b596104a | ||
|
|
743a273e40 | ||
|
|
5f787190a9 | ||
|
|
0b8fa1d456 | ||
|
|
40e467ec66 | ||
|
|
8576560979 | ||
|
|
a67cedb52c | ||
|
|
1f21ece48a | ||
|
|
58b575485c | ||
|
|
10ce96944e | ||
|
|
4d36b0bd38 | ||
|
|
14f19592ae | ||
|
|
9297af9438 | ||
|
|
ae8eb74675 | ||
|
|
33c4a3adde | ||
|
|
c30396f5f2 | ||
|
|
8f9a1eb108 | ||
|
|
f93fc10fc4 | ||
|
|
9e783963d5 | ||
|
|
063cfb2084 | ||
|
|
8cacc639b6 | ||
|
|
85819efe8f | ||
|
|
7193731ae6 | ||
|
|
f2b3ac9502 | ||
|
|
49271d89da | ||
|
|
df7f24f310 | ||
|
|
7b68e3f799 | ||
|
|
ad88a08631 | ||
|
|
20aa6c0f4c | ||
|
|
60c7ac2622 | ||
|
|
d0f2b7e7e6 | ||
|
|
ab44f52202 | ||
|
|
45f075556b | ||
|
|
e3dbe1e382 | ||
|
|
e8bcca3a2c | ||
|
|
4280143d37 | ||
|
|
fb93e6a5b3 | ||
|
|
29c7f0b4d1 | ||
|
|
69ec117b22 | ||
|
|
9d5a96c0d9 | ||
|
|
5a9911e940 | ||
|
|
574773b1ea | ||
|
|
ce45fea03d | ||
|
|
6fa26e21bc | ||
|
|
75f33adcb1 | ||
|
|
4e45775989 | ||
|
|
4035b7a321 | ||
|
|
008744ceda | ||
|
|
df92635a57 | ||
|
|
2393535f0d | ||
|
|
417834b17e | ||
|
|
eb370aa31d | ||
|
|
1c29572034 | ||
|
|
629a28cdf3 | ||
|
|
58d08711af | ||
|
|
dc595d8308 | ||
|
|
7a85c42b8f | ||
|
|
5b1497acdb | ||
|
|
4612763b44 | ||
|
|
af72df5b98 | ||
|
|
e75c273ac4 | ||
|
|
8af5412efc | ||
|
|
98533cfa4b | ||
|
|
f0af78c27b | ||
|
|
88cd1a2188 | ||
|
|
c2c2a48845 | ||
|
|
551ca77e35 | ||
|
|
356c0af60b | ||
|
|
328a484588 | ||
|
|
2266e4956f | ||
|
|
eb06129c5c | ||
|
|
fb8ecd6e2f | ||
|
|
bc77942a9a | ||
|
|
4d71adbc0d | ||
|
|
102250719f | ||
|
|
8b95404d00 | ||
|
|
79c6a8d2b1 | ||
|
|
ca7466d2b8 | ||
|
|
914d8d4cff | ||
|
|
1b315363c2 | ||
|
|
5ae762a393 | ||
|
|
e5c8ced4f9 | ||
|
|
9ffaabcc49 | ||
|
|
d23af23268 | ||
|
|
c2e4c310ff | ||
|
|
32ea9fe578 | ||
|
|
fb018a2dde | ||
|
|
ead7819f51 | ||
|
|
06abe13c5f | ||
|
|
a2f596b650 | ||
|
|
c7dc842529 | ||
|
|
42ac0e5030 | ||
|
|
c1b44ecc53 | ||
|
|
423a0740b5 | ||
|
|
4136c3a2b7 | ||
|
|
c124baaf29 | ||
|
|
5419b94747 | ||
|
|
ee7a28c529 | ||
|
|
a9944cfe9e | ||
|
|
f8a2c51bf3 | ||
|
|
1452324ff5 | ||
|
|
fcf901d5c0 | ||
|
|
e7e274b13a | ||
|
|
c2483ea9b6 | ||
|
|
9434e8febc | ||
|
|
22d629211d | ||
|
|
ab4e2ed182 | ||
|
|
db4fdf1aaf | ||
|
|
cf3fa7f457 | ||
|
|
3b297c4079 | ||
|
|
2facd5b5ef | ||
|
|
417fd2334a | ||
|
|
4e75c4b2d7 | ||
|
|
d1844d4b30 | ||
|
|
0620122763 | ||
|
|
ecbded40ff | ||
|
|
4c3d7a86bb | ||
|
|
1ceb9824ab | ||
|
|
c7f654dffe | ||
|
|
b83cad7983 | ||
|
|
e5d5f7f0d8 | ||
|
|
156da96621 | ||
|
|
a55f0a1007 | ||
|
|
b04598a63c | ||
|
|
7e7853230f | ||
|
|
9a7366e894 | ||
|
|
fa7e258617 | ||
|
|
1db6f2db49 | ||
|
|
ae8000f368 | ||
|
|
9c3892558f | ||
|
|
6b1ba1184a | ||
|
|
51c7167d22 | ||
|
|
7c67e4e423 | ||
|
|
3a0aa5e0a0 | ||
|
|
cafbc94043 | ||
|
|
92e6de6f94 | ||
|
|
b95ad82f7d | ||
|
|
95a2a7f325 | ||
|
|
857fed50cb | ||
|
|
80a2983272 | ||
|
|
9017254186 | ||
|
|
4cf143f1c8 | ||
|
|
b98204a9fb | ||
|
|
15edd80a69 | ||
|
|
39d7c6072d | ||
|
|
75f4352555 | ||
|
|
7d56ccbfaa | ||
|
|
a89864a20b | ||
|
|
baa7ee0370 | ||
|
|
bb7dfcd3b8 | ||
|
|
d3bf954e9f | ||
|
|
0cc0d250fd | ||
|
|
a54d08a7c1 | ||
|
|
a428bc1288 | ||
|
|
fe712e6cae | ||
|
|
6ed5bc12da | ||
|
|
31a1060a5a | ||
|
|
b650111a11 | ||
|
|
cd195eba1f | ||
|
|
774c7f54ff | ||
|
|
068f33981d | ||
|
|
0fa6279f39 | ||
|
|
5b6346f6d5 | ||
|
|
adc32bc3b1 | ||
|
|
c556da9ed7 | ||
|
|
52b4ccbc49 | ||
|
|
de1efebdca | ||
|
|
8e1a87b547 | ||
|
|
bb892a1b63 | ||
|
|
d03bfe689a | ||
|
|
422b6ef92c | ||
|
|
fb1e192e12 | ||
|
|
72b08af300 | ||
|
|
f9163dd1f0 | ||
|
|
eac9eb462e | ||
|
|
209d67d448 | ||
|
|
fd6ca57f24 | ||
|
|
e4030e0bfc | ||
|
|
bdc514700d | ||
|
|
2c29bcf77f | ||
|
|
827a2604ee | ||
|
|
ac184b2142 | ||
|
|
0792223a8a | ||
|
|
66569e3d53 | ||
|
|
dd9fbc8646 | ||
|
|
a48d5e5f12 | ||
|
|
8e630dacf6 | ||
|
|
855dde4426 | ||
|
|
91875dcd6e | ||
|
|
8e15b08ae2 | ||
|
|
06abf4edbf | ||
|
|
5989ed5cb8 | ||
|
|
25937d36a0 | ||
|
|
c323317810 | ||
|
|
00f339771b | ||
|
|
3307bff023 | ||
|
|
cd587701c8 | ||
|
|
db2b9d052b | ||
|
|
0e77287209 | ||
|
|
e6dc2a664e | ||
|
|
354867d702 | ||
|
|
0eb4f255d2 | ||
|
|
a06e11cc34 | ||
|
|
28bd96cc0b | ||
|
|
6e0e03c38b | ||
|
|
c746bed889 | ||
|
|
bfeb8a98b6 | ||
|
|
7b0377eda0 | ||
|
|
d769826b0d | ||
|
|
d5c654c053 | ||
|
|
a9a1d8a5d2 | ||
|
|
f153ed380d | ||
|
|
51d270af6d | ||
|
|
3b6914bf04 | ||
|
|
82ec685054 | ||
|
|
6da07f02bd | ||
|
|
0349e3d3ff | ||
|
|
21e0a7ee8b | ||
|
|
c1993cac40 | ||
|
|
27cfd6afd4 | ||
|
|
0a6cbb97a8 | ||
|
|
e55218223b | ||
|
|
ae0bccf7d3 | ||
|
|
baa09d1e0a | ||
|
|
1f1e7b70b7 | ||
|
|
469bd6692b | ||
|
|
e409645c99 | ||
|
|
7e9d6d8abb | ||
|
|
c913407490 | ||
|
|
c01915fd04 | ||
|
|
c9829a2b6f | ||
|
|
953dbbda49 | ||
|
|
3d01901774 | ||
|
|
c005a55c74 | ||
|
|
00f927f137 | ||
|
|
9c3449ecd9 | ||
|
|
cf57515f70 | ||
|
|
7f59867170 | ||
|
|
76a3777a4d | ||
|
|
68221a76b7 | ||
|
|
eeabbaee88 | ||
|
|
33d552a4d1 | ||
|
|
934e18e715 | ||
|
|
5804b88a44 | ||
|
|
ffcb92e779 | ||
|
|
e9859df7cc | ||
|
|
684669dfd7 | ||
|
|
c0ee117170 | ||
|
|
d58928e831 | ||
|
|
bf3da78e69 | ||
|
|
7649d62255 | ||
|
|
8140487f60 | ||
|
|
d5b14e3552 | ||
|
|
340ff83f98 | ||
|
|
64f4e71418 | ||
|
|
9deb460a26 | ||
|
|
fe7ac11afa | ||
|
|
ad639c1d2b | ||
|
|
1d07eda8db | ||
|
|
5b0e2de6ae | ||
|
|
418ecb7ec8 | ||
|
|
29e526527c | ||
|
|
b37328627b | ||
|
|
71258e0d20 | ||
|
|
1df8fe33d5 | ||
|
|
7e5851922c | ||
|
|
ba13ae7672 | ||
|
|
2868bbabf3 | ||
|
|
036fa6e669 | ||
|
|
773a783295 | ||
|
|
8816088095 | ||
|
|
5443561d5d | ||
|
|
ea108d8a66 | ||
|
|
c9008991f3 | ||
|
|
75f3d25cef | ||
|
|
1f84a4e426 | ||
|
|
fa5942cc08 | ||
|
|
dd5d865d92 | ||
|
|
b1d4387222 | ||
|
|
4a56211b0b | ||
|
|
7163345437 | ||
|
|
2400c7a60e | ||
|
|
fed121126a | ||
|
|
a5b7d6dd00 | ||
|
|
5e2aa357d2 | ||
|
|
7c6cc4dffd | ||
|
|
638b0fd953 | ||
|
|
94c82633c7 | ||
|
|
98f26893a6 | ||
|
|
ea5dea8edb | ||
|
|
d060b824dd | ||
|
|
947f2e610a | ||
|
|
89a4090eca | ||
|
|
1291162410 | ||
|
|
ca82e1f3d1 | ||
|
|
cc8165aea5 | ||
|
|
949d6faa96 | ||
|
|
31041a0138 | ||
|
|
cdbd3406f5 | ||
|
|
f53c75e513 | ||
|
|
e24cde4406 | ||
|
|
ff45d5cdbf | ||
|
|
912dd71259 | ||
|
|
0a3f66e9a0 | ||
|
|
7bb37492cc | ||
|
|
028ed539dd | ||
|
|
bfcd552500 | ||
|
|
21f7ef9eb2 | ||
|
|
2bc1cadeff | ||
|
|
aa29740ce2 | ||
|
|
c37b31d848 | ||
|
|
c64c1b49fd | ||
|
|
141a3b109c | ||
|
|
c6c26a08c8 | ||
|
|
94d7f701d1 | ||
|
|
34e5212961 | ||
|
|
7261264c3a | ||
|
|
daedcfc595 | ||
|
|
516b26f2bf | ||
|
|
17f65bf468 | ||
|
|
623ed02e35 | ||
|
|
be01adce36 | ||
|
|
4fc5f6c366 | ||
|
|
7186a13284 | ||
|
|
731ecf0a31 | ||
|
|
d18b181a25 | ||
|
|
9a477de2f5 | ||
|
|
1551f18af0 | ||
|
|
8e1e66da21 | ||
|
|
9550a7c57c | ||
|
|
0ac6d23515 | ||
|
|
1afca3f698 | ||
|
|
b02f100fa4 | ||
|
|
96fd66018c | ||
|
|
d0a7bc2fd6 | ||
|
|
d9c2de10d9 | ||
|
|
45193df53a | ||
|
|
1466b1aad2 | ||
|
|
25ef2bbf01 | ||
|
|
42bfbd1e61 | ||
|
|
ed33635da7 | ||
|
|
a870ded21a | ||
|
|
8ccbc90a3b | ||
|
|
9f8c7daf40 | ||
|
|
58234e788b | ||
|
|
c7813c0857 | ||
|
|
df7aa95031 | ||
|
|
e5bd6efa08 | ||
|
|
79d834b5ab | ||
|
|
422067eb3c | ||
|
|
0b8dda0e42 | ||
|
|
fa22fd9f81 | ||
|
|
d7b3cc0c69 | ||
|
|
8f2f246618 | ||
|
|
cfc8b93c4e | ||
|
|
029cf34cfd | ||
|
|
6ac557918a | ||
|
|
494e534b00 | ||
|
|
ad2e065de1 | ||
|
|
0531d199dc | ||
|
|
3ebd31c0a1 |
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
|
||||||
702
libc/Android.mk
702
libc/Android.mk
@@ -8,123 +8,36 @@ libc_common_src_files := \
|
|||||||
$(syscall_src) \
|
$(syscall_src) \
|
||||||
unistd/abort.c \
|
unistd/abort.c \
|
||||||
unistd/alarm.c \
|
unistd/alarm.c \
|
||||||
unistd/brk.c \
|
|
||||||
unistd/daemon.c \
|
|
||||||
unistd/eventfd.c \
|
|
||||||
unistd/exec.c \
|
unistd/exec.c \
|
||||||
unistd/fcntl.c \
|
|
||||||
unistd/fnmatch.c \
|
unistd/fnmatch.c \
|
||||||
unistd/fstatfs.c \
|
|
||||||
unistd/ftime.c \
|
|
||||||
unistd/ftok.c \
|
|
||||||
unistd/getdtablesize.c \
|
|
||||||
unistd/gethostname.c \
|
|
||||||
unistd/getopt_long.c \
|
unistd/getopt_long.c \
|
||||||
unistd/getpgrp.c \
|
|
||||||
unistd/getpriority.c \
|
|
||||||
unistd/getpt.c \
|
|
||||||
unistd/initgroups.c \
|
|
||||||
unistd/isatty.c \
|
|
||||||
unistd/issetugid.c \
|
|
||||||
unistd/killpg.c \
|
|
||||||
unistd/lseek64.c \
|
|
||||||
unistd/mmap.c \
|
|
||||||
unistd/open.c \
|
|
||||||
unistd/openat.c \
|
|
||||||
unistd/opendir.c \
|
|
||||||
unistd/pathconf.c \
|
|
||||||
unistd/perror.c \
|
|
||||||
unistd/popen.c \
|
|
||||||
unistd/pread.c \
|
|
||||||
unistd/pselect.c \
|
|
||||||
unistd/ptsname.c \
|
|
||||||
unistd/ptsname_r.c \
|
|
||||||
unistd/pwrite.c \
|
|
||||||
unistd/raise.c \
|
|
||||||
unistd/reboot.c \
|
|
||||||
unistd/recv.c \
|
|
||||||
unistd/sbrk.c \
|
|
||||||
unistd/send.c \
|
|
||||||
unistd/setegid.c \
|
|
||||||
unistd/setuid.c \
|
|
||||||
unistd/seteuid.c \
|
|
||||||
unistd/setreuid.c \
|
|
||||||
unistd/setresuid.c \
|
|
||||||
unistd/setpgrp.c \
|
|
||||||
unistd/sigblock.c \
|
|
||||||
unistd/siginterrupt.c \
|
|
||||||
unistd/siglist.c \
|
|
||||||
unistd/signal.c \
|
|
||||||
unistd/signame.c \
|
|
||||||
unistd/sigsetmask.c \
|
|
||||||
unistd/sigsuspend.c \
|
|
||||||
unistd/sigwait.c \
|
|
||||||
unistd/sleep.c \
|
|
||||||
unistd/statfs.c \
|
|
||||||
unistd/syslog.c \
|
unistd/syslog.c \
|
||||||
unistd/system.c \
|
unistd/system.c \
|
||||||
unistd/tcgetpgrp.c \
|
|
||||||
unistd/tcsetpgrp.c \
|
|
||||||
unistd/time.c \
|
unistd/time.c \
|
||||||
unistd/umount.c \
|
|
||||||
unistd/unlockpt.c \
|
|
||||||
unistd/usleep.c \
|
|
||||||
unistd/wait.c \
|
|
||||||
stdio/asprintf.c \
|
stdio/asprintf.c \
|
||||||
stdio/clrerr.c \
|
|
||||||
stdio/fclose.c \
|
|
||||||
stdio/fdopen.c \
|
|
||||||
stdio/feof.c \
|
|
||||||
stdio/ferror.c \
|
|
||||||
stdio/fflush.c \
|
stdio/fflush.c \
|
||||||
stdio/fgetc.c \
|
stdio/fgetc.c \
|
||||||
stdio/fgetln.c \
|
|
||||||
stdio/fgetpos.c \
|
|
||||||
stdio/fgets.c \
|
|
||||||
stdio/fileno.c \
|
|
||||||
stdio/findfp.c \
|
stdio/findfp.c \
|
||||||
stdio/flags.c \
|
|
||||||
stdio/flockfile.c \
|
|
||||||
stdio/fopen.c \
|
|
||||||
stdio/fprintf.c \
|
stdio/fprintf.c \
|
||||||
stdio/fpurge.c \
|
|
||||||
stdio/fputc.c \
|
stdio/fputc.c \
|
||||||
stdio/fputs.c \
|
|
||||||
stdio/fread.c \
|
stdio/fread.c \
|
||||||
stdio/freopen.c \
|
stdio/freopen.c \
|
||||||
stdio/fscanf.c \
|
stdio/fscanf.c \
|
||||||
stdio/fseek.c \
|
stdio/fseek.c \
|
||||||
stdio/fsetpos.c \
|
|
||||||
stdio/ftell.c \
|
stdio/ftell.c \
|
||||||
stdio/funopen.c \
|
|
||||||
stdio/fvwrite.c \
|
stdio/fvwrite.c \
|
||||||
stdio/fwalk.c \
|
|
||||||
stdio/fwrite.c \
|
|
||||||
stdio/getc.c \
|
|
||||||
stdio/getchar.c \
|
|
||||||
stdio/gets.c \
|
stdio/gets.c \
|
||||||
stdio/makebuf.c \
|
stdio/makebuf.c \
|
||||||
stdio/mktemp.c \
|
stdio/mktemp.c \
|
||||||
stdio/printf.c \
|
stdio/printf.c \
|
||||||
stdio/putc.c \
|
|
||||||
stdio/putchar.c \
|
|
||||||
stdio/puts.c \
|
|
||||||
stdio/putw.c \
|
|
||||||
stdio/refill.c \
|
stdio/refill.c \
|
||||||
stdio/remove.c \
|
|
||||||
stdio/rewind.c \
|
stdio/rewind.c \
|
||||||
stdio/rget.c \
|
|
||||||
stdio/scanf.c \
|
stdio/scanf.c \
|
||||||
stdio/setbuf.c \
|
|
||||||
stdio/setbuffer.c \
|
|
||||||
stdio/setvbuf.c \
|
stdio/setvbuf.c \
|
||||||
stdio/snprintf.c\
|
stdio/snprintf.c\
|
||||||
stdio/sprintf.c \
|
stdio/sprintf.c \
|
||||||
stdio/sscanf.c \
|
stdio/sscanf.c \
|
||||||
stdio/stdio.c \
|
stdio/stdio.c \
|
||||||
stdio/tempnam.c \
|
|
||||||
stdio/tmpfile.c \
|
|
||||||
stdio/tmpnam.c \
|
|
||||||
stdio/ungetc.c \
|
stdio/ungetc.c \
|
||||||
stdio/vasprintf.c \
|
stdio/vasprintf.c \
|
||||||
stdio/vfprintf.c \
|
stdio/vfprintf.c \
|
||||||
@@ -135,38 +48,12 @@ libc_common_src_files := \
|
|||||||
stdio/vscanf.c \
|
stdio/vscanf.c \
|
||||||
stdio/vsscanf.c \
|
stdio/vsscanf.c \
|
||||||
stdio/wbuf.c \
|
stdio/wbuf.c \
|
||||||
stdio/wsetup.c \
|
|
||||||
stdio/__fgets_chk.c \
|
|
||||||
stdio/__snprintf_chk.c \
|
|
||||||
stdio/__sprintf_chk.c \
|
|
||||||
stdio/__vsnprintf_chk.c \
|
|
||||||
stdio/__vsprintf_chk.c \
|
|
||||||
stdlib/_rand48.c \
|
|
||||||
stdlib/assert.c \
|
|
||||||
stdlib/atexit.c \
|
stdlib/atexit.c \
|
||||||
stdlib/atoi.c \
|
|
||||||
stdlib/atol.c \
|
|
||||||
stdlib/atoll.c \
|
|
||||||
stdlib/bsearch.c \
|
|
||||||
stdlib/ctype_.c \
|
stdlib/ctype_.c \
|
||||||
stdlib/div.c \
|
|
||||||
stdlib/exit.c \
|
stdlib/exit.c \
|
||||||
stdlib/getenv.c \
|
stdlib/getenv.c \
|
||||||
stdlib/jrand48.c \
|
|
||||||
stdlib/ldiv.c \
|
|
||||||
stdlib/lldiv.c \
|
|
||||||
stdlib/locale.c \
|
|
||||||
stdlib/lrand48.c \
|
|
||||||
stdlib/mrand48.c \
|
|
||||||
stdlib/nrand48.c \
|
|
||||||
stdlib/putenv.c \
|
stdlib/putenv.c \
|
||||||
stdlib/qsort.c \
|
|
||||||
stdlib/seed48.c \
|
|
||||||
stdlib/setenv.c \
|
stdlib/setenv.c \
|
||||||
stdlib/setjmperr.c \
|
|
||||||
stdlib/srand48.c \
|
|
||||||
stdlib/strntoimax.c \
|
|
||||||
stdlib/strntoumax.c \
|
|
||||||
stdlib/strtod.c \
|
stdlib/strtod.c \
|
||||||
stdlib/strtoimax.c \
|
stdlib/strtoimax.c \
|
||||||
stdlib/strtol.c \
|
stdlib/strtol.c \
|
||||||
@@ -176,131 +63,115 @@ libc_common_src_files := \
|
|||||||
stdlib/strtoumax.c \
|
stdlib/strtoumax.c \
|
||||||
stdlib/tolower_.c \
|
stdlib/tolower_.c \
|
||||||
stdlib/toupper_.c \
|
stdlib/toupper_.c \
|
||||||
stdlib/wchar.c \
|
|
||||||
string/index.c \
|
string/index.c \
|
||||||
string/memccpy.c \
|
|
||||||
string/memchr.c \
|
|
||||||
string/memmem.c \
|
|
||||||
string/memrchr.c \
|
|
||||||
string/memswap.c \
|
|
||||||
string/strcasecmp.c \
|
string/strcasecmp.c \
|
||||||
string/strcasestr.c \
|
|
||||||
string/strcat.c \
|
string/strcat.c \
|
||||||
string/strchr.c \
|
|
||||||
string/strcoll.c \
|
|
||||||
string/strcspn.c \
|
string/strcspn.c \
|
||||||
string/strdup.c \
|
string/strdup.c \
|
||||||
string/strlcat.c \
|
string/strlcat.c \
|
||||||
string/strlcpy.c \
|
string/strlcpy.c \
|
||||||
string/strncat.c \
|
string/strncat.c \
|
||||||
string/strncpy.c \
|
string/strncpy.c \
|
||||||
string/strndup.c \
|
|
||||||
string/strnlen.c \
|
|
||||||
string/strpbrk.c \
|
string/strpbrk.c \
|
||||||
string/strrchr.c \
|
string/strrchr.c \
|
||||||
string/strsep.c \
|
string/strsep.c \
|
||||||
string/strspn.c \
|
string/strspn.c \
|
||||||
string/strstr.c \
|
string/strstr.c \
|
||||||
string/strtok.c \
|
string/strtok.c \
|
||||||
string/strtotimeval.c \
|
|
||||||
string/__memcpy_chk.c \
|
|
||||||
string/__memmove_chk.c \
|
|
||||||
string/__memset_chk.c \
|
|
||||||
string/__strcat_chk.c \
|
|
||||||
string/__strcpy_chk.c \
|
|
||||||
string/__strlcat_chk.c \
|
|
||||||
string/__strlcpy_chk.c \
|
|
||||||
string/__strlen_chk.c \
|
|
||||||
string/__strncat_chk.c \
|
|
||||||
string/__strncpy_chk.c \
|
|
||||||
wchar/wcpcpy.c \
|
|
||||||
wchar/wcpncpy.c \
|
|
||||||
wchar/wcscasecmp.c \
|
|
||||||
wchar/wcscat.c \
|
|
||||||
wchar/wcschr.c \
|
|
||||||
wchar/wcscmp.c \
|
|
||||||
wchar/wcscoll.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/wcswidth.c \
|
||||||
wchar/wcsxfrm.c \
|
wchar/wcsxfrm.c \
|
||||||
wchar/wmemchr.c \
|
|
||||||
wchar/wmemcmp.c \
|
|
||||||
wchar/wmemcpy.c \
|
|
||||||
wchar/wmemmove.c \
|
|
||||||
wchar/wmemset.c \
|
|
||||||
inet/bindresvport.c \
|
|
||||||
inet/inet_addr.c \
|
|
||||||
inet/inet_aton.c \
|
|
||||||
inet/inet_ntoa.c \
|
|
||||||
inet/inet_ntop.c \
|
|
||||||
inet/inet_pton.c \
|
|
||||||
inet/ether_aton.c \
|
|
||||||
inet/ether_ntoa.c \
|
|
||||||
tzcode/asctime.c \
|
tzcode/asctime.c \
|
||||||
tzcode/difftime.c \
|
tzcode/difftime.c \
|
||||||
tzcode/localtime.c \
|
tzcode/localtime.c \
|
||||||
tzcode/strftime.c \
|
tzcode/strftime.c \
|
||||||
tzcode/strptime.c \
|
tzcode/strptime.c \
|
||||||
bionic/__set_errno.c \
|
|
||||||
bionic/bionic_clone.c \
|
|
||||||
bionic/cpuacct.c \
|
|
||||||
bionic/arc4random.c \
|
bionic/arc4random.c \
|
||||||
bionic/basename.c \
|
bionic/atoi.c \
|
||||||
bionic/basename_r.c \
|
bionic/atol.c \
|
||||||
|
bionic/atoll.c \
|
||||||
|
bionic/bindresvport.c \
|
||||||
|
bionic/bionic_clone.c \
|
||||||
bionic/clearenv.c \
|
bionic/clearenv.c \
|
||||||
bionic/dirname.c \
|
bionic/cpuacct.c \
|
||||||
bionic/dirname_r.c \
|
bionic/daemon.c \
|
||||||
bionic/drand48.c \
|
|
||||||
bionic/erand48.c \
|
|
||||||
bionic/err.c \
|
bionic/err.c \
|
||||||
|
bionic/ether_aton.c \
|
||||||
|
bionic/ether_ntoa.c \
|
||||||
|
bionic/fcntl.c \
|
||||||
bionic/fdprintf.c \
|
bionic/fdprintf.c \
|
||||||
|
bionic/flockfile.c \
|
||||||
bionic/fork.c \
|
bionic/fork.c \
|
||||||
|
bionic/fstatfs.c \
|
||||||
|
bionic/ftime.c \
|
||||||
|
bionic/ftok.c \
|
||||||
bionic/fts.c \
|
bionic/fts.c \
|
||||||
bionic/getcwd.cpp \
|
bionic/getdtablesize.c \
|
||||||
bionic/if_nametoindex.c \
|
bionic/gethostname.c \
|
||||||
|
bionic/getpgrp.c \
|
||||||
|
bionic/getpriority.c \
|
||||||
|
bionic/getpt.c \
|
||||||
bionic/if_indextoname.c \
|
bionic/if_indextoname.c \
|
||||||
|
bionic/if_nametoindex.c \
|
||||||
|
bionic/initgroups.c \
|
||||||
bionic/ioctl.c \
|
bionic/ioctl.c \
|
||||||
|
bionic/isatty.c \
|
||||||
|
bionic/issetugid.c \
|
||||||
bionic/ldexp.c \
|
bionic/ldexp.c \
|
||||||
bionic/libc_init_common.c \
|
bionic/lseek64.c \
|
||||||
bionic/logd_write.c \
|
|
||||||
bionic/md5.c \
|
bionic/md5.c \
|
||||||
bionic/memmove_words.c \
|
bionic/memchr.c \
|
||||||
|
bionic/memmem.c \
|
||||||
|
bionic/memrchr.c \
|
||||||
|
bionic/memswap.c \
|
||||||
|
bionic/mmap.c \
|
||||||
|
bionic/openat.c \
|
||||||
|
bionic/open.c \
|
||||||
|
bionic/pathconf.c \
|
||||||
|
bionic/perror.c \
|
||||||
|
bionic/pread.c \
|
||||||
|
bionic/pselect.c \
|
||||||
|
bionic/ptsname.c \
|
||||||
|
bionic/ptsname_r.c \
|
||||||
bionic/pututline.c \
|
bionic/pututline.c \
|
||||||
bionic/realpath.c \
|
bionic/pwrite.c \
|
||||||
bionic/sched_getaffinity.c \
|
bionic/reboot.c \
|
||||||
bionic/sched_getcpu.c \
|
bionic/recv.c \
|
||||||
bionic/sched_cpualloc.c \
|
bionic/sched_cpualloc.c \
|
||||||
bionic/sched_cpucount.c \
|
bionic/sched_cpucount.c \
|
||||||
|
bionic/sched_getcpu.c \
|
||||||
bionic/semaphore.c \
|
bionic/semaphore.c \
|
||||||
bionic/sha1.c \
|
bionic/send.c \
|
||||||
bionic/strerror.cpp \
|
bionic/setegid.c \
|
||||||
bionic/strerror_r.cpp \
|
bionic/seteuid.c \
|
||||||
bionic/strsignal.cpp \
|
bionic/setpgrp.c \
|
||||||
bionic/stubs.cpp \
|
bionic/setresuid.c \
|
||||||
|
bionic/setreuid.c \
|
||||||
|
bionic/setuid.c \
|
||||||
|
bionic/sigblock.c \
|
||||||
|
bionic/siginterrupt.c \
|
||||||
|
bionic/siglist.c \
|
||||||
|
bionic/signal.c \
|
||||||
|
bionic/signame.c \
|
||||||
|
bionic/sigsetmask.c \
|
||||||
|
bionic/sigsuspend.c \
|
||||||
|
bionic/sleep.c \
|
||||||
|
bionic/statfs.c \
|
||||||
|
bionic/strndup.c \
|
||||||
|
bionic/strnlen.c \
|
||||||
|
bionic/strntoimax.c \
|
||||||
|
bionic/strntoumax.c \
|
||||||
|
bionic/strtotimeval.c \
|
||||||
bionic/system_properties.c \
|
bionic/system_properties.c \
|
||||||
bionic/tdestroy.c \
|
bionic/tcgetpgrp.c \
|
||||||
bionic/time64.c \
|
bionic/tcsetpgrp.c \
|
||||||
bionic/thread_atexit.c \
|
bionic/thread_atexit.c \
|
||||||
bionic/utime.c \
|
bionic/time64.c \
|
||||||
|
bionic/umount.c \
|
||||||
|
bionic/unlockpt.c \
|
||||||
|
bionic/usleep.c \
|
||||||
bionic/utmp.c \
|
bionic/utmp.c \
|
||||||
|
bionic/wcscoll.c \
|
||||||
netbsd/gethnamaddr.c \
|
netbsd/gethnamaddr.c \
|
||||||
netbsd/isc/ev_timers.c \
|
|
||||||
netbsd/isc/ev_streams.c \
|
|
||||||
netbsd/inet/nsap_addr.c \
|
netbsd/inet/nsap_addr.c \
|
||||||
netbsd/resolv/__dn_comp.c \
|
netbsd/resolv/__dn_comp.c \
|
||||||
netbsd/resolv/__res_close.c \
|
netbsd/resolv/__res_close.c \
|
||||||
@@ -329,69 +200,175 @@ libc_common_src_files := \
|
|||||||
netbsd/nameser/ns_print.c \
|
netbsd/nameser/ns_print.c \
|
||||||
netbsd/nameser/ns_samedomain.c \
|
netbsd/nameser/ns_samedomain.c \
|
||||||
|
|
||||||
libc_upstream_netbsd_src_files := \
|
libc_bionic_src_files := \
|
||||||
upstream-netbsd/libc/compat-43/creat.c \
|
bionic/assert.cpp \
|
||||||
upstream-netbsd/libc/gen/ftw.c \
|
bionic/brk.cpp \
|
||||||
upstream-netbsd/libc/gen/nftw.c \
|
bionic/dirent.cpp \
|
||||||
upstream-netbsd/libc/gen/nice.c \
|
bionic/__errno.c \
|
||||||
upstream-netbsd/libc/gen/psignal.c \
|
bionic/eventfd_read.cpp \
|
||||||
upstream-netbsd/libc/regex/regcomp.c \
|
bionic/eventfd_write.cpp \
|
||||||
upstream-netbsd/libc/regex/regerror.c \
|
bionic/__fgets_chk.cpp \
|
||||||
upstream-netbsd/libc/regex/regexec.c \
|
bionic/getauxval.cpp \
|
||||||
upstream-netbsd/libc/regex/regfree.c \
|
bionic/getcwd.cpp \
|
||||||
upstream-netbsd/libc/stdlib/tdelete.c \
|
bionic/libc_init_common.cpp \
|
||||||
upstream-netbsd/libc/stdlib/tfind.c \
|
bionic/libc_logging.cpp \
|
||||||
upstream-netbsd/libc/stdlib/tsearch.c \
|
bionic/libgen.cpp \
|
||||||
upstream-netbsd/libc/string/strxfrm.c \
|
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/sched_getaffinity.cpp \
|
||||||
|
bionic/__set_errno.cpp \
|
||||||
|
bionic/setlocale.cpp \
|
||||||
|
bionic/signalfd.cpp \
|
||||||
|
bionic/sigwait.cpp \
|
||||||
|
bionic/__strcat_chk.cpp \
|
||||||
|
bionic/strchr.cpp \
|
||||||
|
bionic/__strcpy_chk.cpp \
|
||||||
|
bionic/strerror.cpp \
|
||||||
|
bionic/strerror_r.cpp \
|
||||||
|
bionic/__strlcat_chk.cpp \
|
||||||
|
bionic/__strlcpy_chk.cpp \
|
||||||
|
bionic/__strlen_chk.cpp \
|
||||||
|
bionic/__strncat_chk.cpp \
|
||||||
|
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 \
|
||||||
|
|
||||||
# The following files are common, but must be compiled
|
libc_upstream_freebsd_src_files := \
|
||||||
# with different C flags when building a static C library.
|
upstream-freebsd/lib/libc/stdio/clrerr.c \
|
||||||
#
|
upstream-freebsd/lib/libc/stdio/fclose.c \
|
||||||
# The reason for this is the implementation of __get_tls()
|
upstream-freebsd/lib/libc/stdio/fdopen.c \
|
||||||
# that will differ between the shared and static versions
|
upstream-freebsd/lib/libc/stdio/feof.c \
|
||||||
# of the library.
|
upstream-freebsd/lib/libc/stdio/ferror.c \
|
||||||
#
|
upstream-freebsd/lib/libc/stdio/fgetln.c \
|
||||||
# See comments in private/bionic_tls.h for more details.
|
upstream-freebsd/lib/libc/stdio/fgetpos.c \
|
||||||
#
|
upstream-freebsd/lib/libc/stdio/fgets.c \
|
||||||
# NOTE: bionic/pthread.c is added later to this list
|
upstream-freebsd/lib/libc/stdio/fileno.c \
|
||||||
# because it needs special handling on ARM, see
|
upstream-freebsd/lib/libc/stdio/flags.c \
|
||||||
# below.
|
upstream-freebsd/lib/libc/stdio/fopen.c \
|
||||||
#
|
upstream-freebsd/lib/libc/stdio/fpurge.c \
|
||||||
libc_static_common_src_files := \
|
upstream-freebsd/lib/libc/stdio/fputs.c \
|
||||||
unistd/sysconf.c \
|
upstream-freebsd/lib/libc/stdio/fsetpos.c \
|
||||||
bionic/__errno.c \
|
upstream-freebsd/lib/libc/stdio/funopen.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/fwalk.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/fwrite.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/getc.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/getchar.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/putc.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/putchar.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/puts.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/putw.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/remove.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/rget.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/setbuf.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/setbuffer.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/tempnam.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/tmpnam.c \
|
||||||
|
upstream-freebsd/lib/libc/stdio/wsetup.c \
|
||||||
|
upstream-freebsd/lib/libc/stdlib/qsort.c \
|
||||||
|
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 \
|
||||||
|
upstream-netbsd/libc/compat-43/creat.c \
|
||||||
|
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 \
|
||||||
|
upstream-netbsd/libc/inet/inet_ntoa.c \
|
||||||
|
upstream-netbsd/libc/inet/inet_ntop.c \
|
||||||
|
upstream-netbsd/libc/inet/inet_pton.c \
|
||||||
|
upstream-netbsd/libc/isc/ev_streams.c \
|
||||||
|
upstream-netbsd/libc/isc/ev_timers.c \
|
||||||
|
upstream-netbsd/libc/regex/regcomp.c \
|
||||||
|
upstream-netbsd/libc/regex/regerror.c \
|
||||||
|
upstream-netbsd/libc/regex/regexec.c \
|
||||||
|
upstream-netbsd/libc/regex/regfree.c \
|
||||||
|
upstream-netbsd/libc/stdio/getdelim.c \
|
||||||
|
upstream-netbsd/libc/stdio/getline.c \
|
||||||
|
upstream-netbsd/libc/stdlib/bsearch.c \
|
||||||
|
upstream-netbsd/libc/stdlib/div.c \
|
||||||
|
upstream-netbsd/libc/stdlib/drand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/erand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/jrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/ldiv.c \
|
||||||
|
upstream-netbsd/libc/stdlib/lldiv.c \
|
||||||
|
upstream-netbsd/libc/stdlib/lrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/mrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/nrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/_rand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/seed48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/srand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/tdelete.c \
|
||||||
|
upstream-netbsd/libc/stdlib/tfind.c \
|
||||||
|
upstream-netbsd/libc/stdlib/tsearch.c \
|
||||||
|
upstream-netbsd/libc/string/memccpy.c \
|
||||||
|
upstream-netbsd/libc/string/strcasestr.c \
|
||||||
|
upstream-netbsd/libc/string/strcoll.c \
|
||||||
|
upstream-netbsd/libc/string/strxfrm.c \
|
||||||
|
upstream-netbsd/libc/unistd/killpg.c \
|
||||||
|
|
||||||
# Architecture specific source files go here
|
# Architecture specific source files go here
|
||||||
# =========================================================
|
# =========================================================
|
||||||
ifeq ($(TARGET_ARCH),arm)
|
ifeq ($(TARGET_ARCH),arm)
|
||||||
libc_common_src_files += \
|
libc_common_src_files += \
|
||||||
arch-arm/bionic/__get_sp.S \
|
bionic/memmove.c.arm \
|
||||||
arch-arm/bionic/_exit_with_stack_teardown.S \
|
|
||||||
arch-arm/bionic/_setjmp.S \
|
|
||||||
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/ffs.S \
|
|
||||||
arch-arm/bionic/futex_arm.S \
|
|
||||||
arch-arm/bionic/kill.S \
|
|
||||||
arch-arm/bionic/libgcc_compat.c \
|
|
||||||
arch-arm/bionic/tkill.S \
|
|
||||||
arch-arm/bionic/tgkill.S \
|
|
||||||
arch-arm/bionic/memcmp.S \
|
|
||||||
arch-arm/bionic/memcmp16.S \
|
|
||||||
arch-arm/bionic/memcpy.S \
|
|
||||||
arch-arm/bionic/memset.S \
|
|
||||||
arch-arm/bionic/setjmp.S \
|
|
||||||
arch-arm/bionic/sigsetjmp.S \
|
|
||||||
arch-arm/bionic/strlen.c.arm \
|
|
||||||
arch-arm/bionic/strcpy.S \
|
|
||||||
arch-arm/bionic/strcmp.S \
|
|
||||||
arch-arm/bionic/syscall.S \
|
|
||||||
string/memmove.c.arm \
|
|
||||||
string/bcopy.c \
|
string/bcopy.c \
|
||||||
string/strncmp.c \
|
string/strncmp.c \
|
||||||
unistd/socketcalls.c
|
|
||||||
|
|
||||||
# These files need to be arm so that gdbserver
|
# These files need to be arm so that gdbserver
|
||||||
# can set breakpoints in them without messing
|
# can set breakpoints in them without messing
|
||||||
@@ -403,81 +380,31 @@ libc_common_src_files += \
|
|||||||
bionic/ptrace.c.arm
|
bionic/ptrace.c.arm
|
||||||
|
|
||||||
libc_static_common_src_files += \
|
libc_static_common_src_files += \
|
||||||
bionic/pthread.c.arm \
|
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
|
endif # arm
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),x86)
|
ifeq ($(TARGET_ARCH),x86)
|
||||||
libc_common_src_files += \
|
libc_common_src_files += \
|
||||||
arch-x86/bionic/__get_sp.S \
|
bionic/pthread-atfork.c \
|
||||||
arch-x86/bionic/__get_tls.c \
|
bionic/pthread-rwlocks.c \
|
||||||
arch-x86/bionic/__set_tls.c \
|
bionic/pthread-timers.c \
|
||||||
arch-x86/bionic/clone.S \
|
bionic/ptrace.c \
|
||||||
arch-x86/bionic/_exit_with_stack_teardown.S \
|
string/strcpy.c \
|
||||||
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
|
|
||||||
|
|
||||||
libc_static_common_src_files += \
|
libc_static_common_src_files += \
|
||||||
bionic/pthread.c \
|
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
|
endif # x86
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),mips)
|
ifeq ($(TARGET_ARCH),mips)
|
||||||
libc_common_src_files += \
|
libc_common_src_files += \
|
||||||
arch-mips/bionic/__get_sp.S \
|
bionic/memcmp.c \
|
||||||
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 += \
|
|
||||||
string/bcopy.c \
|
string/bcopy.c \
|
||||||
string/memcmp.c \
|
|
||||||
string/strcmp.c \
|
string/strcmp.c \
|
||||||
string/strcpy.c \
|
string/strcpy.c \
|
||||||
string/strncmp.c
|
string/strncmp.c
|
||||||
@@ -489,14 +416,46 @@ libc_common_src_files += \
|
|||||||
bionic/ptrace.c
|
bionic/ptrace.c
|
||||||
|
|
||||||
libc_static_common_src_files += \
|
libc_static_common_src_files += \
|
||||||
bionic/pthread.c
|
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
|
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
|
# Define some common cflags
|
||||||
# ========================================================
|
# ========================================================
|
||||||
libc_common_cflags := \
|
libc_common_cflags := \
|
||||||
@@ -508,7 +467,6 @@ libc_common_cflags := \
|
|||||||
-I$(LOCAL_PATH)/private \
|
-I$(LOCAL_PATH)/private \
|
||||||
-DPOSIX_MISTAKE \
|
-DPOSIX_MISTAKE \
|
||||||
-DLOG_ON_HEAP_ERROR \
|
-DLOG_ON_HEAP_ERROR \
|
||||||
-std=gnu99 \
|
|
||||||
-Wall -Wextra
|
-Wall -Wextra
|
||||||
|
|
||||||
# these macro definitions are required to implement the
|
# these macro definitions are required to implement the
|
||||||
@@ -534,27 +492,6 @@ ifeq ($(TARGET_ARCH),arm)
|
|||||||
libc_common_cflags += -DSOFTFLOAT
|
libc_common_cflags += -DSOFTFLOAT
|
||||||
libc_common_cflags += -fstrict-aliasing
|
libc_common_cflags += -fstrict-aliasing
|
||||||
libc_crt_target_cflags := -mthumb-interwork
|
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
|
endif # !arm
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),x86)
|
ifeq ($(TARGET_ARCH),x86)
|
||||||
@@ -625,7 +562,7 @@ ifeq ($(TARGET_ARCH),mips)
|
|||||||
libc_crt_target_so_cflags := -fPIC
|
libc_crt_target_so_cflags := -fPIC
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGET_ARCH),x86)
|
ifeq ($(TARGET_ARCH),x86)
|
||||||
libc_crtbegin_extension := S
|
libc_crtbegin_extension := c
|
||||||
libc_crt_target_so_cflags := -fPIC
|
libc_crt_target_so_cflags := -fPIC
|
||||||
endif
|
endif
|
||||||
ifeq ($(libc_crtbegin_extension),)
|
ifeq ($(libc_crtbegin_extension),)
|
||||||
@@ -739,8 +676,8 @@ WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := bionic/ssp.c
|
LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp
|
||||||
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector
|
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector -Werror
|
||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
LOCAL_MODULE := libbionic_ssp
|
LOCAL_MODULE := libbionic_ssp
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
@@ -749,6 +686,29 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
|||||||
include $(BUILD_STATIC_LIBRARY)
|
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
|
# libc_netbsd.a - upstream NetBSD C library code
|
||||||
# ========================================================
|
# ========================================================
|
||||||
@@ -762,6 +722,7 @@ LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files)
|
|||||||
LOCAL_CFLAGS := \
|
LOCAL_CFLAGS := \
|
||||||
$(libc_common_cflags) \
|
$(libc_common_cflags) \
|
||||||
-I$(LOCAL_PATH)/upstream-netbsd \
|
-I$(LOCAL_PATH)/upstream-netbsd \
|
||||||
|
-I$(LOCAL_PATH)/upstream-netbsd/libc/include \
|
||||||
-include upstream-netbsd/netbsd-compat.h
|
-include upstream-netbsd/netbsd-compat.h
|
||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
LOCAL_MODULE := libc_netbsd
|
LOCAL_MODULE := libc_netbsd
|
||||||
@@ -771,6 +732,22 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
|||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
|
# ========================================================
|
||||||
|
# libc_bionic.a - home-grown C library code
|
||||||
|
# ========================================================
|
||||||
|
#
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := $(libc_bionic_src_files)
|
||||||
|
LOCAL_CFLAGS := $(libc_common_cflags) -Werror
|
||||||
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
|
LOCAL_MODULE := libc_bionic
|
||||||
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
|
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||||
|
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
# ========================================================
|
# ========================================================
|
||||||
# libc_common.a
|
# libc_common.a
|
||||||
# ========================================================
|
# ========================================================
|
||||||
@@ -778,11 +755,13 @@ include $(BUILD_STATIC_LIBRARY)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := $(libc_common_src_files)
|
LOCAL_SRC_FILES := $(libc_common_src_files)
|
||||||
LOCAL_CFLAGS := $(libc_common_cflags)
|
LOCAL_CFLAGS := $(libc_common_cflags) \
|
||||||
|
-std=gnu99 \
|
||||||
|
-I$(LOCAL_PATH)/upstream-netbsd/libc/include # for netbsd private headers
|
||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
LOCAL_MODULE := libc_common
|
LOCAL_MODULE := libc_common
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_netbsd
|
LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_bionic libc_freebsd libc_netbsd
|
||||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||||
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
@@ -793,21 +772,22 @@ include $(BUILD_STATIC_LIBRARY)
|
|||||||
# ========================================================
|
# ========================================================
|
||||||
#
|
#
|
||||||
# This is a version of the static C library that does not
|
# This is a version of the static C library that does not
|
||||||
# include malloc. It's useful in situations when calling
|
# include malloc. It's useful in situations when the user wants
|
||||||
# the user wants to provide their own malloc implementation,
|
# to provide their own malloc implementation, or wants to
|
||||||
# or wants to explicitly disallow the use of the use of malloc,
|
# explicitly disallow the use of the use of malloc,
|
||||||
# like the dynamic loader.
|
# such as in the dynamic loader.
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
$(libc_arch_static_src_files) \
|
$(libc_arch_static_src_files) \
|
||||||
$(libc_static_common_src_files) \
|
$(libc_static_common_src_files) \
|
||||||
bionic/libc_init_static.c
|
bionic/libc_init_static.cpp
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
LOCAL_CFLAGS := $(libc_common_cflags) \
|
LOCAL_CFLAGS := $(libc_common_cflags) \
|
||||||
-DLIBC_STATIC
|
-DLIBC_STATIC \
|
||||||
|
-std=gnu99
|
||||||
|
|
||||||
LOCAL_MODULE := libc_nomalloc
|
LOCAL_MODULE := libc_nomalloc
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
@@ -827,10 +807,11 @@ LOCAL_SRC_FILES := \
|
|||||||
$(libc_static_common_src_files) \
|
$(libc_static_common_src_files) \
|
||||||
bionic/dlmalloc.c \
|
bionic/dlmalloc.c \
|
||||||
bionic/malloc_debug_common.cpp \
|
bionic/malloc_debug_common.cpp \
|
||||||
bionic/libc_init_static.c
|
bionic/libc_init_static.cpp
|
||||||
|
|
||||||
LOCAL_CFLAGS := $(libc_common_cflags) \
|
LOCAL_CFLAGS := $(libc_common_cflags) \
|
||||||
-DLIBC_STATIC
|
-DLIBC_STATIC \
|
||||||
|
-std=gnu99
|
||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
LOCAL_MODULE := libc
|
LOCAL_MODULE := libc
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
@@ -851,7 +832,7 @@ include $(CLEAR_VARS)
|
|||||||
# Since this code is experimental it is disabled by default.
|
# Since this code is experimental it is disabled by default.
|
||||||
# see libc/bionic/pthread_debug.c for details
|
# see libc/bionic/pthread_debug.c for details
|
||||||
|
|
||||||
LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0
|
LOCAL_CFLAGS := $(libc_common_cflags) -std=gnu99 -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0
|
||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
@@ -859,8 +840,8 @@ LOCAL_SRC_FILES := \
|
|||||||
$(libc_static_common_src_files) \
|
$(libc_static_common_src_files) \
|
||||||
bionic/dlmalloc.c \
|
bionic/dlmalloc.c \
|
||||||
bionic/malloc_debug_common.cpp \
|
bionic/malloc_debug_common.cpp \
|
||||||
bionic/pthread_debug.c \
|
bionic/pthread_debug.cpp \
|
||||||
bionic/libc_init_dynamic.c
|
bionic/libc_init_dynamic.cpp
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),arm)
|
ifeq ($(TARGET_ARCH),arm)
|
||||||
LOCAL_NO_CRT := true
|
LOCAL_NO_CRT := true
|
||||||
@@ -875,6 +856,7 @@ endif
|
|||||||
|
|
||||||
LOCAL_MODULE:= libc
|
LOCAL_MODULE:= libc
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
|
LOCAL_REQUIRED_MODULES := tzdata
|
||||||
|
|
||||||
# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
|
# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
|
||||||
# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
|
# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
|
||||||
@@ -911,10 +893,10 @@ LOCAL_CFLAGS := \
|
|||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
|
bionic/debug_mapinfo.cpp \
|
||||||
|
bionic/debug_stacktrace.cpp \
|
||||||
bionic/malloc_debug_leak.cpp \
|
bionic/malloc_debug_leak.cpp \
|
||||||
bionic/malloc_debug_check.cpp \
|
bionic/malloc_debug_check.cpp \
|
||||||
bionic/malloc_debug_check_mapinfo.cpp \
|
|
||||||
bionic/malloc_debug_stacktrace.cpp
|
|
||||||
|
|
||||||
LOCAL_MODULE:= libc_malloc_debug_leak
|
LOCAL_MODULE:= libc_malloc_debug_leak
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
|
|||||||
357
libc/NOTICE
357
libc/NOTICE
@@ -37,6 +37,40 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
|
||||||
|
Copyright (C) 1995-1999, 2001, 2003 Internet Software Consortium.
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||||
|
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
|
||||||
|
Copyright (C) 1997-2001 Internet Software Consortium.
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||||
|
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (C) 2006 The Android Open Source Project
|
Copyright (C) 2006 The Android Open Source Project
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
@@ -65,22 +99,6 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (C) 2007 The Android Open Source Project
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (C) 2008 The Android Open Source Project
|
Copyright (C) 2008 The Android Open Source Project
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
@@ -328,6 +346,50 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (C) 2013 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (C) 2013 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.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1980, 1983, 1988, 1993
|
Copyright (c) 1980, 1983, 1988, 1993
|
||||||
The Regents of the University of California. All rights reserved.
|
The Regents of the University of California. All rights reserved.
|
||||||
|
|
||||||
@@ -438,6 +500,40 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 1982, 1986, 1993
|
||||||
|
The Regents of the University of California. All rights reserved.
|
||||||
|
(c) UNIX System Laboratories, Inc.
|
||||||
|
All or some portions of this file are derived from material licensed
|
||||||
|
to the University of California by American Telephone and Telegraph
|
||||||
|
Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||||
|
the permission of UNIX System Laboratories, Inc.
|
||||||
|
|
||||||
|
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. Neither the name of the University nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1983, 1987, 1989
|
Copyright (c) 1983, 1987, 1989
|
||||||
The Regents of the University of California. All rights reserved.
|
The Regents of the University of California. All rights reserved.
|
||||||
|
|
||||||
@@ -569,7 +665,11 @@ are met:
|
|||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the University nor the names of its contributors
|
3. All advertising materials mentioning features or use of this software
|
||||||
|
must display the following acknowledgement:
|
||||||
|
This product includes software developed by the University of
|
||||||
|
California, Berkeley and its contributors.
|
||||||
|
4. Neither the name of the University nor the names of its contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
@@ -585,24 +685,6 @@ 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
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
|
|
||||||
Portions Copyright (c) 1993 by Digital Equipment Corporation.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies, and that
|
|
||||||
the name of Digital Equipment Corporation not be used in advertising or
|
|
||||||
publicity pertaining to distribution of the document or software without
|
|
||||||
specific, written prior permission.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
|
|
||||||
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
|
|
||||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
|
|
||||||
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
|
||||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
||||||
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
||||||
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1983, 1993
|
Copyright (c) 1983, 1993
|
||||||
@@ -1406,38 +1488,6 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1990 Regents of the University of California.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This code is derived from software contributed to Berkeley by
|
|
||||||
Chris Torek.
|
|
||||||
|
|
||||||
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. Neither the name of the University nor the names of its contributors
|
|
||||||
may be used to endorse or promote products derived from this software
|
|
||||||
without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 1990 The Regents of the University of California.
|
Copyright (c) 1990 The Regents of the University of California.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
@@ -1591,35 +1641,6 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1990, 1993
|
|
||||||
The Regents of the University of California. 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.
|
|
||||||
4. Neither the name of the University nor the names of its contributors
|
|
||||||
may be used to endorse or promote products derived from this software
|
|
||||||
without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 1990, 1993
|
Copyright (c) 1990, 1993
|
||||||
The Regents of the University of California. All rights reserved.
|
The Regents of the University of California. All rights reserved.
|
||||||
|
|
||||||
@@ -2376,6 +2397,35 @@ to anyone/anything when using this software.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 1994 The NetBSD Foundation, Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
by Christos Zoulas.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
|
Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
|
||||||
(Royal Institute of Technology, Stockholm, Sweden).
|
(Royal Institute of Technology, Stockholm, Sweden).
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
@@ -2463,32 +2513,6 @@ rights to redistribute these changes.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1995, 1996 Erik Theisen. 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 author may not be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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) 1996 by Internet Software Consortium.
|
Copyright (c) 1996 by Internet Software Consortium.
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software for any
|
Permission to use, copy, modify, and distribute this software for any
|
||||||
@@ -3596,23 +3620,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
|
||||||
Copyright (c) 1997-1999 by Internet Software Consortium.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
|
||||||
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
Copyright (c) 1999 by Internet Software Consortium.
|
Copyright (c) 1999 by Internet Software Consortium.
|
||||||
|
|
||||||
@@ -3673,6 +3680,23 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
|
Copyright (c) 1995-1999 by Internet Software Consortium
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||||
|
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2007-2008 Michael G Schwern
|
Copyright (c) 2007-2008 Michael G Schwern
|
||||||
|
|
||||||
This software originally derived from Paul Sheer's pivotal_gmtime_r.c.
|
This software originally derived from Paul Sheer's pivotal_gmtime_r.c.
|
||||||
@@ -3833,6 +3857,33 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||||
|
|
||||||
|
This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
by Roy Marples.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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) 2010 MIPS Technologies, Inc.
|
Copyright (c) 2010 MIPS Technologies, Inc.
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
@@ -3979,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,
|
Copyright (c)1999 Citrus Project,
|
||||||
All rights reserved.
|
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
|
# This file is used to automatically generate bionic's the system calls stubs.
|
||||||
# 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>
|
|
||||||
#
|
#
|
||||||
# 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:
|
# Note that:
|
||||||
# - syscall_name correspond to the name of the syscall, which may differ from
|
# - 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()
|
# 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)
|
# 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
|
# The call_id parameter, given that func_name and syscall_name have
|
||||||
@@ -18,298 +16,306 @@
|
|||||||
# - each parameter type is assumed to be stored on 32 bits, there is no plan to support
|
# - each parameter type is assumed to be stored on 32 bits, there is no plan to support
|
||||||
# 64-bit architectures at the moment
|
# 64-bit architectures at the moment
|
||||||
#
|
#
|
||||||
# - it there is "stub" instead of a syscall number, the tool will not generate any
|
# - the final field can be "1", meaning: generate a stub for each architecture,
|
||||||
# assembler template for the syscall; it's up to the bionic implementation to provide
|
# taking the constants from the kernel header files.
|
||||||
# a relevant C stub
|
|
||||||
#
|
#
|
||||||
# - additionally, if the syscall number is different amoung ARM, and x86, MIPS use:
|
# - the final field can be "stub" meaning: do not generate any stubs ---
|
||||||
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,mips_number
|
# 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
|
# process management
|
||||||
void _exit:exit_group (int) 248,252,246
|
void _exit:exit_group (int) 1
|
||||||
void _exit_thread:exit (int) 1
|
void _exit_thread:exit (int) 1
|
||||||
pid_t __fork:fork (void) 2
|
pid_t __fork:fork (void) 1
|
||||||
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7,7
|
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,1,1
|
||||||
int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284,278
|
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
|
# NOTE: this system call is never called directly, but we list it there
|
||||||
# to have __NR_clone properly defined.
|
# 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:setuid32 (uid_t) 1,1,-1
|
||||||
int __setuid:setuid (uid_t) -1,-1,23
|
int __setuid:setuid (uid_t) -1,-1,1
|
||||||
uid_t getuid:getuid32 () 199,199,-1
|
uid_t getuid:getuid32 () 1,1,-1
|
||||||
uid_t getuid:getuid () -1,-1,24
|
uid_t getuid:getuid () -1,-1,1
|
||||||
gid_t getgid:getgid32 () 200,200,-1
|
gid_t getgid:getgid32 () 1,1,-1
|
||||||
gid_t getgid:getgid () -1,-1,47
|
gid_t getgid:getgid () -1,-1,1
|
||||||
uid_t geteuid:geteuid32 () 201,201,-1
|
uid_t geteuid:geteuid32 () 1,1,-1
|
||||||
uid_t geteuid:geteuid () -1,-1,49
|
uid_t geteuid:geteuid () -1,-1,1
|
||||||
gid_t getegid:getegid32 () 202,202,-1
|
gid_t getegid:getegid32 () 1,1,-1
|
||||||
gid_t getegid:getegid () -1,-1,50
|
gid_t getegid:getegid () -1,-1,1
|
||||||
uid_t getresuid:getresuid32 (uid_t *ruid, uid_t *euid, uid_t *suid) 209,209,-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,186
|
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) 211,211,-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,191
|
gid_t getresgid:getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) -1,-1,1
|
||||||
pid_t gettid() 224,224,222
|
pid_t gettid() 1
|
||||||
ssize_t readahead(int, off64_t, size_t) 225,225,223
|
ssize_t readahead(int, off64_t, size_t) 1
|
||||||
int getgroups:getgroups32(int, gid_t *) 205,205,-1
|
int getgroups:getgroups32(int, gid_t *) 1,1,-1
|
||||||
int getgroups:getgroups(int, gid_t *) -1,-1,80
|
int getgroups:getgroups(int, gid_t *) -1,-1,1
|
||||||
pid_t getpgid(pid_t) 132
|
pid_t getpgid(pid_t) 1
|
||||||
pid_t getppid() 64
|
pid_t getppid() 1
|
||||||
pid_t getsid(pid_t) 147
|
pid_t getsid(pid_t) 1
|
||||||
pid_t setsid() 66
|
pid_t setsid() 1
|
||||||
int setgid:setgid32(gid_t) 214,214,-1
|
int setgid:setgid32(gid_t) 1,1,-1
|
||||||
int setgid:setgid(gid_t) -1,-1,46
|
int setgid:setgid(gid_t) -1,-1,1
|
||||||
int seteuid:seteuid32(uid_t) stub
|
int seteuid:seteuid32(uid_t) stub
|
||||||
int __setreuid:setreuid32(uid_t, uid_t) 203,203,-1
|
int __setreuid:setreuid32(uid_t, uid_t) 1,1,-1
|
||||||
int __setreuid:setreuid(uid_t, uid_t) -1,-1,70
|
int __setreuid:setreuid(uid_t, uid_t) -1,-1,1
|
||||||
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208,208,-1
|
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 1,1,-1
|
||||||
int __setresuid:setresuid(uid_t, uid_t, uid_t) -1,-1,185
|
int __setresuid:setresuid(uid_t, uid_t, uid_t) -1,-1,1
|
||||||
int setresgid:setresgid32(gid_t, gid_t, gid_t) 210,210,-1
|
int setresgid:setresgid32(gid_t, gid_t, gid_t) 1,1,-1
|
||||||
int setresgid:setresgid(gid_t, gid_t, gid_t) -1,-1,190
|
int setresgid:setresgid(gid_t, gid_t, gid_t) -1,-1,1
|
||||||
void* __brk:brk(void*) 45
|
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
|
# 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 kill(pid_t, int) -1,1,1
|
||||||
int tkill(pid_t tid, int sig) -1,238,236
|
int tkill(pid_t tid, int sig) -1,1,1
|
||||||
int tgkill(pid_t tgid, pid_t tid, int sig) -1,270,266
|
int tgkill(pid_t tgid, pid_t tid, int sig) -1,1,1
|
||||||
int __ptrace:ptrace(int request, int pid, void* addr, void* data) 26
|
int __ptrace:ptrace(int request, int pid, void* addr, void* data) 1
|
||||||
int __set_thread_area:set_thread_area(void* user_desc) -1,243,283
|
int __set_thread_area:set_thread_area(void* user_desc) -1,1,1
|
||||||
int __getpriority:getpriority(int, int) 96
|
int __getpriority:getpriority(int, int) 1
|
||||||
int setpriority(int, int, int) 97
|
int setpriority(int, int, int) 1
|
||||||
int setrlimit(int resource, const struct rlimit *rlp) 75
|
int setrlimit(int resource, const struct rlimit *rlp) 1
|
||||||
int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 191,191,-1
|
int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 1,1,-1
|
||||||
int getrlimit:getrlimit(int resource, struct rlimit *rlp) -1,-1,76
|
int getrlimit:getrlimit(int resource, struct rlimit *rlp) -1,-1,1
|
||||||
int getrusage(int who, struct rusage* r_usage) 77
|
int getrusage(int who, struct rusage* r_usage) 1
|
||||||
int setgroups:setgroups32(int, const gid_t *) 206,206,-1
|
int setgroups:setgroups32(int, const gid_t *) 1,1,-1
|
||||||
int setgroups:setgroups(int, const gid_t *) -1,-1,81
|
int setgroups:setgroups(int, const gid_t *) -1,-1,1
|
||||||
pid_t getpgrp(void) stub
|
pid_t getpgrp(void) stub
|
||||||
int setpgid(pid_t, pid_t) 57
|
int setpgid(pid_t, pid_t) 1
|
||||||
pid_t vfork(void) 190,-1,-1
|
pid_t vfork(void) 1,-1,-1
|
||||||
int setregid:setregid32(gid_t, gid_t) 204,204,-1
|
int setregid:setregid32(gid_t, gid_t) 1,1,-1
|
||||||
int setregid:setregid(gid_t, gid_t) -1,-1,71
|
int setregid:setregid(gid_t, gid_t) -1,-1,1
|
||||||
int chroot(const char *) 61
|
int chroot(const char *) 1
|
||||||
# IMPORTANT: Even though <sys/prctl.h> declares prctl(int,...), the syscall stub must take 6 arguments
|
# IMPORTANT: Even though <sys/prctl.h> declares prctl(int,...), the syscall stub must take 6 arguments
|
||||||
# to match the kernel implementation.
|
# 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 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) 184,184,204
|
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) 185,185,205
|
int capset(cap_user_header_t header, const cap_user_data_t data) 1
|
||||||
int sigaltstack(const stack_t*, stack_t*) 186,186,206
|
int sigaltstack(const stack_t*, stack_t*) 1
|
||||||
int acct(const char* filepath) 51
|
int acct(const char* filepath) 1
|
||||||
|
|
||||||
# file descriptors
|
# file descriptors
|
||||||
ssize_t read (int, void*, size_t) 3
|
ssize_t read (int, void*, size_t) 1
|
||||||
ssize_t write (int, const void*, size_t) 4
|
ssize_t write (int, const void*, size_t) 1
|
||||||
ssize_t pread64 (int, void *, size_t, off64_t) 180,180,200
|
ssize_t pread64 (int, void *, size_t, off64_t) 1
|
||||||
ssize_t pwrite64 (int, void *, size_t, off64_t) 181,181,201
|
ssize_t pwrite64 (int, void *, size_t, off64_t) 1
|
||||||
int __open:open (const char*, int, mode_t) 5
|
int __open:open (const char*, int, mode_t) 1
|
||||||
int __openat:openat (int, const char*, int, mode_t) 322,295,288
|
int __openat:openat (int, const char*, int, mode_t) 1
|
||||||
int close (int) 6
|
int close (int) 1
|
||||||
int creat(const char*, mode_t) stub
|
int creat(const char*, mode_t) stub
|
||||||
off_t lseek(int, off_t, int) 19
|
off_t lseek(int, off_t, int) 1
|
||||||
int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 140
|
int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 1
|
||||||
pid_t getpid () 20
|
pid_t getpid () 1
|
||||||
void * mmap(void *, size_t, int, int, int, long) stub
|
void * mmap(void *, size_t, int, int, int, long) stub
|
||||||
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 192,192,210
|
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 1
|
||||||
int munmap(void *, size_t) 91
|
int munmap(void *, size_t) 1
|
||||||
void * mremap(void *, size_t, size_t, unsigned long) 163,163,167
|
void * mremap(void *, size_t, size_t, unsigned long) 1
|
||||||
int msync(const void *, size_t, int) 144
|
int msync(const void *, size_t, int) 1
|
||||||
int mprotect(const void *, size_t, int) 125
|
int mprotect(const void *, size_t, int) 1
|
||||||
int madvise(const void *, size_t, int) 220,219,218
|
int madvise(const void *, size_t, int) 1
|
||||||
int mlock(const void *addr, size_t len) 150,150,154
|
int mlock(const void *addr, size_t len) 1
|
||||||
int munlock(const void *addr, size_t len) 151,151,155
|
int munlock(const void *addr, size_t len) 1
|
||||||
int mlockall(int flags) 152,152,156
|
int mlockall(int flags) 1
|
||||||
int munlockall() 153,153,157
|
int munlockall() 1
|
||||||
int mincore(void* start, size_t length, unsigned char* vec) 219,218,217
|
int mincore(void* start, size_t length, unsigned char* vec) 1
|
||||||
int __ioctl:ioctl(int, int, void *) 54
|
int __ioctl:ioctl(int, int, void *) 1
|
||||||
int readv(int, const struct iovec *, int) 145
|
int readv(int, const struct iovec *, int) 1
|
||||||
int writev(int, const struct iovec *, int) 146
|
int writev(int, const struct iovec *, int) 1
|
||||||
int __fcntl:fcntl(int, int, void*) 55
|
int __fcntl:fcntl(int, int, void*) 1
|
||||||
int flock(int, int) 143
|
int flock(int, int) 1
|
||||||
int fchmod(int, mode_t) 94
|
int fchmod(int, mode_t) 1
|
||||||
int dup(int) 41
|
int dup(int) 1
|
||||||
int pipe(int *) 42,42,-1
|
int pipe(int *) 1,1,-1
|
||||||
int pipe2(int *, int) 359,331,328
|
int pipe2(int *, int) 1
|
||||||
int dup2(int, int) 63
|
int dup2(int, int) 1
|
||||||
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 142
|
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 1
|
||||||
int ftruncate(int, off_t) 93
|
int ftruncate(int, off_t) 1
|
||||||
int ftruncate64(int, off64_t) 194,194,212
|
int ftruncate64(int, off64_t) 1
|
||||||
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220,219
|
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 1
|
||||||
int fsync(int) 118
|
int fsync(int) 1
|
||||||
int fdatasync(int) 148,148,152
|
int fdatasync(int) 1
|
||||||
int fchown:fchown32(int, uid_t, gid_t) 207,207,-1
|
int fchown:fchown32(int, uid_t, gid_t) 1,1,-1
|
||||||
int fchown:fchown(int, uid_t, gid_t) -1,-1,95
|
int fchown:fchown(int, uid_t, gid_t) -1,-1,1
|
||||||
void sync(void) 36
|
void sync(void) 1
|
||||||
int __fcntl64:fcntl64(int, int, void *) 221,221,220
|
int __fcntl64:fcntl64(int, int, void *) 1
|
||||||
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 267,269,256
|
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 1
|
||||||
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 187,187,207
|
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) 327,300,293
|
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 1
|
||||||
int mkdirat(int dirfd, const char *pathname, mode_t mode) 323,296,289
|
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) 325,298,291
|
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) 333,306,299
|
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) 329,302,295
|
int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) 1
|
||||||
int fsetxattr(int, const char *, const void *, size_t, int) 228,228,226
|
int fsetxattr(int, const char *, const void *, size_t, int) 1
|
||||||
ssize_t fgetxattr(int, const char *, void *, size_t) 231,231,229
|
ssize_t fgetxattr(int, const char *, void *, size_t) 1
|
||||||
ssize_t flistxattr(int, char *, size_t) 234,234,232
|
ssize_t flistxattr(int, char *, size_t) 1
|
||||||
int fremovexattr(int, const char *) 237,237,235
|
int fremovexattr(int, const char *) 1
|
||||||
|
|
||||||
# file system
|
# file system
|
||||||
int link (const char*, const char*) 9
|
int link (const char*, const char*) 1
|
||||||
int unlink (const char*) 10
|
int unlink (const char*) 1
|
||||||
int unlinkat (int, const char *, int) 328,301,294
|
int unlinkat (int, const char *, int) 1
|
||||||
int chdir (const char*) 12
|
int chdir (const char*) 1
|
||||||
int mknod (const char*, mode_t, dev_t) 14
|
int mknod (const char*, mode_t, dev_t) 1
|
||||||
int chmod (const char*,mode_t) 15
|
int chmod (const char*,mode_t) 1
|
||||||
int chown:chown32(const char *, uid_t, gid_t) 212,212,-1
|
int chown:chown32(const char *, uid_t, gid_t) 1,1,-1
|
||||||
int chown:chown(const char *, uid_t, gid_t) -1,-1,202
|
int chown:chown(const char *, uid_t, gid_t) -1,-1,1
|
||||||
int lchown:lchown32 (const char*, uid_t, gid_t) 198,198,-1
|
int lchown:lchown32 (const char*, uid_t, gid_t) 1,1,-1
|
||||||
int lchown:lchown (const char*, uid_t, gid_t) -1,-1,16
|
int lchown:lchown (const char*, uid_t, gid_t) -1,-1,1
|
||||||
int mount (const char*, const char*, const char*, unsigned long, const void*) 21
|
int mount (const char*, const char*, const char*, unsigned long, const void*) 1
|
||||||
int umount(const char*) stub
|
int umount(const char*) stub
|
||||||
int umount2 (const char*, int) 52
|
int umount2 (const char*, int) 1
|
||||||
int fstat:fstat64(int, struct stat*) 197,197,215
|
int fstat:fstat64(int, struct stat*) 1
|
||||||
int stat:stat64(const char *, struct stat *) 195,195,213
|
int stat:stat64(const char *, struct stat *) 1
|
||||||
int lstat:lstat64(const char *, struct stat *) 196,196,214
|
int lstat:lstat64(const char *, struct stat *) 1
|
||||||
int mkdir(const char *, mode_t) 39
|
int mkdir(const char *, mode_t) 1
|
||||||
int readlink(const char *, char *, size_t) 85
|
int readlink(const char *, char *, size_t) 1
|
||||||
int rmdir(const char *) 40
|
int rmdir(const char *) 1
|
||||||
int rename(const char *, const char *) 38
|
int rename(const char *, const char *) 1
|
||||||
int __getcwd:getcwd(char * buf, size_t size) 183,183,203
|
int __getcwd:getcwd(char * buf, size_t size) 1
|
||||||
int access(const char *, int) 33
|
int access(const char *, int) 1
|
||||||
int faccessat(int, const char *, int, int) 334,307,300
|
int faccessat(int, const char *, int, int) 1
|
||||||
int symlink(const char *, const char *) 83
|
int symlink(const char *, const char *) 1
|
||||||
int fchdir(int) 133
|
int fchdir(int) 1
|
||||||
int truncate(const char*, off_t) 92
|
int truncate(const char*, off_t) 1
|
||||||
int setxattr(const char *, const char *, const void *, size_t, int) 226,226,224
|
int setxattr(const char *, const char *, const void *, size_t, int) 1
|
||||||
int lsetxattr(const char *, const char *, const void *, size_t, int) 227,227,225
|
int lsetxattr(const char *, const char *, const void *, size_t, int) 1
|
||||||
ssize_t getxattr(const char *, const char *, void *, size_t) 229,229,227
|
ssize_t getxattr(const char *, const char *, void *, size_t) 1
|
||||||
ssize_t lgetxattr(const char *, const char *, void *, size_t) 230,230,228
|
ssize_t lgetxattr(const char *, const char *, void *, size_t) 1
|
||||||
ssize_t listxattr(const char *, char *, size_t) 232,232,230
|
ssize_t listxattr(const char *, char *, size_t) 1
|
||||||
ssize_t llistxattr(const char *, char *, size_t) 233,233,231
|
ssize_t llistxattr(const char *, char *, size_t) 1
|
||||||
int removexattr(const char *, const char *) 235,235,233
|
int removexattr(const char *, const char *) 1
|
||||||
int lremovexattr(const char *, const char *) 236,236,234
|
int lremovexattr(const char *, const char *) 1
|
||||||
int __statfs64:statfs64(const char *, size_t, struct statfs *) 266,268,255
|
int __statfs64:statfs64(const char *, size_t, struct statfs *) 1
|
||||||
long unshare(unsigned long) 337,310,303
|
long unshare(unsigned long) 1
|
||||||
|
|
||||||
# time
|
# time
|
||||||
int pause () 29
|
int pause () 1
|
||||||
int gettimeofday(struct timeval*, struct timezone*) 78
|
int gettimeofday(struct timeval*, struct timezone*) 1
|
||||||
int settimeofday(const struct timeval*, const struct timezone*) 79
|
int settimeofday(const struct timeval*, const struct timezone*) 1
|
||||||
clock_t times(struct tms *) 43
|
clock_t times(struct tms *) 1
|
||||||
int nanosleep(const struct timespec *, struct timespec *) 162,162,166
|
int nanosleep(const struct timespec *, struct timespec *) 1
|
||||||
int clock_gettime(clockid_t clk_id, struct timespec *tp) 263,265,263
|
int clock_gettime(clockid_t clk_id, struct timespec *tp) 1
|
||||||
int clock_settime(clockid_t clk_id, const struct timespec *tp) 262,264,262
|
int clock_settime(clockid_t clk_id, const struct timespec *tp) 1
|
||||||
int clock_getres(clockid_t clk_id, struct timespec *res) 264,266,264
|
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) 265,267,265
|
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *req, struct timespec *rem) 1
|
||||||
int getitimer(int, const struct itimerval *) 105
|
int getitimer(int, const struct itimerval *) 1
|
||||||
int setitimer(int, const struct itimerval *, struct itimerval *) 104
|
int setitimer(int, const struct itimerval *, struct itimerval *) 1
|
||||||
int __timer_create:timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) 257,259,257
|
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*) 258,260,258
|
int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) 1
|
||||||
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 259,261,259
|
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 1
|
||||||
int __timer_getoverrun:timer_getoverrun(timer_t) 260,262,260
|
int __timer_getoverrun:timer_getoverrun(timer_t) 1
|
||||||
int __timer_delete:timer_delete(timer_t) 261,263,261
|
int __timer_delete:timer_delete(timer_t) 1
|
||||||
int utimes(const char*, const struct timeval tvp[2]) 269,271,267
|
int utimes(const char*, const struct timeval tvp[2]) 1
|
||||||
int utimensat(int, const char *, const struct timespec times[2], int) 348,320,316
|
int utimensat(int, const char *, const struct timespec times[2], int) 1
|
||||||
|
|
||||||
# signals
|
# signals
|
||||||
int sigaction(int, const struct sigaction *, struct sigaction *) 67
|
int sigaction(int, const struct sigaction *, struct sigaction *) 1
|
||||||
int sigprocmask(int, const sigset_t *, sigset_t *) 126
|
int sigprocmask(int, const sigset_t *, sigset_t *) 1
|
||||||
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72,72,-1
|
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 1,1,-1
|
||||||
int __sigsuspend:sigsuspend(const sigset_t *mask) -1,-1,72
|
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) 174,174,194
|
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) 175,175,195
|
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) 177,177,197
|
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 *) 73
|
int sigpending(sigset_t *) 1
|
||||||
|
int signalfd4(int fd, const sigset_t *mask, size_t sizemask, int flags) 1
|
||||||
|
|
||||||
# sockets
|
# sockets
|
||||||
int socket(int, int, int) 281,-1,183
|
int socket(int, int, int) 1,-1,1
|
||||||
int socketpair(int, int, int, int*) 288,-1,184
|
int socketpair(int, int, int, int*) 1,-1,1
|
||||||
int bind(int, struct sockaddr *, int) 282,-1,169
|
int bind(int, struct sockaddr *, int) 1,-1,1
|
||||||
int connect(int, struct sockaddr *, socklen_t) 283,-1,170
|
int connect(int, struct sockaddr *, socklen_t) 1,-1,1
|
||||||
int listen(int, int) 284,-1,174
|
int listen(int, int) 1,-1,1
|
||||||
int accept(int, struct sockaddr *, socklen_t *) 285,-1,168
|
int accept(int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||||
int getsockname(int, struct sockaddr *, socklen_t *) 286,-1,172
|
int getsockname(int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||||
int getpeername(int, struct sockaddr *, socklen_t *) 287,-1,171
|
int getpeername(int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||||
int sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t) 290,-1,180
|
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 *) 292,-1,176
|
int recvfrom(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) 1,-1,1
|
||||||
int shutdown(int, int) 293,-1,182
|
int shutdown(int, int) 1,-1,1
|
||||||
int setsockopt(int, int, int, const void *, socklen_t) 294,-1,181
|
int setsockopt(int, int, int, const void *, socklen_t) 1,-1,1
|
||||||
int getsockopt(int, int, int, void *, socklen_t *) 295,-1,173
|
int getsockopt(int, int, int, void *, socklen_t *) 1,-1,1
|
||||||
int sendmsg(int, const struct msghdr *, unsigned int) 296,-1,179
|
int sendmsg(int, const struct msghdr *, unsigned int) 1,-1,1
|
||||||
int recvmsg(int, struct msghdr *, unsigned int) 297,-1,177
|
int recvmsg(int, struct msghdr *, unsigned int) 1,-1,1
|
||||||
|
|
||||||
# sockets for x86. These are done as an "indexed" call to socketcall syscall.
|
# sockets for x86. These are done as an "indexed" call to socketcall syscall.
|
||||||
int socket:socketcall:1 (int, int, int) -1,102,-1
|
int socket:socketcall:1 (int, int, int) -1,1,-1
|
||||||
int bind:socketcall:2 (int, struct sockaddr *, int) -1,102,-1
|
int bind:socketcall:2 (int, struct sockaddr *, int) -1,1,-1
|
||||||
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,102,-1
|
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,1,-1
|
||||||
int listen:socketcall:4(int, int) -1,102,-1
|
int listen:socketcall:4(int, int) -1,1,-1
|
||||||
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,102,-1
|
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,1,-1
|
||||||
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,102,-1
|
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,1,-1
|
||||||
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,102,-1
|
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,1,-1
|
||||||
int socketpair:socketcall:8(int, int, int, int*) -1,102,-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,102,-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,102,-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,102,-1
|
int shutdown:socketcall:13(int, int) -1,1,-1
|
||||||
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,102,-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,102,-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,102,-1
|
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,1,-1
|
||||||
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102,-1
|
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,1,-1
|
||||||
|
|
||||||
# scheduler & real-time
|
# scheduler & real-time
|
||||||
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156,156,160
|
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 1
|
||||||
int sched_getscheduler(pid_t pid) 157,157,161
|
int sched_getscheduler(pid_t pid) 1
|
||||||
int sched_yield(void) 158,158,162
|
int sched_yield(void) 1
|
||||||
int sched_setparam(pid_t pid, const struct sched_param *param) 154,154,158
|
int sched_setparam(pid_t pid, const struct sched_param *param) 1
|
||||||
int sched_getparam(pid_t pid, struct sched_param *param) 155,155,159
|
int sched_getparam(pid_t pid, struct sched_param *param) 1
|
||||||
int sched_get_priority_max(int policy) 159,159,163
|
int sched_get_priority_max(int policy) 1
|
||||||
int sched_get_priority_min(int policy) 160,160,164
|
int sched_get_priority_min(int policy) 1
|
||||||
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161,161,165
|
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) 241,241,239
|
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) 242,242,240
|
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) 345,318,312
|
int __getcpu:getcpu(unsigned *cpu, unsigned *node, void *unused) 1
|
||||||
|
|
||||||
# io priorities
|
# io priorities
|
||||||
int ioprio_set(int which, int who, int ioprio) 314,289,314
|
int ioprio_set(int which, int who, int ioprio) 1
|
||||||
int ioprio_get(int which, int who) 315,290,315
|
int ioprio_get(int which, int who) 1
|
||||||
|
|
||||||
# other
|
# other
|
||||||
int uname(struct utsname *) 122
|
int uname(struct utsname *) 1
|
||||||
pid_t __wait4:wait4(pid_t pid, int *status, int options, struct rusage *rusage) 114
|
mode_t umask(mode_t) 1
|
||||||
mode_t umask(mode_t) 60
|
int __reboot:reboot(int, int, int, void *) 1
|
||||||
int __reboot:reboot(int, int, int, void *) 88
|
int __syslog:syslog(int, char *, int) 1
|
||||||
int __syslog:syslog(int, char *, int) 103
|
int init_module(void *, unsigned long, const char *) 1
|
||||||
int init_module(void *, unsigned long, const char *) 128
|
int delete_module(const char*, unsigned int) 1
|
||||||
int delete_module(const char*, unsigned int) 129
|
int klogctl:syslog(int, char *, int) 1
|
||||||
int klogctl:syslog(int, char *, int) 103
|
int sysinfo(struct sysinfo *) 1
|
||||||
int sysinfo(struct sysinfo *) 116
|
int personality(unsigned long) 1
|
||||||
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) 1
|
||||||
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364
|
|
||||||
|
|
||||||
# futex
|
# futex
|
||||||
int futex(void *, int, int, void *, void *, int) 240,240,238
|
int futex(void *, int, int, void *, void *, int) 1
|
||||||
|
|
||||||
# epoll
|
# epoll
|
||||||
int epoll_create(int size) 250,254,248
|
int epoll_create(int size) 1
|
||||||
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255,249
|
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) 252,256,250
|
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 1
|
||||||
|
|
||||||
int inotify_init(void) 316,291,284
|
int inotify_init(void) 1
|
||||||
int inotify_add_watch(int, const char *, unsigned int) 317,292,285
|
int inotify_add_watch(int, const char *, unsigned int) 1
|
||||||
int inotify_rm_watch(int, unsigned int) 318,293,286
|
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
|
# ARM-specific ARM_NR_BASE == 0x0f0000 == 983040
|
||||||
int __set_tls:ARM_set_tls(void*) 983045,-1,-1
|
int __set_tls:__ARM_NR_set_tls(void*) 1,-1,-1
|
||||||
int cacheflush:ARM_cacheflush(long start, long end, long flags) 983042,-1,-1
|
int cacheflush:__ARM_NR_cacheflush(long start, long end, long flags) 1,-1,-1
|
||||||
|
|
||||||
# MIPS-specific
|
# MIPS-specific
|
||||||
int _flush_cache:cacheflush(char *addr, const int nbytes, const int op) -1,-1,147
|
int _flush_cache:cacheflush(char *addr, const int nbytes, const int op) -1,-1,1
|
||||||
int syscall(int number,...) -1,-1,0
|
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
|
||||||
@@ -25,10 +25,10 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
.global __get_sp
|
|
||||||
.type __get_sp, %function
|
|
||||||
|
|
||||||
__get_sp:
|
#include <machine/asm.h>
|
||||||
mov r0, sp
|
|
||||||
bx lr
|
|
||||||
|
|
||||||
|
ENTRY(__get_sp)
|
||||||
|
mov r0, sp
|
||||||
|
bx lr
|
||||||
|
END(__get_sp)
|
||||||
|
|||||||
@@ -25,27 +25,20 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <asm/unistd.h>
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
@ void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode)
|
// void _exit_with_stack_teardown(void* stackBase, int stackSize, int retCode)
|
||||||
ENTRY(_exit_with_stack_teardown)
|
ENTRY(_exit_with_stack_teardown)
|
||||||
|
|
||||||
#if __ARM_EABI__
|
|
||||||
mov lr, r2
|
mov lr, r2
|
||||||
ldr r7, =__NR_munmap
|
ldr r7, =__NR_munmap
|
||||||
swi #0 @ the stack is destroyed by this call
|
swi #0 // the stack is destroyed by this call
|
||||||
mov r0, lr
|
mov r0, lr
|
||||||
ldr r7, =__NR_exit
|
ldr r7, =__NR_exit
|
||||||
swi #0
|
swi #0
|
||||||
#else
|
|
||||||
mov lr, r2
|
|
||||||
swi # __NR_munmap @ the stack is destroyed by this call
|
|
||||||
mov r0, lr
|
|
||||||
swi # __NR_exit
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@ exit() should never return, cause a crash if it does
|
// exit() should never return, cause a crash if it does
|
||||||
mov r0, #0
|
mov r0, #0
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
END(_exit_with_stack_teardown)
|
END(_exit_with_stack_teardown)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <private/logd.h>
|
#include <private/libc_logging.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -50,10 +50,9 @@ atexit(void (*func)(void))
|
|||||||
* calling library may have been dlclose()'d, causing the program to
|
* calling library may have been dlclose()'d, causing the program to
|
||||||
* crash.
|
* crash.
|
||||||
*/
|
*/
|
||||||
static char const warning[] =
|
static char const warning[] = "WARNING: generic atexit() called from legacy shared library\n";
|
||||||
"WARNING: generic atexit() called from legacy shared library\n";
|
|
||||||
|
|
||||||
__libc_android_log_print(ANDROID_LOG_WARN, "libc", warning);
|
__libc_format_log(ANDROID_LOG_WARN, "libc", warning);
|
||||||
fprintf(stderr, warning);
|
fprintf(stderr, warning);
|
||||||
|
|
||||||
return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
|
return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
|
||||||
|
|||||||
@@ -25,47 +25,42 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
|
// int __pthread_clone(void* (*fn)(void*), void* child_stack, int flags, void* arg);
|
||||||
ENTRY(__pthread_clone)
|
ENTRY(__pthread_clone)
|
||||||
@ insert the args onto the new stack
|
# Copy the args onto the new stack.
|
||||||
stmdb r1!, {r0, r3}
|
stmdb r1!, {r0, r3}
|
||||||
|
|
||||||
@ do the system call
|
|
||||||
@ get flags
|
|
||||||
|
|
||||||
|
# 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.
|
||||||
mov r0, r2
|
mov r0, r2
|
||||||
|
|
||||||
@ new sp is already in r1
|
|
||||||
|
|
||||||
#if __ARM_EABI__
|
|
||||||
stmfd sp!, {r4, r7}
|
stmfd sp!, {r4, r7}
|
||||||
|
|
||||||
|
# System call.
|
||||||
ldr r7, =__NR_clone
|
ldr r7, =__NR_clone
|
||||||
swi #0
|
swi #0
|
||||||
#else
|
|
||||||
swi #__NR_clone
|
|
||||||
#endif
|
|
||||||
|
|
||||||
movs r0, r0
|
movs r0, r0
|
||||||
#if __ARM_EABI__
|
beq 1f
|
||||||
ldmnefd sp!, {r4, r7}
|
|
||||||
#endif
|
|
||||||
blt __error
|
|
||||||
bxne lr
|
|
||||||
|
|
||||||
|
# In parent, reload saved registers then either return or set errno.
|
||||||
|
ldmfd sp!, {r4, r7}
|
||||||
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
|
||||||
@ pick the function arg and call address off the stack and jump
|
1: # The child.
|
||||||
@ to the C __thread_entry function which does some setup and then
|
# pick the function arg and call address off the stack and jump
|
||||||
@ calls the thread's start function
|
# to the C __thread_entry function which does some setup and then
|
||||||
|
# calls the thread's start function
|
||||||
pop {r0, r1}
|
pop {r0, r1}
|
||||||
mov r2, sp @ __thread_entry needs the TLS pointer
|
# __thread_entry needs the TLS pointer
|
||||||
|
mov r2, sp
|
||||||
b __thread_entry
|
b __thread_entry
|
||||||
|
|
||||||
__error:
|
|
||||||
mov r0, #-1
|
|
||||||
bx lr
|
|
||||||
END(__pthread_clone)
|
END(__pthread_clone)
|
||||||
|
|
||||||
|
|
||||||
@@ -76,8 +71,8 @@ END(__pthread_clone)
|
|||||||
# pid_t *pid, void *tls, pid_t *ctid,
|
# pid_t *pid, void *tls, pid_t *ctid,
|
||||||
# int (*fn)(void *), void* arg );
|
# int (*fn)(void *), void* arg );
|
||||||
#
|
#
|
||||||
# NOTE: This is not the same signature than the GLibc
|
# NOTE: This is not the same signature as the glibc
|
||||||
# __clone function here !! Placing 'fn' and 'arg'
|
# __clone function. Placing 'fn' and 'arg'
|
||||||
# at the end of the parameter list makes the
|
# at the end of the parameter list makes the
|
||||||
# implementation much simpler.
|
# implementation much simpler.
|
||||||
#
|
#
|
||||||
@@ -96,20 +91,20 @@ ENTRY(__bionic_clone)
|
|||||||
str r5, [r1, #-4]
|
str r5, [r1, #-4]
|
||||||
str r6, [r1, #-8]
|
str r6, [r1, #-8]
|
||||||
|
|
||||||
# system call
|
# System call
|
||||||
ldr r7, =__NR_clone
|
ldr r7, =__NR_clone
|
||||||
swi #0
|
swi #0
|
||||||
movs r0, r0
|
movs r0, r0
|
||||||
beq 1f
|
beq 1f
|
||||||
|
|
||||||
# in parent, reload saved registers
|
# In the parent, reload saved registers then either return or set errno.
|
||||||
# then either exit or error
|
|
||||||
#
|
|
||||||
ldmfd sp!, {r4, r5, r6, r7}
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
bxne lr
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
b __set_syscall_errno
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
|
||||||
1: # in the child - pick arguments
|
1: # The child.
|
||||||
ldr r0, [sp, #-4]
|
ldr r0, [sp, #-4]
|
||||||
ldr r1, [sp, #-8]
|
ldr r1, [sp, #-8]
|
||||||
b __bionic_clone_entry
|
b __bionic_clone_entry
|
||||||
|
|||||||
@@ -26,21 +26,9 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct
|
#include "../../bionic/libc_init_common.h"
|
||||||
{
|
#include <stddef.h>
|
||||||
void (**preinit_array)(void);
|
#include <stdint.h>
|
||||||
void (**init_array)(void);
|
|
||||||
void (**fini_array)(void);
|
|
||||||
} structors_array_t;
|
|
||||||
|
|
||||||
extern int main(int argc, char **argv, char **env);
|
|
||||||
|
|
||||||
extern void __libc_init(
|
|
||||||
unsigned int *elfdata,
|
|
||||||
void (*onexit)(void),
|
|
||||||
int (*slingshot)(int, char**, char**),
|
|
||||||
structors_array_t const * const structors
|
|
||||||
);
|
|
||||||
|
|
||||||
__attribute__ ((section (".preinit_array")))
|
__attribute__ ((section (".preinit_array")))
|
||||||
void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
|
void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
|
||||||
@@ -51,17 +39,14 @@ void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1;
|
|||||||
__attribute__ ((section (".fini_array")))
|
__attribute__ ((section (".fini_array")))
|
||||||
void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
|
void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
|
||||||
|
|
||||||
__attribute__((visibility("hidden")))
|
__LIBC_HIDDEN__ void _start() {
|
||||||
void _start() {
|
|
||||||
structors_array_t array;
|
structors_array_t array;
|
||||||
void *elfdata;
|
|
||||||
|
|
||||||
array.preinit_array = &__PREINIT_ARRAY__;
|
array.preinit_array = &__PREINIT_ARRAY__;
|
||||||
array.init_array = &__INIT_ARRAY__;
|
array.init_array = &__INIT_ARRAY__;
|
||||||
array.fini_array = &__FINI_ARRAY__;
|
array.fini_array = &__FINI_ARRAY__;
|
||||||
|
|
||||||
elfdata = __builtin_frame_address(0) + sizeof(void *);
|
void* raw_args = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
|
||||||
__libc_init(elfdata, (void *) 0, &main, &array);
|
__libc_init(raw_args, NULL, &main, &array);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "__dso_handle.h"
|
#include "__dso_handle.h"
|
||||||
|
|||||||
@@ -31,55 +31,11 @@
|
|||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <machine/cpu-features.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)
|
ENTRY(ffs)
|
||||||
/* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */
|
/* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */
|
||||||
rsb r1, r0, #0
|
rsb r1, r0, #0
|
||||||
ands r0, r0, r1
|
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
|
clzne r0, r0
|
||||||
rsbne r0, r0, #32
|
rsbne r0, r0, #32
|
||||||
bx lr
|
bx lr
|
||||||
END(ffs)
|
END(ffs)
|
||||||
#endif /* !defined(__ARM_HAVE_CLZ) */
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,32 +25,14 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
#include <asm/unistd.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <machine/cpu-features.h>
|
|
||||||
|
|
||||||
#define FUTEX_WAIT 0
|
#define FUTEX_WAIT 0
|
||||||
#define FUTEX_WAKE 1
|
#define FUTEX_WAKE 1
|
||||||
|
|
||||||
/* __futex_wait(*ftx, val, *timespec) */
|
// __futex_syscall3(*ftx, op, val)
|
||||||
/* __futex_wake(*ftx, counter) */
|
|
||||||
/* __futex_syscall3(*ftx, op, val) */
|
|
||||||
/* __futex_syscall4(*ftx, op, val, *timespec) */
|
|
||||||
|
|
||||||
.global __futex_wait
|
|
||||||
.type __futex_wait, %function
|
|
||||||
|
|
||||||
.global __futex_wake
|
|
||||||
.type __futex_wake, %function
|
|
||||||
|
|
||||||
.global __futex_syscall3
|
|
||||||
.type __futex_syscall3, %function
|
|
||||||
|
|
||||||
.global __futex_syscall4
|
|
||||||
.type __futex_syscall4, %function
|
|
||||||
|
|
||||||
#if __ARM_EABI__
|
|
||||||
|
|
||||||
ENTRY(__futex_syscall3)
|
ENTRY(__futex_syscall3)
|
||||||
stmdb sp!, {r4, r7}
|
stmdb sp!, {r4, r7}
|
||||||
.save {r4, r7}
|
.save {r4, r7}
|
||||||
@@ -60,53 +42,32 @@ ENTRY(__futex_syscall3)
|
|||||||
bx lr
|
bx lr
|
||||||
END(__futex_syscall3)
|
END(__futex_syscall3)
|
||||||
|
|
||||||
ENTRY(__futex_wait)
|
// __futex_syscall4(*ftx, op, val, *timespec)
|
||||||
stmdb sp!, {r4, r7}
|
|
||||||
.save {r4, r7}
|
|
||||||
mov r3, r2
|
|
||||||
mov r2, r1
|
|
||||||
mov r1, #FUTEX_WAIT
|
|
||||||
ldr r7, =__NR_futex
|
|
||||||
swi #0
|
|
||||||
ldmia sp!, {r4, r7}
|
|
||||||
bx lr
|
|
||||||
END(__futex_wait)
|
|
||||||
|
|
||||||
ENTRY(__futex_wake)
|
|
||||||
.save {r4, r7}
|
|
||||||
stmdb sp!, {r4, r7}
|
|
||||||
mov r2, r1
|
|
||||||
mov r1, #FUTEX_WAKE
|
|
||||||
ldr r7, =__NR_futex
|
|
||||||
swi #0
|
|
||||||
ldmia sp!, {r4, r7}
|
|
||||||
bx lr
|
|
||||||
END(__futex_wake)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
ENTRY(__futex_syscall3)
|
|
||||||
swi #__NR_futex
|
|
||||||
bx lr
|
|
||||||
END(__futex_syscall3)
|
|
||||||
|
|
||||||
ENTRY(__futex_wait)
|
|
||||||
mov r3, r2
|
|
||||||
mov r2, r1
|
|
||||||
mov r1, #FUTEX_WAIT
|
|
||||||
swi #__NR_futex
|
|
||||||
bx lr
|
|
||||||
END(__futex_wait)
|
|
||||||
|
|
||||||
ENTRY(__futex_wake)
|
|
||||||
mov r2, r1
|
|
||||||
mov r1, #FUTEX_WAKE
|
|
||||||
swi #__NR_futex
|
|
||||||
bx lr
|
|
||||||
END(__futex_wake)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ENTRY(__futex_syscall4)
|
ENTRY(__futex_syscall4)
|
||||||
b __futex_syscall3
|
b __futex_syscall3
|
||||||
END(__futex_syscall4)
|
END(__futex_syscall4)
|
||||||
|
|
||||||
|
// __futex_wait(*ftx, val, *timespec)
|
||||||
|
ENTRY(__futex_wait)
|
||||||
|
stmdb sp!, {r4, r7}
|
||||||
|
.save {r4, r7}
|
||||||
|
mov r3, r2
|
||||||
|
mov r2, r1
|
||||||
|
mov r1, #FUTEX_WAIT
|
||||||
|
ldr r7, =__NR_futex
|
||||||
|
swi #0
|
||||||
|
ldmia sp!, {r4, r7}
|
||||||
|
bx lr
|
||||||
|
END(__futex_wait)
|
||||||
|
|
||||||
|
// __futex_wake(*ftx, counter)
|
||||||
|
ENTRY(__futex_wake)
|
||||||
|
.save {r4, r7}
|
||||||
|
stmdb sp!, {r4, r7}
|
||||||
|
mov r2, r1
|
||||||
|
mov r1, #FUTEX_WAKE
|
||||||
|
ldr r7, =__NR_futex
|
||||||
|
swi #0
|
||||||
|
ldmia sp!, {r4, r7}
|
||||||
|
bx lr
|
||||||
|
END(__futex_wake)
|
||||||
|
|||||||
@@ -25,6 +25,11 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/err.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <machine/asm.h>
|
||||||
|
|
||||||
/* unlike our auto-generated syscall stubs, this code saves lr
|
/* unlike our auto-generated syscall stubs, this code saves lr
|
||||||
on the stack, as well as a few other registers. this makes
|
on the stack, as well as a few other registers. this makes
|
||||||
our stack unwinder happy, when we generate debug stack
|
our stack unwinder happy, when we generate debug stack
|
||||||
@@ -32,19 +37,14 @@
|
|||||||
abort due to a fatal runtime error (e.g. detection
|
abort due to a fatal runtime error (e.g. detection
|
||||||
of a corrupted malloc heap).
|
of a corrupted malloc heap).
|
||||||
*/
|
*/
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
#include <machine/asm.h>
|
|
||||||
|
|
||||||
#ifndef __NR_kill
|
|
||||||
#define __NR_kill 37
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ENTRY(kill)
|
ENTRY(kill)
|
||||||
stmfd sp!, {r4-r7, ip, lr}
|
stmfd sp!, {r4-r7, ip, lr}
|
||||||
ldr r7, =__NR_kill
|
ldr r7, =__NR_kill
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4-r7, ip, lr}
|
ldmfd sp!, {r4-r7, ip, lr}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(kill)
|
END(kill)
|
||||||
|
|||||||
@@ -110,6 +110,7 @@
|
|||||||
XX(__aeabi_fsub) \
|
XX(__aeabi_fsub) \
|
||||||
XX(__aeabi_i2d) \
|
XX(__aeabi_i2d) \
|
||||||
XX(__aeabi_i2f) \
|
XX(__aeabi_i2f) \
|
||||||
|
XX(__aeabi_idiv) \
|
||||||
XX(__aeabi_l2d) \
|
XX(__aeabi_l2d) \
|
||||||
XX(__aeabi_l2f) \
|
XX(__aeabi_l2f) \
|
||||||
XX(__aeabi_lmul) \
|
XX(__aeabi_lmul) \
|
||||||
|
|||||||
@@ -29,44 +29,93 @@
|
|||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_32_BYTE_CACHE_LINE
|
||||||
|
#define CACHE_LINE_SIZE 32
|
||||||
|
#else
|
||||||
|
#define CACHE_LINE_SIZE 64
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optimized memcmp() for ARM9.
|
* Optimized memcmp() for Cortex-A9.
|
||||||
* This would not be optimal on XScale or ARM11, where more prefetching
|
|
||||||
* and use of PLD will be needed.
|
|
||||||
* The 2 major optimzations here are
|
|
||||||
* (1) The main loop compares 16 bytes at a time
|
|
||||||
* (2) The loads are scheduled in a way they won't stall
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ENTRY(memcmp)
|
ENTRY(memcmp)
|
||||||
PLD (r0, #0)
|
pld [r0, #(CACHE_LINE_SIZE * 0)]
|
||||||
PLD (r1, #0)
|
pld [r0, #(CACHE_LINE_SIZE * 1)]
|
||||||
|
|
||||||
/* take of the case where length is 0 or the buffers are the same */
|
/* take of the case where length is 0 or the buffers are the same */
|
||||||
cmp r0, r1
|
cmp r0, r1
|
||||||
cmpne r2, #0
|
|
||||||
moveq r0, #0
|
moveq r0, #0
|
||||||
bxeq lr
|
bxeq lr
|
||||||
|
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 0)]
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 1)]
|
||||||
|
|
||||||
|
/* make sure we have at least 8+4 bytes, this simplify things below
|
||||||
|
* and avoid some overhead for small blocks
|
||||||
|
*/
|
||||||
|
cmp r2, #(8+4)
|
||||||
|
bmi 10f
|
||||||
|
/*
|
||||||
|
* Neon optimization
|
||||||
|
* Comparing 32 bytes at a time
|
||||||
|
*/
|
||||||
|
#if defined(__ARM_NEON__) && defined(NEON_UNALIGNED_ACCESS)
|
||||||
|
subs r2, r2, #32
|
||||||
|
blo 3f
|
||||||
|
|
||||||
|
/* preload all the cache lines we need. */
|
||||||
|
pld [r0, #(CACHE_LINE_SIZE * 2)]
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
|
|
||||||
|
1: /* The main loop compares 32 bytes at a time */
|
||||||
|
vld1.8 {d0 - d3}, [r0]!
|
||||||
|
pld [r0, #(CACHE_LINE_SIZE * 2)]
|
||||||
|
vld1.8 {d4 - d7}, [r1]!
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
|
|
||||||
|
/* Start subtracting the values and merge results */
|
||||||
|
vsub.i8 q0, q2
|
||||||
|
vsub.i8 q1, q3
|
||||||
|
vorr q2, q0, q1
|
||||||
|
vorr d4, d5
|
||||||
|
vmov r3, ip, d4
|
||||||
|
/* Check if there are any differences among the 32 bytes */
|
||||||
|
orrs r3, ip
|
||||||
|
bne 2f
|
||||||
|
subs r2, r2, #32
|
||||||
|
bhs 1b
|
||||||
|
b 3f
|
||||||
|
2:
|
||||||
|
/* Check if the difference was in the first or last 16 bytes */
|
||||||
|
sub r0, #32
|
||||||
|
vorr d0, d1
|
||||||
|
sub r1, #32
|
||||||
|
vmov r3, ip, d0
|
||||||
|
orrs r3, ip
|
||||||
|
/* if the first 16 bytes are equal, we only have to rewind 16 bytes */
|
||||||
|
ittt eq
|
||||||
|
subeq r2, #16
|
||||||
|
addeq r0, #16
|
||||||
|
addeq r1, #16
|
||||||
|
|
||||||
|
3: /* fix-up the remaining count */
|
||||||
|
add r2, r2, #32
|
||||||
|
|
||||||
|
cmp r2, #(8+4)
|
||||||
|
bmi 10f
|
||||||
|
#endif
|
||||||
|
|
||||||
.save {r4, lr}
|
.save {r4, lr}
|
||||||
/* save registers */
|
/* save registers */
|
||||||
stmfd sp!, {r4, lr}
|
stmfd sp!, {r4, lr}
|
||||||
|
|
||||||
PLD (r0, #32)
|
|
||||||
PLD (r1, #32)
|
|
||||||
|
|
||||||
/* since r0 hold the result, move the first source
|
/* since r0 hold the result, move the first source
|
||||||
* pointer somewhere else
|
* pointer somewhere else
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mov r4, r0
|
mov r4, r0
|
||||||
|
|
||||||
/* make sure we have at least 8+4 bytes, this simplify things below
|
|
||||||
* and avoid some overhead for small blocks
|
|
||||||
*/
|
|
||||||
cmp r2, #(8+4)
|
|
||||||
bmi 8f
|
|
||||||
|
|
||||||
/* align first pointer to word boundary
|
/* align first pointer to word boundary
|
||||||
* offset = -src & 3
|
* offset = -src & 3
|
||||||
*/
|
*/
|
||||||
@@ -102,9 +151,9 @@ ENTRY(memcmp)
|
|||||||
ldr ip, [r1]
|
ldr ip, [r1]
|
||||||
subs r2, r2, #(32 + 4)
|
subs r2, r2, #(32 + 4)
|
||||||
bmi 1f
|
bmi 1f
|
||||||
|
|
||||||
0: PLD (r4, #64)
|
0: pld [r4, #(CACHE_LINE_SIZE * 2)]
|
||||||
PLD (r1, #64)
|
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
ldr r0, [r4], #4
|
ldr r0, [r4], #4
|
||||||
ldr lr, [r1, #4]!
|
ldr lr, [r1, #4]!
|
||||||
eors r0, r0, ip
|
eors r0, r0, ip
|
||||||
@@ -129,14 +178,14 @@ ENTRY(memcmp)
|
|||||||
ldreq r0, [r4], #4
|
ldreq r0, [r4], #4
|
||||||
ldreq ip, [r1, #4]!
|
ldreq ip, [r1, #4]!
|
||||||
eoreqs r0, r0, lr
|
eoreqs r0, r0, lr
|
||||||
bne 2f
|
bne 2f
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
bhs 0b
|
bhs 0b
|
||||||
|
|
||||||
/* do we have at least 4 bytes left? */
|
/* do we have at least 4 bytes left? */
|
||||||
1: adds r2, r2, #(32 - 4 + 4)
|
1: adds r2, r2, #(32 - 4 + 4)
|
||||||
bmi 4f
|
bmi 4f
|
||||||
|
|
||||||
/* finish off 4 bytes at a time */
|
/* finish off 4 bytes at a time */
|
||||||
3: ldr r0, [r4], #4
|
3: ldr r0, [r4], #4
|
||||||
ldr ip, [r1], #4
|
ldr ip, [r1], #4
|
||||||
@@ -170,19 +219,28 @@ ENTRY(memcmp)
|
|||||||
9: /* restore registers and return */
|
9: /* restore registers and return */
|
||||||
ldmfd sp!, {r4, lr}
|
ldmfd sp!, {r4, lr}
|
||||||
bx lr
|
bx lr
|
||||||
END(memcmp)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
10: /* process less than 12 bytes */
|
||||||
|
cmp r2, #0
|
||||||
|
moveq r0, #0
|
||||||
|
bxeq lr
|
||||||
|
mov r3, r0
|
||||||
|
11:
|
||||||
|
ldrb r0, [r3], #1
|
||||||
|
ldrb ip, [r1], #1
|
||||||
|
subs r0, ip
|
||||||
|
bxne lr
|
||||||
|
subs r2, r2, #1
|
||||||
|
bne 11b
|
||||||
|
bx lr
|
||||||
|
|
||||||
5: /*************** non-congruent case ***************/
|
5: /*************** non-congruent case ***************/
|
||||||
and r0, r1, #3
|
and r0, r1, #3
|
||||||
cmp r0, #2
|
cmp r0, #2
|
||||||
bne 4f
|
bne 4f
|
||||||
|
|
||||||
/* here, offset is 2 (16-bits aligned, special cased) */
|
/* here, offset is 2 (16-bits aligned, special cased) */
|
||||||
|
|
||||||
/* make sure we have at least 16 bytes to process */
|
/* make sure we have at least 16 bytes to process */
|
||||||
subs r2, r2, #16
|
subs r2, r2, #16
|
||||||
addmi r2, r2, #16
|
addmi r2, r2, #16
|
||||||
@@ -192,8 +250,8 @@ END(memcmp)
|
|||||||
bic r1, r1, #3
|
bic r1, r1, #3
|
||||||
ldr lr, [r1], #4
|
ldr lr, [r1], #4
|
||||||
|
|
||||||
6: PLD (r1, #64)
|
6: pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
PLD (r4, #64)
|
pld [r4, #(CACHE_LINE_SIZE * 2)]
|
||||||
mov ip, lr, lsr #16
|
mov ip, lr, lsr #16
|
||||||
ldr lr, [r1], #4
|
ldr lr, [r1], #4
|
||||||
ldr r0, [r4], #4
|
ldr r0, [r4], #4
|
||||||
@@ -280,3 +338,4 @@ END(memcmp)
|
|||||||
mov r2, #4
|
mov r2, #4
|
||||||
ldmfd sp!, {r5, r6, r7}
|
ldmfd sp!, {r5, r6, r7}
|
||||||
b 8b
|
b 8b
|
||||||
|
END(memcmp)
|
||||||
|
|||||||
@@ -37,28 +37,35 @@
|
|||||||
#ifdef HAVE_32_BYTE_CACHE_LINE
|
#ifdef HAVE_32_BYTE_CACHE_LINE
|
||||||
/* a prefetch distance of 2 cache-lines */
|
/* a prefetch distance of 2 cache-lines */
|
||||||
#define CACHE_LINE_SIZE 32
|
#define CACHE_LINE_SIZE 32
|
||||||
#define PREFETCH_DISTANCE (CACHE_LINE_SIZE*2)
|
|
||||||
#else
|
#else
|
||||||
/* a prefetch distance of 4 cache-lines works best experimentally */
|
/* a prefetch distance of 4 cache-lines works best experimentally */
|
||||||
#define CACHE_LINE_SIZE 64
|
#define CACHE_LINE_SIZE 64
|
||||||
#define PREFETCH_DISTANCE (CACHE_LINE_SIZE*4)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ENTRY(memcpy)
|
ENTRY(memcpy)
|
||||||
.save {r0, lr}
|
.save {r0, lr}
|
||||||
/* start preloading as early as possible */
|
/* start preloading as early as possible */
|
||||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
pld [r1, #(CACHE_LINE_SIZE * 0)]
|
||||||
stmfd sp!, {r0, lr}
|
stmfd sp!, {r0, lr}
|
||||||
pld [r1, #(CACHE_LINE_SIZE*1)]
|
pld [r1, #(CACHE_LINE_SIZE * 1)]
|
||||||
|
|
||||||
|
/* If Neon supports unaligned access then remove the align code,
|
||||||
|
* unless a size limit has been specified.
|
||||||
|
*/
|
||||||
|
#ifndef NEON_UNALIGNED_ACCESS
|
||||||
/* do we have at least 16-bytes to copy (needed for alignment below) */
|
/* do we have at least 16-bytes to copy (needed for alignment below) */
|
||||||
cmp r2, #16
|
cmp r2, #16
|
||||||
blo 5f
|
blo 5f
|
||||||
|
|
||||||
|
/* check if buffers are aligned. If so, run arm-only version */
|
||||||
|
eor r3, r0, r1
|
||||||
|
ands r3, r3, #0x3
|
||||||
|
beq 11f
|
||||||
|
|
||||||
/* align destination to cache-line for the write-buffer */
|
/* align destination to cache-line for the write-buffer */
|
||||||
rsb r3, r0, #0
|
rsb r3, r0, #0
|
||||||
ands r3, r3, #0xF
|
ands r3, r3, #0xF
|
||||||
beq 0f
|
beq 2f
|
||||||
|
|
||||||
/* copy up to 15-bytes (count in r3) */
|
/* copy up to 15-bytes (count in r3) */
|
||||||
sub r2, r2, r3
|
sub r2, r2, r3
|
||||||
@@ -79,10 +86,9 @@ ENTRY(memcpy)
|
|||||||
vld1.8 {d0}, [r1]!
|
vld1.8 {d0}, [r1]!
|
||||||
vst1.8 {d0}, [r0, :64]!
|
vst1.8 {d0}, [r0, :64]!
|
||||||
2:
|
2:
|
||||||
|
/* preload immediately the next cache line, which we may need */
|
||||||
0: /* preload immediately the next cache line, which we may need */
|
pld [r1, #(CACHE_LINE_SIZE * 0)]
|
||||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
pld [r1, #(CACHE_LINE_SIZE * 1)]
|
||||||
pld [r1, #(CACHE_LINE_SIZE*1)]
|
|
||||||
|
|
||||||
#ifdef HAVE_32_BYTE_CACHE_LINE
|
#ifdef HAVE_32_BYTE_CACHE_LINE
|
||||||
/* make sure we have at least 32 bytes to copy */
|
/* make sure we have at least 32 bytes to copy */
|
||||||
@@ -108,23 +114,22 @@ ENTRY(memcpy)
|
|||||||
subs r2, r2, #64
|
subs r2, r2, #64
|
||||||
blo 2f
|
blo 2f
|
||||||
|
|
||||||
/* preload all the cache lines we need.
|
/* preload all the cache lines we need. */
|
||||||
* NOTE: the number of pld below depends on PREFETCH_DISTANCE,
|
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
* ideally would would increase the distance in the main loop to
|
pld [r1, #(CACHE_LINE_SIZE * 3)]
|
||||||
* avoid the goofy code below. In practice this doesn't seem to make
|
|
||||||
* a big difference.
|
|
||||||
*/
|
|
||||||
pld [r1, #(CACHE_LINE_SIZE*2)]
|
|
||||||
pld [r1, #(CACHE_LINE_SIZE*3)]
|
|
||||||
pld [r1, #(PREFETCH_DISTANCE)]
|
|
||||||
|
|
||||||
1: /* The main loop copies 64 bytes at a time */
|
1: /* The main loop copies 64 bytes at a time */
|
||||||
vld1.8 {d0 - d3}, [r1]!
|
vld1.8 {d0 - d3}, [r1]!
|
||||||
vld1.8 {d4 - d7}, [r1]!
|
vld1.8 {d4 - d7}, [r1]!
|
||||||
pld [r1, #(PREFETCH_DISTANCE)]
|
#ifdef HAVE_32_BYTE_CACHE_LINE
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 3)]
|
||||||
|
#else
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 3)]
|
||||||
|
#endif
|
||||||
subs r2, r2, #64
|
subs r2, r2, #64
|
||||||
vst1.8 {d0 - d3}, [r0, :128]!
|
vst1.8 {d0 - d3}, [r0, :128]!
|
||||||
vst1.8 {d4 - d7}, [r0, :128]!
|
vst1.8 {d4 - d7}, [r0, :128]!
|
||||||
bhs 1b
|
bhs 1b
|
||||||
|
|
||||||
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
|
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
|
||||||
@@ -133,9 +138,9 @@ ENTRY(memcpy)
|
|||||||
blo 4f
|
blo 4f
|
||||||
|
|
||||||
3: /* 32 bytes at a time. These cache lines were already preloaded */
|
3: /* 32 bytes at a time. These cache lines were already preloaded */
|
||||||
vld1.8 {d0 - d3}, [r1]!
|
vld1.8 {d0 - d3}, [r1]!
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
vst1.8 {d0 - d3}, [r0, :128]!
|
vst1.8 {d0 - d3}, [r0, :128]!
|
||||||
bhs 3b
|
bhs 3b
|
||||||
#endif
|
#endif
|
||||||
4: /* less than 32 left */
|
4: /* less than 32 left */
|
||||||
@@ -145,7 +150,6 @@ ENTRY(memcpy)
|
|||||||
// copies 16 bytes, 128-bits aligned
|
// copies 16 bytes, 128-bits aligned
|
||||||
vld1.8 {d0, d1}, [r1]!
|
vld1.8 {d0, d1}, [r1]!
|
||||||
vst1.8 {d0, d1}, [r0, :128]!
|
vst1.8 {d0, d1}, [r0, :128]!
|
||||||
|
|
||||||
5: /* copy up to 15-bytes (count in r2) */
|
5: /* copy up to 15-bytes (count in r2) */
|
||||||
movs ip, r2, lsl #29
|
movs ip, r2, lsl #29
|
||||||
bcc 1f
|
bcc 1f
|
||||||
@@ -164,6 +168,164 @@ ENTRY(memcpy)
|
|||||||
|
|
||||||
ldmfd sp!, {r0, lr}
|
ldmfd sp!, {r0, lr}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
|
#else /* NEON_UNALIGNED_ACCESS */
|
||||||
|
|
||||||
|
// Check so divider is at least 16 bytes, needed for alignment code.
|
||||||
|
cmp r2, #16
|
||||||
|
blo 5f
|
||||||
|
|
||||||
|
#ifdef NEON_MEMCPY_ALIGNMENT_DIVIDER
|
||||||
|
/* Check the upper size limit for Neon unaligned memory access in memcpy */
|
||||||
|
#if NEON_MEMCPY_ALIGNMENT_DIVIDER >= 16
|
||||||
|
cmp r2, #NEON_MEMCPY_ALIGNMENT_DIVIDER
|
||||||
|
blo 3f
|
||||||
|
#endif
|
||||||
|
/* check if buffers are aligned. If so, run arm-only version */
|
||||||
|
eor r3, r0, r1
|
||||||
|
ands r3, r3, #0x3
|
||||||
|
beq 11f
|
||||||
|
|
||||||
|
/* 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 * 1)]
|
||||||
|
3:
|
||||||
|
#endif
|
||||||
|
/* 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 * 2)]
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 3)]
|
||||||
|
|
||||||
|
1: /* The main loop copies 64 bytes at a time */
|
||||||
|
vld1.8 {d0 - d3}, [r1]!
|
||||||
|
vld1.8 {d4 - d7}, [r1]!
|
||||||
|
#ifdef HAVE_32_BYTE_CACHE_LINE
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 3)]
|
||||||
|
#else
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 3)]
|
||||||
|
#endif
|
||||||
|
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
|
||||||
|
#endif /* NEON_UNALIGNED_ACCESS */
|
||||||
|
11:
|
||||||
|
/* Simple arm-only copy loop to handle aligned copy operations */
|
||||||
|
stmfd sp!, {r4, r5, r6, r7, r8}
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 2)]
|
||||||
|
|
||||||
|
/* 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, #32
|
||||||
|
blt 5f
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 3)]
|
||||||
|
3: /* Main copy loop, copying 32 bytes at a time */
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE * 4)]
|
||||||
|
ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||||
|
subs r2, r2, #32
|
||||||
|
stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr}
|
||||||
|
bge 3b
|
||||||
|
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)
|
END(memcpy)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
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)
|
||||||
@@ -26,23 +26,114 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optimized memset() for ARM.
|
* Optimized memset() for ARM.
|
||||||
*
|
*
|
||||||
* memset() returns its first argument.
|
* memset() returns its first argument.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__ARM_NEON__)
|
||||||
|
.fpu neon
|
||||||
|
#endif
|
||||||
|
|
||||||
ENTRY(bzero)
|
ENTRY(bzero)
|
||||||
mov r2, r1
|
mov r2, r1
|
||||||
mov r1, #0
|
mov r1, #0
|
||||||
|
// Fall through to memset...
|
||||||
END(bzero)
|
END(bzero)
|
||||||
|
|
||||||
ENTRY(memset)
|
ENTRY(memset)
|
||||||
|
#if defined(__ARM_NEON__)
|
||||||
|
|
||||||
|
#ifdef NEON_MEMSET_DIVIDER
|
||||||
|
cmp r2, #NEON_MEMSET_DIVIDER
|
||||||
|
bhi 11f
|
||||||
|
#endif
|
||||||
|
.save {r0}
|
||||||
|
stmfd sp!, {r0}
|
||||||
|
|
||||||
|
vdup.8 q0, r1
|
||||||
|
|
||||||
|
#ifndef NEON_UNALIGNED_ACCESS
|
||||||
|
/* 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:
|
||||||
|
#endif
|
||||||
|
/* 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
|
||||||
|
#ifndef NEON_UNALIGNED_ACCESS
|
||||||
|
vst1.8 {d0 - d3}, [r0, :128]!
|
||||||
|
#else
|
||||||
|
vst1.8 {d0 - d3}, [r0]!
|
||||||
|
#endif
|
||||||
|
bhs 1b
|
||||||
|
|
||||||
|
2: /* less than 32 left */
|
||||||
|
add r2, r2, #32
|
||||||
|
tst r2, #0x10
|
||||||
|
beq 3f
|
||||||
|
|
||||||
|
// writes 16 bytes, 128-bits aligned
|
||||||
|
#ifndef NEON_UNALIGNED_ACCESS
|
||||||
|
vst1.8 {d0, d1}, [r0, :128]!
|
||||||
|
#else
|
||||||
|
vst1.8 {d0, d1}, [r0]!
|
||||||
|
#endif
|
||||||
|
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:
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Optimized memset() for ARM.
|
||||||
|
*
|
||||||
|
* memset() returns its first argument.
|
||||||
|
*/
|
||||||
|
|
||||||
/* compute the offset to align the destination
|
/* compute the offset to align the destination
|
||||||
* offset = (4-(src&3))&3 = -src & 3
|
* offset = (4-(src&3))&3 = -src & 3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.save {r0, r4-r7, lr}
|
.save {r0, r4-r7, lr}
|
||||||
stmfd sp!, {r0, r4-r7, lr}
|
stmfd sp!, {r0, r4-r7, lr}
|
||||||
rsb r3, r0, #0
|
rsb r3, r0, #0
|
||||||
@@ -70,7 +161,7 @@ ENTRY(memset)
|
|||||||
mov r5, r1
|
mov r5, r1
|
||||||
mov r6, r1
|
mov r6, r1
|
||||||
mov r7, r1
|
mov r7, r1
|
||||||
|
|
||||||
rsb r3, r0, #0
|
rsb r3, r0, #0
|
||||||
ands r3, r3, #0x1C
|
ands r3, r3, #0x1C
|
||||||
beq 3f
|
beq 3f
|
||||||
@@ -78,7 +169,7 @@ ENTRY(memset)
|
|||||||
andhi r3, r2, #0x1C
|
andhi r3, r2, #0x1C
|
||||||
sub r2, r2, r3
|
sub r2, r2, r3
|
||||||
|
|
||||||
/* conditionnaly writes 0 to 7 words (length in r3) */
|
/* conditionally writes 0 to 7 words (length in r3) */
|
||||||
movs r3, r3, lsl #28
|
movs r3, r3, lsl #28
|
||||||
stmcsia r0!, {r1, lr}
|
stmcsia r0!, {r1, lr}
|
||||||
stmcsia r0!, {r1, lr}
|
stmcsia r0!, {r1, lr}
|
||||||
@@ -95,7 +186,7 @@ ENTRY(memset)
|
|||||||
bhs 1b
|
bhs 1b
|
||||||
2: add r2, r2, #32
|
2: add r2, r2, #32
|
||||||
|
|
||||||
/* conditionnaly stores 0 to 31 bytes */
|
/* conditionally stores 0 to 31 bytes */
|
||||||
movs r2, r2, lsl #28
|
movs r2, r2, lsl #28
|
||||||
stmcsia r0!, {r1,r3,r12,lr}
|
stmcsia r0!, {r1,r3,r12,lr}
|
||||||
stmmiia r0!, {r1, lr}
|
stmmiia r0!, {r1, lr}
|
||||||
|
|||||||
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__))) */
|
||||||
@@ -60,52 +60,52 @@ size_t strlen(const char *s)
|
|||||||
// We need to process 32 bytes per loop to schedule PLD properly
|
// We need to process 32 bytes per loop to schedule PLD properly
|
||||||
// and achieve the maximum bus speed.
|
// and achieve the maximum bus speed.
|
||||||
asm(
|
asm(
|
||||||
"ldr %[v], [ %[s] ], #4 \n"
|
"ldr %[v], [%[s]], #4 \n"
|
||||||
"sub %[l], %[l], %[s] \n"
|
"sub %[l], %[l], %[s] \n"
|
||||||
"0: \n"
|
"0: \n"
|
||||||
#if __ARM_HAVE_PLD
|
#if __ARM_HAVE_PLD
|
||||||
"pld [ %[s], #64 ] \n"
|
"pld [%[s], #64] \n"
|
||||||
#endif
|
#endif
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
#if !defined(__OPTIMIZE_SIZE__)
|
#if !defined(__OPTIMIZE_SIZE__)
|
||||||
"bne 1f \n"
|
"bne 1f \n"
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
"bne 1f \n"
|
"bne 1f \n"
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
"bne 1f \n"
|
"bne 1f \n"
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
"bne 1f \n"
|
"bne 1f \n"
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
"bne 1f \n"
|
"bne 1f \n"
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
"bne 1f \n"
|
"bne 1f \n"
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
"bne 1f \n"
|
"bne 1f \n"
|
||||||
"sub %[t], %[v], %[mask], lsr #7\n"
|
"sub %[t], %[v], %[mask], lsr #7\n"
|
||||||
"and %[t], %[t], %[mask] \n"
|
"and %[t], %[t], %[mask] \n"
|
||||||
"bics %[t], %[t], %[v] \n"
|
"bics %[t], %[t], %[v] \n"
|
||||||
"ldreq %[v], [ %[s] ], #4 \n"
|
"ldreq %[v], [%[s]], #4 \n"
|
||||||
#endif
|
#endif
|
||||||
"beq 0b \n"
|
"beq 0b \n"
|
||||||
"1: \n"
|
"1: \n"
|
||||||
|
|||||||
@@ -25,47 +25,22 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
|
#include <linux/err.h>
|
||||||
|
#include <machine/asm.h>
|
||||||
|
|
||||||
.text
|
ENTRY(syscall)
|
||||||
.align 4
|
|
||||||
.type syscall,#function
|
|
||||||
.globl syscall
|
|
||||||
|
|
||||||
.text
|
|
||||||
.align
|
|
||||||
|
|
||||||
#if __ARM_EABI__
|
|
||||||
|
|
||||||
syscall:
|
|
||||||
mov ip, sp
|
mov ip, sp
|
||||||
stmfd sp!, {r4, r5, r6, r7}
|
stmfd sp!, {r4, r5, r6, r7}
|
||||||
mov r7, r0
|
mov r7, r0
|
||||||
mov r0, r1
|
mov r0, r1
|
||||||
mov r1, r2
|
mov r1, r2
|
||||||
mov r2, r3
|
mov r2, r3
|
||||||
ldmfd ip, {r3, r4, r5, r6}
|
ldmfd ip, {r3, r4, r5, r6}
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r5, r6, r7}
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
#else
|
END(syscall)
|
||||||
|
|
||||||
#ifndef __NR_syscall
|
|
||||||
#define __NR_syscall 113
|
|
||||||
#endif
|
|
||||||
|
|
||||||
syscall:
|
|
||||||
stmfd sp!, {r4, r5, lr}
|
|
||||||
ldr r4, [sp, #12]
|
|
||||||
ldr r5, [sp, #16]
|
|
||||||
swi __NR_syscall
|
|
||||||
ldmfd sp!, {r4, r5, lr}
|
|
||||||
movs r0, r0
|
|
||||||
bxpl lr
|
|
||||||
b __set_syscall_errno
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -25,6 +25,11 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/err.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <machine/asm.h>
|
||||||
|
|
||||||
/* unlike our auto-generated syscall stubs, this code saves lr
|
/* unlike our auto-generated syscall stubs, this code saves lr
|
||||||
on the stack, as well as a few other registers. this makes
|
on the stack, as well as a few other registers. this makes
|
||||||
our stack unwinder happy, when we generate debug stack
|
our stack unwinder happy, when we generate debug stack
|
||||||
@@ -33,19 +38,13 @@
|
|||||||
of a corrupted malloc heap).
|
of a corrupted malloc heap).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
#include <machine/asm.h>
|
|
||||||
|
|
||||||
#ifndef __NR_tgkill
|
|
||||||
#define __NR_tgkill 268
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ENTRY(tgkill)
|
ENTRY(tgkill)
|
||||||
stmfd sp!, {r4-r7, ip, lr}
|
stmfd sp!, {r4-r7, ip, lr}
|
||||||
ldr r7, =__NR_tgkill
|
ldr r7, =__NR_tgkill
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4-r7, ip, lr}
|
ldmfd sp!, {r4-r7, ip, lr}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(tgkill)
|
END(tgkill)
|
||||||
|
|||||||
@@ -25,6 +25,11 @@
|
|||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/err.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <machine/asm.h>
|
||||||
|
|
||||||
/* unlike our auto-generated syscall stubs, this code saves lr
|
/* unlike our auto-generated syscall stubs, this code saves lr
|
||||||
on the stack, as well as a few other registers. this makes
|
on the stack, as well as a few other registers. this makes
|
||||||
our stack unwinder happy, when we generate debug stack
|
our stack unwinder happy, when we generate debug stack
|
||||||
@@ -33,19 +38,13 @@
|
|||||||
of a corrupted malloc heap).
|
of a corrupted malloc heap).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
#include <machine/asm.h>
|
|
||||||
|
|
||||||
#ifndef __NR_tkill
|
|
||||||
#define __NR_tkill 238
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ENTRY(tkill)
|
ENTRY(tkill)
|
||||||
stmfd sp!, {r4-r7, ip, lr}
|
stmfd sp!, {r4-r7, ip, lr}
|
||||||
ldr r7, =__NR_tkill
|
ldr r7, =__NR_tkill
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4-r7, ip, lr}
|
ldmfd sp!, {r4-r7, ip, lr}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(tkill)
|
END(tkill)
|
||||||
|
|||||||
324
libc/arch-arm/cortex-a15/bionic/memcpy.S
Normal file
324
libc/arch-arm/cortex-a15/bionic/memcpy.S
Normal file
@@ -0,0 +1,324 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* 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). */
|
||||||
|
|
||||||
|
// This version is tuned for the Cortex-A15 processor.
|
||||||
|
|
||||||
|
#include <machine/cpu-features.h>
|
||||||
|
#include <machine/asm.h>
|
||||||
|
|
||||||
|
.text
|
||||||
|
.syntax unified
|
||||||
|
.fpu neon
|
||||||
|
|
||||||
|
#define CACHE_LINE_SIZE 64
|
||||||
|
|
||||||
|
ENTRY(memcpy)
|
||||||
|
// Assumes that n >= 0, and dst, src are valid pointers.
|
||||||
|
// For any sizes less than 832 use the neon code that doesn't
|
||||||
|
// care about the src alignment. This avoids any checks
|
||||||
|
// for src alignment, and offers the best improvement since
|
||||||
|
// smaller sized copies are dominated by the overhead of
|
||||||
|
// the pre and post main loop.
|
||||||
|
// For larger copies, if src and dst cannot both be aligned to
|
||||||
|
// word boundaries, use the neon code.
|
||||||
|
// For all other copies, align dst to a double word boundary
|
||||||
|
// and copy using LDRD/STRD instructions.
|
||||||
|
|
||||||
|
// Save registers (r0 holds the return value):
|
||||||
|
// optimized push {r0, lr}.
|
||||||
|
.save {r0, lr}
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE*16)]
|
||||||
|
push {r0, lr}
|
||||||
|
|
||||||
|
cmp r2, #16
|
||||||
|
blo copy_less_than_16_unknown_align
|
||||||
|
|
||||||
|
cmp r2, #832
|
||||||
|
bge check_alignment
|
||||||
|
|
||||||
|
copy_unknown_alignment:
|
||||||
|
// Unknown alignment of src and dst.
|
||||||
|
// Assumes that the first few bytes have already been prefetched.
|
||||||
|
|
||||||
|
// Align destination to 128 bits. The mainloop store instructions
|
||||||
|
// require this alignment or they will throw an exception.
|
||||||
|
rsb r3, r0, #0
|
||||||
|
ands r3, r3, #0xF
|
||||||
|
beq 2f
|
||||||
|
|
||||||
|
// Copy up to 15 bytes (count in r3).
|
||||||
|
sub r2, r2, r3
|
||||||
|
movs ip, r3, lsl #31
|
||||||
|
|
||||||
|
itt mi
|
||||||
|
ldrbmi lr, [r1], #1
|
||||||
|
strbmi lr, [r0], #1
|
||||||
|
itttt cs
|
||||||
|
ldrbcs ip, [r1], #1
|
||||||
|
ldrbcs lr, [r1], #1
|
||||||
|
strbcs ip, [r0], #1
|
||||||
|
strbcs lr, [r0], #1
|
||||||
|
|
||||||
|
movs ip, r3, lsl #29
|
||||||
|
bge 1f
|
||||||
|
// Copies 4 bytes, dst 32 bits aligned before, at least 64 bits after.
|
||||||
|
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, dst 64 bits aligned before, at least 128 bits after.
|
||||||
|
vld1.8 {d0}, [r1]!
|
||||||
|
vst1.8 {d0}, [r0, :64]!
|
||||||
|
|
||||||
|
2: // Make sure we have at least 64 bytes to copy.
|
||||||
|
subs r2, r2, #64
|
||||||
|
blo 2f
|
||||||
|
|
||||||
|
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.
|
||||||
|
adds r2, r2, #32
|
||||||
|
blo 3f
|
||||||
|
|
||||||
|
// 32 bytes. These cache lines were already preloaded.
|
||||||
|
vld1.8 {d0 - d3}, [r1]!
|
||||||
|
sub r2, r2, #32
|
||||||
|
vst1.8 {d0 - d3}, [r0, :128]!
|
||||||
|
3: // Less than 32 left.
|
||||||
|
add r2, r2, #32
|
||||||
|
tst r2, #0x10
|
||||||
|
beq copy_less_than_16_unknown_align
|
||||||
|
// Copies 16 bytes, destination 128 bits aligned.
|
||||||
|
vld1.8 {d0, d1}, [r1]!
|
||||||
|
vst1.8 {d0, d1}, [r0, :128]!
|
||||||
|
|
||||||
|
copy_less_than_16_unknown_align:
|
||||||
|
// 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: // Copy 0 to 4 bytes.
|
||||||
|
lsls r2, r2, #31
|
||||||
|
itt ne
|
||||||
|
ldrbne lr, [r1], #1
|
||||||
|
strbne lr, [r0], #1
|
||||||
|
itttt cs
|
||||||
|
ldrbcs ip, [r1], #1
|
||||||
|
ldrbcs lr, [r1]
|
||||||
|
strbcs ip, [r0], #1
|
||||||
|
strbcs lr, [r0]
|
||||||
|
|
||||||
|
pop {r0, pc}
|
||||||
|
|
||||||
|
check_alignment:
|
||||||
|
// If src and dst cannot both be aligned to a word boundary,
|
||||||
|
// use the unaligned copy version.
|
||||||
|
eor r3, r0, r1
|
||||||
|
ands r3, r3, #0x3
|
||||||
|
bne copy_unknown_alignment
|
||||||
|
|
||||||
|
// To try and improve performance, stack layout changed,
|
||||||
|
// i.e., not keeping the stack looking like users expect
|
||||||
|
// (highest numbered register at highest address).
|
||||||
|
// 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.
|
||||||
|
.save {r4, r5}
|
||||||
|
strd r4, r5, [sp, #-8]!
|
||||||
|
.save {r6, r7}
|
||||||
|
strd r6, r7, [sp, #-8]!
|
||||||
|
.save {r8, r9}
|
||||||
|
strd r8, r9, [sp, #-8]!
|
||||||
|
|
||||||
|
// Optimized for already aligned dst code.
|
||||||
|
ands ip, r0, #3
|
||||||
|
bne dst_not_word_aligned
|
||||||
|
|
||||||
|
word_aligned:
|
||||||
|
// Align the destination buffer to 8 bytes, to make sure double
|
||||||
|
// loads and stores don't cross a 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 a cacheline boundary.
|
||||||
|
// This check and realignment are only done if there is >= 832
|
||||||
|
// bytes to copy.
|
||||||
|
|
||||||
|
// Dst is word aligned, but check if it is already double word aligned.
|
||||||
|
ands r3, r0, #4
|
||||||
|
beq 1f
|
||||||
|
ldr r3, [r1], #4
|
||||||
|
str r3, [r0], #4
|
||||||
|
sub r2, #4
|
||||||
|
|
||||||
|
1: // Can only get here if > 64 bytes to copy, so don't do check r2.
|
||||||
|
sub r2, #64
|
||||||
|
|
||||||
|
2: // Every loop iteration copies 64 bytes.
|
||||||
|
.irp offset, #0, #8, #16, #24, #32
|
||||||
|
ldrd r4, r5, [r1, \offset]
|
||||||
|
strd r4, r5, [r0, \offset]
|
||||||
|
.endr
|
||||||
|
|
||||||
|
ldrd r4, r5, [r1, #40]
|
||||||
|
ldrd r6, r7, [r1, #48]
|
||||||
|
ldrd r8, r9, [r1, #56]
|
||||||
|
|
||||||
|
// Keep the pld as far from the next load as possible.
|
||||||
|
// The amount to prefetch was determined experimentally using
|
||||||
|
// large sizes, and verifying the prefetch size does not affect
|
||||||
|
// the smaller copies too much.
|
||||||
|
// WARNING: If the ldrd and strd instructions get too far away
|
||||||
|
// from each other, performance suffers. Three loads
|
||||||
|
// in a row is the best tradeoff.
|
||||||
|
pld [r1, #(CACHE_LINE_SIZE*16)]
|
||||||
|
strd r4, r5, [r0, #40]
|
||||||
|
strd r6, r7, [r0, #48]
|
||||||
|
strd r8, r9, [r0, #56]
|
||||||
|
|
||||||
|
add r0, r0, #64
|
||||||
|
add r1, r1, #64
|
||||||
|
subs r2, r2, #64
|
||||||
|
bge 2b
|
||||||
|
|
||||||
|
// Fix-up the remaining count and make sure we have >= 32 bytes left.
|
||||||
|
adds r2, r2, #32
|
||||||
|
blo 4f
|
||||||
|
|
||||||
|
// Copy 32 bytes. These cache lines were already preloaded.
|
||||||
|
.irp offset, #0, #8, #16, #24
|
||||||
|
ldrd r4, r5, [r1, \offset]
|
||||||
|
strd r4, r5, [r0, \offset]
|
||||||
|
.endr
|
||||||
|
add r1, r1, #32
|
||||||
|
add r0, r0, #32
|
||||||
|
sub r2, r2, #32
|
||||||
|
4: // Less than 32 left.
|
||||||
|
add r2, r2, #32
|
||||||
|
tst r2, #0x10
|
||||||
|
beq 5f
|
||||||
|
// Copy 16 bytes.
|
||||||
|
.irp offset, #0, #8
|
||||||
|
ldrd r4, r5, [r1, \offset]
|
||||||
|
strd r4, r5, [r0, \offset]
|
||||||
|
.endr
|
||||||
|
add r1, r1, #16
|
||||||
|
add r0, r0, #16
|
||||||
|
|
||||||
|
5: // Copy up to 15 bytes (count in r2).
|
||||||
|
movs ip, r2, lsl #29
|
||||||
|
bcc 1f
|
||||||
|
// Copy 8 bytes.
|
||||||
|
ldrd r4, r5, [r1], #8
|
||||||
|
strd r4, r5, [r0], #8
|
||||||
|
1: bge 2f
|
||||||
|
// Copy 4 bytes.
|
||||||
|
ldr r4, [r1], #4
|
||||||
|
str r4, [r0], #4
|
||||||
|
2: // Copy 0 to 4 bytes.
|
||||||
|
lsls r2, r2, #31
|
||||||
|
itt ne
|
||||||
|
ldrbne lr, [r1], #1
|
||||||
|
strbne lr, [r0], #1
|
||||||
|
itttt cs
|
||||||
|
ldrbcs ip, [r1], #1
|
||||||
|
ldrbcs lr, [r1]
|
||||||
|
strbcs ip, [r0], #1
|
||||||
|
strbcs lr, [r0]
|
||||||
|
|
||||||
|
// Restore registers: optimized pop {r0, pc}
|
||||||
|
ldrd r8, r9, [sp], #8
|
||||||
|
ldrd r6, r7, [sp], #8
|
||||||
|
ldrd r4, r5, [sp], #8
|
||||||
|
pop {r0, pc}
|
||||||
|
|
||||||
|
dst_not_word_aligned:
|
||||||
|
// Align dst to word.
|
||||||
|
rsb ip, ip, #4
|
||||||
|
cmp ip, #2
|
||||||
|
|
||||||
|
itt gt
|
||||||
|
ldrbgt lr, [r1], #1
|
||||||
|
strbgt lr, [r0], #1
|
||||||
|
|
||||||
|
itt ge
|
||||||
|
ldrbge lr, [r1], #1
|
||||||
|
strbge lr, [r0], #1
|
||||||
|
|
||||||
|
ldrb lr, [r1], #1
|
||||||
|
strb lr, [r0], #1
|
||||||
|
|
||||||
|
sub r2, r2, ip
|
||||||
|
|
||||||
|
// Src is guaranteed to be at least word aligned by this point.
|
||||||
|
b word_aligned
|
||||||
|
END(memcpy)
|
||||||
164
libc/arch-arm/cortex-a15/bionic/memset.S
Normal file
164
libc/arch-arm/cortex-a15/bionic/memset.S
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 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
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
ENTRY(bzero)
|
||||||
|
mov r2, r1
|
||||||
|
mov r1, #0
|
||||||
|
// Fall through to memset...
|
||||||
|
END(bzero)
|
||||||
|
|
||||||
|
ENTRY(memset)
|
||||||
|
.save {r0}
|
||||||
|
stmfd sp!, {r0}
|
||||||
|
|
||||||
|
// The new algorithm is slower for copies < 16 so use the old
|
||||||
|
// neon code in that case.
|
||||||
|
cmp r2, #16
|
||||||
|
blo set_less_than_16_unknown_align
|
||||||
|
|
||||||
|
// Use strd which requires an even and odd register so move the
|
||||||
|
// values so that:
|
||||||
|
// r0 and r1 contain the memset value
|
||||||
|
// r2 is the number of bytes to set
|
||||||
|
// r3 is the destination pointer
|
||||||
|
mov r3, r0
|
||||||
|
|
||||||
|
// Copy the byte value in every byte of r1.
|
||||||
|
mov r1, r1, lsl #24
|
||||||
|
orr r1, r1, r1, lsr #8
|
||||||
|
orr r1, r1, r1, lsr #16
|
||||||
|
|
||||||
|
check_alignment:
|
||||||
|
// Align destination to a double word to avoid the strd crossing
|
||||||
|
// a cache line boundary.
|
||||||
|
ands ip, r3, #7
|
||||||
|
bne do_double_word_align
|
||||||
|
|
||||||
|
double_word_aligned:
|
||||||
|
mov r0, r1
|
||||||
|
|
||||||
|
subs r2, #64
|
||||||
|
blo set_less_than_64
|
||||||
|
|
||||||
|
1: // Main loop sets 64 bytes at a time.
|
||||||
|
.irp offset, #0, #8, #16, #24, #32, #40, #48, #56
|
||||||
|
strd r0, r1, [r3, \offset]
|
||||||
|
.endr
|
||||||
|
|
||||||
|
add r3, #64
|
||||||
|
subs r2, #64
|
||||||
|
bge 1b
|
||||||
|
|
||||||
|
set_less_than_64:
|
||||||
|
// Restore r2 to the count of bytes left to set.
|
||||||
|
add r2, #64
|
||||||
|
lsls ip, r2, #27
|
||||||
|
bcc set_less_than_32
|
||||||
|
// Set 32 bytes.
|
||||||
|
.irp offset, #0, #8, #16, #24
|
||||||
|
strd r0, r1, [r3, \offset]
|
||||||
|
.endr
|
||||||
|
add r3, #32
|
||||||
|
|
||||||
|
set_less_than_32:
|
||||||
|
bpl set_less_than_16
|
||||||
|
// Set 16 bytes.
|
||||||
|
.irp offset, #0, #8
|
||||||
|
strd r0, r1, [r3, \offset]
|
||||||
|
.endr
|
||||||
|
add r3, #16
|
||||||
|
|
||||||
|
set_less_than_16:
|
||||||
|
// Less than 16 bytes to set.
|
||||||
|
lsls ip, r2, #29
|
||||||
|
bcc set_less_than_8
|
||||||
|
|
||||||
|
// Set 8 bytes.
|
||||||
|
strd r0, r1, [r3], #8
|
||||||
|
|
||||||
|
set_less_than_8:
|
||||||
|
bpl set_less_than_4
|
||||||
|
// Set 4 bytes
|
||||||
|
str r1, [r3], #4
|
||||||
|
|
||||||
|
set_less_than_4:
|
||||||
|
lsls ip, r2, #31
|
||||||
|
it ne
|
||||||
|
strbne r1, [r3], #1
|
||||||
|
itt cs
|
||||||
|
strbcs r1, [r3], #1
|
||||||
|
strbcs r1, [r3]
|
||||||
|
|
||||||
|
ldmfd sp!, {r0}
|
||||||
|
bx lr
|
||||||
|
|
||||||
|
do_double_word_align:
|
||||||
|
rsb ip, ip, #8
|
||||||
|
sub r2, r2, ip
|
||||||
|
movs r0, ip, lsl #31
|
||||||
|
it mi
|
||||||
|
strbmi r1, [r3], #1
|
||||||
|
itt cs
|
||||||
|
strbcs r1, [r3], #1
|
||||||
|
strbcs r1, [r3], #1
|
||||||
|
|
||||||
|
// Dst is at least word aligned by this point.
|
||||||
|
cmp ip, #4
|
||||||
|
blo double_word_aligned
|
||||||
|
str r1, [r3], #4
|
||||||
|
b double_word_aligned
|
||||||
|
|
||||||
|
set_less_than_16_unknown_align:
|
||||||
|
// Set up to 15 bytes.
|
||||||
|
vdup.8 d0, r1
|
||||||
|
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
|
||||||
|
it mi
|
||||||
|
strbmi r1, [r0], #1
|
||||||
|
itt cs
|
||||||
|
strbcs r1, [r0], #1
|
||||||
|
strbcs 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
|
||||||
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)
|
||||||
@@ -35,17 +35,6 @@
|
|||||||
#ifndef _ARM__TYPES_H_
|
#ifndef _ARM__TYPES_H_
|
||||||
#define _ARM__TYPES_H_
|
#define _ARM__TYPES_H_
|
||||||
|
|
||||||
|
|
||||||
#if !defined(__ARM_EABI__)
|
|
||||||
/* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */
|
|
||||||
#define _SIZE_T
|
|
||||||
#define _SSIZE_T
|
|
||||||
#define _PTRDIFF_T
|
|
||||||
typedef unsigned long size_t;
|
|
||||||
typedef long ssize_t;
|
|
||||||
typedef long ptrdiff_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 7.18.1.1 Exact-width integer types */
|
/* 7.18.1.1 Exact-width integer types */
|
||||||
typedef __signed char __int8_t;
|
typedef __signed char __int8_t;
|
||||||
typedef unsigned char __uint8_t;
|
typedef unsigned char __uint8_t;
|
||||||
@@ -98,6 +87,8 @@ typedef unsigned long __psize_t;
|
|||||||
/* Standard system types */
|
/* Standard system types */
|
||||||
typedef int __clock_t;
|
typedef int __clock_t;
|
||||||
typedef int __clockid_t;
|
typedef int __clockid_t;
|
||||||
|
typedef double __double_t;
|
||||||
|
typedef float __float_t;
|
||||||
typedef long __ptrdiff_t;
|
typedef long __ptrdiff_t;
|
||||||
typedef int __time_t;
|
typedef int __time_t;
|
||||||
typedef int __timer_t;
|
typedef int __timer_t;
|
||||||
@@ -116,10 +107,4 @@ typedef int __rune_t;
|
|||||||
typedef void * __wctrans_t;
|
typedef void * __wctrans_t;
|
||||||
typedef void * __wctype_t;
|
typedef void * __wctype_t;
|
||||||
|
|
||||||
#ifdef __ARMEB__
|
|
||||||
#define _BYTE_ORDER _BIG_ENDIAN
|
|
||||||
#else
|
|
||||||
#define _BYTE_ORDER _LITTLE_ENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _ARM__TYPES_H_ */
|
#endif /* _ARM__TYPES_H_ */
|
||||||
|
|||||||
138
libc/arch-arm/include/machine/elf_machdep.h
Normal file
138
libc/arch-arm/include/machine/elf_machdep.h
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
/* $NetBSD: elf_machdep.h,v 1.10 2012/08/05 04:12:46 matt Exp $ */
|
||||||
|
|
||||||
|
#ifndef _ARM_ELF_MACHDEP_H_
|
||||||
|
#define _ARM_ELF_MACHDEP_H_
|
||||||
|
|
||||||
|
#if defined(__ARMEB__)
|
||||||
|
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
|
||||||
|
#else
|
||||||
|
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
|
||||||
|
#define ELF64_MACHDEP_ID_CASES \
|
||||||
|
/* no 64-bit ELF machine types supported */
|
||||||
|
|
||||||
|
/* Processor specific flags for the ELF header e_flags field. */
|
||||||
|
#define EF_ARM_RELEXEC 0x00000001
|
||||||
|
#define EF_ARM_HASENTRY 0x00000002
|
||||||
|
#define EF_ARM_INTERWORK 0x00000004 /* GNU binutils 000413 */
|
||||||
|
#define EF_ARM_SYMSARESORTED 0x00000004 /* ARM ELF A08 */
|
||||||
|
#define EF_ARM_APCS_26 0x00000008 /* GNU binutils 000413 */
|
||||||
|
#define EF_ARM_DYNSYMSUSESEGIDX 0x00000008 /* ARM ELF B01 */
|
||||||
|
#define EF_ARM_APCS_FLOAT 0x00000010 /* GNU binutils 000413 */
|
||||||
|
#define EF_ARM_MAPSYMSFIRST 0x00000010 /* ARM ELF B01 */
|
||||||
|
#define EF_ARM_PIC 0x00000020
|
||||||
|
#define EF_ARM_ALIGN8 0x00000040 /* 8-bit structure alignment. */
|
||||||
|
#define EF_ARM_NEW_ABI 0x00000080
|
||||||
|
#define EF_ARM_OLD_ABI 0x00000100
|
||||||
|
#define EF_ARM_SOFT_FLOAT 0x00000200
|
||||||
|
#define EF_ARM_EABIMASK 0xff000000
|
||||||
|
#define EF_ARM_EABI_VER1 0x01000000
|
||||||
|
#define EF_ARM_EABI_VER2 0x02000000
|
||||||
|
#define EF_ARM_EABI_VER3 0x03000000
|
||||||
|
#define EF_ARM_EABI_VER4 0x04000000
|
||||||
|
#define EF_ARM_EABI_VER5 0x05000000
|
||||||
|
|
||||||
|
#define ELF32_MACHDEP_ID_CASES \
|
||||||
|
case EM_ARM: \
|
||||||
|
break;
|
||||||
|
|
||||||
|
#define ELF32_MACHDEP_ID EM_ARM
|
||||||
|
|
||||||
|
#define ARCH_ELFSIZE 32 /* MD native binary size */
|
||||||
|
|
||||||
|
/* Processor specific relocation types */
|
||||||
|
|
||||||
|
#define R_ARM_NONE 0
|
||||||
|
#define R_ARM_PC24 1
|
||||||
|
#define R_ARM_ABS32 2
|
||||||
|
#define R_ARM_REL32 3
|
||||||
|
#define R_ARM_PC13 4
|
||||||
|
#define R_ARM_ABS16 5
|
||||||
|
#define R_ARM_ABS12 6
|
||||||
|
#define R_ARM_THM_ABS5 7
|
||||||
|
#define R_ARM_ABS8 8
|
||||||
|
#define R_ARM_SBREL32 9
|
||||||
|
#define R_ARM_THM_PC22 10
|
||||||
|
#define R_ARM_THM_PC8 11
|
||||||
|
#define R_ARM_AMP_VCALL9 12
|
||||||
|
#define R_ARM_SWI24 13
|
||||||
|
#define R_ARM_THM_SWI8 14
|
||||||
|
#define R_ARM_XPC25 15
|
||||||
|
#define R_ARM_THM_XPC22 16
|
||||||
|
|
||||||
|
/* TLS relocations */
|
||||||
|
#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */
|
||||||
|
#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */
|
||||||
|
#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */
|
||||||
|
|
||||||
|
/* 20-31 are reserved for ARM Linux. */
|
||||||
|
#define R_ARM_COPY 20
|
||||||
|
#define R_ARM_GLOB_DAT 21
|
||||||
|
#define R_ARM_JUMP_SLOT 22
|
||||||
|
#define R_ARM_RELATIVE 23
|
||||||
|
#define R_ARM_GOTOFF 24
|
||||||
|
#define R_ARM_GOTPC 25
|
||||||
|
#define R_ARM_GOT32 26
|
||||||
|
#define R_ARM_PLT32 27
|
||||||
|
|
||||||
|
#define R_ARM_ALU_PCREL_7_0 32
|
||||||
|
#define R_ARM_ALU_PCREL_15_8 33
|
||||||
|
#define R_ARM_ALU_PCREL_23_15 34
|
||||||
|
#define R_ARM_ALU_SBREL_11_0 35
|
||||||
|
#define R_ARM_ALU_SBREL_19_12 36
|
||||||
|
#define R_ARM_ALU_SBREL_27_20 37
|
||||||
|
|
||||||
|
/* 96-111 are reserved to G++. */
|
||||||
|
#define R_ARM_GNU_VTENTRY 100
|
||||||
|
#define R_ARM_GNU_VTINHERIT 101
|
||||||
|
#define R_ARM_THM_PC11 102
|
||||||
|
#define R_ARM_THM_PC9 103
|
||||||
|
|
||||||
|
/* More TLS relocations */
|
||||||
|
#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic */
|
||||||
|
#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic */
|
||||||
|
#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS */
|
||||||
|
#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of */
|
||||||
|
#define R_ARM_TLS_LE32 108
|
||||||
|
#define R_ARM_TLS_LDO12 109
|
||||||
|
#define R_ARM_TLS_LE12 110
|
||||||
|
#define R_ARM_TLS_IE12GP 111
|
||||||
|
|
||||||
|
/* 112-127 are reserved for private experiments. */
|
||||||
|
|
||||||
|
#define R_ARM_RXPC25 249
|
||||||
|
#define R_ARM_RSBREL32 250
|
||||||
|
#define R_ARM_THM_RPC22 251
|
||||||
|
#define R_ARM_RREL32 252
|
||||||
|
#define R_ARM_RABS32 253
|
||||||
|
#define R_ARM_RPC24 254
|
||||||
|
#define R_ARM_RBASE 255
|
||||||
|
|
||||||
|
#define R_TYPE(name) __CONCAT(R_ARM_,name)
|
||||||
|
|
||||||
|
/* Processor specific program header flags */
|
||||||
|
#define PF_ARM_SB 0x10000000
|
||||||
|
#define PF_ARM_PI 0x20000000
|
||||||
|
#define PF_ARM_ENTRY 0x80000000
|
||||||
|
|
||||||
|
/* Processor specific section header flags */
|
||||||
|
#define SHF_ENTRYSECT 0x10000000
|
||||||
|
#define SHF_COMDEF 0x80000000
|
||||||
|
|
||||||
|
/* Processor specific symbol types */
|
||||||
|
#define STT_ARM_TFUNC STT_LOPROC
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
|
#ifdef ELFSIZE
|
||||||
|
#define ELF_MD_PROBE_FUNC ELFNAME2(arm_netbsd,probe)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct exec_package;
|
||||||
|
|
||||||
|
int arm_netbsd_elf32_probe(struct lwp *, struct exec_package *, void *, char *,
|
||||||
|
vaddr_t *);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ARM_ELF_MACHDEP_H_ */
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
#endif /* __ARM_ARCH__ */
|
#endif /* __ARM_ARCH__ */
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#ifdef __ARMEB__
|
#if defined(__ARMEB__)
|
||||||
#define _BYTE_ORDER _BIG_ENDIAN
|
#define _BYTE_ORDER _BIG_ENDIAN
|
||||||
#else
|
#else
|
||||||
#define _BYTE_ORDER _LITTLE_ENDIAN
|
#define _BYTE_ORDER _LITTLE_ENDIAN
|
||||||
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/_exit_thread.S
|
||||||
syscall_src += arch-arm/syscalls/__fork.S
|
syscall_src += arch-arm/syscalls/__fork.S
|
||||||
syscall_src += arch-arm/syscalls/__waitid.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/__sys_clone.S
|
||||||
syscall_src += arch-arm/syscalls/execve.S
|
syscall_src += arch-arm/syscalls/execve.S
|
||||||
syscall_src += arch-arm/syscalls/__setuid.S
|
syscall_src += arch-arm/syscalls/__setuid.S
|
||||||
@@ -150,6 +151,7 @@ syscall_src += arch-arm/syscalls/__rt_sigaction.S
|
|||||||
syscall_src += arch-arm/syscalls/__rt_sigprocmask.S
|
syscall_src += arch-arm/syscalls/__rt_sigprocmask.S
|
||||||
syscall_src += arch-arm/syscalls/__rt_sigtimedwait.S
|
syscall_src += arch-arm/syscalls/__rt_sigtimedwait.S
|
||||||
syscall_src += arch-arm/syscalls/sigpending.S
|
syscall_src += arch-arm/syscalls/sigpending.S
|
||||||
|
syscall_src += arch-arm/syscalls/signalfd4.S
|
||||||
syscall_src += arch-arm/syscalls/socket.S
|
syscall_src += arch-arm/syscalls/socket.S
|
||||||
syscall_src += arch-arm/syscalls/socketpair.S
|
syscall_src += arch-arm/syscalls/socketpair.S
|
||||||
syscall_src += arch-arm/syscalls/bind.S
|
syscall_src += arch-arm/syscalls/bind.S
|
||||||
@@ -179,7 +181,6 @@ syscall_src += arch-arm/syscalls/__getcpu.S
|
|||||||
syscall_src += arch-arm/syscalls/ioprio_set.S
|
syscall_src += arch-arm/syscalls/ioprio_set.S
|
||||||
syscall_src += arch-arm/syscalls/ioprio_get.S
|
syscall_src += arch-arm/syscalls/ioprio_get.S
|
||||||
syscall_src += arch-arm/syscalls/uname.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/umask.S
|
||||||
syscall_src += arch-arm/syscalls/__reboot.S
|
syscall_src += arch-arm/syscalls/__reboot.S
|
||||||
syscall_src += arch-arm/syscalls/__syslog.S
|
syscall_src += arch-arm/syscalls/__syslog.S
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__brk)
|
ENTRY(__brk)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_brk
|
ldr r7, =__NR_brk
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__brk)
|
END(__brk)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__fcntl)
|
ENTRY(__fcntl)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_fcntl
|
ldr r7, =__NR_fcntl
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__fcntl)
|
END(__fcntl)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__fcntl64)
|
ENTRY(__fcntl64)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_fcntl64
|
ldr r7, =__NR_fcntl64
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__fcntl64)
|
END(__fcntl64)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__fork)
|
ENTRY(__fork)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_fork
|
ldr r7, =__NR_fork
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__fork)
|
END(__fork)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__fstatfs64)
|
ENTRY(__fstatfs64)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_fstatfs64
|
ldr r7, =__NR_fstatfs64
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__fstatfs64)
|
END(__fstatfs64)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__getcpu)
|
ENTRY(__getcpu)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_getcpu
|
ldr r7, =__NR_getcpu
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__getcpu)
|
END(__getcpu)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__getcwd)
|
ENTRY(__getcwd)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_getcwd
|
ldr r7, =__NR_getcwd
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__getcwd)
|
END(__getcwd)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__getpriority)
|
ENTRY(__getpriority)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_getpriority
|
ldr r7, =__NR_getpriority
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__getpriority)
|
END(__getpriority)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__ioctl)
|
ENTRY(__ioctl)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_ioctl
|
ldr r7, =__NR_ioctl
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__ioctl)
|
END(__ioctl)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__llseek)
|
ENTRY(__llseek)
|
||||||
mov ip, sp
|
mov ip, sp
|
||||||
@@ -10,7 +11,8 @@ ENTRY(__llseek)
|
|||||||
ldr r7, =__NR__llseek
|
ldr r7, =__NR__llseek
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r5, r6, r7}
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__llseek)
|
END(__llseek)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__mmap2)
|
ENTRY(__mmap2)
|
||||||
mov ip, sp
|
mov ip, sp
|
||||||
@@ -10,7 +11,8 @@ ENTRY(__mmap2)
|
|||||||
ldr r7, =__NR_mmap2
|
ldr r7, =__NR_mmap2
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r5, r6, r7}
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__mmap2)
|
END(__mmap2)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__open)
|
ENTRY(__open)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_open
|
ldr r7, =__NR_open
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__open)
|
END(__open)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__openat)
|
ENTRY(__openat)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_openat
|
ldr r7, =__NR_openat
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__openat)
|
END(__openat)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__ptrace)
|
ENTRY(__ptrace)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_ptrace
|
ldr r7, =__NR_ptrace
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__ptrace)
|
END(__ptrace)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__reboot)
|
ENTRY(__reboot)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_reboot
|
ldr r7, =__NR_reboot
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__reboot)
|
END(__reboot)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__rt_sigaction)
|
ENTRY(__rt_sigaction)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_rt_sigaction
|
ldr r7, =__NR_rt_sigaction
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__rt_sigaction)
|
END(__rt_sigaction)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__rt_sigprocmask)
|
ENTRY(__rt_sigprocmask)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_rt_sigprocmask
|
ldr r7, =__NR_rt_sigprocmask
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__rt_sigprocmask)
|
END(__rt_sigprocmask)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__rt_sigtimedwait)
|
ENTRY(__rt_sigtimedwait)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_rt_sigtimedwait
|
ldr r7, =__NR_rt_sigtimedwait
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__rt_sigtimedwait)
|
END(__rt_sigtimedwait)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__sched_getaffinity)
|
ENTRY(__sched_getaffinity)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_sched_getaffinity
|
ldr r7, =__NR_sched_getaffinity
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__sched_getaffinity)
|
END(__sched_getaffinity)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__set_tls)
|
ENTRY(__set_tls)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
ldr r7, =__ARM_NR_set_tls
|
||||||
ldr r7, =__NR_ARM_set_tls
|
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__set_tls)
|
END(__set_tls)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__setresuid)
|
ENTRY(__setresuid)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_setresuid32
|
ldr r7, =__NR_setresuid32
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__setresuid)
|
END(__setresuid)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__setreuid)
|
ENTRY(__setreuid)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_setreuid32
|
ldr r7, =__NR_setreuid32
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__setreuid)
|
END(__setreuid)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__setuid)
|
ENTRY(__setuid)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_setuid32
|
ldr r7, =__NR_setuid32
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__setuid)
|
END(__setuid)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__sigsuspend)
|
ENTRY(__sigsuspend)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_sigsuspend
|
ldr r7, =__NR_sigsuspend
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__sigsuspend)
|
END(__sigsuspend)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__statfs64)
|
ENTRY(__statfs64)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_statfs64
|
ldr r7, =__NR_statfs64
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__statfs64)
|
END(__statfs64)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__sys_clone)
|
ENTRY(__sys_clone)
|
||||||
mov ip, sp
|
mov ip, sp
|
||||||
@@ -10,7 +11,8 @@ ENTRY(__sys_clone)
|
|||||||
ldr r7, =__NR_clone
|
ldr r7, =__NR_clone
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r5, r6, r7}
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__sys_clone)
|
END(__sys_clone)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__syslog)
|
ENTRY(__syslog)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_syslog
|
ldr r7, =__NR_syslog
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__syslog)
|
END(__syslog)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__timer_create)
|
ENTRY(__timer_create)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_timer_create
|
ldr r7, =__NR_timer_create
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__timer_create)
|
END(__timer_create)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__timer_delete)
|
ENTRY(__timer_delete)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_timer_delete
|
ldr r7, =__NR_timer_delete
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__timer_delete)
|
END(__timer_delete)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__timer_getoverrun)
|
ENTRY(__timer_getoverrun)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_timer_getoverrun
|
ldr r7, =__NR_timer_getoverrun
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__timer_getoverrun)
|
END(__timer_getoverrun)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__timer_gettime)
|
ENTRY(__timer_gettime)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_timer_gettime
|
ldr r7, =__NR_timer_gettime
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__timer_gettime)
|
END(__timer_gettime)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__timer_settime)
|
ENTRY(__timer_settime)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_timer_settime
|
ldr r7, =__NR_timer_settime
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__timer_settime)
|
END(__timer_settime)
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
|
||||||
#include <machine/asm.h>
|
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__wait4)
|
|
||||||
.save {r4, r7}
|
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_wait4
|
|
||||||
swi #0
|
|
||||||
ldmfd sp!, {r4, r7}
|
|
||||||
movs r0, r0
|
|
||||||
bxpl lr
|
|
||||||
b __set_syscall_errno
|
|
||||||
END(__wait4)
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(__waitid)
|
ENTRY(__waitid)
|
||||||
mov ip, sp
|
mov ip, sp
|
||||||
@@ -10,7 +11,8 @@ ENTRY(__waitid)
|
|||||||
ldr r7, =__NR_waitid
|
ldr r7, =__NR_waitid
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r5, r6, r7}
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(__waitid)
|
END(__waitid)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(_exit)
|
ENTRY(_exit)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_exit_group
|
ldr r7, =__NR_exit_group
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(_exit)
|
END(_exit)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(_exit_thread)
|
ENTRY(_exit_thread)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_exit
|
ldr r7, =__NR_exit
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(_exit_thread)
|
END(_exit_thread)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(accept)
|
ENTRY(accept)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_accept
|
ldr r7, =__NR_accept
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(accept)
|
END(accept)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(access)
|
ENTRY(access)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_access
|
ldr r7, =__NR_access
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(access)
|
END(access)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(acct)
|
ENTRY(acct)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_acct
|
ldr r7, =__NR_acct
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(acct)
|
END(acct)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(bind)
|
ENTRY(bind)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_bind
|
ldr r7, =__NR_bind
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(bind)
|
END(bind)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(cacheflush)
|
ENTRY(cacheflush)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
ldr r7, =__ARM_NR_cacheflush
|
||||||
ldr r7, =__NR_ARM_cacheflush
|
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(cacheflush)
|
END(cacheflush)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(capget)
|
ENTRY(capget)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_capget
|
ldr r7, =__NR_capget
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(capget)
|
END(capget)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(capset)
|
ENTRY(capset)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_capset
|
ldr r7, =__NR_capset
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(capset)
|
END(capset)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(chdir)
|
ENTRY(chdir)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_chdir
|
ldr r7, =__NR_chdir
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(chdir)
|
END(chdir)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(chmod)
|
ENTRY(chmod)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_chmod
|
ldr r7, =__NR_chmod
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(chmod)
|
END(chmod)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(chown)
|
ENTRY(chown)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_chown32
|
ldr r7, =__NR_chown32
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(chown)
|
END(chown)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(chroot)
|
ENTRY(chroot)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_chroot
|
ldr r7, =__NR_chroot
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(chroot)
|
END(chroot)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(clock_getres)
|
ENTRY(clock_getres)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_clock_getres
|
ldr r7, =__NR_clock_getres
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(clock_getres)
|
END(clock_getres)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(clock_gettime)
|
ENTRY(clock_gettime)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_clock_gettime
|
ldr r7, =__NR_clock_gettime
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(clock_gettime)
|
END(clock_gettime)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(clock_nanosleep)
|
ENTRY(clock_nanosleep)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_clock_nanosleep
|
ldr r7, =__NR_clock_nanosleep
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(clock_nanosleep)
|
END(clock_nanosleep)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(clock_settime)
|
ENTRY(clock_settime)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_clock_settime
|
ldr r7, =__NR_clock_settime
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(clock_settime)
|
END(clock_settime)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(close)
|
ENTRY(close)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_close
|
ldr r7, =__NR_close
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(close)
|
END(close)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(connect)
|
ENTRY(connect)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_connect
|
ldr r7, =__NR_connect
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(connect)
|
END(connect)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(delete_module)
|
ENTRY(delete_module)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_delete_module
|
ldr r7, =__NR_delete_module
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(delete_module)
|
END(delete_module)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(dup)
|
ENTRY(dup)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_dup
|
ldr r7, =__NR_dup
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(dup)
|
END(dup)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* autogenerated by gensyscalls.py */
|
/* autogenerated by gensyscalls.py */
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
#include <linux/err.h>
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
#include <sys/linux-syscalls.h>
|
|
||||||
|
|
||||||
ENTRY(dup2)
|
ENTRY(dup2)
|
||||||
.save {r4, r7}
|
mov ip, r7
|
||||||
stmfd sp!, {r4, r7}
|
|
||||||
ldr r7, =__NR_dup2
|
ldr r7, =__NR_dup2
|
||||||
swi #0
|
swi #0
|
||||||
ldmfd sp!, {r4, r7}
|
mov r7, ip
|
||||||
movs r0, r0
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxpl lr
|
bxls lr
|
||||||
b __set_syscall_errno
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
END(dup2)
|
END(dup2)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user