Compare commits
721 Commits
idea133
...
idea133-we
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b1a95bc76 | ||
|
|
9b5ee4aa85 | ||
|
|
185dd72a2c | ||
|
|
9ded07cff6 | ||
|
|
4356adc3f4 | ||
|
|
52defb7c70 | ||
|
|
629d892d0b | ||
|
|
bfa582d032 | ||
|
|
6916166e10 | ||
|
|
e0a36f49a9 | ||
|
|
ad534985ec | ||
|
|
e2341d08fa | ||
|
|
8ec21d9ded | ||
|
|
53b24382f5 | ||
|
|
580b246917 | ||
|
|
6b56691a67 | ||
|
|
a334c1ec13 | ||
|
|
640b4a5a64 | ||
|
|
2d822ebe7a | ||
|
|
792ae72e41 | ||
|
|
5ca7ed9005 | ||
|
|
e987803c35 | ||
|
|
f1ada79a83 | ||
|
|
c42f5c6fe6 | ||
|
|
d6ff0dcef6 | ||
|
|
efaa461bd6 | ||
|
|
9287223674 | ||
|
|
26ec9679ff | ||
|
|
790890fd5c | ||
|
|
0d0ccfe2ce | ||
|
|
296f17af0a | ||
|
|
f83e644e2c | ||
|
|
7da3191069 | ||
|
|
568c86a489 | ||
|
|
f0291ca6b7 | ||
|
|
5a0aa3dee2 | ||
|
|
cb475651e3 | ||
|
|
3347a79664 | ||
|
|
de54b90ed5 | ||
|
|
8b1ade5c0b | ||
|
|
8979cfe14b | ||
|
|
fddbafdc0a | ||
|
|
9fb53dd4db | ||
|
|
2ae3f60ca3 | ||
|
|
2d36750c3a | ||
|
|
0990d4fda8 | ||
|
|
77473e4085 | ||
|
|
4566731772 | ||
|
|
b743790cca | ||
|
|
d4ae59dcf2 | ||
|
|
01933d921e | ||
|
|
b8425c549a | ||
|
|
94336d8ecf | ||
|
|
85e780d055 | ||
|
|
c932225e10 | ||
|
|
c19c8e6f71 | ||
|
|
01ae00f317 | ||
|
|
c6e563c87a | ||
|
|
770491fb4f | ||
|
|
55cd82762f | ||
|
|
3d7a0d9b08 | ||
|
|
eab395e4a8 | ||
|
|
7fdab460a9 | ||
|
|
5090964da0 | ||
|
|
07bab525e2 | ||
|
|
0a5e26da1e | ||
|
|
0fd2e87a0c | ||
|
|
d299bcfdad | ||
|
|
3ac3f3fd0c | ||
|
|
329103d3e2 | ||
|
|
f2dc7d1719 | ||
|
|
b7e289ed02 | ||
|
|
213e46f7ae | ||
|
|
533dde4dbf | ||
|
|
eff450ff45 | ||
|
|
b1cacd4245 | ||
|
|
08bfcff0d4 | ||
|
|
ab290718e3 | ||
|
|
6b64000ef0 | ||
|
|
f2aeca505c | ||
|
|
fbb46a0c9a | ||
|
|
690401db7a | ||
|
|
4b7c4f886f | ||
|
|
477d14b092 | ||
|
|
ae77f74bcf | ||
|
|
563ea4e151 | ||
|
|
409588cdae | ||
|
|
2e3b7108b5 | ||
|
|
3b0433f34f | ||
|
|
a64d76895d | ||
|
|
aa3d46a45d | ||
|
|
b84926b95c | ||
|
|
1abc9ff6a5 | ||
|
|
cf83fd77ca | ||
|
|
f602bf8e94 | ||
|
|
0c567f1e6c | ||
|
|
16ea297f12 | ||
|
|
cbf6df0459 | ||
|
|
532ad903d2 | ||
|
|
d8f8e9c59e | ||
|
|
36f5a95b83 | ||
|
|
53c884e281 | ||
|
|
eae5902e73 | ||
|
|
58d9e280d4 | ||
|
|
635edbdf93 | ||
|
|
c6cd884640 | ||
|
|
156c3afcf1 | ||
|
|
8d77bce185 | ||
|
|
8eaeaf50cb | ||
|
|
d0ecf5974f | ||
|
|
cce36c1878 | ||
|
|
345b49a7c0 | ||
|
|
c5eea6d386 | ||
|
|
4ff967f330 | ||
|
|
0dcf06f976 | ||
|
|
b1bfa7956c | ||
|
|
c363e5dd0a | ||
|
|
16f6429c38 | ||
|
|
83c07b5e50 | ||
|
|
f3489807af | ||
|
|
d39f3f2c2e | ||
|
|
44a98d5c12 | ||
|
|
d812b2196a | ||
|
|
d3679c815e | ||
|
|
2e003f4324 | ||
|
|
8abf44c415 | ||
|
|
6d09ec3c2f | ||
|
|
17e6a98b48 | ||
|
|
6a45fe9872 | ||
|
|
a9585aedbc | ||
|
|
865119efd4 | ||
|
|
9b22c21cee | ||
|
|
1acd9716c2 | ||
|
|
fe0c6ae561 | ||
|
|
db68e56997 | ||
|
|
cd79c8b158 | ||
|
|
2f68866f37 | ||
|
|
1b836ee6f8 | ||
|
|
9d3c2dd11f | ||
|
|
b88da06580 | ||
|
|
9e94ea5c11 | ||
|
|
f3c73901cb | ||
|
|
0e351e4011 | ||
|
|
779585fb26 | ||
|
|
0549371bd7 | ||
|
|
183ad9df53 | ||
|
|
12bbb91645 | ||
|
|
012cb4583a | ||
|
|
857b179673 | ||
|
|
acbe322e82 | ||
|
|
8da69a25b7 | ||
|
|
c480f57dd3 | ||
|
|
f081e139fe | ||
|
|
cb65cc3fb4 | ||
|
|
9ceae0c9a6 | ||
|
|
20828db758 | ||
|
|
4abaa576e8 | ||
|
|
4bd97cee28 | ||
|
|
26c2bb84dd | ||
|
|
b760164dd6 | ||
|
|
073ea10156 | ||
|
|
40b0579127 | ||
|
|
a13c7fd3b3 | ||
|
|
0f95a55322 | ||
|
|
76ba8e86d5 | ||
|
|
02c78a3867 | ||
|
|
0558906866 | ||
|
|
7823f320b1 | ||
|
|
28417eb9b5 | ||
|
|
5eb670462a | ||
|
|
a0b3232161 | ||
|
|
6455ac73da | ||
|
|
c4e71fc91f | ||
|
|
b676aafad0 | ||
|
|
b64868a507 | ||
|
|
8c42606ae1 | ||
|
|
4e364d9724 | ||
|
|
93e1907ae1 | ||
|
|
e4392199af | ||
|
|
c5992a036b | ||
|
|
a5d83312bd | ||
|
|
b52a4ab4e2 | ||
|
|
e62355057c | ||
|
|
764a993611 | ||
|
|
c4936e20a3 | ||
|
|
7f38a3c9be | ||
|
|
9f525644df | ||
|
|
ff64831b09 | ||
|
|
ac70d2e1fe | ||
|
|
5363a45f2b | ||
|
|
e2239ddb72 | ||
|
|
5acd2d4005 | ||
|
|
48501af98f | ||
|
|
4e3ce11450 | ||
|
|
0b0387c965 | ||
|
|
9195a258ee | ||
|
|
41059d764f | ||
|
|
b9bb48bf28 | ||
|
|
950a58e24d | ||
|
|
26c31a75a5 | ||
|
|
efbdb53f84 | ||
|
|
5f149f1bde | ||
|
|
60ba211d2b | ||
|
|
50249bca00 | ||
|
|
77e944fd46 | ||
|
|
47931f8f79 | ||
|
|
5c7bda5c61 | ||
|
|
dc5fcf3620 | ||
|
|
caa15bfe2d | ||
|
|
804b95e535 | ||
|
|
3868759314 | ||
|
|
eb554998d7 | ||
|
|
e2a0f15c08 | ||
|
|
8061facb7c | ||
|
|
26be5f50c2 | ||
|
|
fe6adbad19 | ||
|
|
d8d6feed3a | ||
|
|
f723b70fe0 | ||
|
|
1f13657131 | ||
|
|
edd7c2ec25 | ||
|
|
9c9ef0db91 | ||
|
|
473d06707b | ||
|
|
1653ad5e08 | ||
|
|
cb1da5d0c9 | ||
|
|
1021c05f1b | ||
|
|
1b0dc40980 | ||
|
|
f1bfc8781e | ||
|
|
ab5488f975 | ||
|
|
e3bb025b3d | ||
|
|
92d81d893f | ||
|
|
e05816cfa0 | ||
|
|
64b2963224 | ||
|
|
ea9bf67881 | ||
|
|
f42df8c1ac | ||
|
|
7f3a272ae3 | ||
|
|
796249a4ce | ||
|
|
88b44feb7d | ||
|
|
b7afa9df25 | ||
|
|
3bfa0fd32f | ||
|
|
b732b71dc1 | ||
|
|
108f6dc316 | ||
|
|
aad59fafea | ||
|
|
9cea377505 | ||
|
|
ac3fc00ca2 | ||
|
|
557942ac58 | ||
|
|
d8fe15fdb6 | ||
|
|
c19972a4ca | ||
|
|
6617fb73b6 | ||
|
|
50282f72bb | ||
|
|
c8564f2df2 | ||
|
|
a58b3f78e1 | ||
|
|
cd3303fa38 | ||
|
|
2f3ba8844a | ||
|
|
406a75d371 | ||
|
|
206fe5fd16 | ||
|
|
f1d7536dcf | ||
|
|
bc475bc8d1 | ||
|
|
4bfaf462f0 | ||
|
|
ecbf00bda2 | ||
|
|
8f2a30a92a | ||
|
|
5b5d6e7045 | ||
|
|
c8fc4ddc18 | ||
|
|
f1de90b3a2 | ||
|
|
812fd4263a | ||
|
|
0ae6445e9a | ||
|
|
f71c0e75e0 | ||
|
|
133bd09334 | ||
|
|
989a80b750 | ||
|
|
9e8a8dc18c | ||
|
|
4d77c1151c | ||
|
|
95c1abecc0 | ||
|
|
cce6c380d7 | ||
|
|
998d7b0307 | ||
|
|
c20de90287 | ||
|
|
753ad778bc | ||
|
|
8664be583a | ||
|
|
2cc58603d5 | ||
|
|
7227066726 | ||
|
|
7eb28b59c7 | ||
|
|
849e162d3b | ||
|
|
f171b34cf0 | ||
|
|
f212bbf666 | ||
|
|
143df89f72 | ||
|
|
205c7887ad | ||
|
|
d16100c1fb | ||
|
|
f2cea021ab | ||
|
|
6ece7fc33a | ||
|
|
879d330499 | ||
|
|
bd3155dc5d | ||
|
|
01cd78854a | ||
|
|
603332fc4c | ||
|
|
0e79338d12 | ||
|
|
5a8173860d | ||
|
|
56e1eebd39 | ||
|
|
eef2928f94 | ||
|
|
40488560c1 | ||
|
|
2282e16d76 | ||
|
|
2725ca95b2 | ||
|
|
c1005aaf8e | ||
|
|
ef43a6fb0e | ||
|
|
8d4b5849f2 | ||
|
|
76b4f1a33c | ||
|
|
ad41e9a4eb | ||
|
|
55f9710ac4 | ||
|
|
cccfe1e17c | ||
|
|
753e139906 | ||
|
|
3cdf5739cd | ||
|
|
dd8c7863c6 | ||
|
|
b28e490b73 | ||
|
|
5810bcf381 | ||
|
|
40c31ade2c | ||
|
|
a0ca209ac0 | ||
|
|
a4eafa6dbc | ||
|
|
10f6beb3eb | ||
|
|
3e3409af0f | ||
|
|
2cd3490d7b | ||
|
|
247dc91889 | ||
|
|
a305659196 | ||
|
|
19f58efa22 | ||
|
|
ec674b4d06 | ||
|
|
21d9e58d01 | ||
|
|
57a883640f | ||
|
|
7aef27468e | ||
|
|
6380b51a8d | ||
|
|
321ecc4eaf | ||
|
|
c8937eadf4 | ||
|
|
152b9de19a | ||
|
|
638e7892c6 | ||
|
|
159b28eb46 | ||
|
|
55b6ec3f93 | ||
|
|
c4fbf92ce1 | ||
|
|
0bca08d69f | ||
|
|
cd50898ad1 | ||
|
|
be1d91dedc | ||
|
|
fd9e20d10f | ||
|
|
04620a3cd7 | ||
|
|
333e2ae87d | ||
|
|
4d46c94031 | ||
|
|
4b558f50a4 | ||
|
|
a0cd9bc339 | ||
|
|
0ad555a908 | ||
|
|
b145b5ef7c | ||
|
|
d9ba757ef4 | ||
|
|
d40eb1594d | ||
|
|
087dbc6bb7 | ||
|
|
22a0d6fcdc | ||
|
|
dec5bacf14 | ||
|
|
4e54b114f9 | ||
|
|
e7ea9363cb | ||
|
|
7e4fa56099 | ||
|
|
85c5202a64 | ||
|
|
fcb502e3ec | ||
|
|
68a651e716 | ||
|
|
9fc76027f3 | ||
|
|
48d145c1ce | ||
|
|
252ee1e112 | ||
|
|
f0870c3bfe | ||
|
|
bef5016491 | ||
|
|
39b644a0e2 | ||
|
|
a0bf9bdea2 | ||
|
|
0e714a5b41 | ||
|
|
8e541b1223 | ||
|
|
569fb9887d | ||
|
|
4a46a68942 | ||
|
|
9f2d1bcd17 | ||
|
|
caaae7f2e9 | ||
|
|
51e6cb33e3 | ||
|
|
2c7c79e6e5 | ||
|
|
aedb00d04e | ||
|
|
f33df6a662 | ||
|
|
cecc036970 | ||
|
|
f38292862b | ||
|
|
dfeb42ede6 | ||
|
|
9bd9b7dd20 | ||
|
|
15e71cd760 | ||
|
|
e4ab19c67d | ||
|
|
ddad384dbf | ||
|
|
a8b1eb3fcf | ||
|
|
2ec592c338 | ||
|
|
ddc8cc7a68 | ||
|
|
692207eb45 | ||
|
|
d51db86aaf | ||
|
|
4ab29a3e4a | ||
|
|
d892892e8e | ||
|
|
bd33537fde | ||
|
|
e9db4a976f | ||
|
|
627d37cd1f | ||
|
|
fd3a9fb0c3 | ||
|
|
e334540516 | ||
|
|
3073f90b17 | ||
|
|
6ff0c75c83 | ||
|
|
ad2cfe2f23 | ||
|
|
7ba84d3108 | ||
|
|
000ffd8ab0 | ||
|
|
3ba62f733b | ||
|
|
3434727b3e | ||
|
|
0336e35368 | ||
|
|
d4ee6b62d7 | ||
|
|
26349d8c2e | ||
|
|
35036961f8 | ||
|
|
2d367905a2 | ||
|
|
27c7dbeee6 | ||
|
|
ba76572789 | ||
|
|
901553aaf4 | ||
|
|
1e4378ea06 | ||
|
|
c380385f0b | ||
|
|
b6208836cb | ||
|
|
5c7816f425 | ||
|
|
a92b57c7f8 | ||
|
|
7c1efffc24 | ||
|
|
53e43292aa | ||
|
|
ba40a56017 | ||
|
|
0e44bc3bae | ||
|
|
d4934a70e6 | ||
|
|
fe317a3775 | ||
|
|
b26e4944e2 | ||
|
|
37e9570bce | ||
|
|
c6d96bb867 | ||
|
|
c9ae21a5c3 | ||
|
|
3572fbc8cd | ||
|
|
247904a235 | ||
|
|
9150dfb1c6 | ||
|
|
0133944b09 | ||
|
|
90b0157679 | ||
|
|
da030de702 | ||
|
|
e65055af11 | ||
|
|
b8dc9bbd90 | ||
|
|
26172fa401 | ||
|
|
677b6e605b | ||
|
|
8d0fe1c49e | ||
|
|
cb43f8474d | ||
|
|
d28b277952 | ||
|
|
851e68a240 | ||
|
|
22c6b7ffd3 | ||
|
|
c345caae9a | ||
|
|
6a686556b9 | ||
|
|
09289d92f9 | ||
|
|
bfa2b6fc6a | ||
|
|
54d49ac75b | ||
|
|
6e39ba73bf | ||
|
|
adab51aefd | ||
|
|
ca566b3103 | ||
|
|
1fbe6213cd | ||
|
|
d9459525b4 | ||
|
|
75f04d1076 | ||
|
|
d465eb4e76 | ||
|
|
fbaddda9f0 | ||
|
|
b69c0b532e | ||
|
|
6db95a869e | ||
|
|
9abbbdc534 | ||
|
|
e6c451f5f2 | ||
|
|
eae27dc55a | ||
|
|
5f6f4a956c | ||
|
|
560cee6bff | ||
|
|
44ef37c1b4 | ||
|
|
24ef4779eb | ||
|
|
6b5559315d | ||
|
|
986f906710 | ||
|
|
006f9ad891 | ||
|
|
787c1f937a | ||
|
|
1d18e9cc0a | ||
|
|
b36020789a | ||
|
|
db1ea34748 | ||
|
|
3623d80675 | ||
|
|
915fefb62e | ||
|
|
ffe026680e | ||
|
|
3d19a8319b | ||
|
|
7f15e28dd4 | ||
|
|
cd6748cdd7 | ||
|
|
a38cb08861 | ||
|
|
240f1e2940 | ||
|
|
d4bc9ef83b | ||
|
|
cfbfe7059c | ||
|
|
95b808c4ae | ||
|
|
36ee4ab243 | ||
|
|
fadc8a7777 | ||
|
|
671e236d5f | ||
|
|
fc48e8cf28 | ||
|
|
c62b8a4d3f | ||
|
|
7b3876e251 | ||
|
|
aa0ebdafc7 | ||
|
|
9e572ca416 | ||
|
|
76c8b88269 | ||
|
|
c4c50b25f8 | ||
|
|
f25d677147 | ||
|
|
819c132ebc | ||
|
|
199346a2ab | ||
|
|
022885e2fa | ||
|
|
faf05bacd4 | ||
|
|
577fce0108 | ||
|
|
9918665a45 | ||
|
|
c856baeead | ||
|
|
b3a23bd017 | ||
|
|
a206dde5bd | ||
|
|
a6ecba4d23 | ||
|
|
71e4466b10 | ||
|
|
0266ae5f88 | ||
|
|
eeb9a9f59a | ||
|
|
3a9c5d66dc | ||
|
|
e74fc3a64f | ||
|
|
ebd90b9ba9 | ||
|
|
c16a453291 | ||
|
|
9f87a0b285 | ||
|
|
4affcbf877 | ||
|
|
f04935c85e | ||
|
|
8a80a23c93 | ||
|
|
645d0312c2 | ||
|
|
5036935c41 | ||
|
|
5043212b76 | ||
|
|
e163a3986a | ||
|
|
ea0fab18ba | ||
|
|
375aaa3f60 | ||
|
|
9afe2884c7 | ||
|
|
12e8b76e5f | ||
|
|
609526f97f | ||
|
|
53cc62c31b | ||
|
|
f64b8ea09d | ||
|
|
a122c376ef | ||
|
|
8d60cc6316 | ||
|
|
fb4da1e7b7 | ||
|
|
ed29345c22 | ||
|
|
62e9c76ee8 | ||
|
|
4939d6d842 | ||
|
|
f858bd1c6e | ||
|
|
47ff6b9faa | ||
|
|
a14df4a98a | ||
|
|
7b95807fa0 | ||
|
|
46f3db6bb8 | ||
|
|
07f8402552 | ||
|
|
3614424e10 | ||
|
|
53a55c121b | ||
|
|
02c661b883 | ||
|
|
807bbb75f1 | ||
|
|
4e72fcc3c2 | ||
|
|
8f35527592 | ||
|
|
677a07cb9a | ||
|
|
972c39c4fe | ||
|
|
e61d106008 | ||
|
|
fbaa254016 | ||
|
|
037b10d05a | ||
|
|
718a5b5495 | ||
|
|
c75e7726ea | ||
|
|
908e8c24ab | ||
|
|
4ea434e5d2 | ||
|
|
5ceb889ac9 | ||
|
|
4449fe9675 | ||
|
|
431166d995 | ||
|
|
652dd5196d | ||
|
|
d373d0c038 | ||
|
|
ba0c668fec | ||
|
|
4041b13c20 | ||
|
|
6f23ce36ce | ||
|
|
b32cc03203 | ||
|
|
1682c63d77 | ||
|
|
e2a292d278 | ||
|
|
5acce960f4 | ||
|
|
62ffe14a7e | ||
|
|
513f83bb7f | ||
|
|
69d242d21c | ||
|
|
f38fb19d9d | ||
|
|
d1973ca513 | ||
|
|
5b4884fac9 | ||
|
|
323d4b6f68 | ||
|
|
12159420e1 | ||
|
|
c8d412637a | ||
|
|
7ac975146e | ||
|
|
af8aebebb5 | ||
|
|
d971f72905 | ||
|
|
b5e211031b | ||
|
|
a4aafd1560 | ||
|
|
ebc1c76d77 | ||
|
|
7ff07ad321 | ||
|
|
ae189740de | ||
|
|
c835c35727 | ||
|
|
f784f0365d | ||
|
|
4e9cb032d1 | ||
|
|
33c3e8d3b2 | ||
|
|
1272dbd1d7 | ||
|
|
8e6bf35a16 | ||
|
|
d29c75f090 | ||
|
|
f8b2b3c81e | ||
|
|
1c2cf23a0c | ||
|
|
6114ffb3e1 | ||
|
|
a8a3178445 | ||
|
|
c65cbf97d9 | ||
|
|
0f461e35f6 | ||
|
|
8276d2875f | ||
|
|
66f473ef33 | ||
|
|
38f0ef3ff7 | ||
|
|
5b17e4da39 | ||
|
|
8a6eec38eb | ||
|
|
5d5cc2273f | ||
|
|
eddc8ece3d | ||
|
|
155b076420 | ||
|
|
4c8caf0ad3 | ||
|
|
4faf76ca11 | ||
|
|
bc4e135a8e | ||
|
|
65c6f3099e | ||
|
|
1c1b83549f | ||
|
|
bbb34f9536 | ||
|
|
01e505ac9c | ||
|
|
abfc88fed7 | ||
|
|
27a4bb3198 | ||
|
|
54a7494f17 | ||
|
|
10cd709ff9 | ||
|
|
e4bc756121 | ||
|
|
5f1322cecf | ||
|
|
b235f8c877 | ||
|
|
8c8852f163 | ||
|
|
dd00364807 | ||
|
|
338e6102a6 | ||
|
|
894f8cb139 | ||
|
|
c1c3f7d446 | ||
|
|
c5bf703c4c | ||
|
|
3b36564b18 | ||
|
|
a85aaf11fa | ||
|
|
66d166192e | ||
|
|
b0a2efc6f2 | ||
|
|
7b0c23f1ac | ||
|
|
887e1140fe | ||
|
|
17c9fe7d2f | ||
|
|
5063791535 | ||
|
|
3b2f4142aa | ||
|
|
b93702a046 | ||
|
|
470334333e | ||
|
|
2aace21a19 | ||
|
|
6d929061c3 | ||
|
|
5b395ce071 | ||
|
|
3fdb735590 | ||
|
|
434f97f66a | ||
|
|
99868904fe | ||
|
|
68d89c7d65 | ||
|
|
22323f91b1 | ||
|
|
5eccb9646d | ||
|
|
026b6ab6d5 | ||
|
|
766c7efe28 | ||
|
|
5e26221a1d | ||
|
|
21955e5453 | ||
|
|
498295ca2b | ||
|
|
aa267685c9 | ||
|
|
ea23753ea0 | ||
|
|
a19a41b6b5 | ||
|
|
f85b9ac3ec | ||
|
|
28ddd91c49 | ||
|
|
b8fa5b1ca9 | ||
|
|
17cabe15d5 | ||
|
|
f576472a14 | ||
|
|
e3fb66dd01 | ||
|
|
ed96db2a4f | ||
|
|
6ad8f76f1f | ||
|
|
cd0609f4fc | ||
|
|
cf7a4a4fda | ||
|
|
9a42eef8b1 | ||
|
|
bb4f6dc2ec | ||
|
|
845c778fa6 | ||
|
|
1afb375d30 | ||
|
|
eb15a6c9cd | ||
|
|
da9775509b | ||
|
|
20adf52cf2 | ||
|
|
dcc18ea4c6 | ||
|
|
c13d89b829 | ||
|
|
bf3ec9ad52 | ||
|
|
81ddd14381 | ||
|
|
25447aec39 | ||
|
|
e4c6b08c4e | ||
|
|
4063bb6147 | ||
|
|
90bd36bca6 | ||
|
|
ddea383433 | ||
|
|
241608e9ce | ||
|
|
f5897dcb1d | ||
|
|
28d4b9bbcb | ||
|
|
0b61567f9f | ||
|
|
ba9fee97cf | ||
|
|
717ad6498c | ||
|
|
ad8842f5c6 | ||
|
|
7649766b45 | ||
|
|
2b333ea31e | ||
|
|
be5231442b | ||
|
|
d2bcbf0dbe | ||
|
|
9e79af3b61 | ||
|
|
611b903ca7 | ||
|
|
e00f4890c7 | ||
|
|
62e6fe5849 | ||
|
|
e7c59f9e20 | ||
|
|
c13fb75cea | ||
|
|
f293b15728 | ||
|
|
e365f9d654 | ||
|
|
4fae14f333 | ||
|
|
2e3826c081 | ||
|
|
282e232e2a | ||
|
|
4e78ca63b8 | ||
|
|
1c4f101a9b | ||
|
|
c858b567ad | ||
|
|
e210488e0d | ||
|
|
db7180233f | ||
|
|
1924a5c92e | ||
|
|
3937d41561 | ||
|
|
4c186ffb83 | ||
|
|
341b55a1e6 | ||
|
|
2b333b97a2 | ||
|
|
003be7104b | ||
|
|
c54ca40aef | ||
|
|
063a572e6b | ||
|
|
8623bf7b4d | ||
|
|
513d2770de | ||
|
|
c2f082f655 | ||
|
|
802a0a7285 | ||
|
|
5aad083f3d | ||
|
|
1887621de8 | ||
|
|
97e0c1dd5a | ||
|
|
5407eed84b | ||
|
|
38fcbbb35a | ||
|
|
ed76a9361c | ||
|
|
7bd0815371 | ||
|
|
dff7203ee9 | ||
|
|
73ef27cd0d | ||
|
|
960ee37f2a | ||
|
|
2e3591557f | ||
|
|
c11f6f0f39 | ||
|
|
a84f88f098 | ||
|
|
bd3efbc9b5 |
@@ -8,8 +8,5 @@ KNOWN ABI BUGS
|
|||||||
sigset_t is too small on ARM and x86 (but correct on MIPS), so 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
|
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
|
atexit(3) handlers registered by a shared library aren't called on
|
||||||
dlclose(3); this only affects ARM. http://b/4998315
|
dlclose(3); this only affects ARM. http://b/4998315
|
||||||
|
|||||||
165
HACKING.txt
Normal file
165
HACKING.txt
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
Working on bionic
|
||||||
|
=================
|
||||||
|
|
||||||
|
What are the big pieces of bionic?
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
libc/ --- libc.so, libc.a
|
||||||
|
The C library. Stuff like fopen(3) and kill(2).
|
||||||
|
libm/ --- libm.so, libm.a
|
||||||
|
The math library. Traditionally Unix systems kept stuff like sin(3) and
|
||||||
|
cos(3) in a separate library to save space in the days before shared
|
||||||
|
libraries.
|
||||||
|
libdl/ --- libdl.so
|
||||||
|
The dynamic linker interface library. This is actually just a bunch of
|
||||||
|
stubs that the dynamic linker replaces with pointers to its own
|
||||||
|
implementation at runtime. This is where stuff like dlopen(3) lives.
|
||||||
|
libstdc++/ --- libstdc++.so
|
||||||
|
The C++ ABI support functions. The C++ compiler doesn't know how to
|
||||||
|
implement thread-safe static initialization and the like, so it just calls
|
||||||
|
functions that are supplied by the system. Stuff like __cxa_guard_acquire
|
||||||
|
and __cxa_pure_virtual live here.
|
||||||
|
|
||||||
|
linker/ --- /system/bin/linker and /system/bin/linker64
|
||||||
|
The dynamic linker. When you run a dynamically-linked executable, its ELF
|
||||||
|
file has a DT_INTERP entry that says "use the following program to start me".
|
||||||
|
On Android, that's either linker or linker64 (depending on whether it's a
|
||||||
|
32-bit or 64-bit executable). It's responsible for loading the ELF executable
|
||||||
|
into memory and resolving references to symbols (so that when your code tries
|
||||||
|
to jump to fopen(3), say, it lands in the right place).
|
||||||
|
|
||||||
|
tests/ --- unit tests
|
||||||
|
The tests/ directory contains unit tests. Roughly arranged as one file per
|
||||||
|
publicly-exported header file.
|
||||||
|
benchmarks/ --- benchmarks
|
||||||
|
The benchmarks/ directory contains benchmarks.
|
||||||
|
|
||||||
|
|
||||||
|
What's in libc/?
|
||||||
|
----------------
|
||||||
|
|
||||||
|
libc/
|
||||||
|
arch-arm/
|
||||||
|
arch-arm64/
|
||||||
|
arch-common/
|
||||||
|
arch-mips/
|
||||||
|
arch-mips64/
|
||||||
|
arch-x86/
|
||||||
|
arch-x86_64/
|
||||||
|
# Each architecture has its own subdirectory for stuff that isn't shared
|
||||||
|
# because it's architecture-specific. There will be a .mk file in here that
|
||||||
|
# drags in all the architecture-specific files.
|
||||||
|
bionic/
|
||||||
|
# Every architecture needs a handful of machine-specific assembler files.
|
||||||
|
# They live here.
|
||||||
|
include/
|
||||||
|
machine/
|
||||||
|
# The majority of header files are actually in libc/include/, but many
|
||||||
|
# of them pull in a <machine/something.h> for things like limits,
|
||||||
|
# endianness, and how floating point numbers are represented. Those
|
||||||
|
# headers live here.
|
||||||
|
string/
|
||||||
|
# Most architectures have a handful of optional assembler files
|
||||||
|
# implementing optimized versions of various routines. The <string.h>
|
||||||
|
# functions are particular favorites.
|
||||||
|
syscalls/
|
||||||
|
# The syscalls directories contain script-generated assembler files.
|
||||||
|
# See 'Adding system calls' later.
|
||||||
|
|
||||||
|
include/
|
||||||
|
# The public header files on everyone's include path. These are a mixture of
|
||||||
|
# files written by us and files taken from BSD.
|
||||||
|
|
||||||
|
kernel/
|
||||||
|
# The kernel uapi header files. These are scrubbed copies of the originals
|
||||||
|
# in external/kernel-headers/. These files must not be edited directly. The
|
||||||
|
# generate_uapi_headers.sh script should be used to go from a kernel tree to
|
||||||
|
# external/kernel-headers/ --- this takes care of the architecture-specific
|
||||||
|
# details. The update_all.py script should be used to regenerate bionic's
|
||||||
|
# scrubbed headers from external/kernel-headers/.
|
||||||
|
|
||||||
|
private/
|
||||||
|
# These are private header files meant for use within bionic itself.
|
||||||
|
|
||||||
|
stdio/
|
||||||
|
stdlib/
|
||||||
|
unistd/
|
||||||
|
# These are legacy files of unknown provenance. In the past, bionic was a
|
||||||
|
# mess of random versions of random files from all three of FreeBSD, NetBSD,
|
||||||
|
# and OpenBSD! We've been working to clean that up, but these directories
|
||||||
|
# are basically where all the stuff we haven't got to yet lives.
|
||||||
|
dns/
|
||||||
|
# Contains the DNS resolver (originates from NetBSD code).
|
||||||
|
|
||||||
|
upstream-dlmalloc/
|
||||||
|
upstream-freebsd/
|
||||||
|
upstream-netbsd/
|
||||||
|
upstream-openbsd/
|
||||||
|
# These directories contain unmolested upstream source. Any time we can
|
||||||
|
# just use a BSD implementation of something unmodified, we should.
|
||||||
|
# The structure under these directories mimics the upstream tree,
|
||||||
|
# but there's also...
|
||||||
|
android/
|
||||||
|
include/
|
||||||
|
# This is where we keep the hacks necessary to build BSD source
|
||||||
|
# in our world. The *-compat.h files are automatically included
|
||||||
|
# using -include, but we also provide equivalents for missing
|
||||||
|
# header/source files needed by the BSD implementation.
|
||||||
|
|
||||||
|
bionic/
|
||||||
|
# This is the biggest mess. The C++ files are files we own, typically
|
||||||
|
# because the Linux kernel interface is sufficiently different that we
|
||||||
|
# can't use any of the BSD implementations. The C files are usually
|
||||||
|
# legacy mess that needs to be sorted out, either by replacing it with
|
||||||
|
# current upstream source in one of the upstream directories or by
|
||||||
|
# switching the file to C++ and cleaning it up.
|
||||||
|
|
||||||
|
tools/
|
||||||
|
# Various tools used to maintain bionic.
|
||||||
|
|
||||||
|
tzcode/
|
||||||
|
# A modified superset of the IANA tzcode. Most of the modifications relate
|
||||||
|
# to Android's use of a single file (with corresponding index) to contain
|
||||||
|
# time zone data.
|
||||||
|
zoneinfo/
|
||||||
|
# Android-format time zone data.
|
||||||
|
# See 'Updating tzdata' later.
|
||||||
|
|
||||||
|
|
||||||
|
Adding system calls
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Adding a system call usually involves:
|
||||||
|
|
||||||
|
1. Add entries to SYSCALLS.TXT.
|
||||||
|
See SYSCALLS.TXT itself for documentation on the format.
|
||||||
|
2. Run the gensyscalls.py script.
|
||||||
|
3. Add constants (and perhaps types) to the appropriate header file.
|
||||||
|
Note that you should check to see whether the constants are already in
|
||||||
|
kernel uapi header files, in which case you just need to make sure that
|
||||||
|
the appropriate POSIX header file in libc/include/ includes the
|
||||||
|
relevant file or files.
|
||||||
|
4. Add function declarations to the appropriate header file.
|
||||||
|
5. Add at least basic tests. Even a test that deliberately supplies
|
||||||
|
an invalid argument helps check that we're generating the right symbol
|
||||||
|
and have the right declaration in the header file. (And strace(1) can
|
||||||
|
confirm that the correct system call is being made.)
|
||||||
|
|
||||||
|
|
||||||
|
Updating kernel header files
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
As mentioned above, this is currently a two-step process:
|
||||||
|
|
||||||
|
1. Use generate_uapi_headers.sh to go from a Linux source tree to appropriate
|
||||||
|
contents for external/kernel-headers/.
|
||||||
|
2. Run update_all.py to scrub those headers and import them into bionic.
|
||||||
|
|
||||||
|
|
||||||
|
Updating tzdata
|
||||||
|
---------------
|
||||||
|
|
||||||
|
This is fully automated:
|
||||||
|
|
||||||
|
1. Run update-tzdata.py.
|
||||||
|
|
||||||
80
benchmarks/Android.mk
Normal file
80
benchmarks/Android.mk
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
ifneq ($(BUILD_TINY_ANDROID), true)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Benchmarks.
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
benchmark_c_flags = \
|
||||||
|
-O2 \
|
||||||
|
-Wall -Wextra \
|
||||||
|
-Werror \
|
||||||
|
-fno-builtin \
|
||||||
|
-std=gnu++11 \
|
||||||
|
|
||||||
|
benchmark_src_files = \
|
||||||
|
benchmark_main.cpp \
|
||||||
|
math_benchmark.cpp \
|
||||||
|
property_benchmark.cpp \
|
||||||
|
pthread_benchmark.cpp \
|
||||||
|
semaphore_benchmark.cpp \
|
||||||
|
stdio_benchmark.cpp \
|
||||||
|
string_benchmark.cpp \
|
||||||
|
time_benchmark.cpp \
|
||||||
|
unistd_benchmark.cpp \
|
||||||
|
|
||||||
|
# Build benchmarks for the device (with bionic's .so). Run with:
|
||||||
|
# adb shell bionic-benchmarks
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := bionic-benchmarks
|
||||||
|
LOCAL_MODULE_STEM_32 := bionic-benchmarks32
|
||||||
|
LOCAL_MODULE_STEM_64 := bionic-benchmarks64
|
||||||
|
LOCAL_MULTILIB := both
|
||||||
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
||||||
|
LOCAL_CFLAGS += $(benchmark_c_flags)
|
||||||
|
LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
|
||||||
|
LOCAL_SHARED_LIBRARIES += libstlport
|
||||||
|
LOCAL_SRC_FILES := $(benchmark_src_files)
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
|
ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
|
||||||
|
ifeq ($(TARGET_ARCH),x86)
|
||||||
|
LINKER = linker
|
||||||
|
NATIVE_SUFFIX=32
|
||||||
|
else
|
||||||
|
LINKER = linker64
|
||||||
|
NATIVE_SUFFIX=64
|
||||||
|
endif
|
||||||
|
|
||||||
|
bionic-benchmarks-run-on-host: bionic-benchmarks $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
|
||||||
|
if [ ! -d /system -o ! -d /system/bin ]; then \
|
||||||
|
echo "Attempting to create /system/bin"; \
|
||||||
|
sudo mkdir -p -m 0777 /system/bin; \
|
||||||
|
fi
|
||||||
|
mkdir -p $(TARGET_OUT_DATA)/local/tmp
|
||||||
|
cp $(TARGET_OUT_EXECUTABLES)/$(LINKER) /system/bin
|
||||||
|
cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin
|
||||||
|
ANDROID_DATA=$(TARGET_OUT_DATA) \
|
||||||
|
ANDROID_ROOT=$(TARGET_OUT) \
|
||||||
|
LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \
|
||||||
|
$(TARGET_OUT_EXECUTABLES)/bionic-benchmarks$(NATIVE_SUFFIX) $(BIONIC_BENCHMARKS_FLAGS)
|
||||||
|
endif # linux-x86
|
||||||
|
|
||||||
|
endif # !BUILD_TINY_ANDROID
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
static int64_t gBytesProcessed;
|
static int64_t gBytesProcessed;
|
||||||
static int64_t gBenchmarkTotalTimeNs;
|
static int64_t gBenchmarkTotalTimeNs;
|
||||||
static int64_t gBenchmarkStartTimeNs;
|
static int64_t gBenchmarkStartTimeNs;
|
||||||
@@ -162,8 +164,8 @@ void Benchmark::RunWithArg(int arg) {
|
|||||||
snprintf(full_name, sizeof(full_name), "%s", name_);
|
snprintf(full_name, sizeof(full_name), "%s", name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%-20s %10lld %10lld%s\n", full_name,
|
printf("%-20s %10d %10" PRId64 "%s\n", full_name,
|
||||||
static_cast<int64_t>(iterations), gBenchmarkTotalTimeNs/iterations, throughput);
|
iterations, gBenchmarkTotalTimeNs/iterations, throughput);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
171
benchmarks/math_benchmark.cpp
Normal file
171
benchmarks/math_benchmark.cpp
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "benchmark.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
// Avoid optimization.
|
||||||
|
double d;
|
||||||
|
double v;
|
||||||
|
|
||||||
|
static void BM_math_sqrt(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = 2.0;
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += sqrt(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_sqrt);
|
||||||
|
|
||||||
|
static void BM_math_log10(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = 1234.0;
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += log10(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_log10);
|
||||||
|
|
||||||
|
static void BM_math_logb(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = 1234.0;
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += logb(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_logb);
|
||||||
|
|
||||||
|
static void BM_math_isinf_NORMAL(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = 1234.0; // FP_NORMAL
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += (isinf)(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_isinf_NORMAL);
|
||||||
|
|
||||||
|
static void BM_math_isinf_NAN(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = nan(""); // FP_NAN
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += (isinf)(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_isinf_NAN);
|
||||||
|
|
||||||
|
static void BM_math_isinf_INFINITE(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = HUGE_VAL; // FP_INFINITE
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += (isinf)(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_isinf_INFINITE);
|
||||||
|
|
||||||
|
static void BM_math_isinf_ZERO(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = 0.0; // FP_ZERO
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += (isinf)(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_isinf_ZERO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void BM_math_fpclassify_NORMAL(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = 1234.0; // FP_NORMAL
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += fpclassify(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_fpclassify_NORMAL);
|
||||||
|
|
||||||
|
static void BM_math_fpclassify_NAN(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = nan(""); // FP_NAN
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += fpclassify(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_fpclassify_NAN);
|
||||||
|
|
||||||
|
static void BM_math_fpclassify_INFINITE(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = HUGE_VAL; // FP_INFINITE
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += fpclassify(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_fpclassify_INFINITE);
|
||||||
|
|
||||||
|
static void BM_math_fpclassify_ZERO(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
d = 0.0;
|
||||||
|
v = 0.0; // FP_ZERO
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
d += fpclassify(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_math_fpclassify_ZERO);
|
||||||
@@ -15,6 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "benchmark.h"
|
#include "benchmark.h"
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
|
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
|
||||||
@@ -32,10 +35,17 @@ struct LocalPropertyTestState {
|
|||||||
LocalPropertyTestState(int nprops) : nprops(nprops), valid(false) {
|
LocalPropertyTestState(int nprops) : nprops(nprops), valid(false) {
|
||||||
static const char prop_name_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_";
|
static const char prop_name_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_";
|
||||||
|
|
||||||
char dir_template[] = "/data/local/tmp/prop-XXXXXX";
|
const char* android_data = getenv("ANDROID_DATA");
|
||||||
|
if (android_data == NULL) {
|
||||||
|
printf("ANDROID_DATA environment variable not set\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
char dir_template[PATH_MAX];
|
||||||
|
snprintf(dir_template, sizeof(dir_template), "%s/local/tmp/prop-XXXXXX", android_data);
|
||||||
char *dirname = mkdtemp(dir_template);
|
char *dirname = mkdtemp(dir_template);
|
||||||
if (!dirname) {
|
if (!dirname) {
|
||||||
perror("making temp file for test state failed (is /data/local/tmp writable?)");
|
printf("making temp file for test state failed (is %s/local/tmp writable?): %s\n",
|
||||||
|
android_data, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
104
benchmarks/pthread_benchmark.cpp
Normal file
104
benchmarks/pthread_benchmark.cpp
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "benchmark.h"
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
static void BM_pthread_self(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
pthread_self();
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_pthread_self);
|
||||||
|
|
||||||
|
static void BM_pthread_getspecific(int iters) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
pthread_key_t key;
|
||||||
|
pthread_key_create(&key, NULL);
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
pthread_getspecific(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
pthread_key_delete(key);
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_pthread_getspecific);
|
||||||
|
|
||||||
|
static void DummyPthreadOnceInitFunction() {
|
||||||
|
}
|
||||||
|
|
||||||
|
static void BM_pthread_once(int iters) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
pthread_once_t once = PTHREAD_ONCE_INIT;
|
||||||
|
pthread_once(&once, DummyPthreadOnceInitFunction);
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
pthread_once(&once, DummyPthreadOnceInitFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_pthread_once);
|
||||||
|
|
||||||
|
static void BM_pthread_mutex_lock(int iters) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
pthread_mutex_lock(&mutex);
|
||||||
|
pthread_mutex_unlock(&mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_pthread_mutex_lock);
|
||||||
|
|
||||||
|
static void BM_pthread_mutex_lock_ERRORCHECK(int iters) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
pthread_mutex_t mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER;
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
pthread_mutex_lock(&mutex);
|
||||||
|
pthread_mutex_unlock(&mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_pthread_mutex_lock_ERRORCHECK);
|
||||||
|
|
||||||
|
static void BM_pthread_mutex_lock_RECURSIVE(int iters) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
pthread_mutex_lock(&mutex);
|
||||||
|
pthread_mutex_unlock(&mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_pthread_mutex_lock_RECURSIVE);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 The Android Open Source Project
|
* Copyright (C) 2014 The Android Open Source Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -16,47 +16,34 @@
|
|||||||
|
|
||||||
#include "benchmark.h"
|
#include "benchmark.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <semaphore.h>
|
||||||
|
|
||||||
// Avoid optimization.
|
static void BM_semaphore_sem_getvalue(int iters) {
|
||||||
double d;
|
StopBenchmarkTiming();
|
||||||
double v;
|
sem_t semaphore;
|
||||||
|
sem_init(&semaphore, 1, 1);
|
||||||
static void BM_math_sqrt(int iters) {
|
|
||||||
StartBenchmarkTiming();
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
d = 0.0;
|
|
||||||
v = 2.0;
|
|
||||||
for (int i = 0; i < iters; ++i) {
|
for (int i = 0; i < iters; ++i) {
|
||||||
d += sqrt(v);
|
int dummy;
|
||||||
|
sem_getvalue(&semaphore, &dummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
StopBenchmarkTiming();
|
StopBenchmarkTiming();
|
||||||
}
|
}
|
||||||
BENCHMARK(BM_math_sqrt);
|
BENCHMARK(BM_semaphore_sem_getvalue);
|
||||||
|
|
||||||
static void BM_math_log10(int iters) {
|
static void BM_semaphore_sem_wait_sem_post(int iters) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
sem_t semaphore;
|
||||||
|
sem_init(&semaphore, 1, 1);
|
||||||
StartBenchmarkTiming();
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
d = 0.0;
|
|
||||||
v = 1234.0;
|
|
||||||
for (int i = 0; i < iters; ++i) {
|
for (int i = 0; i < iters; ++i) {
|
||||||
d += log10(v);
|
sem_wait(&semaphore);
|
||||||
|
sem_post(&semaphore);
|
||||||
}
|
}
|
||||||
|
|
||||||
StopBenchmarkTiming();
|
StopBenchmarkTiming();
|
||||||
}
|
}
|
||||||
BENCHMARK(BM_math_log10);
|
BENCHMARK(BM_semaphore_sem_wait_sem_post);
|
||||||
|
|
||||||
static void BM_math_logb(int iters) {
|
|
||||||
StartBenchmarkTiming();
|
|
||||||
|
|
||||||
d = 0.0;
|
|
||||||
v = 1234.0;
|
|
||||||
for (int i = 0; i < iters; ++i) {
|
|
||||||
d += logb(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
StopBenchmarkTiming();
|
|
||||||
}
|
|
||||||
BENCHMARK(BM_math_logb);
|
|
||||||
61
benchmarks/stdio_benchmark.cpp
Normal file
61
benchmarks/stdio_benchmark.cpp
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "benchmark.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define KB 1024
|
||||||
|
#define MB 1024*KB
|
||||||
|
|
||||||
|
#define AT_COMMON_SIZES \
|
||||||
|
Arg(1)->Arg(2)->Arg(3)->Arg(4)->Arg(8)->Arg(16)->Arg(32)->Arg(64)->Arg(512)-> \
|
||||||
|
Arg(1*KB)->Arg(4*KB)->Arg(8*KB)->Arg(16*KB)->Arg(64*KB)
|
||||||
|
|
||||||
|
static void BM_stdio_fread(int iters, int chunk_size) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
FILE* fp = fopen("/dev/zero", "rw");
|
||||||
|
char* buf = new char[chunk_size];
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
fread(buf, chunk_size, 1, fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(chunk_size));
|
||||||
|
delete[] buf;
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_stdio_fread)->AT_COMMON_SIZES;
|
||||||
|
|
||||||
|
|
||||||
|
static void BM_stdio_fwrite(int iters, int chunk_size) {
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
FILE* fp = fopen("/dev/zero", "rw");
|
||||||
|
char* buf = new char[chunk_size];
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
fwrite(buf, chunk_size, 1, fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
SetBenchmarkBytesProcessed(int64_t(iters) * int64_t(chunk_size));
|
||||||
|
delete[] buf;
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_stdio_fwrite)->AT_COMMON_SIZES;
|
||||||
30
benchmarks/unistd_benchmark.cpp
Normal file
30
benchmarks/unistd_benchmark.cpp
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "benchmark.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
static void BM_unistd_getpid(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
getpid();
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_unistd_getpid);
|
||||||
1104
libc/Android.mk
1104
libc/Android.mk
File diff suppressed because it is too large
Load Diff
1139
libc/NOTICE
1139
libc/NOTICE
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
# where:
|
# where:
|
||||||
# arch_list ::= "all" | arch+
|
# arch_list ::= "all" | arch+
|
||||||
# arch ::= "aarch64" | "arm" | "mips" | "x86" | "x86_64"
|
# arch ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64"
|
||||||
#
|
#
|
||||||
# Note:
|
# Note:
|
||||||
# - syscall_name corresponds to the name of the syscall, which may differ from
|
# - syscall_name corresponds to the name of the syscall, which may differ from
|
||||||
@@ -27,53 +27,62 @@
|
|||||||
int execve(const char*, char* const*, char* const*) all
|
int execve(const char*, char* const*, char* const*) all
|
||||||
|
|
||||||
uid_t getuid:getuid32() arm,x86
|
uid_t getuid:getuid32() arm,x86
|
||||||
uid_t getuid:getuid() aarch64,mips,x86_64
|
uid_t getuid:getuid() arm64,mips,mips64,x86_64
|
||||||
gid_t getgid:getgid32() arm,x86
|
gid_t getgid:getgid32() arm,x86
|
||||||
gid_t getgid:getgid() aarch64,mips,x86_64
|
gid_t getgid:getgid() arm64,mips,mips64,x86_64
|
||||||
uid_t geteuid:geteuid32() arm,x86
|
uid_t geteuid:geteuid32() arm,x86
|
||||||
uid_t geteuid:geteuid() aarch64,mips,x86_64
|
uid_t geteuid:geteuid() arm64,mips,mips64,x86_64
|
||||||
gid_t getegid:getegid32() arm,x86
|
gid_t getegid:getegid32() arm,x86
|
||||||
gid_t getegid:getegid() aarch64,mips,x86_64
|
gid_t getegid:getegid() arm64,mips,mips64,x86_64
|
||||||
uid_t getresuid:getresuid32(uid_t* ruid, uid_t* euid, uid_t* suid) arm,x86
|
uid_t getresuid:getresuid32(uid_t* ruid, uid_t* euid, uid_t* suid) arm,x86
|
||||||
uid_t getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid) aarch64,mips,x86_64
|
uid_t getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid) arm64,mips,mips64,x86_64
|
||||||
gid_t getresgid:getresgid32(gid_t* rgid, gid_t* egid, gid_t* sgid) arm,x86
|
gid_t getresgid:getresgid32(gid_t* rgid, gid_t* egid, gid_t* sgid) arm,x86
|
||||||
gid_t getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid) aarch64,mips,x86_64
|
gid_t getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid) arm64,mips,mips64,x86_64
|
||||||
pid_t gettid() all
|
pid_t gettid() all
|
||||||
ssize_t readahead(int, off64_t, size_t) all
|
ssize_t readahead(int, off64_t, size_t) all
|
||||||
int getgroups:getgroups32(int, gid_t*) arm,x86
|
int getgroups:getgroups32(int, gid_t*) arm,x86
|
||||||
int getgroups:getgroups(int, gid_t*) aarch64,mips,x86_64
|
int getgroups:getgroups(int, gid_t*) arm64,mips,mips64,x86_64
|
||||||
pid_t getpgid(pid_t) all
|
pid_t getpgid(pid_t) all
|
||||||
pid_t getppid() all
|
pid_t getppid() all
|
||||||
pid_t getsid(pid_t) all
|
pid_t getsid(pid_t) all
|
||||||
pid_t setsid() all
|
pid_t setsid() all
|
||||||
int setgid:setgid32(gid_t) arm,x86
|
int setgid:setgid32(gid_t) arm,x86
|
||||||
int setgid:setgid(gid_t) aarch64,mips,x86_64
|
int setgid:setgid(gid_t) arm64,mips,mips64,x86_64
|
||||||
int setuid:setuid32(uid_t) arm,x86
|
int setuid:setuid32(uid_t) arm,x86
|
||||||
int setuid:setuid(uid_t) aarch64,mips,x86_64
|
int setuid:setuid(uid_t) arm64,mips,mips64,x86_64
|
||||||
int setreuid:setreuid32(uid_t, uid_t) arm,x86
|
int setreuid:setreuid32(uid_t, uid_t) arm,x86
|
||||||
int setreuid:setreuid(uid_t, uid_t) aarch64,mips,x86_64
|
int setreuid:setreuid(uid_t, uid_t) arm64,mips,mips64,x86_64
|
||||||
int setresuid:setresuid32(uid_t, uid_t, uid_t) arm,x86
|
int setresuid:setresuid32(uid_t, uid_t, uid_t) arm,x86
|
||||||
int setresuid:setresuid(uid_t, uid_t, uid_t) aarch64,mips,x86_64
|
int setresuid:setresuid(uid_t, uid_t, uid_t) arm64,mips,mips64,x86_64
|
||||||
int setresgid:setresgid32(gid_t, gid_t, gid_t) arm,x86
|
int setresgid:setresgid32(gid_t, gid_t, gid_t) arm,x86
|
||||||
int setresgid:setresgid(gid_t, gid_t, gid_t) aarch64,mips,x86_64
|
int setresgid:setresgid(gid_t, gid_t, gid_t) arm64,mips,mips64,x86_64
|
||||||
void* __brk:brk(void*) all
|
void* __brk:brk(void*) all
|
||||||
int kill(pid_t, int) all
|
int kill(pid_t, int) all
|
||||||
int tkill(pid_t tid, int sig) all
|
int tkill(pid_t tid, int sig) all
|
||||||
int tgkill(pid_t tgid, pid_t tid, int sig) all
|
int tgkill(pid_t tgid, pid_t tid, int sig) all
|
||||||
int __ptrace:ptrace(int request, int pid, void* addr, void* data) all
|
int __ptrace:ptrace(int request, int pid, void* addr, void* data) all
|
||||||
int __set_thread_area:set_thread_area(void* user_desc) mips,x86
|
int __set_thread_area:set_thread_area(void* user_desc) mips,mips64,x86
|
||||||
int __getpriority:getpriority(int, int) all
|
|
||||||
int setpriority(int, int, int) all
|
# <sys/resource.h>
|
||||||
int setrlimit(int resource, const struct rlimit* rlp) all
|
int getrusage(int, struct rusage*) all
|
||||||
int getrlimit:ugetrlimit(int resource, struct rlimit* rlp) arm,x86
|
int __getpriority:getpriority(int, int) all
|
||||||
int getrlimit:getrlimit(int resource, struct rlimit* rlp) aarch64,mips,x86_64
|
int setpriority(int, int, int) all
|
||||||
int getrusage(int who, struct rusage* r_usage) all
|
# On LP64, rlimit and rlimit64 are the same.
|
||||||
|
# On 32-bit systems we use prlimit64 to implement the rlimit64 functions.
|
||||||
|
int getrlimit:ugetrlimit(int, struct rlimit*) arm,x86
|
||||||
|
int getrlimit(int, struct rlimit*) mips
|
||||||
|
int getrlimit|getrlimit64(int, struct rlimit*) arm64,mips64,x86_64
|
||||||
|
int setrlimit(int, const struct rlimit*) arm,mips,x86
|
||||||
|
int setrlimit|setrlimit64(int, const struct rlimit*) arm64,mips64,x86_64
|
||||||
|
int prlimit64|prlimit(pid_t, int, struct rlimit64*, const struct rlimit64*) arm64,mips64,x86_64
|
||||||
|
int prlimit64(pid_t, int, struct rlimit64*, const struct rlimit64*) arm,mips,x86
|
||||||
|
|
||||||
int setgroups:setgroups32(int, const gid_t*) arm,x86
|
int setgroups:setgroups32(int, const gid_t*) arm,x86
|
||||||
int setgroups:setgroups(int, const gid_t*) aarch64,mips,x86_64
|
int setgroups:setgroups(int, const gid_t*) arm64,mips,mips64,x86_64
|
||||||
int setpgid(pid_t, pid_t) all
|
int setpgid(pid_t, pid_t) all
|
||||||
pid_t vfork(void) arm
|
pid_t vfork(void) arm
|
||||||
int setregid:setregid32(gid_t, gid_t) arm,x86
|
int setregid:setregid32(gid_t, gid_t) arm,x86
|
||||||
int setregid:setregid(gid_t, gid_t) aarch64,mips,x86_64
|
int setregid:setregid(gid_t, gid_t) arm64,mips,mips64,x86_64
|
||||||
int chroot(const char*) all
|
int chroot(const char*) all
|
||||||
# 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.
|
||||||
@@ -88,13 +97,11 @@ int acct(const char* filepath) all
|
|||||||
ssize_t read(int, void*, size_t) all
|
ssize_t read(int, void*, size_t) all
|
||||||
ssize_t write(int, const void*, size_t) all
|
ssize_t write(int, const void*, size_t) all
|
||||||
ssize_t pread64(int, void*, size_t, off64_t) arm,mips,x86
|
ssize_t pread64(int, void*, size_t, off64_t) arm,mips,x86
|
||||||
ssize_t pread64|pread(int, void*, size_t, off_t) aarch64,x86_64
|
ssize_t pread64|pread(int, void*, size_t, off_t) arm64,mips64,x86_64
|
||||||
ssize_t pwrite64(int, void*, size_t, off64_t) arm,mips,x86
|
ssize_t pwrite64(int, void*, size_t, off64_t) arm,mips,x86
|
||||||
ssize_t pwrite64|pwrite(int, void*, size_t, off_t) aarch64,x86_64
|
ssize_t pwrite64|pwrite(int, void*, size_t, off_t) arm64,mips64,x86_64
|
||||||
int close(int) all
|
int close(int) all
|
||||||
pid_t getpid() all
|
pid_t getpid() all
|
||||||
void* mmap(void*, size_t, int, int, int, long) aarch64,x86_64
|
|
||||||
void* __mmap2:mmap2(void*, size_t, int, int, int, long) arm,mips,x86
|
|
||||||
int munmap(void*, size_t) all
|
int munmap(void*, size_t) all
|
||||||
void* mremap(void*, size_t, size_t, unsigned long) all
|
void* mremap(void*, size_t, size_t, unsigned long) all
|
||||||
int msync(const void*, size_t, int) all
|
int msync(const void*, size_t, int) all
|
||||||
@@ -109,31 +116,35 @@ int __ioctl:ioctl(int, int, void*) all
|
|||||||
int readv(int, const struct iovec*, int) all
|
int readv(int, const struct iovec*, int) all
|
||||||
int writev(int, const struct iovec*, int) all
|
int writev(int, const struct iovec*, int) all
|
||||||
int __fcntl64:fcntl64(int, int, void*) arm,mips,x86
|
int __fcntl64:fcntl64(int, int, void*) arm,mips,x86
|
||||||
int fcntl(int, int, void*) aarch64,x86_64
|
int fcntl(int, int, void*) arm64,mips64,x86_64
|
||||||
int flock(int, int) all
|
int flock(int, int) all
|
||||||
int fchmod(int, mode_t) all
|
int fchmod(int, mode_t) all
|
||||||
int dup(int) all
|
int dup(int) all
|
||||||
int pipe2(int*, int) all
|
int pipe2(int*, int) all
|
||||||
int dup3(int, int, int) all
|
int dup3(int, int, int) all
|
||||||
int getdents:getdents64(unsigned int, struct dirent*, unsigned int) all
|
|
||||||
int fsync(int) all
|
int fsync(int) all
|
||||||
int fdatasync(int) all
|
int fdatasync(int) all
|
||||||
int fchown:fchown32(int, uid_t, gid_t) arm,x86
|
int fchown:fchown32(int, uid_t, gid_t) arm,x86
|
||||||
int fchown:fchown(int, uid_t, gid_t) aarch64,mips,x86_64
|
int fchown:fchown(int, uid_t, gid_t) arm64,mips,mips64,x86_64
|
||||||
void sync(void) all
|
void sync(void) all
|
||||||
int __fstatfs64:fstatfs64(int, size_t, struct statfs*) arm,mips,x86
|
|
||||||
int fstatfs(int, struct statfs*) aarch64,x86_64
|
|
||||||
int fsetxattr(int, const char*, const void*, size_t, int) all
|
int fsetxattr(int, const char*, const void*, size_t, int) all
|
||||||
ssize_t fgetxattr(int, const char*, void*, size_t) all
|
ssize_t fgetxattr(int, const char*, void*, size_t) all
|
||||||
ssize_t flistxattr(int, char*, size_t) all
|
ssize_t flistxattr(int, char*, size_t) all
|
||||||
int fremovexattr(int, const char*) all
|
int fremovexattr(int, const char*) all
|
||||||
|
|
||||||
|
# mips64 doesn't have getdents64 until 3.10 kernels.
|
||||||
|
# We need this special-case hack as long as we need to support mips64 on older kernels.
|
||||||
|
# The currently-available Debian qemu image is on a 3.2 kernel.
|
||||||
|
int getdents:getdents64(unsigned int, struct dirent*, unsigned int) arm,arm64,mips,x86,x86_64
|
||||||
|
int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int) mips64
|
||||||
|
int __getdents:getdents(unsigned int, void*, unsigned int) mips64
|
||||||
|
|
||||||
int __openat:openat(int, const char*, int, mode_t) all
|
int __openat:openat(int, const char*, int, mode_t) all
|
||||||
int faccessat(int, const char*, int, int) all
|
int faccessat(int, const char*, int, int) all
|
||||||
int fchmodat(int, const char*, mode_t, int) all
|
int fchmodat(int, const char*, mode_t, int) all
|
||||||
int fchownat(int, const char*, uid_t, gid_t, int) all
|
int fchownat(int, const char*, uid_t, gid_t, int) all
|
||||||
int fstatat:fstatat64(int, const char*, struct stat*, int) arm,mips,x86
|
int fstatat64|fstatat:fstatat64(int, const char*, struct stat*, int) arm,mips,x86
|
||||||
int fstatat:newfstatat(int, const char*, struct stat*, int) aarch64,x86_64
|
int fstatat64|fstatat:newfstatat(int, const char*, struct stat*, int) arm64,mips64,x86_64
|
||||||
int linkat(int, const char*, int, const char*, int) all
|
int linkat(int, const char*, int, const char*, int) all
|
||||||
int mkdirat(int, const char*, mode_t) all
|
int mkdirat(int, const char*, mode_t) all
|
||||||
int mknodat(int, const char*, mode_t, dev_t) all
|
int mknodat(int, const char*, mode_t, dev_t) all
|
||||||
@@ -149,23 +160,35 @@ int utimensat(int, const char*, const struct timespec times[2], int) all
|
|||||||
# That means that every system call in this section should take three lines.
|
# That means that every system call in this section should take three lines.
|
||||||
off_t lseek(int, off_t, int) arm,mips,x86
|
off_t lseek(int, off_t, int) arm,mips,x86
|
||||||
int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,mips,x86
|
int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) arm,mips,x86
|
||||||
off_t lseek|lseek64(int, off_t, int) aarch64,x86_64
|
off_t lseek|lseek64(int, off_t, int) arm64,mips64,x86_64
|
||||||
int ftruncate(int, off_t) arm,mips,x86
|
int ftruncate(int, off_t) arm,mips,x86
|
||||||
int ftruncate64(int, off64_t) arm,mips,x86
|
int ftruncate64(int, off64_t) arm,mips,x86
|
||||||
int ftruncate|ftruncate64(int, off_t) aarch64,x86_64
|
int ftruncate|ftruncate64(int, off_t) arm64,mips64,x86_64
|
||||||
ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) arm,mips,x86
|
ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) arm,mips,x86
|
||||||
ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count) arm,mips,x86
|
ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count) arm,mips,x86
|
||||||
ssize_t sendfile|sendfile64(int out_fd, int in_fd, off_t* offset, size_t count) aarch64,x86_64
|
ssize_t sendfile|sendfile64(int out_fd, int in_fd, off_t* offset, size_t count) arm64,mips64,x86_64
|
||||||
int truncate(const char*, off_t) arm,mips,x86
|
int truncate(const char*, off_t) arm,mips,x86
|
||||||
int truncate64(const char*, off64_t) arm,mips,x86
|
int truncate64(const char*, off64_t) arm,mips,x86
|
||||||
int truncate|truncate64(const char*, off_t) aarch64,x86_64
|
int truncate|truncate64(const char*, off_t) arm64,mips64,x86_64
|
||||||
|
# (mmap only gets two lines because we only used the 64-bit variant on 32-bit systems.)
|
||||||
|
void* __mmap2:mmap2(void*, size_t, int, int, int, long) arm,mips,x86
|
||||||
|
void* mmap|mmap64(void*, size_t, int, int, int, off_t) arm64,mips64,x86_64
|
||||||
|
# (fallocate only gets two lines because there is no 32-bit variant.)
|
||||||
|
int fallocate64:fallocate(int, int, off64_t, off64_t) arm,mips,x86
|
||||||
|
int fallocate|fallocate64(int, int, off_t, off_t) arm64,mips64,x86_64
|
||||||
|
|
||||||
|
int __fstatfs64:fstatfs64(int, size_t, struct statfs*) arm,mips,x86
|
||||||
|
int fstatfs64|fstatfs:fstatfs(int, struct statfs*) arm64,mips64,x86_64
|
||||||
|
int __statfs64:statfs64(const char*, size_t, struct statfs*) arm,mips,x86
|
||||||
|
int statfs64|statfs:statfs(const char*, struct statfs*) arm64,mips64,x86_64
|
||||||
|
|
||||||
|
int fstat64|fstat:fstat64(int, struct stat*) arm,mips,x86
|
||||||
|
int fstat64|fstat:fstat(int, struct stat*) arm64,mips64,x86_64
|
||||||
|
|
||||||
# file system
|
# file system
|
||||||
int chdir(const char*) all
|
int chdir(const char*) all
|
||||||
int mount(const char*, const char*, const char*, unsigned long, const void*) all
|
int mount(const char*, const char*, const char*, unsigned long, const void*) all
|
||||||
int umount2(const char*, int) all
|
int umount2(const char*, int) all
|
||||||
int fstat:fstat64(int, struct stat*) arm,mips,x86
|
|
||||||
int fstat(int, struct stat*) aarch64,x86_64
|
|
||||||
int __getcwd:getcwd(char* buf, size_t size) all
|
int __getcwd:getcwd(char* buf, size_t size) all
|
||||||
int fchdir(int) all
|
int fchdir(int) all
|
||||||
int setxattr(const char*, const char*, const void*, size_t, int) all
|
int setxattr(const char*, const char*, const void*, size_t, int) all
|
||||||
@@ -176,9 +199,6 @@ ssize_t listxattr(const char*, char*, size_t) all
|
|||||||
ssize_t llistxattr(const char*, char*, size_t) all
|
ssize_t llistxattr(const char*, char*, size_t) all
|
||||||
int removexattr(const char*, const char*) all
|
int removexattr(const char*, const char*) all
|
||||||
int lremovexattr(const char*, const char*) all
|
int lremovexattr(const char*, const char*) all
|
||||||
int __statfs64:statfs64(const char*, size_t, struct statfs*) arm,mips,x86
|
|
||||||
int statfs(const char*, struct statfs*) aarch64,x86_64
|
|
||||||
long unshare(unsigned long) all
|
|
||||||
int swapon(const char*, int) all
|
int swapon(const char*, int) all
|
||||||
int swapoff(const char*) all
|
int swapoff(const char*) all
|
||||||
|
|
||||||
@@ -193,11 +213,11 @@ int clock_getres(clockid_t clk_id, struct timespec* res) all
|
|||||||
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec* req, struct timespec* rem) all
|
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec* req, struct timespec* rem) all
|
||||||
int getitimer(int, const struct itimerval*) all
|
int getitimer(int, const struct itimerval*) all
|
||||||
int setitimer(int, const struct itimerval*, struct itimerval*) all
|
int setitimer(int, const struct itimerval*, struct itimerval*) all
|
||||||
int __timer_create:timer_create(clockid_t clockid, struct sigevent* evp, timer_t* timerid) all
|
int __timer_create:timer_create(clockid_t clockid, struct sigevent* evp, __kernel_timer_t* timerid) all
|
||||||
int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) all
|
int __timer_settime:timer_settime(__kernel_timer_t, int, const struct itimerspec*, struct itimerspec*) all
|
||||||
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) all
|
int __timer_gettime:timer_gettime(__kernel_timer_t, struct itimerspec*) all
|
||||||
int __timer_getoverrun:timer_getoverrun(timer_t) all
|
int __timer_getoverrun:timer_getoverrun(__kernel_timer_t) all
|
||||||
int __timer_delete:timer_delete(timer_t) all
|
int __timer_delete:timer_delete(__kernel_timer_t) all
|
||||||
int timerfd_create(clockid_t, int) all
|
int timerfd_create(clockid_t, int) all
|
||||||
int timerfd_settime(int, int, const struct itimerspec*, struct itimerspec*) all
|
int timerfd_settime(int, int, const struct itimerspec*, struct itimerspec*) all
|
||||||
int timerfd_gettime(int, struct itimerspec*) all
|
int timerfd_gettime(int, struct itimerspec*) all
|
||||||
@@ -212,21 +232,24 @@ int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t*, struct siginfo_t*, st
|
|||||||
int signalfd4(int, const sigset_t*, size_t, int) all
|
int signalfd4(int, const sigset_t*, size_t, int) all
|
||||||
|
|
||||||
# sockets
|
# sockets
|
||||||
int socket(int, int, int) aarch64,arm,mips,x86_64
|
int socket(int, int, int) arm,arm64,mips,mips64,x86_64
|
||||||
int socketpair(int, int, int, int*) aarch64,arm,mips,x86_64
|
int socketpair(int, int, int, int*) arm,arm64,mips,mips64,x86_64
|
||||||
int bind(int, struct sockaddr*, int) aarch64,arm,mips,x86_64
|
int bind(int, struct sockaddr*, int) arm,arm64,mips,mips64,x86_64
|
||||||
int connect(int, struct sockaddr*, socklen_t) aarch64,arm,mips,x86_64
|
int connect(int, struct sockaddr*, socklen_t) arm,arm64,mips,mips64,x86_64
|
||||||
int listen(int, int) aarch64,arm,mips,x86_64
|
int listen(int, int) arm,arm64,mips,mips64,x86_64
|
||||||
int accept(int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
|
int accept(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64
|
||||||
int getsockname(int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
|
int accept4(int, struct sockaddr*, socklen_t*, int) arm,arm64,mips,mips64,x86_64
|
||||||
int getpeername(int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
|
int getsockname(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64
|
||||||
int sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t) aarch64,arm,mips,x86_64
|
int getpeername(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64
|
||||||
int recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*) aarch64,arm,mips,x86_64
|
int sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t) arm,arm64,mips,mips64,x86_64
|
||||||
int shutdown(int, int) aarch64,arm,mips,x86_64
|
int recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64
|
||||||
int setsockopt(int, int, int, const void*, socklen_t) aarch64,arm,mips,x86_64
|
int shutdown(int, int) arm,arm64,mips,mips64,x86_64
|
||||||
int getsockopt(int, int, int, void*, socklen_t*) aarch64,arm,mips,x86_64
|
int setsockopt(int, int, int, const void*, socklen_t) arm,arm64,mips,mips64,x86_64
|
||||||
int sendmsg(int, const struct msghdr*, unsigned int) aarch64,arm,mips,x86_64
|
int getsockopt(int, int, int, void*, socklen_t*) arm,arm64,mips,mips64,x86_64
|
||||||
int recvmsg(int, struct msghdr*, unsigned int) aarch64,arm,mips,x86_64
|
int sendmsg(int, const struct msghdr*, unsigned int) arm,arm64,mips,mips64,x86_64
|
||||||
|
int recvmsg(int, struct msghdr*, unsigned int) arm,arm64,mips,mips64,x86_64
|
||||||
|
int recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*) arm,arm64,mips,mips64,x86_64
|
||||||
|
int sendmmsg(int, struct mmsghdr*, unsigned int, int) arm,arm64,mips,mips64,x86_64
|
||||||
|
|
||||||
# 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) x86
|
int socket:socketcall:1(int, int, int) x86
|
||||||
@@ -244,6 +267,9 @@ int setsockopt:socketcall:14(int, int, int, const void*, socklen_t) x
|
|||||||
int getsockopt:socketcall:15(int, int, int, void*, socklen_t*) x86
|
int getsockopt:socketcall:15(int, int, int, void*, socklen_t*) x86
|
||||||
int sendmsg:socketcall:16(int, const struct msghdr*, unsigned int) x86
|
int sendmsg:socketcall:16(int, const struct msghdr*, unsigned int) x86
|
||||||
int recvmsg:socketcall:17(int, struct msghdr*, unsigned int) x86
|
int recvmsg:socketcall:17(int, struct msghdr*, unsigned int) x86
|
||||||
|
int accept4:socketcall:18(int, struct sockaddr*, socklen_t*, int) x86
|
||||||
|
int recvmmsg:socketcall:19(int, struct mmsghdr*, unsigned int, int, const struct timespec*) x86
|
||||||
|
int sendmmsg:socketcall:20(int, struct mmsghdr*, unsigned int, int) x86
|
||||||
|
|
||||||
# scheduler & real-time
|
# scheduler & real-time
|
||||||
int sched_setscheduler(pid_t pid, int policy, const struct sched_param* param) all
|
int sched_setscheduler(pid_t pid, int policy, const struct sched_param* param) all
|
||||||
@@ -255,8 +281,10 @@ int sched_get_priority_max(int policy) all
|
|||||||
int sched_get_priority_min(int policy) all
|
int sched_get_priority_min(int policy) all
|
||||||
int sched_rr_get_interval(pid_t pid, struct timespec* interval) all
|
int sched_rr_get_interval(pid_t pid, struct timespec* interval) all
|
||||||
int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) all
|
int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) all
|
||||||
|
int setns(int, int) all
|
||||||
|
int unshare(int) all
|
||||||
int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) all
|
int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) all
|
||||||
int __getcpu:getcpu(unsigned* cpu, unsigned* node, void* unused) all
|
int __getcpu:getcpu(unsigned*, unsigned*, void*) all
|
||||||
|
|
||||||
# io priorities
|
# io priorities
|
||||||
int ioprio_set(int which, int who, int ioprio) all
|
int ioprio_set(int which, int who, int ioprio) all
|
||||||
@@ -280,7 +308,7 @@ int __epoll_pwait:epoll_pwait(int, struct epoll_event*, int, int, const sigset_t
|
|||||||
|
|
||||||
int eventfd:eventfd2(unsigned int, int) all
|
int eventfd:eventfd2(unsigned int, int) all
|
||||||
|
|
||||||
void _exit:exit_group(int) all
|
void _exit|_Exit:exit_group(int) all
|
||||||
void __exit:exit(int) all
|
void __exit:exit(int) all
|
||||||
|
|
||||||
int futex(void*, int, int, void*, void*, int) all
|
int futex(void*, int, int, void*, void*, int) all
|
||||||
@@ -302,4 +330,4 @@ int __set_tls:__ARM_NR_set_tls(void*) arm
|
|||||||
int cacheflush:__ARM_NR_cacheflush(long start, long end, long flags) arm
|
int cacheflush:__ARM_NR_cacheflush(long start, long end, long flags) arm
|
||||||
|
|
||||||
# MIPS-specific
|
# MIPS-specific
|
||||||
int _flush_cache:cacheflush(char* addr, const int nbytes, const int op) mips
|
int _flush_cache:cacheflush(char* addr, const int nbytes, const int op) mips,mips64
|
||||||
|
|||||||
@@ -1,188 +0,0 @@
|
|||||||
# Generated by gensyscalls.py. Do not edit.
|
|
||||||
syscall_src :=
|
|
||||||
syscall_src += arch-aarch64/syscalls/__brk.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__epoll_pwait.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__exit.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__getcpu.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__getcwd.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__getpriority.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__ioctl.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__openat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__ppoll.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__pselect6.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__ptrace.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__reboot.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__rt_sigaction.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__rt_sigpending.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__rt_sigprocmask.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__rt_sigsuspend.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__rt_sigtimedwait.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__sched_getaffinity.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__set_tid_address.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__syslog.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__timer_create.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__timer_delete.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__timer_getoverrun.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__timer_gettime.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__timer_settime.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/__waitid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/_exit.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/accept.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/acct.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/bind.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/capget.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/capset.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/chdir.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/chroot.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/clock_getres.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/clock_gettime.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/clock_nanosleep.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/clock_settime.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/close.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/connect.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/delete_module.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/dup.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/dup3.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/epoll_create1.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/epoll_ctl.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/eventfd.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/execve.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/faccessat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fchdir.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fchmod.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fchmodat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fchown.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fchownat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fcntl.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fdatasync.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fgetxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/flistxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/flock.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fremovexattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fsetxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fstat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fstatat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fstatfs.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/fsync.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/ftruncate.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/futex.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getdents.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getegid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/geteuid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getgid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getgroups.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getitimer.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getpeername.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getpgid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getpid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getppid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getresgid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getresuid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getrlimit.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getrusage.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getsid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getsockname.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getsockopt.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/gettid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/gettimeofday.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getuid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/getxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/init_module.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/inotify_add_watch.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/inotify_init1.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/inotify_rm_watch.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/ioprio_get.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/ioprio_set.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/kill.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/klogctl.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/lgetxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/linkat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/listen.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/listxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/llistxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/lremovexattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/lseek.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/lsetxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/madvise.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mincore.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mkdirat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mknodat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mlock.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mlockall.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mmap.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mount.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mprotect.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/mremap.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/msync.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/munlock.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/munlockall.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/munmap.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/nanosleep.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/perf_event_open.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/personality.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/pipe2.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/prctl.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/pread64.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/pwrite64.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/read.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/readahead.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/readlinkat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/readv.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/recvfrom.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/recvmsg.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/removexattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/renameat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_get_priority_max.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_get_priority_min.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_getparam.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_getscheduler.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_rr_get_interval.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_setaffinity.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_setparam.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_setscheduler.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sched_yield.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sendfile.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sendmsg.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sendto.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setgid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setgroups.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setitimer.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setpgid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setpriority.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setregid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setresgid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setresuid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setreuid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setrlimit.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setsid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setsockopt.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/settimeofday.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setuid.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/setxattr.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/shutdown.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sigaltstack.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/signalfd4.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/socket.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/socketpair.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/statfs.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/swapoff.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/swapon.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/symlinkat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sync.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/sysinfo.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/tgkill.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/timerfd_create.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/timerfd_gettime.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/timerfd_settime.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/times.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/tkill.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/truncate.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/umask.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/umount2.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/uname.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/unlinkat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/unshare.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/utimensat.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/wait4.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/write.S
|
|
||||||
syscall_src += arch-aarch64/syscalls/writev.S
|
|
||||||
@@ -1,4 +1,52 @@
|
|||||||
_LIBC_ARCH_COMMON_SRC_FILES := \
|
# arm specific configs
|
||||||
|
|
||||||
|
# These are used by the 32-bit targets, but not the 64-bit ones.
|
||||||
|
libc_common_src_files_arm := \
|
||||||
|
bionic/legacy_32_bit_support.cpp \
|
||||||
|
bionic/ndk_cruft.cpp \
|
||||||
|
bionic/time64.c \
|
||||||
|
|
||||||
|
# These are shared by all the 32-bit targets, but not the 64-bit ones.
|
||||||
|
libc_bionic_src_files_arm := \
|
||||||
|
bionic/mmap.cpp
|
||||||
|
|
||||||
|
libc_common_src_files_arm += \
|
||||||
|
bionic/index.cpp \
|
||||||
|
bionic/memchr.c \
|
||||||
|
bionic/memmove.c.arm \
|
||||||
|
bionic/memrchr.c \
|
||||||
|
bionic/strchr.cpp \
|
||||||
|
bionic/strnlen.c \
|
||||||
|
bionic/strrchr.cpp \
|
||||||
|
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/wcslen.c \
|
||||||
|
upstream-freebsd/lib/libc/string/wcsrchr.c \
|
||||||
|
upstream-freebsd/lib/libc/string/wmemcmp.c \
|
||||||
|
upstream-openbsd/lib/libc/string/bcopy.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strlcat.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strlcpy.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strncat.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strncmp.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strncpy.c \
|
||||||
|
|
||||||
|
# The C++ fortify function implementations for which there is an
|
||||||
|
# arm assembler version.
|
||||||
|
#
|
||||||
|
# Fortify implementations of libc functions.
|
||||||
|
# libc_common_src_files_arm +=
|
||||||
|
# bionic/__memcpy_chk.cpp \
|
||||||
|
# bionic/__memset_chk.cpp \
|
||||||
|
# bionic/__strcpy_chk.cpp \
|
||||||
|
# bionic/__strcat_chk.cpp \
|
||||||
|
|
||||||
|
libc_common_cflags_arm := -DSOFTFLOAT
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
### CPU specific source files
|
||||||
|
libc_bionic_src_files_arm += \
|
||||||
arch-arm/bionic/abort_arm.S \
|
arch-arm/bionic/abort_arm.S \
|
||||||
arch-arm/bionic/atomics_arm.c \
|
arch-arm/bionic/atomics_arm.c \
|
||||||
arch-arm/bionic/__bionic_clone.S \
|
arch-arm/bionic/__bionic_clone.S \
|
||||||
@@ -14,30 +62,31 @@ _LIBC_ARCH_COMMON_SRC_FILES := \
|
|||||||
arch-arm/bionic/sigsetjmp.S \
|
arch-arm/bionic/sigsetjmp.S \
|
||||||
arch-arm/bionic/syscall.S \
|
arch-arm/bionic/syscall.S \
|
||||||
|
|
||||||
# These are used by the static and dynamic versions of the libc
|
libc_arch_static_src_files_arm := arch-arm/bionic/exidx_static.c
|
||||||
# respectively.
|
libc_arch_dynamic_src_files_arm := arch-arm/bionic/exidx_dynamic.c
|
||||||
_LIBC_ARCH_STATIC_SRC_FILES := \
|
|
||||||
arch-arm/bionic/exidx_static.c \
|
|
||||||
bionic/dl_iterate_phdr_static.c \
|
|
||||||
|
|
||||||
_LIBC_ARCH_DYNAMIC_SRC_FILES := \
|
## CPU variant specific source files
|
||||||
arch-arm/bionic/exidx_dynamic.c \
|
ifeq ($(strip $(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT)),)
|
||||||
|
$(warning TARGET_$(my_2nd_arch_prefix)ARCH is arm, but TARGET_$(my_2nd_arch_prefix)CPU_VARIANT is not defined)
|
||||||
# Remove the C++ fortify function implementations for which there is an
|
|
||||||
# arm assembler version.
|
|
||||||
_LIBC_FORTIFY_FILES_TO_REMOVE := \
|
|
||||||
bionic/__memcpy_chk.cpp \
|
|
||||||
bionic/__memset_chk.cpp \
|
|
||||||
bionic/__strcpy_chk.cpp \
|
|
||||||
bionic/__strcat_chk.cpp \
|
|
||||||
|
|
||||||
libc_common_src_files := \
|
|
||||||
$(filter-out $(_LIBC_FORTIFY_FILES_TO_REMOVE),$(libc_common_src_files))
|
|
||||||
|
|
||||||
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-a7, cortex-a8, cortex-a9, cortex-a15, krait. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.")
|
|
||||||
endif
|
endif
|
||||||
|
cpu_variant_mk := $(LOCAL_PATH)/arch-arm/$(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT)/$(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT).mk
|
||||||
|
ifeq ($(wildcard $(cpu_variant_mk)),)
|
||||||
|
$(error "TARGET_$(my_2nd_arch_prefix)CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait, denver. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.")
|
||||||
|
endif
|
||||||
|
include $(cpu_variant_mk)
|
||||||
|
libc_common_additional_dependencies += $(cpu_variant_mk)
|
||||||
|
|
||||||
_LIBC_ARCH_ADDITIONAL_DEPENDENCIES := \
|
cpu_variant_mk :=
|
||||||
$(LOCAL_PATH)/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk
|
|
||||||
include $(LOCAL_PATH)/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk
|
|
||||||
|
libc_crt_target_cflags_arm := \
|
||||||
|
-I$(LOCAL_PATH)/arch-arm/include \
|
||||||
|
-mthumb-interwork
|
||||||
|
|
||||||
|
libc_crt_target_so_cflags_arm :=
|
||||||
|
|
||||||
|
libc_crt_target_crtbegin_file_arm := \
|
||||||
|
$(LOCAL_PATH)/arch-common/bionic/crtbegin.c
|
||||||
|
|
||||||
|
libc_crt_target_crtbegin_so_file_arm := \
|
||||||
|
$(LOCAL_PATH)/arch-common/bionic/crtbegin_so.c
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
ENTRY(__get_sp)
|
ENTRY(__get_sp)
|
||||||
mov r0, sp
|
mov r0, sp
|
||||||
|
|||||||
@@ -26,18 +26,16 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include <asm/unistd.h>
|
|
||||||
|
|
||||||
// void _exit_with_stack_teardown(void* stackBase, size_t stackSize, int status)
|
// void _exit_with_stack_teardown(void* stackBase, size_t stackSize)
|
||||||
ENTRY(_exit_with_stack_teardown)
|
ENTRY(_exit_with_stack_teardown)
|
||||||
mov lr, r2
|
ldr r7, =__NR_munmap
|
||||||
ldr r7, =__NR_munmap
|
swi #0
|
||||||
swi #0
|
// If munmap failed, we ignore the failure and exit anyway.
|
||||||
// If munmap failed, we ignore the failure and exit anyway.
|
|
||||||
|
|
||||||
mov r0, lr
|
mov r0, #0
|
||||||
ldr r7, =__NR_exit
|
ldr r7, =__NR_exit
|
||||||
swi #0
|
swi #0
|
||||||
// The exit syscall does not return.
|
// The exit syscall does not return.
|
||||||
END(_exit_with_stack_teardown)
|
END(_exit_with_stack_teardown)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include <machine/setjmp.h>
|
#include <machine/setjmp.h>
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ ENTRY(_longjmp)
|
|||||||
|
|
||||||
/* validation failed, die die die. */
|
/* validation failed, die die die. */
|
||||||
botch:
|
botch:
|
||||||
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
|
bl PIC_SYM(longjmperror, PLT)
|
||||||
bl PIC_SYM(_C_LABEL(abort), PLT)
|
bl PIC_SYM(abort, PLT)
|
||||||
b . - 8 /* Cannot get here */
|
b . - 8 /* Cannot get here */
|
||||||
END(_longjmp)
|
END(_longjmp)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Coding the abort function in assembly so that registers are guaranteed to
|
* Coding the abort function in assembly so that registers are guaranteed to
|
||||||
@@ -40,5 +40,5 @@ ENTRY(abort)
|
|||||||
.cfi_def_cfa_offset 8
|
.cfi_def_cfa_offset 8
|
||||||
.cfi_rel_offset r3, 0
|
.cfi_rel_offset r3, 0
|
||||||
.cfi_rel_offset r14, 4
|
.cfi_rel_offset r14, 4
|
||||||
bl PIC_SYM(_C_LABEL(__libc_android_abort), PLT)
|
bl PIC_SYM(__libc_android_abort, PLT)
|
||||||
END(abort)
|
END(abort)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012 The Android Open Source Project
|
* Copyright (C) 2012 The Android Open Source Project
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
@@ -26,13 +26,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <asm/unistd.h>
|
#include <private/bionic_asm.h>
|
||||||
#include <machine/asm.h>
|
|
||||||
|
|
||||||
#define FUTEX_WAIT 0
|
#define FUTEX_WAIT 0
|
||||||
#define FUTEX_WAKE 1
|
#define FUTEX_WAKE 1
|
||||||
|
|
||||||
// __futex_syscall3(*ftx, op, val)
|
// int __futex_syscall3(volatile void* ftx, int op, int count)
|
||||||
ENTRY(__futex_syscall3)
|
ENTRY(__futex_syscall3)
|
||||||
mov ip, r7
|
mov ip, r7
|
||||||
ldr r7, =__NR_futex
|
ldr r7, =__NR_futex
|
||||||
@@ -41,12 +40,12 @@ ENTRY(__futex_syscall3)
|
|||||||
bx lr
|
bx lr
|
||||||
END(__futex_syscall3)
|
END(__futex_syscall3)
|
||||||
|
|
||||||
// __futex_syscall4(*ftx, op, val, *timespec)
|
// int __futex_syscall4(volatile void* ftx, int op, int val, const struct timespec* timeout)
|
||||||
ENTRY(__futex_syscall4)
|
ENTRY(__futex_syscall4)
|
||||||
b __futex_syscall3
|
b __futex_syscall3
|
||||||
END(__futex_syscall4)
|
END(__futex_syscall4)
|
||||||
|
|
||||||
// __futex_wait(*ftx, val, *timespec)
|
// int __futex_wait(volatile void* ftx, int val, const struct timespec* timeout)
|
||||||
ENTRY(__futex_wait)
|
ENTRY(__futex_wait)
|
||||||
mov ip, r7
|
mov ip, r7
|
||||||
mov r3, r2
|
mov r3, r2
|
||||||
@@ -58,7 +57,7 @@ ENTRY(__futex_wait)
|
|||||||
bx lr
|
bx lr
|
||||||
END(__futex_wait)
|
END(__futex_wait)
|
||||||
|
|
||||||
// __futex_wake(*ftx, counter)
|
// int __futex_wake(volatile void* ftx, int count)
|
||||||
ENTRY(__futex_wake)
|
ENTRY(__futex_wake)
|
||||||
mov ip, r7
|
mov ip, r7
|
||||||
mov r2, r1
|
mov r2, r1
|
||||||
|
|||||||
@@ -1,170 +1,159 @@
|
|||||||
/*
|
/* Generated by genlibgcc_compat.py */
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* This file contains dummy references to libgcc.a functions to force the
|
extern char __adddf3;
|
||||||
* dynamic linker to copy their definition into the final libc.so binary.
|
extern char __addsf3;
|
||||||
*
|
extern char __aeabi_cdcmpeq;
|
||||||
* They are required to ensure backwards binary compatibility with
|
extern char __aeabi_cdcmple;
|
||||||
* libc.so provided by the platform and binaries built with the NDK or
|
extern char __aeabi_cdrcmple;
|
||||||
* different versions/configurations of toolchains.
|
extern char __aeabi_d2f;
|
||||||
*
|
extern char __aeabi_d2iz;
|
||||||
* Now, for a more elaborate description of the issue:
|
extern char __aeabi_dadd;
|
||||||
*
|
extern char __aeabi_dcmpeq;
|
||||||
* libgcc.a is a compiler-specific library containing various helper
|
extern char __aeabi_dcmpge;
|
||||||
* functions used to implement certain operations that are not necessarily
|
extern char __aeabi_dcmpgt;
|
||||||
* supported by the target CPU. For example, integer division doesn't have a
|
extern char __aeabi_dcmple;
|
||||||
* corresponding CPU instruction on ARMv5, and is instead implemented in the
|
extern char __aeabi_dcmplt;
|
||||||
* compiler-generated machine code as a call to an __idiv helper function.
|
extern char __aeabi_dcmpun;
|
||||||
*
|
extern char __aeabi_ddiv;
|
||||||
* Normally, one has to place libgcc.a in the link command used to generate
|
extern char __aeabi_dmul;
|
||||||
* target binaries (shared libraries and executables) after all objects and
|
extern char __aeabi_drsub;
|
||||||
* static libraries, but before dependent shared libraries, i.e. something
|
extern char __aeabi_dsub;
|
||||||
* like:
|
extern char __aeabi_f2d;
|
||||||
* gcc <options> -o libfoo.so foo.a libgcc.a -lc -lm
|
extern char __aeabi_f2iz;
|
||||||
*
|
extern char __aeabi_f2uiz;
|
||||||
* This ensures that any helper function needed by the code in foo.a is copied
|
extern char __aeabi_fadd;
|
||||||
* into the final libfoo.so. However, doing so will link a bunch of other __cxa
|
extern char __aeabi_fcmpun;
|
||||||
* functions from libgcc.a into each .so and executable, causing 4k+ increase
|
extern char __aeabi_fdiv;
|
||||||
* in every binary. Therefore the Android platform build system has been
|
extern char __aeabi_fmul;
|
||||||
* using this instead:
|
extern char __aeabi_frsub;
|
||||||
*
|
extern char __aeabi_fsub;
|
||||||
* gcc <options> -o libfoo.so foo.a -lc -lm libgcc.a
|
extern char __aeabi_i2d;
|
||||||
*
|
extern char __aeabi_i2f;
|
||||||
* The problem with this is that if one helper function needed by foo.a has
|
extern char __aeabi_idiv;
|
||||||
* already been copied into libc.so or libm.so, then nothing will be copied
|
extern char __aeabi_idivmod;
|
||||||
* into libfoo.so. Instead, a symbol import definition will be added to it
|
extern char __aeabi_l2d;
|
||||||
* so libfoo.so can directly call the one in libc.so at runtime.
|
extern char __aeabi_l2f;
|
||||||
*
|
extern char __aeabi_lasr;
|
||||||
* When refreshing toolchains for new versions or using different architecture
|
extern char __aeabi_ldivmod;
|
||||||
* flags, the set of helper functions copied to libc.so may change, which
|
extern char __aeabi_llsl;
|
||||||
* resulted in some native shared libraries generated with the NDK or prebuilts
|
extern char __aeabi_llsr;
|
||||||
* from vendors to fail to load properly.
|
extern char __aeabi_lmul;
|
||||||
*
|
extern char __aeabi_ui2d;
|
||||||
* The NDK has been fixed after 1.6_r1 to use the correct link command, so
|
extern char __aeabi_ui2f;
|
||||||
* any native shared library generated with it should now be safe from that
|
extern char __aeabi_uidiv;
|
||||||
* problem. On the other hand, existing shared libraries distributed with
|
extern char __aeabi_uidivmod;
|
||||||
* applications that were generated with a previous version of the NDK
|
extern char __aeabi_ul2d;
|
||||||
* still need all 1.5/1.6 helper functions in libc.so and libm.so
|
extern char __aeabi_ul2f;
|
||||||
*
|
extern char __aeabi_uldivmod;
|
||||||
* After 3.2, the toolchain was updated again, adding __aeabi_f2uiz to the
|
extern char __aeabi_unwind_cpp_pr0;
|
||||||
* list of requirements. Technically, this is due to mis-linked NDK libraries
|
extern char __aeabi_unwind_cpp_pr1;
|
||||||
* but it is easier to add a single function here than asking several app
|
extern char __cmpdf2;
|
||||||
* developers to fix their build.
|
extern char __divdf3;
|
||||||
*
|
extern char __divsf3;
|
||||||
* The __aeabi_idiv function is added to the list since cortex-a15 supports
|
extern char __eqdf2;
|
||||||
* HW idiv instructions so the system libc.so doesn't pull in the reference to
|
extern char __extendsfdf2;
|
||||||
* __aeabi_idiv but legacy libraries built against cortex-a9 targets still need
|
extern char __fixdfsi;
|
||||||
* it.
|
extern char __fixsfsi;
|
||||||
*
|
extern char __floatdidf;
|
||||||
* Final note: some of the functions below should really be in libm.so to
|
extern char __floatdisf;
|
||||||
* completely reflect the state of 1.5/1.6 system images. However,
|
extern char __floatsidf;
|
||||||
* since libm.so depends on libc.so, it's easier to put all of
|
extern char __floatsisf;
|
||||||
* these in libc.so instead, since the dynamic linker will always
|
extern char __floatundidf;
|
||||||
* search in libc.so before libm.so for dependencies.
|
extern char __floatundisf;
|
||||||
*/
|
extern char __floatunsidf;
|
||||||
|
extern char __floatunsisf;
|
||||||
|
extern char __gedf2;
|
||||||
|
extern char __gtdf2;
|
||||||
|
extern char __ledf2;
|
||||||
|
extern char __ltdf2;
|
||||||
|
extern char __muldf3;
|
||||||
|
extern char __muldi3;
|
||||||
|
extern char __mulsf3;
|
||||||
|
extern char __nedf2;
|
||||||
|
extern char __popcount_tab;
|
||||||
|
extern char __popcountsi2;
|
||||||
|
extern char __subdf3;
|
||||||
|
extern char __subsf3;
|
||||||
|
extern char __truncdfsf2;
|
||||||
|
extern char __unorddf2;
|
||||||
|
extern char __unordsf2;
|
||||||
|
|
||||||
#define COMPAT_FUNCTIONS_LIST \
|
void* __bionic_libgcc_compat_symbols[] = {
|
||||||
XX(__adddf3) \
|
&__adddf3,
|
||||||
XX(__addsf3) \
|
&__addsf3,
|
||||||
XX(__aeabi_cdcmpeq) \
|
&__aeabi_cdcmpeq,
|
||||||
XX(__aeabi_cdcmple) \
|
&__aeabi_cdcmple,
|
||||||
XX(__aeabi_cdrcmple) \
|
&__aeabi_cdrcmple,
|
||||||
XX(__aeabi_d2f) \
|
&__aeabi_d2f,
|
||||||
XX(__aeabi_d2iz) \
|
&__aeabi_d2iz,
|
||||||
XX(__aeabi_dadd) \
|
&__aeabi_dadd,
|
||||||
XX(__aeabi_dcmpeq) \
|
&__aeabi_dcmpeq,
|
||||||
XX(__aeabi_dcmpge) \
|
&__aeabi_dcmpge,
|
||||||
XX(__aeabi_dcmpgt) \
|
&__aeabi_dcmpgt,
|
||||||
XX(__aeabi_dcmple) \
|
&__aeabi_dcmple,
|
||||||
XX(__aeabi_dcmplt) \
|
&__aeabi_dcmplt,
|
||||||
XX(__aeabi_dcmpun) \
|
&__aeabi_dcmpun,
|
||||||
XX(__aeabi_ddiv) \
|
&__aeabi_ddiv,
|
||||||
XX(__aeabi_dmul) \
|
&__aeabi_dmul,
|
||||||
XX(__aeabi_drsub) \
|
&__aeabi_drsub,
|
||||||
XX(__aeabi_dsub) \
|
&__aeabi_dsub,
|
||||||
XX(__aeabi_f2d) \
|
&__aeabi_f2d,
|
||||||
XX(__aeabi_f2iz) \
|
&__aeabi_f2iz,
|
||||||
XX(__aeabi_f2uiz) \
|
&__aeabi_f2uiz,
|
||||||
XX(__aeabi_fadd) \
|
&__aeabi_fadd,
|
||||||
XX(__aeabi_fcmpun) \
|
&__aeabi_fcmpun,
|
||||||
XX(__aeabi_fdiv) \
|
&__aeabi_fdiv,
|
||||||
XX(__aeabi_fmul) \
|
&__aeabi_fmul,
|
||||||
XX(__aeabi_frsub) \
|
&__aeabi_frsub,
|
||||||
XX(__aeabi_fsub) \
|
&__aeabi_fsub,
|
||||||
XX(__aeabi_i2d) \
|
&__aeabi_i2d,
|
||||||
XX(__aeabi_i2f) \
|
&__aeabi_i2f,
|
||||||
XX(__aeabi_idiv) \
|
&__aeabi_idiv,
|
||||||
XX(__aeabi_l2d) \
|
&__aeabi_idivmod,
|
||||||
XX(__aeabi_l2f) \
|
&__aeabi_l2d,
|
||||||
XX(__aeabi_lasr) \
|
&__aeabi_l2f,
|
||||||
XX(__aeabi_lmul) \
|
&__aeabi_lasr,
|
||||||
XX(__aeabi_llsl) \
|
&__aeabi_ldivmod,
|
||||||
XX(__aeabi_llsr) \
|
&__aeabi_llsl,
|
||||||
XX(__aeabi_ui2d) \
|
&__aeabi_llsr,
|
||||||
XX(__aeabi_ui2f) \
|
&__aeabi_lmul,
|
||||||
XX(__aeabi_ul2d) \
|
&__aeabi_ui2d,
|
||||||
XX(__aeabi_ul2f) \
|
&__aeabi_ui2f,
|
||||||
XX(__cmpdf2) \
|
&__aeabi_uidiv,
|
||||||
XX(__divdf3) \
|
&__aeabi_uidivmod,
|
||||||
XX(__divsf3) \
|
&__aeabi_ul2d,
|
||||||
XX(__eqdf2) \
|
&__aeabi_ul2f,
|
||||||
XX(__extendsfdf2) \
|
&__aeabi_uldivmod,
|
||||||
XX(__fixdfsi) \
|
&__aeabi_unwind_cpp_pr0,
|
||||||
XX(__fixsfsi) \
|
&__aeabi_unwind_cpp_pr1,
|
||||||
XX(__floatdidf) \
|
&__cmpdf2,
|
||||||
XX(__floatdisf) \
|
&__divdf3,
|
||||||
XX(__floatsidf) \
|
&__divsf3,
|
||||||
XX(__floatsisf) \
|
&__eqdf2,
|
||||||
XX(__floatundidf) \
|
&__extendsfdf2,
|
||||||
XX(__floatundisf) \
|
&__fixdfsi,
|
||||||
XX(__floatunsidf) \
|
&__fixsfsi,
|
||||||
XX(__floatunsisf) \
|
&__floatdidf,
|
||||||
XX(__gedf2) \
|
&__floatdisf,
|
||||||
XX(__gtdf2) \
|
&__floatsidf,
|
||||||
XX(__ledf2) \
|
&__floatsisf,
|
||||||
XX(__ltdf2) \
|
&__floatundidf,
|
||||||
XX(__muldf3) \
|
&__floatundisf,
|
||||||
XX(__muldi3) \
|
&__floatunsidf,
|
||||||
XX(__mulsf3) \
|
&__floatunsisf,
|
||||||
XX(__nedf2) \
|
&__gedf2,
|
||||||
XX(__subdf3) \
|
&__gtdf2,
|
||||||
XX(__subsf3) \
|
&__ledf2,
|
||||||
XX(__truncdfsf2) \
|
&__ltdf2,
|
||||||
XX(__unorddf2) \
|
&__muldf3,
|
||||||
XX(__unordsf2) \
|
&__muldi3,
|
||||||
|
&__mulsf3,
|
||||||
#define XX(f) extern void f(void);
|
&__nedf2,
|
||||||
COMPAT_FUNCTIONS_LIST
|
&__popcount_tab,
|
||||||
#undef XX
|
&__popcountsi2,
|
||||||
|
&__subdf3,
|
||||||
void __bionic_libgcc_compat_hooks(void)
|
&__subsf3,
|
||||||
{
|
&__truncdfsf2,
|
||||||
#define XX(f) f();
|
&__unorddf2,
|
||||||
COMPAT_FUNCTIONS_LIST
|
&__unordsf2,
|
||||||
#undef XX
|
};
|
||||||
}
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_32_BYTE_CACHE_LINE
|
#ifdef HAVE_32_BYTE_CACHE_LINE
|
||||||
|
|||||||
@@ -27,20 +27,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optimized memcmp16() for ARM9.
|
* Optimized memcmp16() for ARM9.
|
||||||
* This would not be optimal on XScale or ARM11, where more prefetching
|
* This would not be optimal on XScale or ARM11, where more prefetching
|
||||||
* and use of PLD will be needed.
|
* and use of pld will be needed.
|
||||||
* The 2 major optimzations here are
|
* The 2 major optimzations here are
|
||||||
* (1) The main loop compares 16 bytes at a time
|
* (1) The main loop compares 16 bytes at a time
|
||||||
* (2) The loads are scheduled in a way they won't stall
|
* (2) The loads are scheduled in a way they won't stall
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ENTRY(__memcmp16)
|
ENTRY(__memcmp16)
|
||||||
PLD (r0, #0)
|
pld [r0, #0]
|
||||||
PLD (r1, #0)
|
pld [r1, #0]
|
||||||
|
|
||||||
/* take of the case where length is nul or the buffers are the same */
|
/* take of the case where length is nul or the buffers are the same */
|
||||||
cmp r0, r1
|
cmp r0, r1
|
||||||
@@ -62,13 +62,13 @@ ENTRY(__memcmp16)
|
|||||||
bpl 0f
|
bpl 0f
|
||||||
|
|
||||||
/* small blocks (less then 12 words) */
|
/* small blocks (less then 12 words) */
|
||||||
PLD (r0, #32)
|
pld [r0, #32]
|
||||||
PLD (r1, #32)
|
pld [r1, #32]
|
||||||
|
|
||||||
1: ldrh r0, [r3], #2
|
1: ldrh r0, [r3], #2
|
||||||
ldrh ip, [r1], #2
|
ldrh ip, [r1], #2
|
||||||
subs r0, r0, ip
|
subs r0, r0, ip
|
||||||
bxne lr
|
bxne lr
|
||||||
subs r2, r2, #1
|
subs r2, r2, #1
|
||||||
bne 1b
|
bne 1b
|
||||||
bx lr
|
bx lr
|
||||||
@@ -79,11 +79,11 @@ ENTRY(__memcmp16)
|
|||||||
.cfi_def_cfa_offset 8
|
.cfi_def_cfa_offset 8
|
||||||
.cfi_rel_offset r4, 0
|
.cfi_rel_offset r4, 0
|
||||||
.cfi_rel_offset lr, 4
|
.cfi_rel_offset lr, 4
|
||||||
|
|
||||||
/* align first pointer to word boundary */
|
/* align first pointer to word boundary */
|
||||||
tst r3, #2
|
tst r3, #2
|
||||||
beq 0f
|
beq 0f
|
||||||
|
|
||||||
ldrh r0, [r3], #2
|
ldrh r0, [r3], #2
|
||||||
ldrh ip, [r1], #2
|
ldrh ip, [r1], #2
|
||||||
sub r2, r2, #1
|
sub r2, r2, #1
|
||||||
@@ -111,10 +111,10 @@ ENTRY(__memcmp16)
|
|||||||
ldr ip, [r1]
|
ldr ip, [r1]
|
||||||
subs r2, r2, #(16 + 2)
|
subs r2, r2, #(16 + 2)
|
||||||
bmi 1f
|
bmi 1f
|
||||||
|
|
||||||
0:
|
0:
|
||||||
PLD (r3, #64)
|
pld [r3, #64]
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
ldr r0, [r3], #4
|
ldr r0, [r3], #4
|
||||||
ldr lr, [r1, #4]!
|
ldr lr, [r1, #4]!
|
||||||
eors r0, r0, ip
|
eors r0, r0, ip
|
||||||
@@ -139,14 +139,14 @@ ENTRY(__memcmp16)
|
|||||||
ldreq r0, [r3], #4
|
ldreq r0, [r3], #4
|
||||||
ldreq ip, [r1, #4]!
|
ldreq ip, [r1, #4]!
|
||||||
eoreqs r0, r0, lr
|
eoreqs r0, r0, lr
|
||||||
bne 2f
|
bne 2f
|
||||||
subs r2, r2, #16
|
subs r2, r2, #16
|
||||||
bhs 0b
|
bhs 0b
|
||||||
|
|
||||||
/* do we have at least 2 words left? */
|
/* do we have at least 2 words left? */
|
||||||
1: adds r2, r2, #(16 - 2 + 2)
|
1: adds r2, r2, #(16 - 2 + 2)
|
||||||
bmi 4f
|
bmi 4f
|
||||||
|
|
||||||
/* finish off 2 words at a time */
|
/* finish off 2 words at a time */
|
||||||
3: ldr r0, [r3], #4
|
3: ldr r0, [r3], #4
|
||||||
ldr ip, [r1], #4
|
ldr ip, [r1], #4
|
||||||
@@ -195,8 +195,8 @@ ENTRY(__memcmp16)
|
|||||||
sub r2, r2, #8
|
sub r2, r2, #8
|
||||||
|
|
||||||
6:
|
6:
|
||||||
PLD (r3, #64)
|
pld [r3, #64]
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
mov ip, lr, lsr #16
|
mov ip, lr, lsr #16
|
||||||
ldr lr, [r1], #4
|
ldr lr, [r1], #4
|
||||||
ldr r0, [r3], #4
|
ldr r0, [r3], #4
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
#if defined(__ARM_NEON__) && !defined(ARCH_ARM_USE_NON_NEON_MEMCPY)
|
#if defined(__ARM_NEON__) && !defined(ARCH_ARM_USE_NON_NEON_MEMCPY)
|
||||||
|
|
||||||
@@ -352,9 +352,9 @@ ENTRY(memcpy)
|
|||||||
|
|
||||||
// preload the destination because we'll align it to a cache line
|
// preload the destination because we'll align it to a cache line
|
||||||
// with small writes. Also start the source "pump".
|
// with small writes. Also start the source "pump".
|
||||||
PLD (r0, #0)
|
pld [r0, #0]
|
||||||
PLD (r1, #0)
|
pld [r1, #0]
|
||||||
PLD (r1, #32)
|
pld [r1, #32]
|
||||||
|
|
||||||
/* it simplifies things to take care of len<4 early */
|
/* it simplifies things to take care of len<4 early */
|
||||||
cmp r2, #4
|
cmp r2, #4
|
||||||
@@ -442,7 +442,7 @@ cached_aligned32:
|
|||||||
add r12, r12, #64
|
add r12, r12, #64
|
||||||
|
|
||||||
1: ldmia r1!, { r4-r11 }
|
1: ldmia r1!, { r4-r11 }
|
||||||
PLD (r12, #64)
|
pld [r12, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
|
|
||||||
// NOTE: if r12 is more than 64 ahead of r1, the following ldrhi
|
// NOTE: if r12 is more than 64 ahead of r1, the following ldrhi
|
||||||
@@ -563,7 +563,7 @@ loop16:
|
|||||||
ldr r12, [r1], #4
|
ldr r12, [r1], #4
|
||||||
1: mov r4, r12
|
1: mov r4, r12
|
||||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
ldrhs r12, [r1], #4
|
ldrhs r12, [r1], #4
|
||||||
orr r3, r3, r4, lsl #16
|
orr r3, r3, r4, lsl #16
|
||||||
@@ -590,7 +590,7 @@ loop8:
|
|||||||
ldr r12, [r1], #4
|
ldr r12, [r1], #4
|
||||||
1: mov r4, r12
|
1: mov r4, r12
|
||||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
ldrhs r12, [r1], #4
|
ldrhs r12, [r1], #4
|
||||||
orr r3, r3, r4, lsl #24
|
orr r3, r3, r4, lsl #24
|
||||||
@@ -617,7 +617,7 @@ loop24:
|
|||||||
ldr r12, [r1], #4
|
ldr r12, [r1], #4
|
||||||
1: mov r4, r12
|
1: mov r4, r12
|
||||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
ldrhs r12, [r1], #4
|
ldrhs r12, [r1], #4
|
||||||
orr r3, r3, r4, lsl #8
|
orr r3, r3, r4, lsl #8
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
/* This implementation requires ARM state. */
|
/* This implementation requires ARM state. */
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include <machine/setjmp.h>
|
#include <machine/setjmp.h>
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ ENTRY(setjmp)
|
|||||||
.cfi_rel_offset r14, 4
|
.cfi_rel_offset r14, 4
|
||||||
mov r0, #0x00000000
|
mov r0, #0x00000000
|
||||||
|
|
||||||
bl PIC_SYM(_C_LABEL(sigblock), PLT)
|
bl PIC_SYM(sigblock, PLT)
|
||||||
mov r1, r0
|
mov r1, r0
|
||||||
|
|
||||||
ldmfd sp!, {r0, r14}
|
ldmfd sp!, {r0, r14}
|
||||||
@@ -108,11 +108,11 @@ ENTRY(longjmp)
|
|||||||
.cfi_adjust_cfa_offset 4
|
.cfi_adjust_cfa_offset 4
|
||||||
|
|
||||||
mov r0, r2
|
mov r0, r2
|
||||||
bl PIC_SYM(_C_LABEL(sigsetmask), PLT)
|
bl PIC_SYM(sigsetmask, PLT)
|
||||||
|
|
||||||
add sp, sp, #4 /* unalign the stack */
|
add sp, sp, #4 /* unalign the stack */
|
||||||
.cfi_adjust_cfa_offset -4
|
.cfi_adjust_cfa_offset -4
|
||||||
ldmfd sp!, {r0, r1, r14}
|
ldmfd sp!, {r0, r1, r14}
|
||||||
.cfi_def_cfa_offset 0
|
.cfi_def_cfa_offset 0
|
||||||
|
|
||||||
#ifdef __ARM_HAVE_VFP
|
#ifdef __ARM_HAVE_VFP
|
||||||
@@ -147,7 +147,7 @@ ENTRY(longjmp)
|
|||||||
|
|
||||||
/* validation failed, die die die. */
|
/* validation failed, die die die. */
|
||||||
botch:
|
botch:
|
||||||
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
|
bl PIC_SYM(longjmperror, PLT)
|
||||||
bl PIC_SYM(_C_LABEL(abort), PLT)
|
bl PIC_SYM(abort, PLT)
|
||||||
b . - 8 /* Cannot get here */
|
b . - 8 /* Cannot get here */
|
||||||
END(longjmp)
|
END(longjmp)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#define _ALIGN_TEXT .align 0
|
#define _ALIGN_TEXT .align 0
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include <machine/setjmp.h>
|
#include <machine/setjmp.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -50,8 +50,8 @@
|
|||||||
|
|
||||||
ENTRY(sigsetjmp)
|
ENTRY(sigsetjmp)
|
||||||
teq r1, #0
|
teq r1, #0
|
||||||
beq PIC_SYM(_C_LABEL(_setjmp), PLT)
|
beq PIC_SYM(_setjmp, PLT)
|
||||||
b PIC_SYM(_C_LABEL(setjmp), PLT)
|
b PIC_SYM(setjmp, PLT)
|
||||||
END(sigsetjmp)
|
END(sigsetjmp)
|
||||||
|
|
||||||
.L_setjmp_magic:
|
.L_setjmp_magic:
|
||||||
@@ -61,6 +61,6 @@ ENTRY(siglongjmp)
|
|||||||
ldr r2, .L_setjmp_magic
|
ldr r2, .L_setjmp_magic
|
||||||
ldr r3, [r0]
|
ldr r3, [r0]
|
||||||
teq r2, r3
|
teq r2, r3
|
||||||
beq PIC_SYM(_C_LABEL(_longjmp), PLT)
|
beq PIC_SYM(_longjmp, PLT)
|
||||||
b PIC_SYM(_C_LABEL(longjmp), PLT)
|
b PIC_SYM(longjmp, PLT)
|
||||||
END(siglongjmp)
|
END(siglongjmp)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
@@ -52,8 +52,8 @@
|
|||||||
#define magic2(REG) REG, lsl #7
|
#define magic2(REG) REG, lsl #7
|
||||||
|
|
||||||
ENTRY(strcmp)
|
ENTRY(strcmp)
|
||||||
PLD(r0, #0)
|
pld [r0, #0]
|
||||||
PLD(r1, #0)
|
pld [r1, #0]
|
||||||
eor r2, r0, r1
|
eor r2, r0, r1
|
||||||
tst r2, #3
|
tst r2, #3
|
||||||
|
|
||||||
@@ -88,8 +88,8 @@ ENTRY(strcmp)
|
|||||||
orr r4, r4, r4, lsl #16
|
orr r4, r4, r4, lsl #16
|
||||||
.p2align 2
|
.p2align 2
|
||||||
4:
|
4:
|
||||||
PLD(r0, #8)
|
pld [r0, #8]
|
||||||
PLD(r1, #8)
|
pld [r1, #8]
|
||||||
sub r2, ip, magic1(r4)
|
sub r2, ip, magic1(r4)
|
||||||
cmp ip, r3
|
cmp ip, r3
|
||||||
itttt eq
|
itttt eq
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,8 @@
|
|||||||
|
|
||||||
// Prototype: void *memcpy (void *dst, const void *src, size_t count).
|
// Prototype: void *memcpy (void *dst, const void *src, size_t count).
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optimized memset() for ARM.
|
* Optimized memset() for ARM.
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
#ifdef __ARMEB__
|
#ifdef __ARMEB__
|
||||||
#define S2LOMEM lsl
|
#define S2LOMEM lsl
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a15/bionic/memcpy.S)
|
libc_bionic_src_files_arm += \
|
||||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a15/bionic/memset.S)
|
arch-arm/cortex-a15/bionic/memcpy.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCAT,arch-arm/cortex-a15/bionic/strcat.S)
|
arch-arm/cortex-a15/bionic/memset.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a15/bionic/strcmp.S)
|
arch-arm/cortex-a15/bionic/strcat.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCPY,arch-arm/cortex-a15/bionic/strcpy.S)
|
arch-arm/cortex-a15/bionic/strcmp.S \
|
||||||
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a15/bionic/strlen.S)
|
arch-arm/cortex-a15/bionic/strcpy.S \
|
||||||
$(call libc-add-cpu-variant-src,__STRCAT_CHK,arch-arm/cortex-a15/bionic/__strcat_chk.S)
|
arch-arm/cortex-a15/bionic/strlen.S \
|
||||||
$(call libc-add-cpu-variant-src,__STRCPY_CHK,arch-arm/cortex-a15/bionic/__strcpy_chk.S)
|
arch-arm/cortex-a15/bionic/__strcat_chk.S \
|
||||||
|
arch-arm/cortex-a15/bionic/__strcpy_chk.S \
|
||||||
include bionic/libc/arch-arm/generic/generic.mk
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
.fpu neon
|
.fpu neon
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
.fpu neon
|
.fpu neon
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This code assumes it is running on a processor that supports all arm v7
|
* This code assumes it is running on a processor that supports all arm v7
|
||||||
|
|||||||
@@ -26,9 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <private/bionic_asm.h>
|
||||||
#include <machine/asm.h>
|
#include <private/libc_events.h>
|
||||||
#include "private/libc_events.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This code assumes it is running on a processor that supports all arm v7
|
* This code assumes it is running on a processor that supports all arm v7
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
#ifdef __ARMEB__
|
#ifdef __ARMEB__
|
||||||
#define S2LOMEM lsl
|
#define S2LOMEM lsl
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a9/bionic/memcpy.S)
|
libc_bionic_src_files_arm += \
|
||||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a9/bionic/memset.S)
|
arch-arm/cortex-a9/bionic/memcpy.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCAT,arch-arm/cortex-a9/bionic/strcat.S)
|
arch-arm/cortex-a9/bionic/memset.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a9/bionic/strcmp.S)
|
arch-arm/cortex-a9/bionic/strcat.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCPY,arch-arm/cortex-a9/bionic/strcpy.S)
|
arch-arm/cortex-a9/bionic/strcmp.S \
|
||||||
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a9/bionic/strlen.S)
|
arch-arm/cortex-a9/bionic/strcpy.S \
|
||||||
$(call libc-add-cpu-variant-src,__STRCAT_CHK,arch-arm/cortex-a9/bionic/__strcat_chk.S)
|
arch-arm/cortex-a9/bionic/strlen.S \
|
||||||
$(call libc-add-cpu-variant-src,__STRCPY_CHK,arch-arm/cortex-a9/bionic/__strcpy_chk.S)
|
arch-arm/cortex-a9/bionic/__strcat_chk.S \
|
||||||
|
arch-arm/cortex-a9/bionic/__strcpy_chk.S \
|
||||||
include bionic/libc/arch-arm/generic/generic.mk
|
|
||||||
|
|||||||
221
libc/arch-arm/denver/bionic/__strcat_chk.S
Normal file
221
libc/arch-arm/denver/bionic/__strcat_chk.S
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
/*
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
.thumb
|
||||||
|
.thumb_func
|
||||||
|
|
||||||
|
// Get the length of src string, then get the source of the dst string.
|
||||||
|
// Check that the two lengths together don't exceed the threshold, then
|
||||||
|
// do a memcpy of the data.
|
||||||
|
ENTRY(__strcat_chk)
|
||||||
|
pld [r0, #0]
|
||||||
|
push {r0, lr}
|
||||||
|
.save {r0, lr}
|
||||||
|
.cfi_def_cfa_offset 8
|
||||||
|
.cfi_rel_offset r0, 0
|
||||||
|
.cfi_rel_offset lr, 4
|
||||||
|
push {r4, r5}
|
||||||
|
.save {r4, r5}
|
||||||
|
.cfi_adjust_cfa_offset 8
|
||||||
|
.cfi_rel_offset r4, 0
|
||||||
|
.cfi_rel_offset r5, 4
|
||||||
|
|
||||||
|
mov lr, r2
|
||||||
|
|
||||||
|
// Save the dst register to r5
|
||||||
|
mov r5, r0
|
||||||
|
|
||||||
|
// Zero out r4
|
||||||
|
eor r4, r4, r4
|
||||||
|
|
||||||
|
// r1 contains the address of the string to count.
|
||||||
|
.L_strlen_start:
|
||||||
|
mov r0, r1
|
||||||
|
ands r3, r1, #7
|
||||||
|
beq .L_mainloop
|
||||||
|
|
||||||
|
// Align to a double word (64 bits).
|
||||||
|
rsb r3, r3, #8
|
||||||
|
lsls ip, r3, #31
|
||||||
|
beq .L_align_to_32
|
||||||
|
|
||||||
|
ldrb r2, [r1], #1
|
||||||
|
cbz r2, .L_update_count_and_finish
|
||||||
|
|
||||||
|
.L_align_to_32:
|
||||||
|
bcc .L_align_to_64
|
||||||
|
ands ip, r3, #2
|
||||||
|
beq .L_align_to_64
|
||||||
|
|
||||||
|
ldrb r2, [r1], #1
|
||||||
|
cbz r2, .L_update_count_and_finish
|
||||||
|
ldrb r2, [r1], #1
|
||||||
|
cbz r2, .L_update_count_and_finish
|
||||||
|
|
||||||
|
.L_align_to_64:
|
||||||
|
tst r3, #4
|
||||||
|
beq .L_mainloop
|
||||||
|
ldr r3, [r1], #4
|
||||||
|
|
||||||
|
sub ip, r3, #0x01010101
|
||||||
|
bic ip, ip, r3
|
||||||
|
ands ip, ip, #0x80808080
|
||||||
|
bne .L_zero_in_second_register
|
||||||
|
|
||||||
|
.p2align 2
|
||||||
|
.L_mainloop:
|
||||||
|
ldrd r2, r3, [r1], #8
|
||||||
|
|
||||||
|
pld [r1, #64]
|
||||||
|
|
||||||
|
sub ip, r2, #0x01010101
|
||||||
|
bic ip, ip, r2
|
||||||
|
ands ip, ip, #0x80808080
|
||||||
|
bne .L_zero_in_first_register
|
||||||
|
|
||||||
|
sub ip, r3, #0x01010101
|
||||||
|
bic ip, ip, r3
|
||||||
|
ands ip, ip, #0x80808080
|
||||||
|
bne .L_zero_in_second_register
|
||||||
|
b .L_mainloop
|
||||||
|
|
||||||
|
.L_update_count_and_finish:
|
||||||
|
sub r3, r1, r0
|
||||||
|
sub r3, r3, #1
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_zero_in_first_register:
|
||||||
|
sub r3, r1, r0
|
||||||
|
lsls r2, ip, #17
|
||||||
|
bne .L_sub8_and_finish
|
||||||
|
bcs .L_sub7_and_finish
|
||||||
|
lsls ip, ip, #1
|
||||||
|
bne .L_sub6_and_finish
|
||||||
|
|
||||||
|
sub r3, r3, #5
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_sub8_and_finish:
|
||||||
|
sub r3, r3, #8
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_sub7_and_finish:
|
||||||
|
sub r3, r3, #7
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_sub6_and_finish:
|
||||||
|
sub r3, r3, #6
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_zero_in_second_register:
|
||||||
|
sub r3, r1, r0
|
||||||
|
lsls r2, ip, #17
|
||||||
|
bne .L_sub4_and_finish
|
||||||
|
bcs .L_sub3_and_finish
|
||||||
|
lsls ip, ip, #1
|
||||||
|
bne .L_sub2_and_finish
|
||||||
|
|
||||||
|
sub r3, r3, #1
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_sub4_and_finish:
|
||||||
|
sub r3, r3, #4
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_sub3_and_finish:
|
||||||
|
sub r3, r3, #3
|
||||||
|
b .L_finish
|
||||||
|
|
||||||
|
.L_sub2_and_finish:
|
||||||
|
sub r3, r3, #2
|
||||||
|
|
||||||
|
.L_finish:
|
||||||
|
cmp r4, #0
|
||||||
|
bne .L_strlen_done
|
||||||
|
|
||||||
|
// Time to get the dst string length.
|
||||||
|
mov r1, r5
|
||||||
|
|
||||||
|
// Save the original source address to r5.
|
||||||
|
mov r5, r0
|
||||||
|
|
||||||
|
// Save the current length (adding 1 for the terminator).
|
||||||
|
add r4, r3, #1
|
||||||
|
b .L_strlen_start
|
||||||
|
|
||||||
|
// r0 holds the pointer to the dst string.
|
||||||
|
// r3 holds the dst string length.
|
||||||
|
// r4 holds the src string length + 1.
|
||||||
|
.L_strlen_done:
|
||||||
|
add r2, r3, r4
|
||||||
|
cmp r2, lr
|
||||||
|
bhi __strcat_chk_failed
|
||||||
|
|
||||||
|
// Set up the registers for the memcpy code.
|
||||||
|
mov r1, r5
|
||||||
|
pld [r1, #64]
|
||||||
|
mov r2, r4
|
||||||
|
add r0, r0, r3
|
||||||
|
pop {r4, r5}
|
||||||
|
END(__strcat_chk)
|
||||||
|
|
||||||
|
#define MEMCPY_BASE __strcat_chk_memcpy_base
|
||||||
|
#define MEMCPY_BASE_ALIGNED __strcat_chk_memcpy_base_aligned
|
||||||
|
|
||||||
|
#include "memcpy_base.S"
|
||||||
|
|
||||||
|
ENTRY_PRIVATE(__strcat_chk_failed)
|
||||||
|
.save {r0, lr}
|
||||||
|
.save {r4, r5}
|
||||||
|
|
||||||
|
.cfi_def_cfa_offset 8
|
||||||
|
.cfi_rel_offset r0, 0
|
||||||
|
.cfi_rel_offset lr, 4
|
||||||
|
.cfi_adjust_cfa_offset 8
|
||||||
|
.cfi_rel_offset r4, 0
|
||||||
|
.cfi_rel_offset r5, 4
|
||||||
|
|
||||||
|
ldr r0, error_message
|
||||||
|
ldr r1, error_code
|
||||||
|
1:
|
||||||
|
add r0, pc
|
||||||
|
bl __fortify_chk_fail
|
||||||
|
error_code:
|
||||||
|
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
|
||||||
|
error_message:
|
||||||
|
.word error_string-(1b+4)
|
||||||
|
END(__strcat_chk_failed)
|
||||||
|
|
||||||
|
.data
|
||||||
|
error_string:
|
||||||
|
.string "strcat: prevented write past end of buffer"
|
||||||
182
libc/arch-arm/denver/bionic/__strcpy_chk.S
Normal file
182
libc/arch-arm/denver/bionic/__strcpy_chk.S
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
/*
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
.thumb
|
||||||
|
.thumb_func
|
||||||
|
|
||||||
|
// Get the length of the source string first, then do a memcpy of the data
|
||||||
|
// instead of a strcpy.
|
||||||
|
ENTRY(__strcpy_chk)
|
||||||
|
pld [r0, #0]
|
||||||
|
push {r0, lr}
|
||||||
|
.save {r0, lr}
|
||||||
|
.cfi_def_cfa_offset 8
|
||||||
|
.cfi_rel_offset r0, 0
|
||||||
|
.cfi_rel_offset lr, 4
|
||||||
|
|
||||||
|
mov lr, r2
|
||||||
|
mov r0, r1
|
||||||
|
|
||||||
|
ands r3, r1, #7
|
||||||
|
beq .L_mainloop
|
||||||
|
|
||||||
|
// Align to a double word (64 bits).
|
||||||
|
rsb r3, r3, #8
|
||||||
|
lsls ip, r3, #31
|
||||||
|
beq .L_align_to_32
|
||||||
|
|
||||||
|
ldrb r2, [r0], #1
|
||||||
|
cbz r2, .L_update_count_and_finish
|
||||||
|
|
||||||
|
.L_align_to_32:
|
||||||
|
bcc .L_align_to_64
|
||||||
|
ands ip, r3, #2
|
||||||
|
beq .L_align_to_64
|
||||||
|
|
||||||
|
ldrb r2, [r0], #1
|
||||||
|
cbz r2, .L_update_count_and_finish
|
||||||
|
ldrb r2, [r0], #1
|
||||||
|
cbz r2, .L_update_count_and_finish
|
||||||
|
|
||||||
|
.L_align_to_64:
|
||||||
|
tst r3, #4
|
||||||
|
beq .L_mainloop
|
||||||
|
ldr r3, [r0], #4
|
||||||
|
|
||||||
|
sub ip, r3, #0x01010101
|
||||||
|
bic ip, ip, r3
|
||||||
|
ands ip, ip, #0x80808080
|
||||||
|
bne .L_zero_in_second_register
|
||||||
|
|
||||||
|
.p2align 2
|
||||||
|
.L_mainloop:
|
||||||
|
ldrd r2, r3, [r0], #8
|
||||||
|
|
||||||
|
pld [r0, #64]
|
||||||
|
|
||||||
|
sub ip, r2, #0x01010101
|
||||||
|
bic ip, ip, r2
|
||||||
|
ands ip, ip, #0x80808080
|
||||||
|
bne .L_zero_in_first_register
|
||||||
|
|
||||||
|
sub ip, r3, #0x01010101
|
||||||
|
bic ip, ip, r3
|
||||||
|
ands ip, ip, #0x80808080
|
||||||
|
bne .L_zero_in_second_register
|
||||||
|
b .L_mainloop
|
||||||
|
|
||||||
|
.L_update_count_and_finish:
|
||||||
|
sub r3, r0, r1
|
||||||
|
sub r3, r3, #1
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_zero_in_first_register:
|
||||||
|
sub r3, r0, r1
|
||||||
|
lsls r2, ip, #17
|
||||||
|
bne .L_sub8_and_finish
|
||||||
|
bcs .L_sub7_and_finish
|
||||||
|
lsls ip, ip, #1
|
||||||
|
bne .L_sub6_and_finish
|
||||||
|
|
||||||
|
sub r3, r3, #5
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_sub8_and_finish:
|
||||||
|
sub r3, r3, #8
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_sub7_and_finish:
|
||||||
|
sub r3, r3, #7
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_sub6_and_finish:
|
||||||
|
sub r3, r3, #6
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_zero_in_second_register:
|
||||||
|
sub r3, r0, r1
|
||||||
|
lsls r2, ip, #17
|
||||||
|
bne .L_sub4_and_finish
|
||||||
|
bcs .L_sub3_and_finish
|
||||||
|
lsls ip, ip, #1
|
||||||
|
bne .L_sub2_and_finish
|
||||||
|
|
||||||
|
sub r3, r3, #1
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_sub4_and_finish:
|
||||||
|
sub r3, r3, #4
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_sub3_and_finish:
|
||||||
|
sub r3, r3, #3
|
||||||
|
b .L_check_size
|
||||||
|
|
||||||
|
.L_sub2_and_finish:
|
||||||
|
sub r3, r3, #2
|
||||||
|
|
||||||
|
.L_check_size:
|
||||||
|
pld [r1, #0]
|
||||||
|
pld [r1, #64]
|
||||||
|
ldr r0, [sp]
|
||||||
|
cmp r3, lr
|
||||||
|
bhs __strcpy_chk_failed
|
||||||
|
|
||||||
|
// Add 1 for copy length to get the string terminator.
|
||||||
|
add r2, r3, #1
|
||||||
|
END(__strcpy_chk)
|
||||||
|
|
||||||
|
#define MEMCPY_BASE __strcpy_chk_memcpy_base
|
||||||
|
#define MEMCPY_BASE_ALIGNED __strcpy_chk_memcpy_base_aligned
|
||||||
|
#include "memcpy_base.S"
|
||||||
|
|
||||||
|
ENTRY_PRIVATE(__strcpy_chk_failed)
|
||||||
|
.save {r0, lr}
|
||||||
|
.cfi_def_cfa_offset 8
|
||||||
|
.cfi_rel_offset r0, 0
|
||||||
|
.cfi_rel_offset lr, 4
|
||||||
|
|
||||||
|
ldr r0, error_message
|
||||||
|
ldr r1, error_code
|
||||||
|
1:
|
||||||
|
add r0, pc
|
||||||
|
bl __fortify_chk_fail
|
||||||
|
error_code:
|
||||||
|
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
|
||||||
|
error_message:
|
||||||
|
.word error_string-(1b+4)
|
||||||
|
END(__strcpy_chk_failed)
|
||||||
|
|
||||||
|
.data
|
||||||
|
error_string:
|
||||||
|
.string "strcpy: prevented write past end of buffer"
|
||||||
105
libc/arch-arm/denver/bionic/memcpy.S
Normal file
105
libc/arch-arm/denver/bionic/memcpy.S
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* 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).
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
|
.text
|
||||||
|
.syntax unified
|
||||||
|
.fpu neon
|
||||||
|
|
||||||
|
ENTRY(__memcpy_chk)
|
||||||
|
cmp r2, r3
|
||||||
|
bhi __memcpy_chk_fail
|
||||||
|
|
||||||
|
// Fall through to memcpy...
|
||||||
|
END(__memcpy_chk)
|
||||||
|
|
||||||
|
ENTRY(memcpy)
|
||||||
|
pld [r1, #64]
|
||||||
|
push {r0, lr}
|
||||||
|
.save {r0, lr}
|
||||||
|
.cfi_def_cfa_offset 8
|
||||||
|
.cfi_rel_offset r0, 0
|
||||||
|
.cfi_rel_offset lr, 4
|
||||||
|
END(memcpy)
|
||||||
|
|
||||||
|
#define MEMCPY_BASE __memcpy_base
|
||||||
|
#define MEMCPY_BASE_ALIGNED __memcpy_base_aligned
|
||||||
|
#include "memcpy_base.S"
|
||||||
|
|
||||||
|
ENTRY_PRIVATE(__memcpy_chk_fail)
|
||||||
|
// Preserve lr for backtrace.
|
||||||
|
push {lr}
|
||||||
|
.save {lr}
|
||||||
|
.cfi_def_cfa_offset 4
|
||||||
|
.cfi_rel_offset lr, 0
|
||||||
|
|
||||||
|
ldr r0, error_message
|
||||||
|
ldr r1, error_code
|
||||||
|
1:
|
||||||
|
add r0, pc
|
||||||
|
bl __fortify_chk_fail
|
||||||
|
error_code:
|
||||||
|
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
|
||||||
|
error_message:
|
||||||
|
.word error_string-(1b+8)
|
||||||
|
END(__memcpy_chk_fail)
|
||||||
|
|
||||||
|
.data
|
||||||
|
error_string:
|
||||||
|
.string "memcpy: prevented write past end of buffer"
|
||||||
234
libc/arch-arm/denver/bionic/memcpy_base.S
Normal file
234
libc/arch-arm/denver/bionic/memcpy_base.S
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2008 The Android Open Source Project
|
||||||
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2013-2014, NVIDIA Corporation. 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CACHE_LINE_SIZE (64)
|
||||||
|
#define PREFETCH_DISTANCE (CACHE_LINE_SIZE*6)
|
||||||
|
|
||||||
|
ENTRY_PRIVATE(MEMCPY_BASE)
|
||||||
|
.cfi_def_cfa_offset 8
|
||||||
|
.cfi_rel_offset r0, 0
|
||||||
|
.cfi_rel_offset lr, 4
|
||||||
|
|
||||||
|
cmp r2, #0
|
||||||
|
beq .L_memcpy_done
|
||||||
|
cmp r0, r1
|
||||||
|
beq .L_memcpy_done
|
||||||
|
|
||||||
|
/* preload next cache line */
|
||||||
|
pld [r1, #CACHE_LINE_SIZE*1]
|
||||||
|
|
||||||
|
/* Deal with very small blocks (< 32bytes) asap */
|
||||||
|
cmp r2, #32
|
||||||
|
blo .L_memcpy_lt_32bytes
|
||||||
|
/* no need to align if len < 128 bytes */
|
||||||
|
cmp r2, #128
|
||||||
|
blo .L_memcpy_lt_128bytes
|
||||||
|
|
||||||
|
/* large copy, align dest to 64 byte boundry */
|
||||||
|
pld [r1, #CACHE_LINE_SIZE*2]
|
||||||
|
rsb r3, r0, #0
|
||||||
|
ands r3, r3, #0x3F
|
||||||
|
pld [r1, #CACHE_LINE_SIZE*3]
|
||||||
|
beq .L_memcpy_dispatch
|
||||||
|
sub r2, r2, r3
|
||||||
|
/* copy 1 byte */
|
||||||
|
movs ip, r3, lsl #31
|
||||||
|
itt mi
|
||||||
|
ldrbmi ip, [r1], #1
|
||||||
|
strbmi ip, [r0], #1
|
||||||
|
/* copy 2 bytes */
|
||||||
|
itt cs
|
||||||
|
ldrhcs ip, [r1], #2
|
||||||
|
strhcs ip, [r0], #2
|
||||||
|
/* copy 4 bytes */
|
||||||
|
movs ip, r3, lsl #29
|
||||||
|
itt mi
|
||||||
|
ldrmi ip, [r1], #4
|
||||||
|
strmi ip, [r0], #4
|
||||||
|
/* copy 8 bytes */
|
||||||
|
bcc 1f
|
||||||
|
vld1.8 {d0}, [r1]!
|
||||||
|
vst1.8 {d0}, [r0, :64]!
|
||||||
|
1: /* copy 16 bytes */
|
||||||
|
movs ip, r3, lsl #27
|
||||||
|
bpl 1f
|
||||||
|
vld1.8 {q0}, [r1]!
|
||||||
|
vst1.8 {q0}, [r0, :128]!
|
||||||
|
1: /* copy 32 bytes */
|
||||||
|
bcc .L_memcpy_dispatch
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
|
||||||
|
.L_memcpy_dispatch:
|
||||||
|
// pre-decrement by 128 to detect nearly-done condition easily, but
|
||||||
|
// also need to check if we have less than 128 bytes left at this
|
||||||
|
// point due to alignment code above
|
||||||
|
subs r2, r2, #128
|
||||||
|
blo .L_memcpy_lt_128presub
|
||||||
|
|
||||||
|
// Denver does better if both source and dest are aligned so
|
||||||
|
// we'll special-case that even though the code is virually identical
|
||||||
|
tst r1, #0xF
|
||||||
|
bne .L_memcpy_neon_unalign_src_pld
|
||||||
|
|
||||||
|
// DRAM memcpy should be throttled slightly to get full bandwidth
|
||||||
|
//
|
||||||
|
cmp r2, #32768
|
||||||
|
bhi .L_memcpy_neon_unalign_src_pld
|
||||||
|
.align 4
|
||||||
|
1:
|
||||||
|
/* copy 128 bytes in each loop */
|
||||||
|
subs r2, r2, #128
|
||||||
|
|
||||||
|
/* preload a cache line */
|
||||||
|
pld [r1, #PREFETCH_DISTANCE]
|
||||||
|
/* copy a cache line */
|
||||||
|
vld1.8 {q0, q1}, [r1, :128]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
vld1.8 {q0, q1}, [r1, :128]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
/* preload a cache line */
|
||||||
|
pld [r1, #PREFETCH_DISTANCE]
|
||||||
|
/* copy a cache line */
|
||||||
|
vld1.8 {q0, q1}, [r1, :128]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
vld1.8 {q0, q1}, [r1, :128]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
|
||||||
|
bhs 1b
|
||||||
|
adds r2, r2, #128
|
||||||
|
bne .L_memcpy_lt_128bytes_align
|
||||||
|
pop {r0, pc}
|
||||||
|
|
||||||
|
.align 4
|
||||||
|
.L_memcpy_neon_unalign_src_pld:
|
||||||
|
1:
|
||||||
|
/* copy 128 bytes in each loop */
|
||||||
|
subs r2, r2, #128
|
||||||
|
|
||||||
|
/* preload a cache line */
|
||||||
|
pld [r1, #PREFETCH_DISTANCE]
|
||||||
|
/* copy a cache line */
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
/* preload a cache line */
|
||||||
|
pld [r1, #PREFETCH_DISTANCE]
|
||||||
|
/* copy a cache line */
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
|
||||||
|
bhs 1b
|
||||||
|
adds r2, r2, #128
|
||||||
|
bne .L_memcpy_lt_128bytes_align
|
||||||
|
pop {r0, pc}
|
||||||
|
|
||||||
|
.L_memcpy_lt_128presub:
|
||||||
|
add r2, r2, #128
|
||||||
|
.L_memcpy_lt_128bytes_align:
|
||||||
|
/* copy 64 bytes */
|
||||||
|
movs ip, r2, lsl #26
|
||||||
|
bcc 1f
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
1: /* copy 32 bytes */
|
||||||
|
bpl 1f
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0, :256]!
|
||||||
|
1: /* copy 16 bytes */
|
||||||
|
movs ip, r2, lsl #28
|
||||||
|
bcc 1f
|
||||||
|
vld1.8 {q0}, [r1]!
|
||||||
|
vst1.8 {q0}, [r0, :128]!
|
||||||
|
1: /* copy 8 bytes */
|
||||||
|
bpl 1f
|
||||||
|
vld1.8 {d0}, [r1]!
|
||||||
|
vst1.8 {d0}, [r0, :64]!
|
||||||
|
1: /* copy 4 bytes */
|
||||||
|
tst r2, #4
|
||||||
|
itt ne
|
||||||
|
ldrne ip, [r1], #4
|
||||||
|
strne ip, [r0], #4
|
||||||
|
/* copy 2 bytes */
|
||||||
|
movs ip, r2, lsl #31
|
||||||
|
itt cs
|
||||||
|
ldrhcs ip, [r1], #2
|
||||||
|
strhcs ip, [r0], #2
|
||||||
|
/* copy 1 byte */
|
||||||
|
itt mi
|
||||||
|
ldrbmi ip, [r1]
|
||||||
|
strbmi ip, [r0]
|
||||||
|
|
||||||
|
pop {r0, pc}
|
||||||
|
|
||||||
|
.L_memcpy_lt_128bytes:
|
||||||
|
/* copy 64 bytes */
|
||||||
|
movs ip, r2, lsl #26
|
||||||
|
bcc 1f
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0]!
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0]!
|
||||||
|
1: /* copy 32 bytes */
|
||||||
|
bpl .L_memcpy_lt_32bytes
|
||||||
|
vld1.8 {q0, q1}, [r1]!
|
||||||
|
vst1.8 {q0, q1}, [r0]!
|
||||||
|
.L_memcpy_lt_32bytes:
|
||||||
|
/* copy 16 bytes */
|
||||||
|
movs ip, r2, lsl #28
|
||||||
|
bcc 1f
|
||||||
|
vld1.8 {q0}, [r1]!
|
||||||
|
vst1.8 {q0}, [r0]!
|
||||||
|
1: /* copy 8 bytes */
|
||||||
|
bpl 1f
|
||||||
|
vld1.8 {d0}, [r1]!
|
||||||
|
vst1.8 {d0}, [r0]!
|
||||||
|
1: /* copy 4 bytes */
|
||||||
|
tst r2, #4
|
||||||
|
itt ne
|
||||||
|
ldrne ip, [r1], #4
|
||||||
|
strne ip, [r0], #4
|
||||||
|
/* copy 2 bytes */
|
||||||
|
movs ip, r2, lsl #31
|
||||||
|
itt cs
|
||||||
|
ldrhcs ip, [r1], #2
|
||||||
|
strhcs ip, [r0], #2
|
||||||
|
/* copy 1 byte */
|
||||||
|
itt mi
|
||||||
|
ldrbmi ip, [r1]
|
||||||
|
strbmi ip, [r0]
|
||||||
|
|
||||||
|
.L_memcpy_done:
|
||||||
|
pop {r0, pc}
|
||||||
|
END(MEMCPY_BASE)
|
||||||
207
libc/arch-arm/denver/bionic/memset.S
Normal file
207
libc/arch-arm/denver/bionic/memset.S
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 The Android Open Source Project
|
||||||
|
* Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Optimized memset() for ARM.
|
||||||
|
*
|
||||||
|
* memset() returns its first argument.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fpu neon
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
ENTRY(__memset_chk)
|
||||||
|
cmp r2, r3
|
||||||
|
bls .L_done
|
||||||
|
|
||||||
|
// Preserve lr for backtrace.
|
||||||
|
push {lr}
|
||||||
|
.cfi_def_cfa_offset 4
|
||||||
|
.cfi_rel_offset lr, 0
|
||||||
|
|
||||||
|
|
||||||
|
ldr r0, error_message
|
||||||
|
ldr r1, error_code
|
||||||
|
1:
|
||||||
|
add r0, pc
|
||||||
|
bl __fortify_chk_fail
|
||||||
|
error_code:
|
||||||
|
.word BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW
|
||||||
|
error_message:
|
||||||
|
.word error_string-(1b+8)
|
||||||
|
END(__memset_chk)
|
||||||
|
|
||||||
|
ENTRY(bzero)
|
||||||
|
mov r2, r1
|
||||||
|
mov r1, #0
|
||||||
|
.L_done:
|
||||||
|
// Fall through to memset...
|
||||||
|
END(bzero)
|
||||||
|
|
||||||
|
ENTRY(memset)
|
||||||
|
pldw [r0]
|
||||||
|
mov r3, r0
|
||||||
|
|
||||||
|
// Duplicate the low byte of r1
|
||||||
|
mov r1, r1, lsl #24
|
||||||
|
orr r1, r1, r1, lsr #8
|
||||||
|
orr r1, r1, r1, lsr #16
|
||||||
|
|
||||||
|
cmp r2, #16
|
||||||
|
blo .L_less_than_16
|
||||||
|
|
||||||
|
// This section handles regions 16 bytes or larger
|
||||||
|
//
|
||||||
|
// Use aligned vst1.8 and vstm when possible. Register values will be:
|
||||||
|
// ip is scratch
|
||||||
|
// q0, q1, and r1 contain the memset value
|
||||||
|
// r2 is the number of bytes to set
|
||||||
|
// r3 is the advancing destination pointer
|
||||||
|
vdup.32 q0, r1
|
||||||
|
|
||||||
|
ands ip, r3, 0xF
|
||||||
|
beq .L_memset_aligned
|
||||||
|
|
||||||
|
// Align dest pointer to 16-byte boundary.
|
||||||
|
pldw [r0, #64]
|
||||||
|
rsb ip, ip, #16
|
||||||
|
|
||||||
|
// Pre-adjust the byte count to reflect post-aligment value. Expecting
|
||||||
|
// 8-byte alignment to be rather common so we special case that one.
|
||||||
|
sub r2, r2, ip
|
||||||
|
|
||||||
|
/* set 1 byte */
|
||||||
|
tst ip, #1
|
||||||
|
it ne
|
||||||
|
strbne r1, [r3], #1
|
||||||
|
/* set 2 bytes */
|
||||||
|
tst ip, #2
|
||||||
|
it ne
|
||||||
|
strhne r1, [r3], #2
|
||||||
|
/* set 4 bytes */
|
||||||
|
movs ip, ip, lsl #29
|
||||||
|
it mi
|
||||||
|
strmi r1, [r3], #4
|
||||||
|
/* set 8 bytes */
|
||||||
|
itt cs
|
||||||
|
strcs r1, [r3], #4
|
||||||
|
strcs r1, [r3], #4
|
||||||
|
|
||||||
|
.L_memset_aligned:
|
||||||
|
// Destination is now 16-byte aligned. Determine how to handle
|
||||||
|
// remaining bytes.
|
||||||
|
vmov q1, q0
|
||||||
|
cmp r2, #128
|
||||||
|
blo .L_less_than_128
|
||||||
|
|
||||||
|
// We need to set a larger block of memory. Use four Q regs to
|
||||||
|
// set a full cache line in one instruction. Pre-decrement
|
||||||
|
// r2 to simplify end-of-loop detection
|
||||||
|
vmov q2, q0
|
||||||
|
vmov q3, q0
|
||||||
|
pldw [r0, #128]
|
||||||
|
sub r2, r2, #128
|
||||||
|
.align 4
|
||||||
|
.L_memset_loop_128:
|
||||||
|
pldw [r3, #192]
|
||||||
|
vstm r3!, {q0, q1, q2, q3}
|
||||||
|
vstm r3!, {q0, q1, q2, q3}
|
||||||
|
subs r2, r2, #128
|
||||||
|
bhs .L_memset_loop_128
|
||||||
|
|
||||||
|
// Un-bias r2 so it contains the number of bytes left. Early
|
||||||
|
// exit if we are done.
|
||||||
|
adds r2, r2, #128
|
||||||
|
beq 2f
|
||||||
|
|
||||||
|
.align 4
|
||||||
|
.L_less_than_128:
|
||||||
|
// set 64 bytes
|
||||||
|
movs ip, r2, lsl #26
|
||||||
|
bcc 1f
|
||||||
|
vst1.8 {q0, q1}, [r3, :128]!
|
||||||
|
vst1.8 {q0, q1}, [r3, :128]!
|
||||||
|
beq 2f
|
||||||
|
1:
|
||||||
|
// set 32 bytes
|
||||||
|
bpl 1f
|
||||||
|
vst1.8 {q0, q1}, [r3, :128]!
|
||||||
|
1:
|
||||||
|
// set 16 bytes
|
||||||
|
movs ip, r2, lsl #28
|
||||||
|
bcc 1f
|
||||||
|
vst1.8 {q0}, [r3, :128]!
|
||||||
|
beq 2f
|
||||||
|
1:
|
||||||
|
// set 8 bytes
|
||||||
|
bpl 1f
|
||||||
|
vst1.8 {d0}, [r3, :64]!
|
||||||
|
1:
|
||||||
|
// set 4 bytes
|
||||||
|
tst r2, #4
|
||||||
|
it ne
|
||||||
|
strne r1, [r3], #4
|
||||||
|
1:
|
||||||
|
// set 2 bytes
|
||||||
|
movs ip, r2, lsl #31
|
||||||
|
it cs
|
||||||
|
strhcs r1, [r3], #2
|
||||||
|
// set 1 byte
|
||||||
|
it mi
|
||||||
|
strbmi r1, [r3]
|
||||||
|
2:
|
||||||
|
bx lr
|
||||||
|
|
||||||
|
.L_less_than_16:
|
||||||
|
// Store up to 15 bytes without worrying about byte alignment
|
||||||
|
movs ip, r2, lsl #29
|
||||||
|
bcc 1f
|
||||||
|
str r1, [r3], #4
|
||||||
|
str r1, [r3], #4
|
||||||
|
beq 2f
|
||||||
|
1:
|
||||||
|
it mi
|
||||||
|
strmi r1, [r3], #4
|
||||||
|
movs ip, r2, lsl #31
|
||||||
|
it mi
|
||||||
|
strbmi r1, [r3], #1
|
||||||
|
itt cs
|
||||||
|
strbcs r1, [r3], #1
|
||||||
|
strbcs r1, [r3]
|
||||||
|
2:
|
||||||
|
bx lr
|
||||||
|
END(memset)
|
||||||
|
|
||||||
|
.data
|
||||||
|
error_string:
|
||||||
|
.string "memset: prevented write past end of buffer"
|
||||||
12
libc/arch-arm/denver/denver.mk
Normal file
12
libc/arch-arm/denver/denver.mk
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
libc_bionic_src_files_arm += \
|
||||||
|
arch-arm/denver/bionic/memcpy.S \
|
||||||
|
arch-arm/denver/bionic/memset.S \
|
||||||
|
arch-arm/denver/bionic/__strcat_chk.S \
|
||||||
|
arch-arm/denver/bionic/__strcpy_chk.S
|
||||||
|
|
||||||
|
# Use cortex-a15 versions of strcat/strcpy/strlen.
|
||||||
|
libc_bionic_src_files_arm += \
|
||||||
|
arch-arm/cortex-a15/bionic/strcat.S \
|
||||||
|
arch-arm/cortex-a15/bionic/strcpy.S \
|
||||||
|
arch-arm/cortex-a15/bionic/strlen.S \
|
||||||
|
arch-arm/cortex-a15/bionic/strcmp.S
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optimized memcpy() for ARM.
|
* Optimized memcpy() for ARM.
|
||||||
@@ -57,9 +57,9 @@ ENTRY(memcpy)
|
|||||||
|
|
||||||
// preload the destination because we'll align it to a cache line
|
// preload the destination because we'll align it to a cache line
|
||||||
// with small writes. Also start the source "pump".
|
// with small writes. Also start the source "pump".
|
||||||
PLD (r0, #0)
|
pld [r0, #0]
|
||||||
PLD (r1, #0)
|
pld [r1, #0]
|
||||||
PLD (r1, #32)
|
pld [r1, #32]
|
||||||
|
|
||||||
/* it simplifies things to take care of len<4 early */
|
/* it simplifies things to take care of len<4 early */
|
||||||
cmp r2, #4
|
cmp r2, #4
|
||||||
@@ -147,7 +147,7 @@ cached_aligned32:
|
|||||||
add r12, r12, #64
|
add r12, r12, #64
|
||||||
|
|
||||||
1: ldmia r1!, { r4-r11 }
|
1: ldmia r1!, { r4-r11 }
|
||||||
PLD (r12, #64)
|
pld [r12, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
|
|
||||||
// NOTE: if r12 is more than 64 ahead of r1, the following ldrhi
|
// NOTE: if r12 is more than 64 ahead of r1, the following ldrhi
|
||||||
@@ -268,7 +268,7 @@ loop16:
|
|||||||
ldr r12, [r1], #4
|
ldr r12, [r1], #4
|
||||||
1: mov r4, r12
|
1: mov r4, r12
|
||||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
ldrhs r12, [r1], #4
|
ldrhs r12, [r1], #4
|
||||||
orr r3, r3, r4, lsl #16
|
orr r3, r3, r4, lsl #16
|
||||||
@@ -295,7 +295,7 @@ loop8:
|
|||||||
ldr r12, [r1], #4
|
ldr r12, [r1], #4
|
||||||
1: mov r4, r12
|
1: mov r4, r12
|
||||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
ldrhs r12, [r1], #4
|
ldrhs r12, [r1], #4
|
||||||
orr r3, r3, r4, lsl #24
|
orr r3, r3, r4, lsl #24
|
||||||
@@ -322,7 +322,7 @@ loop24:
|
|||||||
ldr r12, [r1], #4
|
ldr r12, [r1], #4
|
||||||
1: mov r4, r12
|
1: mov r4, r12
|
||||||
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
ldmia r1!, { r5,r6,r7, r8,r9,r10,r11}
|
||||||
PLD (r1, #64)
|
pld [r1, #64]
|
||||||
subs r2, r2, #32
|
subs r2, r2, #32
|
||||||
ldrhs r12, [r1], #4
|
ldrhs r12, [r1], #4
|
||||||
orr r3, r3, r4, lsl #8
|
orr r3, r3, r4, lsl #8
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optimized memset() for ARM.
|
* Optimized memset() for ARM.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
@@ -52,8 +52,8 @@
|
|||||||
#define magic2(REG) REG, lsl #7
|
#define magic2(REG) REG, lsl #7
|
||||||
|
|
||||||
ENTRY(strcmp)
|
ENTRY(strcmp)
|
||||||
PLD(r0, #0)
|
pld [r0, #0]
|
||||||
PLD(r1, #0)
|
pld [r1, #0]
|
||||||
eor r2, r0, r1
|
eor r2, r0, r1
|
||||||
tst r2, #3
|
tst r2, #3
|
||||||
|
|
||||||
@@ -88,8 +88,8 @@ ENTRY(strcmp)
|
|||||||
orr r4, r4, r4, lsl #16
|
orr r4, r4, r4, lsl #16
|
||||||
.p2align 2
|
.p2align 2
|
||||||
4:
|
4:
|
||||||
PLD(r0, #8)
|
pld [r0, #8]
|
||||||
PLD(r1, #8)
|
pld [r1, #8]
|
||||||
sub r2, ip, magic1(r4)
|
sub r2, ip, magic1(r4)
|
||||||
cmp ip, r3
|
cmp ip, r3
|
||||||
itttt eq
|
itttt eq
|
||||||
|
|||||||
@@ -30,10 +30,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
ENTRY(strcpy)
|
ENTRY(strcpy)
|
||||||
PLD(r1, #0)
|
pld [r1, #0]
|
||||||
eor r2, r0, r1
|
eor r2, r0, r1
|
||||||
mov ip, r0
|
mov ip, r0
|
||||||
tst r2, #3
|
tst r2, #3
|
||||||
@@ -62,7 +62,7 @@ ENTRY(strcpy)
|
|||||||
load stalls. */
|
load stalls. */
|
||||||
.p2align 2
|
.p2align 2
|
||||||
2:
|
2:
|
||||||
PLD(r1, #8)
|
pld [r1, #8]
|
||||||
ldr r4, [r1], #4
|
ldr r4, [r1], #4
|
||||||
sub r2, r3, r5
|
sub r2, r3, r5
|
||||||
bics r2, r2, r3
|
bics r2, r2, r3
|
||||||
|
|||||||
@@ -63,9 +63,7 @@ size_t strlen(const char *s)
|
|||||||
"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
|
|
||||||
"pld [%[s], #64] \n"
|
"pld [%[s], #64] \n"
|
||||||
#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"
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/generic/bionic/memcpy.S)
|
libc_bionic_src_files_arm += \
|
||||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/generic/bionic/memset.S)
|
arch-arm/generic/bionic/memcpy.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCAT,string/strcat.c)
|
arch-arm/generic/bionic/memset.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/generic/bionic/strcmp.S)
|
arch-arm/generic/bionic/strcmp.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCPY,arch-arm/generic/bionic/strcpy.S)
|
arch-arm/generic/bionic/strcpy.S \
|
||||||
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/generic/bionic/strlen.c)
|
arch-arm/generic/bionic/strlen.c \
|
||||||
$(call libc-add-cpu-variant-src,__STRCAT_CHK,bionic/__strcat_chk.cpp)
|
bionic/__strcat_chk.cpp \
|
||||||
$(call libc-add-cpu-variant-src,__STRCPY_CHK,bionic/__strcpy_chk.cpp)
|
bionic/__strcpy_chk.cpp \
|
||||||
|
upstream-openbsd/lib/libc/string/strcat.c \
|
||||||
|
|||||||
@@ -1,110 +0,0 @@
|
|||||||
/* $OpenBSD: _types.h,v 1.3 2006/02/14 18:12:58 miod Exp $ */
|
|
||||||
|
|
||||||
/*-
|
|
||||||
* 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.
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @(#)types.h 8.3 (Berkeley) 1/5/94
|
|
||||||
* @(#)ansi.h 8.2 (Berkeley) 1/4/94
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ARM__TYPES_H_
|
|
||||||
#define _ARM__TYPES_H_
|
|
||||||
|
|
||||||
/* 7.18.1.1 Exact-width integer types */
|
|
||||||
typedef __signed char __int8_t;
|
|
||||||
typedef unsigned char __uint8_t;
|
|
||||||
typedef short __int16_t;
|
|
||||||
typedef unsigned short __uint16_t;
|
|
||||||
typedef int __int32_t;
|
|
||||||
typedef unsigned int __uint32_t;
|
|
||||||
/* LONGLONG */
|
|
||||||
typedef long long __int64_t;
|
|
||||||
/* LONGLONG */
|
|
||||||
typedef unsigned long long __uint64_t;
|
|
||||||
|
|
||||||
/* 7.18.1.2 Minimum-width integer types */
|
|
||||||
typedef __int8_t __int_least8_t;
|
|
||||||
typedef __uint8_t __uint_least8_t;
|
|
||||||
typedef __int16_t __int_least16_t;
|
|
||||||
typedef __uint16_t __uint_least16_t;
|
|
||||||
typedef __int32_t __int_least32_t;
|
|
||||||
typedef __uint32_t __uint_least32_t;
|
|
||||||
typedef __int64_t __int_least64_t;
|
|
||||||
typedef __uint64_t __uint_least64_t;
|
|
||||||
|
|
||||||
/* 7.18.1.3 Fastest minimum-width integer types */
|
|
||||||
typedef __int32_t __int_fast8_t;
|
|
||||||
typedef __uint32_t __uint_fast8_t;
|
|
||||||
typedef __int32_t __int_fast16_t;
|
|
||||||
typedef __uint32_t __uint_fast16_t;
|
|
||||||
typedef __int32_t __int_fast32_t;
|
|
||||||
typedef __uint32_t __uint_fast32_t;
|
|
||||||
typedef __int64_t __int_fast64_t;
|
|
||||||
typedef __uint64_t __uint_fast64_t;
|
|
||||||
|
|
||||||
/* 7.18.1.4 Integer types capable of holding object pointers */
|
|
||||||
typedef int __intptr_t;
|
|
||||||
typedef unsigned int __uintptr_t;
|
|
||||||
|
|
||||||
/* 7.18.1.5 Greatest-width integer types */
|
|
||||||
typedef __int64_t __intmax_t;
|
|
||||||
typedef __uint64_t __uintmax_t;
|
|
||||||
|
|
||||||
/* Register size */
|
|
||||||
typedef __int32_t __register_t;
|
|
||||||
|
|
||||||
/* VM system types */
|
|
||||||
typedef unsigned long __vaddr_t;
|
|
||||||
typedef unsigned long __paddr_t;
|
|
||||||
typedef unsigned long __vsize_t;
|
|
||||||
typedef unsigned long __psize_t;
|
|
||||||
|
|
||||||
/* Standard system types */
|
|
||||||
typedef int __clock_t;
|
|
||||||
typedef int __clockid_t;
|
|
||||||
typedef double __double_t;
|
|
||||||
typedef float __float_t;
|
|
||||||
typedef long __ptrdiff_t;
|
|
||||||
typedef int __time_t;
|
|
||||||
typedef int __timer_t;
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 3
|
|
||||||
typedef __builtin_va_list __va_list;
|
|
||||||
#else
|
|
||||||
typedef char * __va_list;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Wide character support types */
|
|
||||||
#ifndef __cplusplus
|
|
||||||
typedef int __wchar_t;
|
|
||||||
#endif
|
|
||||||
typedef int __wint_t;
|
|
||||||
typedef int __rune_t;
|
|
||||||
typedef void * __wctrans_t;
|
|
||||||
typedef void * __wctype_t;
|
|
||||||
|
|
||||||
#endif /* _ARM__TYPES_H_ */
|
|
||||||
@@ -38,107 +38,22 @@
|
|||||||
#ifndef _ARM32_ASM_H_
|
#ifndef _ARM32_ASM_H_
|
||||||
#define _ARM32_ASM_H_
|
#define _ARM32_ASM_H_
|
||||||
|
|
||||||
#ifdef __ELF__
|
|
||||||
# define _C_LABEL(x) x
|
|
||||||
#else
|
|
||||||
# ifdef __STDC__
|
|
||||||
# define _C_LABEL(x) _ ## x
|
|
||||||
# else
|
|
||||||
# define _C_LABEL(x) _/**/x
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#define _ASM_LABEL(x) x
|
|
||||||
|
|
||||||
#ifdef __STDC__
|
|
||||||
# define __CONCAT(x,y) x ## y
|
|
||||||
# define __STRING(x) #x
|
|
||||||
#else
|
|
||||||
# define __CONCAT(x,y) x/**/y
|
|
||||||
# define __STRING(x) "x"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ALIGN_TEXT
|
#ifndef _ALIGN_TEXT
|
||||||
# define _ALIGN_TEXT .align 0
|
# define _ALIGN_TEXT .align 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
#undef __bionic_asm_custom_entry
|
||||||
* gas/arm uses @ as a single comment character and thus cannot be used here
|
#undef __bionic_asm_custom_end
|
||||||
* Instead it recognised the # instead of an @ symbols in .type directives
|
#define __bionic_asm_custom_entry(f) .fnstart
|
||||||
* We define a couple of macros so that assembly code will not be dependant
|
#define __bionic_asm_custom_end(f) .fnend
|
||||||
* on one or the other.
|
|
||||||
*/
|
|
||||||
#define _ASM_TYPE_FUNCTION #function
|
|
||||||
#define _ASM_TYPE_OBJECT #object
|
|
||||||
#define _ENTRY(x) \
|
|
||||||
.text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x: .fnstart; .cfi_startproc;
|
|
||||||
|
|
||||||
#define _ASM_SIZE(x) .size x, .-x;
|
#undef __bionic_asm_function_type
|
||||||
|
#define __bionic_asm_function_type #function
|
||||||
#define _END(x) \
|
|
||||||
.fnend; .cfi_endproc; \
|
|
||||||
_ASM_SIZE(x)
|
|
||||||
|
|
||||||
#ifdef GPROF
|
|
||||||
# ifdef __ELF__
|
|
||||||
# define _PROF_PROLOGUE \
|
|
||||||
mov ip, lr; bl __mcount
|
|
||||||
# else
|
|
||||||
# define _PROF_PROLOGUE \
|
|
||||||
mov ip,lr; bl mcount
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define _PROF_PROLOGUE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
|
|
||||||
#define ENTRY_NP(y) _ENTRY(_C_LABEL(y))
|
|
||||||
#define END(y) _END(_C_LABEL(y))
|
|
||||||
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
|
|
||||||
#define ASENTRY_NP(y) _ENTRY(_ASM_LABEL(y))
|
|
||||||
#define ASEND(y) _END(_ASM_LABEL(y))
|
|
||||||
|
|
||||||
#ifdef __ELF__
|
|
||||||
#define ENTRY_PRIVATE(y) ENTRY(y); .hidden _C_LABEL(y)
|
|
||||||
#else
|
|
||||||
#define ENTRY_PRIVATE(y) ENTRY(y)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ASMSTR .asciz
|
|
||||||
|
|
||||||
#if defined(__ELF__) && defined(PIC)
|
#if defined(__ELF__) && defined(PIC)
|
||||||
#ifdef __STDC__
|
#define PIC_SYM(x,y) x ## ( ## y ## )
|
||||||
#define PIC_SYM(x,y) x ## ( ## y ## )
|
|
||||||
#else
|
#else
|
||||||
#define PIC_SYM(x,y) x/**/(/**/y/**/)
|
#define PIC_SYM(x,y) x
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
#define PIC_SYM(x,y) x
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __ELF__
|
|
||||||
#define RCSID(x) .section ".ident"; .asciz x
|
|
||||||
#else
|
|
||||||
#define RCSID(x) .text; .asciz x
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __ELF__
|
|
||||||
#define WEAK_ALIAS(alias,sym) \
|
|
||||||
.weak alias; \
|
|
||||||
alias = sym
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __STDC__
|
|
||||||
#define WARN_REFERENCES(sym,msg) \
|
|
||||||
.stabs msg ## ,30,0,0,0 ; \
|
|
||||||
.stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
|
|
||||||
#elif defined(__ELF__)
|
|
||||||
#define WARN_REFERENCES(sym,msg) \
|
|
||||||
.stabs msg,30,0,0,0 ; \
|
|
||||||
.stabs __STRING(sym),1,0,0,0
|
|
||||||
#else
|
|
||||||
#define WARN_REFERENCES(sym,msg) \
|
|
||||||
.stabs msg,30,0,0,0 ; \
|
|
||||||
.stabs __STRING(_/**/sym),1,0,0,0
|
|
||||||
#endif /* __STDC__ */
|
|
||||||
|
|
||||||
#endif /* !_ARM_ASM_H_ */
|
#endif /* !_ARM_ASM_H_ */
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
/* $OpenBSD: cdefs.h,v 1.2 2005/11/24 20:46:44 deraadt Exp $ */
|
|
||||||
|
|
||||||
#ifndef _MACHINE_CDEFS_H_
|
|
||||||
#define _MACHINE_CDEFS_H_
|
|
||||||
|
|
||||||
#if defined(lint)
|
|
||||||
#define __indr_reference(sym,alias) __lint_equal__(sym,alias)
|
|
||||||
#define __warn_references(sym,msg)
|
|
||||||
#define __weak_alias(alias,sym) __lint_equal__(sym,alias)
|
|
||||||
#elif defined(__GNUC__) && defined(__STDC__)
|
|
||||||
#define __weak_alias(alias,sym) \
|
|
||||||
__asm__(".weak " __STRING(alias) " ; " __STRING(alias) \
|
|
||||||
" = " __STRING(sym));
|
|
||||||
#define __warn_references(sym,msg) \
|
|
||||||
__asm__(".section .gnu.warning." __STRING(sym) \
|
|
||||||
" ; .ascii \"" msg "\" ; .text");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !_MACHINE_CDEFS_H_ */
|
|
||||||
@@ -34,133 +34,29 @@
|
|||||||
*
|
*
|
||||||
* This is done to abstract us from the various ARM Architecture
|
* This is done to abstract us from the various ARM Architecture
|
||||||
* quirks and alphabet soup.
|
* quirks and alphabet soup.
|
||||||
*
|
|
||||||
* IMPORTANT: We have no intention to support anything below an ARMv4T !
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* __ARM_ARCH__ is a number corresponding to the ARM revision
|
/* __ARM_ARCH__ is a number corresponding to the ARM revision
|
||||||
* we're going to support
|
* we're going to support. Our toolchain doesn't define __ARM_ARCH__
|
||||||
*
|
|
||||||
* it looks like our toolchain doesn't define __ARM_ARCH__
|
|
||||||
* so try to guess it.
|
* so try to guess it.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
#ifndef __ARM_ARCH__
|
#ifndef __ARM_ARCH__
|
||||||
|
|
||||||
# if defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ || \
|
# if defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ || \
|
||||||
defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__
|
defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__
|
||||||
|
|
||||||
# define __ARM_ARCH__ 7
|
# define __ARM_ARCH__ 7
|
||||||
|
|
||||||
# elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ || \
|
# elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ || \
|
||||||
defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6Z__ || \
|
defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6Z__ || \
|
||||||
defined __ARM_ARCH_6KZ__ || defined __ARM_ARCH_6T2__
|
defined __ARM_ARCH_6KZ__ || defined __ARM_ARCH_6T2__
|
||||||
#
|
|
||||||
# define __ARM_ARCH__ 6
|
# define __ARM_ARCH__ 6
|
||||||
#
|
|
||||||
# elif defined __ARM_ARCH_5__ || defined __ARM_ARCH_5T__ || \
|
|
||||||
defined __ARM_ARCH_5TE__ || defined __ARM_ARCH_5TEJ__
|
|
||||||
#
|
|
||||||
# define __ARM_ARCH__ 5
|
|
||||||
#
|
|
||||||
# elif defined __ARM_ARCH_4T__
|
|
||||||
#
|
|
||||||
# define __ARM_ARCH__ 4
|
|
||||||
#
|
|
||||||
# elif defined __ARM_ARCH_4__
|
|
||||||
# error ARMv4 is not supported, please use ARMv4T at a minimum
|
|
||||||
# else
|
# else
|
||||||
# error Unknown or unsupported ARM architecture
|
# error Unknown or unsupported ARM architecture
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* experimental feature used to check that our ARMv4 workarounds
|
|
||||||
* work correctly without a real ARMv4 machine */
|
|
||||||
#ifdef BIONIC_EXPERIMENTAL_FORCE_ARMV4
|
|
||||||
# undef __ARM_ARCH__
|
|
||||||
# define __ARM_ARCH__ 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_5TE if we have the ARMv5TE instructions */
|
|
||||||
#if __ARM_ARCH__ > 5
|
|
||||||
# define __ARM_HAVE_5TE 1
|
|
||||||
#elif __ARM_ARCH__ == 5
|
|
||||||
# if defined __ARM_ARCH_5TE__ || defined __ARM_ARCH_5TEJ__
|
|
||||||
# define __ARM_HAVE_5TE 1
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* instructions introduced in ARMv5 */
|
|
||||||
#if __ARM_ARCH__ >= 5
|
|
||||||
# define __ARM_HAVE_BLX 1
|
|
||||||
# define __ARM_HAVE_CLZ 1
|
|
||||||
# define __ARM_HAVE_LDC2 1
|
|
||||||
# define __ARM_HAVE_MCR2 1
|
|
||||||
# define __ARM_HAVE_MRC2 1
|
|
||||||
# define __ARM_HAVE_STC2 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ARMv5TE introduces a few instructions */
|
|
||||||
#if __ARM_HAVE_5TE
|
|
||||||
# define __ARM_HAVE_PLD 1
|
|
||||||
# define __ARM_HAVE_MCRR 1
|
|
||||||
# define __ARM_HAVE_MRRC 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_HALFWORD_MULTIPLY when half-word multiply instructions
|
/* define __ARM_HAVE_HALFWORD_MULTIPLY when half-word multiply instructions
|
||||||
* this means variants of: smul, smulw, smla, smlaw, smlal
|
* this means variants of: smul, smulw, smla, smlaw, smlal
|
||||||
*/
|
*/
|
||||||
#if __ARM_HAVE_5TE
|
#define __ARM_HAVE_HALFWORD_MULTIPLY 1
|
||||||
# define __ARM_HAVE_HALFWORD_MULTIPLY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_PAIR_LOAD_STORE when 64-bit memory loads and stored
|
|
||||||
* into/from a pair of 32-bit registers is supported throuhg 'ldrd' and 'strd'
|
|
||||||
*/
|
|
||||||
#if __ARM_HAVE_5TE
|
|
||||||
# define __ARM_HAVE_PAIR_LOAD_STORE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_SATURATED_ARITHMETIC is you have the saturated integer
|
|
||||||
* arithmetic instructions: qdd, qdadd, qsub, qdsub
|
|
||||||
*/
|
|
||||||
#if __ARM_HAVE_5TE
|
|
||||||
# define __ARM_HAVE_SATURATED_ARITHMETIC 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_PC_INTERWORK when a direct assignment to the
|
|
||||||
* pc register will switch into thumb/ARM mode depending on bit 0
|
|
||||||
* of the new instruction address. Before ARMv5, this was not the
|
|
||||||
* case, and you have to write:
|
|
||||||
*
|
|
||||||
* mov r0, [<some address>]
|
|
||||||
* bx r0
|
|
||||||
*
|
|
||||||
* instead of:
|
|
||||||
*
|
|
||||||
* ldr pc, [<some address>]
|
|
||||||
*
|
|
||||||
* note that this affects any instruction that explicitly changes the
|
|
||||||
* value of the pc register, including ldm { ...,pc } or 'add pc, #offset'
|
|
||||||
*/
|
|
||||||
#if __ARM_ARCH__ >= 5
|
|
||||||
# define __ARM_HAVE_PC_INTERWORK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_LDREX_STREX for ARMv6 and ARMv7 architecture to be
|
|
||||||
* used in replacement of deprecated swp instruction
|
|
||||||
*/
|
|
||||||
#if __ARM_ARCH__ >= 6
|
|
||||||
# define __ARM_HAVE_LDREX_STREX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_DMB for ARMv7 architecture
|
|
||||||
*/
|
|
||||||
#if __ARM_ARCH__ >= 7
|
|
||||||
# define __ARM_HAVE_DMB
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* define __ARM_HAVE_LDREXD for ARMv7 architecture
|
/* define __ARM_HAVE_LDREXD for ARMv7 architecture
|
||||||
* (also present in ARMv6K, but not implemented in ARMv7-M, neither of which
|
* (also present in ARMv6K, but not implemented in ARMv7-M, neither of which
|
||||||
@@ -184,18 +80,4 @@
|
|||||||
# define __ARM_HAVE_NEON
|
# define __ARM_HAVE_NEON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Assembly-only macros */
|
|
||||||
#ifdef __ASSEMBLY__
|
|
||||||
|
|
||||||
/* define a handy PLD(address) macro since the cache preload
|
|
||||||
* is an optional opcode
|
|
||||||
*/
|
|
||||||
#if __ARM_HAVE_PLD
|
|
||||||
# define PLD(reg,offset) pld [reg, offset]
|
|
||||||
#else
|
|
||||||
# define PLD(reg,offset) /* nothing */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* ! __ASSEMBLY__ */
|
|
||||||
|
|
||||||
#endif /* _ARM_MACHINE_CPU_FEATURES_H */
|
#endif /* _ARM_MACHINE_CPU_FEATURES_H */
|
||||||
|
|||||||
@@ -33,15 +33,6 @@
|
|||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
||||||
/*
|
|
||||||
* REV and REV16 weren't available on ARM5 or ARM4.
|
|
||||||
* We don't include <machine/cpu-features.h> because it pollutes the
|
|
||||||
* namespace with macros like PLD.
|
|
||||||
*/
|
|
||||||
#if !defined __ARM_ARCH_5__ && !defined __ARM_ARCH_5T__ && \
|
|
||||||
!defined __ARM_ARCH_5TE__ && !defined __ARM_ARCH_5TEJ__ && \
|
|
||||||
!defined __ARM_ARCH_4T__ && !defined __ARM_ARCH_4__
|
|
||||||
|
|
||||||
/* According to RealView Assembler User's Guide, REV and REV16 are available
|
/* According to RealView Assembler User's Guide, REV and REV16 are available
|
||||||
* in Thumb code and 16-bit instructions when used in Thumb-2 code.
|
* in Thumb code and 16-bit instructions when used in Thumb-2 code.
|
||||||
*
|
*
|
||||||
@@ -55,13 +46,13 @@
|
|||||||
*/
|
*/
|
||||||
#define __swap16md(x) ({ \
|
#define __swap16md(x) ({ \
|
||||||
register u_int16_t _x = (x); \
|
register u_int16_t _x = (x); \
|
||||||
__asm volatile ("rev16 %0, %0" : "+l" (_x)); \
|
__asm__ __volatile__("rev16 %0, %0" : "+l" (_x)); \
|
||||||
_x; \
|
_x; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define __swap32md(x) ({ \
|
#define __swap32md(x) ({ \
|
||||||
register u_int32_t _x = (x); \
|
register u_int32_t _x = (x); \
|
||||||
__asm volatile ("rev %0, %0" : "+l" (_x)); \
|
__asm__ __volatile__("rev %0, %0" : "+l" (_x)); \
|
||||||
_x; \
|
_x; \
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -74,7 +65,6 @@
|
|||||||
/* Tell sys/endian.h we have MD variants of the swap macros. */
|
/* Tell sys/endian.h we have MD variants of the swap macros. */
|
||||||
#define MD_SWAP
|
#define MD_SWAP
|
||||||
|
|
||||||
#endif /* __ARM_ARCH__ */
|
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#if defined(__ARMEB__)
|
#if defined(__ARMEB__)
|
||||||
|
|||||||
@@ -1,191 +0,0 @@
|
|||||||
/* $OpenBSD: ieee.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
|
|
||||||
/* $NetBSD: ieee.h,v 1.2 2001/02/21 17:43:50 bjh21 Exp $ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1992, 1993
|
|
||||||
* The Regents of the University of California. All rights reserved.
|
|
||||||
*
|
|
||||||
* This software was developed by the Computer Systems Engineering group
|
|
||||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
|
||||||
* contributed to Berkeley.
|
|
||||||
*
|
|
||||||
* 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, Lawrence Berkeley Laboratory.
|
|
||||||
*
|
|
||||||
* 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. 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
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @(#)ieee.h 8.1 (Berkeley) 6/11/93
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ieee.h defines the machine-dependent layout of the machine's IEEE
|
|
||||||
* floating point.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Define the number of bits in each fraction and exponent.
|
|
||||||
*
|
|
||||||
* k k+1
|
|
||||||
* Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented
|
|
||||||
*
|
|
||||||
* (-exp_bias+1)
|
|
||||||
* as fractions that look like 0.fffff x 2 . This means that
|
|
||||||
*
|
|
||||||
* -126
|
|
||||||
* the number 0.10000 x 2 , for instance, is the same as the normalized
|
|
||||||
*
|
|
||||||
* -127 -128
|
|
||||||
* float 1.0 x 2 . Thus, to represent 2 , we need one leading zero
|
|
||||||
*
|
|
||||||
* -129
|
|
||||||
* in the fraction; to represent 2 , we need two, and so on. This
|
|
||||||
*
|
|
||||||
* (-exp_bias-fracbits+1)
|
|
||||||
* implies that the smallest denormalized number is 2
|
|
||||||
*
|
|
||||||
* for whichever format we are talking about: for single precision, for
|
|
||||||
*
|
|
||||||
* -126 -149
|
|
||||||
* instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and
|
|
||||||
*
|
|
||||||
* -149 == -127 - 23 + 1.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The ARM has two sets of FP data formats. The FPA supports 32-bit, 64-bit
|
|
||||||
* and 96-bit IEEE formats, with the words in big-endian order. VFP supports
|
|
||||||
* 32-bin and 64-bit IEEE formats with the words in the CPU's native byte
|
|
||||||
* order.
|
|
||||||
*
|
|
||||||
* The FPA also has two packed decimal formats, but we ignore them here.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SNG_EXPBITS 8
|
|
||||||
#define SNG_FRACBITS 23
|
|
||||||
|
|
||||||
#define DBL_EXPBITS 11
|
|
||||||
#define DBL_FRACBITS 52
|
|
||||||
|
|
||||||
#ifndef __VFP_FP__
|
|
||||||
#define E80_EXPBITS 15
|
|
||||||
#define E80_FRACBITS 64
|
|
||||||
|
|
||||||
#define EXT_EXPBITS 15
|
|
||||||
#define EXT_FRACBITS 112
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct ieee_single {
|
|
||||||
u_int sng_frac:23;
|
|
||||||
u_int sng_exponent:8;
|
|
||||||
u_int sng_sign:1;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __VFP_FP__
|
|
||||||
struct ieee_double {
|
|
||||||
#ifdef __ARMEB__
|
|
||||||
u_int dbl_sign:1;
|
|
||||||
u_int dbl_exp:11;
|
|
||||||
u_int dbl_frach:20;
|
|
||||||
u_int dbl_fracl;
|
|
||||||
#else /* !__ARMEB__ */
|
|
||||||
u_int dbl_fracl;
|
|
||||||
u_int dbl_frach:20;
|
|
||||||
u_int dbl_exp:11;
|
|
||||||
u_int dbl_sign:1;
|
|
||||||
#endif /* !__ARMEB__ */
|
|
||||||
};
|
|
||||||
#else /* !__VFP_FP__ */
|
|
||||||
struct ieee_double {
|
|
||||||
u_int dbl_frach:20;
|
|
||||||
u_int dbl_exp:11;
|
|
||||||
u_int dbl_sign:1;
|
|
||||||
u_int dbl_fracl;
|
|
||||||
};
|
|
||||||
|
|
||||||
union ieee_double_u {
|
|
||||||
double dblu_d;
|
|
||||||
struct ieee_double dblu_dbl;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct ieee_e80 {
|
|
||||||
u_int e80_exp:15;
|
|
||||||
u_int e80_zero:16;
|
|
||||||
u_int e80_sign:1;
|
|
||||||
u_int e80_frach:31;
|
|
||||||
u_int e80_j:1;
|
|
||||||
u_int e80_fracl;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ieee_ext {
|
|
||||||
u_int ext_frach:16;
|
|
||||||
u_int ext_exp:15;
|
|
||||||
u_int ext_sign:1;
|
|
||||||
u_int ext_frachm;
|
|
||||||
u_int ext_fraclm;
|
|
||||||
u_int ext_fracl;
|
|
||||||
};
|
|
||||||
#endif /* !__VFP_FP__ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Floats whose exponent is in [1..INFNAN) (of whatever type) are
|
|
||||||
* `normal'. Floats whose exponent is INFNAN are either Inf or NaN.
|
|
||||||
* Floats whose exponent is zero are either zero (iff all fraction
|
|
||||||
* bits are zero) or subnormal values.
|
|
||||||
*
|
|
||||||
* A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its
|
|
||||||
* high fraction; if the bit is set, it is a `quiet NaN'.
|
|
||||||
*/
|
|
||||||
#define SNG_EXP_INFNAN 255
|
|
||||||
#define DBL_EXP_INFNAN 2047
|
|
||||||
#ifndef __VFP_FP__
|
|
||||||
#define E80_EXP_INFNAN 32767
|
|
||||||
#define EXT_EXP_INFNAN 32767
|
|
||||||
#endif /* !__VFP_FP__ */
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define SNG_QUIETNAN (1 << 22)
|
|
||||||
#define DBL_QUIETNAN (1 << 19)
|
|
||||||
#ifndef __VFP_FP__
|
|
||||||
#define E80_QUIETNAN (1 << 15)
|
|
||||||
#define EXT_QUIETNAN (1 << 15)
|
|
||||||
#endif /* !__VFP_FP__ */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Exponent biases.
|
|
||||||
*/
|
|
||||||
#define SNG_EXP_BIAS 127
|
|
||||||
#define DBL_EXP_BIAS 1023
|
|
||||||
#ifndef __VFP_FP__
|
|
||||||
#define E80_EXP_BIAS 16383
|
|
||||||
#define EXT_EXP_BIAS 16383
|
|
||||||
#endif /* !__VFP_FP__ */
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
/* $OpenBSD: limits.h,v 1.3 2006/01/06 22:48:46 millert Exp $ */
|
|
||||||
/* $NetBSD: limits.h,v 1.4 2003/04/28 23:16:18 bjh21 Exp $ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1988 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.
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* from: @(#)limits.h 7.2 (Berkeley) 6/28/90
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ARM32_LIMITS_H_
|
|
||||||
#define _ARM32_LIMITS_H_
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
#define MB_LEN_MAX 1 /* no multibyte characters */
|
|
||||||
|
|
||||||
#ifndef SIZE_MAX
|
|
||||||
#define SIZE_MAX UINT_MAX /* max value for a size_t */
|
|
||||||
#endif
|
|
||||||
#ifndef SSIZE_MAX
|
|
||||||
#define SSIZE_MAX INT_MAX /* max value for a ssize_t */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __BSD_VISIBLE
|
|
||||||
#define SIZE_T_MAX UINT_MAX /* max value for a size_t (historic) */
|
|
||||||
|
|
||||||
#define UQUAD_MAX 0xffffffffffffffffULL /* max unsigned quad */
|
|
||||||
#define QUAD_MAX 0x7fffffffffffffffLL /* max signed quad */
|
|
||||||
#define QUAD_MIN (-0x7fffffffffffffffLL-1) /* min signed quad */
|
|
||||||
|
|
||||||
#endif /* __BSD_VISIBLE */
|
|
||||||
|
|
||||||
#define LONGLONG_BIT 64
|
|
||||||
#define LONGLONG_MIN (-9223372036854775807LL-1)
|
|
||||||
#define LONGLONG_MAX 9223372036854775807LL
|
|
||||||
#define ULONGLONG_MAX 18446744073709551615ULL
|
|
||||||
|
|
||||||
#endif /* _ARM32_LIMITS_H_ */
|
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
/* Assumes neon instructions and a cache line size of 32 bytes. */
|
/* Assumes neon instructions and a cache line size of 32 bytes. */
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This code assumes it is running on a processor that supports all arm v7
|
* This code assumes it is running on a processor that supports all arm v7
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
#include "private/libc_events.h"
|
#include <private/libc_events.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This code assumes it is running on a processor that supports all arm v7
|
* This code assumes it is running on a processor that supports all arm v7
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/cpu-features.h>
|
#include <machine/cpu-features.h>
|
||||||
#include <machine/asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
#ifdef __ARMEB__
|
#ifdef __ARMEB__
|
||||||
#define S2LOMEM lsl
|
#define S2LOMEM lsl
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/krait/bionic/memcpy.S)
|
libc_bionic_src_files_arm += \
|
||||||
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/krait/bionic/memset.S)
|
arch-arm/krait/bionic/memcpy.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/krait/bionic/strcmp.S)
|
arch-arm/krait/bionic/memset.S \
|
||||||
$(call libc-add-cpu-variant-src,__STRCAT_CHK,arch-arm/krait/bionic/__strcat_chk.S)
|
arch-arm/krait/bionic/strcmp.S \
|
||||||
$(call libc-add-cpu-variant-src,__STRCPY_CHK,arch-arm/krait/bionic/__strcpy_chk.S)
|
arch-arm/krait/bionic/__strcat_chk.S \
|
||||||
# Use cortex-a15 versions of strcat/strcpy/strlen.
|
arch-arm/krait/bionic/__strcpy_chk.S \
|
||||||
$(call libc-add-cpu-variant-src,STRCAT,arch-arm/cortex-a15/bionic/strcat.S)
|
|
||||||
$(call libc-add-cpu-variant-src,STRCPY,arch-arm/cortex-a15/bionic/strcpy.S)
|
|
||||||
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a15/bionic/strlen.S)
|
|
||||||
|
|
||||||
include bionic/libc/arch-arm/generic/generic.mk
|
# Use cortex-a15 versions of strcat/strcpy/strlen.
|
||||||
|
libc_bionic_src_files_arm += \
|
||||||
|
arch-arm/cortex-a15/bionic/strcat.S \
|
||||||
|
arch-arm/cortex-a15/bionic/strcpy.S \
|
||||||
|
arch-arm/cortex-a15/bionic/strlen.S \
|
||||||
|
|||||||
@@ -1,196 +0,0 @@
|
|||||||
# Generated by gensyscalls.py. Do not edit.
|
|
||||||
syscall_src :=
|
|
||||||
syscall_src += arch-arm/syscalls/__brk.S
|
|
||||||
syscall_src += arch-arm/syscalls/__epoll_pwait.S
|
|
||||||
syscall_src += arch-arm/syscalls/__exit.S
|
|
||||||
syscall_src += arch-arm/syscalls/__fcntl64.S
|
|
||||||
syscall_src += arch-arm/syscalls/__fstatfs64.S
|
|
||||||
syscall_src += arch-arm/syscalls/__getcpu.S
|
|
||||||
syscall_src += arch-arm/syscalls/__getcwd.S
|
|
||||||
syscall_src += arch-arm/syscalls/__getpriority.S
|
|
||||||
syscall_src += arch-arm/syscalls/__ioctl.S
|
|
||||||
syscall_src += arch-arm/syscalls/__llseek.S
|
|
||||||
syscall_src += arch-arm/syscalls/__mmap2.S
|
|
||||||
syscall_src += arch-arm/syscalls/__openat.S
|
|
||||||
syscall_src += arch-arm/syscalls/__ppoll.S
|
|
||||||
syscall_src += arch-arm/syscalls/__pselect6.S
|
|
||||||
syscall_src += arch-arm/syscalls/__ptrace.S
|
|
||||||
syscall_src += arch-arm/syscalls/__reboot.S
|
|
||||||
syscall_src += arch-arm/syscalls/__rt_sigaction.S
|
|
||||||
syscall_src += arch-arm/syscalls/__rt_sigpending.S
|
|
||||||
syscall_src += arch-arm/syscalls/__rt_sigprocmask.S
|
|
||||||
syscall_src += arch-arm/syscalls/__rt_sigsuspend.S
|
|
||||||
syscall_src += arch-arm/syscalls/__rt_sigtimedwait.S
|
|
||||||
syscall_src += arch-arm/syscalls/__sched_getaffinity.S
|
|
||||||
syscall_src += arch-arm/syscalls/__set_tid_address.S
|
|
||||||
syscall_src += arch-arm/syscalls/__set_tls.S
|
|
||||||
syscall_src += arch-arm/syscalls/__sigaction.S
|
|
||||||
syscall_src += arch-arm/syscalls/__statfs64.S
|
|
||||||
syscall_src += arch-arm/syscalls/__syslog.S
|
|
||||||
syscall_src += arch-arm/syscalls/__timer_create.S
|
|
||||||
syscall_src += arch-arm/syscalls/__timer_delete.S
|
|
||||||
syscall_src += arch-arm/syscalls/__timer_getoverrun.S
|
|
||||||
syscall_src += arch-arm/syscalls/__timer_gettime.S
|
|
||||||
syscall_src += arch-arm/syscalls/__timer_settime.S
|
|
||||||
syscall_src += arch-arm/syscalls/__waitid.S
|
|
||||||
syscall_src += arch-arm/syscalls/_exit.S
|
|
||||||
syscall_src += arch-arm/syscalls/accept.S
|
|
||||||
syscall_src += arch-arm/syscalls/acct.S
|
|
||||||
syscall_src += arch-arm/syscalls/bind.S
|
|
||||||
syscall_src += arch-arm/syscalls/cacheflush.S
|
|
||||||
syscall_src += arch-arm/syscalls/capget.S
|
|
||||||
syscall_src += arch-arm/syscalls/capset.S
|
|
||||||
syscall_src += arch-arm/syscalls/chdir.S
|
|
||||||
syscall_src += arch-arm/syscalls/chroot.S
|
|
||||||
syscall_src += arch-arm/syscalls/clock_getres.S
|
|
||||||
syscall_src += arch-arm/syscalls/clock_gettime.S
|
|
||||||
syscall_src += arch-arm/syscalls/clock_nanosleep.S
|
|
||||||
syscall_src += arch-arm/syscalls/clock_settime.S
|
|
||||||
syscall_src += arch-arm/syscalls/close.S
|
|
||||||
syscall_src += arch-arm/syscalls/connect.S
|
|
||||||
syscall_src += arch-arm/syscalls/delete_module.S
|
|
||||||
syscall_src += arch-arm/syscalls/dup.S
|
|
||||||
syscall_src += arch-arm/syscalls/dup3.S
|
|
||||||
syscall_src += arch-arm/syscalls/epoll_create1.S
|
|
||||||
syscall_src += arch-arm/syscalls/epoll_ctl.S
|
|
||||||
syscall_src += arch-arm/syscalls/eventfd.S
|
|
||||||
syscall_src += arch-arm/syscalls/execve.S
|
|
||||||
syscall_src += arch-arm/syscalls/faccessat.S
|
|
||||||
syscall_src += arch-arm/syscalls/fchdir.S
|
|
||||||
syscall_src += arch-arm/syscalls/fchmod.S
|
|
||||||
syscall_src += arch-arm/syscalls/fchmodat.S
|
|
||||||
syscall_src += arch-arm/syscalls/fchown.S
|
|
||||||
syscall_src += arch-arm/syscalls/fchownat.S
|
|
||||||
syscall_src += arch-arm/syscalls/fdatasync.S
|
|
||||||
syscall_src += arch-arm/syscalls/fgetxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/flistxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/flock.S
|
|
||||||
syscall_src += arch-arm/syscalls/fremovexattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/fsetxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/fstat.S
|
|
||||||
syscall_src += arch-arm/syscalls/fstatat.S
|
|
||||||
syscall_src += arch-arm/syscalls/fsync.S
|
|
||||||
syscall_src += arch-arm/syscalls/ftruncate.S
|
|
||||||
syscall_src += arch-arm/syscalls/ftruncate64.S
|
|
||||||
syscall_src += arch-arm/syscalls/futex.S
|
|
||||||
syscall_src += arch-arm/syscalls/getdents.S
|
|
||||||
syscall_src += arch-arm/syscalls/getegid.S
|
|
||||||
syscall_src += arch-arm/syscalls/geteuid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getgid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getgroups.S
|
|
||||||
syscall_src += arch-arm/syscalls/getitimer.S
|
|
||||||
syscall_src += arch-arm/syscalls/getpeername.S
|
|
||||||
syscall_src += arch-arm/syscalls/getpgid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getpid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getppid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getresgid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getresuid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getrlimit.S
|
|
||||||
syscall_src += arch-arm/syscalls/getrusage.S
|
|
||||||
syscall_src += arch-arm/syscalls/getsid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getsockname.S
|
|
||||||
syscall_src += arch-arm/syscalls/getsockopt.S
|
|
||||||
syscall_src += arch-arm/syscalls/gettid.S
|
|
||||||
syscall_src += arch-arm/syscalls/gettimeofday.S
|
|
||||||
syscall_src += arch-arm/syscalls/getuid.S
|
|
||||||
syscall_src += arch-arm/syscalls/getxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/init_module.S
|
|
||||||
syscall_src += arch-arm/syscalls/inotify_add_watch.S
|
|
||||||
syscall_src += arch-arm/syscalls/inotify_init1.S
|
|
||||||
syscall_src += arch-arm/syscalls/inotify_rm_watch.S
|
|
||||||
syscall_src += arch-arm/syscalls/ioprio_get.S
|
|
||||||
syscall_src += arch-arm/syscalls/ioprio_set.S
|
|
||||||
syscall_src += arch-arm/syscalls/kill.S
|
|
||||||
syscall_src += arch-arm/syscalls/klogctl.S
|
|
||||||
syscall_src += arch-arm/syscalls/lgetxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/linkat.S
|
|
||||||
syscall_src += arch-arm/syscalls/listen.S
|
|
||||||
syscall_src += arch-arm/syscalls/listxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/llistxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/lremovexattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/lseek.S
|
|
||||||
syscall_src += arch-arm/syscalls/lsetxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/madvise.S
|
|
||||||
syscall_src += arch-arm/syscalls/mincore.S
|
|
||||||
syscall_src += arch-arm/syscalls/mkdirat.S
|
|
||||||
syscall_src += arch-arm/syscalls/mknodat.S
|
|
||||||
syscall_src += arch-arm/syscalls/mlock.S
|
|
||||||
syscall_src += arch-arm/syscalls/mlockall.S
|
|
||||||
syscall_src += arch-arm/syscalls/mount.S
|
|
||||||
syscall_src += arch-arm/syscalls/mprotect.S
|
|
||||||
syscall_src += arch-arm/syscalls/mremap.S
|
|
||||||
syscall_src += arch-arm/syscalls/msync.S
|
|
||||||
syscall_src += arch-arm/syscalls/munlock.S
|
|
||||||
syscall_src += arch-arm/syscalls/munlockall.S
|
|
||||||
syscall_src += arch-arm/syscalls/munmap.S
|
|
||||||
syscall_src += arch-arm/syscalls/nanosleep.S
|
|
||||||
syscall_src += arch-arm/syscalls/perf_event_open.S
|
|
||||||
syscall_src += arch-arm/syscalls/personality.S
|
|
||||||
syscall_src += arch-arm/syscalls/pipe2.S
|
|
||||||
syscall_src += arch-arm/syscalls/prctl.S
|
|
||||||
syscall_src += arch-arm/syscalls/pread64.S
|
|
||||||
syscall_src += arch-arm/syscalls/pwrite64.S
|
|
||||||
syscall_src += arch-arm/syscalls/read.S
|
|
||||||
syscall_src += arch-arm/syscalls/readahead.S
|
|
||||||
syscall_src += arch-arm/syscalls/readlinkat.S
|
|
||||||
syscall_src += arch-arm/syscalls/readv.S
|
|
||||||
syscall_src += arch-arm/syscalls/recvfrom.S
|
|
||||||
syscall_src += arch-arm/syscalls/recvmsg.S
|
|
||||||
syscall_src += arch-arm/syscalls/removexattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/renameat.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_get_priority_max.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_get_priority_min.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_getparam.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_getscheduler.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_rr_get_interval.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_setaffinity.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_setparam.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_setscheduler.S
|
|
||||||
syscall_src += arch-arm/syscalls/sched_yield.S
|
|
||||||
syscall_src += arch-arm/syscalls/sendfile.S
|
|
||||||
syscall_src += arch-arm/syscalls/sendfile64.S
|
|
||||||
syscall_src += arch-arm/syscalls/sendmsg.S
|
|
||||||
syscall_src += arch-arm/syscalls/sendto.S
|
|
||||||
syscall_src += arch-arm/syscalls/setgid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setgroups.S
|
|
||||||
syscall_src += arch-arm/syscalls/setitimer.S
|
|
||||||
syscall_src += arch-arm/syscalls/setpgid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setpriority.S
|
|
||||||
syscall_src += arch-arm/syscalls/setregid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setresgid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setresuid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setreuid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setrlimit.S
|
|
||||||
syscall_src += arch-arm/syscalls/setsid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setsockopt.S
|
|
||||||
syscall_src += arch-arm/syscalls/settimeofday.S
|
|
||||||
syscall_src += arch-arm/syscalls/setuid.S
|
|
||||||
syscall_src += arch-arm/syscalls/setxattr.S
|
|
||||||
syscall_src += arch-arm/syscalls/shutdown.S
|
|
||||||
syscall_src += arch-arm/syscalls/sigaltstack.S
|
|
||||||
syscall_src += arch-arm/syscalls/signalfd4.S
|
|
||||||
syscall_src += arch-arm/syscalls/socket.S
|
|
||||||
syscall_src += arch-arm/syscalls/socketpair.S
|
|
||||||
syscall_src += arch-arm/syscalls/swapoff.S
|
|
||||||
syscall_src += arch-arm/syscalls/swapon.S
|
|
||||||
syscall_src += arch-arm/syscalls/symlinkat.S
|
|
||||||
syscall_src += arch-arm/syscalls/sync.S
|
|
||||||
syscall_src += arch-arm/syscalls/sysinfo.S
|
|
||||||
syscall_src += arch-arm/syscalls/tgkill.S
|
|
||||||
syscall_src += arch-arm/syscalls/timerfd_create.S
|
|
||||||
syscall_src += arch-arm/syscalls/timerfd_gettime.S
|
|
||||||
syscall_src += arch-arm/syscalls/timerfd_settime.S
|
|
||||||
syscall_src += arch-arm/syscalls/times.S
|
|
||||||
syscall_src += arch-arm/syscalls/tkill.S
|
|
||||||
syscall_src += arch-arm/syscalls/truncate.S
|
|
||||||
syscall_src += arch-arm/syscalls/truncate64.S
|
|
||||||
syscall_src += arch-arm/syscalls/umask.S
|
|
||||||
syscall_src += arch-arm/syscalls/umount2.S
|
|
||||||
syscall_src += arch-arm/syscalls/uname.S
|
|
||||||
syscall_src += arch-arm/syscalls/unlinkat.S
|
|
||||||
syscall_src += arch-arm/syscalls/unshare.S
|
|
||||||
syscall_src += arch-arm/syscalls/utimensat.S
|
|
||||||
syscall_src += arch-arm/syscalls/vfork.S
|
|
||||||
syscall_src += arch-arm/syscalls/wait4.S
|
|
||||||
syscall_src += arch-arm/syscalls/write.S
|
|
||||||
syscall_src += arch-arm/syscalls/writev.S
|
|
||||||
@@ -12,3 +12,6 @@ ENTRY(_exit)
|
|||||||
neg r0, r0
|
neg r0, r0
|
||||||
b __set_errno
|
b __set_errno
|
||||||
END(_exit)
|
END(_exit)
|
||||||
|
|
||||||
|
.globl _Exit
|
||||||
|
.equ _Exit, _exit
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
#include <private/bionic_asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
ENTRY(fstatat)
|
ENTRY(accept4)
|
||||||
mov ip, r7
|
mov ip, r7
|
||||||
ldr r7, =__NR_fstatat64
|
ldr r7, =__NR_accept4
|
||||||
swi #0
|
swi #0
|
||||||
mov r7, ip
|
mov r7, ip
|
||||||
cmn r0, #(MAX_ERRNO + 1)
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxls lr
|
bxls lr
|
||||||
neg r0, r0
|
neg r0, r0
|
||||||
b __set_errno
|
b __set_errno
|
||||||
END(fstatat)
|
END(accept4)
|
||||||
22
libc/arch-arm/syscalls/fallocate64.S
Normal file
22
libc/arch-arm/syscalls/fallocate64.S
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/* Generated by gensyscalls.py. Do not edit. */
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY(fallocate64)
|
||||||
|
mov ip, sp
|
||||||
|
stmfd sp!, {r4, r5, r6, r7}
|
||||||
|
.cfi_def_cfa_offset 16
|
||||||
|
.cfi_rel_offset r4, 0
|
||||||
|
.cfi_rel_offset r5, 4
|
||||||
|
.cfi_rel_offset r6, 8
|
||||||
|
.cfi_rel_offset r7, 12
|
||||||
|
ldmfd ip, {r4, r5, r6}
|
||||||
|
ldr r7, =__NR_fallocate
|
||||||
|
swi #0
|
||||||
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
|
.cfi_def_cfa_offset 0
|
||||||
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
END(fallocate64)
|
||||||
17
libc/arch-arm/syscalls/fstat64.S
Normal file
17
libc/arch-arm/syscalls/fstat64.S
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/* Generated by gensyscalls.py. Do not edit. */
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY(fstat64)
|
||||||
|
mov ip, r7
|
||||||
|
ldr r7, =__NR_fstat64
|
||||||
|
swi #0
|
||||||
|
mov r7, ip
|
||||||
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
END(fstat64)
|
||||||
|
|
||||||
|
.globl fstat
|
||||||
|
.equ fstat, fstat64
|
||||||
17
libc/arch-arm/syscalls/fstatat64.S
Normal file
17
libc/arch-arm/syscalls/fstatat64.S
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/* Generated by gensyscalls.py. Do not edit. */
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY(fstatat64)
|
||||||
|
mov ip, r7
|
||||||
|
ldr r7, =__NR_fstatat64
|
||||||
|
swi #0
|
||||||
|
mov r7, ip
|
||||||
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
END(fstatat64)
|
||||||
|
|
||||||
|
.globl fstatat
|
||||||
|
.equ fstatat, fstatat64
|
||||||
14
libc/arch-arm/syscalls/prlimit64.S
Normal file
14
libc/arch-arm/syscalls/prlimit64.S
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/* Generated by gensyscalls.py. Do not edit. */
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY(prlimit64)
|
||||||
|
mov ip, r7
|
||||||
|
ldr r7, =__NR_prlimit64
|
||||||
|
swi #0
|
||||||
|
mov r7, ip
|
||||||
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
END(prlimit64)
|
||||||
22
libc/arch-arm/syscalls/recvmmsg.S
Normal file
22
libc/arch-arm/syscalls/recvmmsg.S
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/* Generated by gensyscalls.py. Do not edit. */
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY(recvmmsg)
|
||||||
|
mov ip, sp
|
||||||
|
stmfd sp!, {r4, r5, r6, r7}
|
||||||
|
.cfi_def_cfa_offset 16
|
||||||
|
.cfi_rel_offset r4, 0
|
||||||
|
.cfi_rel_offset r5, 4
|
||||||
|
.cfi_rel_offset r6, 8
|
||||||
|
.cfi_rel_offset r7, 12
|
||||||
|
ldmfd ip, {r4, r5, r6}
|
||||||
|
ldr r7, =__NR_recvmmsg
|
||||||
|
swi #0
|
||||||
|
ldmfd sp!, {r4, r5, r6, r7}
|
||||||
|
.cfi_def_cfa_offset 0
|
||||||
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
END(recvmmsg)
|
||||||
14
libc/arch-arm/syscalls/sendmmsg.S
Normal file
14
libc/arch-arm/syscalls/sendmmsg.S
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/* Generated by gensyscalls.py. Do not edit. */
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY(sendmmsg)
|
||||||
|
mov ip, r7
|
||||||
|
ldr r7, =__NR_sendmmsg
|
||||||
|
swi #0
|
||||||
|
mov r7, ip
|
||||||
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
|
bxls lr
|
||||||
|
neg r0, r0
|
||||||
|
b __set_errno
|
||||||
|
END(sendmmsg)
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
#include <private/bionic_asm.h>
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
ENTRY(fstat)
|
ENTRY(setns)
|
||||||
mov ip, r7
|
mov ip, r7
|
||||||
ldr r7, =__NR_fstat64
|
ldr r7, =__NR_setns
|
||||||
swi #0
|
swi #0
|
||||||
mov r7, ip
|
mov r7, ip
|
||||||
cmn r0, #(MAX_ERRNO + 1)
|
cmn r0, #(MAX_ERRNO + 1)
|
||||||
bxls lr
|
bxls lr
|
||||||
neg r0, r0
|
neg r0, r0
|
||||||
b __set_errno
|
b __set_errno
|
||||||
END(fstat)
|
END(setns)
|
||||||
58
libc/arch-arm64/arm64.mk
Normal file
58
libc/arch-arm64/arm64.mk
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# arm64 specific configs
|
||||||
|
|
||||||
|
libc_common_src_files_arm64 := \
|
||||||
|
bionic/index.cpp \
|
||||||
|
bionic/memchr.c \
|
||||||
|
bionic/__memcmp16.cpp \
|
||||||
|
bionic/memrchr.c \
|
||||||
|
bionic/strchr.cpp \
|
||||||
|
bionic/strrchr.cpp \
|
||||||
|
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/wcslen.c \
|
||||||
|
upstream-freebsd/lib/libc/string/wcsrchr.c \
|
||||||
|
upstream-freebsd/lib/libc/string/wmemcmp.c \
|
||||||
|
upstream-openbsd/lib/libc/string/bcopy.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strcat.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strcpy.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strlcat.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strlcpy.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strncat.c \
|
||||||
|
upstream-openbsd/lib/libc/string/strncpy.c \
|
||||||
|
|
||||||
|
# Fortify implementations of libc functions.
|
||||||
|
libc_common_src_files_arm64 += \
|
||||||
|
bionic/__memcpy_chk.cpp \
|
||||||
|
bionic/__memset_chk.cpp \
|
||||||
|
bionic/__strcpy_chk.cpp \
|
||||||
|
bionic/__strcat_chk.cpp \
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
### CPU specific source files
|
||||||
|
libc_bionic_src_files_arm64 := \
|
||||||
|
arch-arm64/bionic/__bionic_clone.S \
|
||||||
|
arch-arm64/bionic/bzero_arm64.c \
|
||||||
|
arch-arm64/bionic/_exit_with_stack_teardown.S \
|
||||||
|
arch-arm64/bionic/futex_arm64.S \
|
||||||
|
arch-arm64/bionic/__get_sp.S \
|
||||||
|
arch-arm64/bionic/__rt_sigreturn.S \
|
||||||
|
arch-arm64/bionic/_setjmp.S \
|
||||||
|
arch-arm64/bionic/setjmp.S \
|
||||||
|
arch-arm64/bionic/__set_tls.c \
|
||||||
|
arch-arm64/bionic/sigsetjmp.S \
|
||||||
|
arch-arm64/bionic/syscall.S \
|
||||||
|
arch-arm64/bionic/vfork.S \
|
||||||
|
|
||||||
|
|
||||||
|
libc_crt_target_cflags_arm64 := \
|
||||||
|
-I$(LOCAL_PATH)/arch-arm64/include
|
||||||
|
|
||||||
|
libc_crt_target_crtbegin_file_arm64 := \
|
||||||
|
$(LOCAL_PATH)/arch-arm64/bionic/crtbegin.c
|
||||||
|
|
||||||
|
libc_crt_target_crtbegin_so_file_arm64 := \
|
||||||
|
$(LOCAL_PATH)/arch-common/bionic/crtbegin_so.c
|
||||||
|
|
||||||
|
include $(LOCAL_PATH)/arch-arm64/generic/generic.mk
|
||||||
63
libc/arch-arm64/bionic/__bionic_clone.S
Normal file
63
libc/arch-arm64/bionic/__bionic_clone.S
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
|
||||||
|
// pid_t __bionic_clone(int flags, void* child_stack, pid_t* parent_tid, void* tls, pid_t* child_tid, int (*fn)(void*), void* arg);
|
||||||
|
|
||||||
|
ENTRY(__bionic_clone)
|
||||||
|
stp x29, x30, [sp, #-16]!
|
||||||
|
mov x29, sp
|
||||||
|
str x8, [sp, #-16]!
|
||||||
|
|
||||||
|
/* store thread pointer & args in child stack */
|
||||||
|
stp x5, x6, [x1, #-16]
|
||||||
|
|
||||||
|
/* sys_clone */
|
||||||
|
uxtw x0, w0
|
||||||
|
mov x8, __NR_clone
|
||||||
|
svc #0
|
||||||
|
|
||||||
|
/* check for child/parent */
|
||||||
|
cbz x0,1f
|
||||||
|
|
||||||
|
ldr x8, [sp], #16
|
||||||
|
ldp x29, x30, [sp], #16
|
||||||
|
|
||||||
|
cmn x0, #(MAX_ERRNO + 1)
|
||||||
|
cneg x0, x0, hi
|
||||||
|
b.hi __set_errno
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
/* thread initialization - set the end of the frame record chain */
|
||||||
|
1:
|
||||||
|
mov x29, xzr
|
||||||
|
ldp x0, x1, [sp, #-16]
|
||||||
|
b __bionic_clone_entry
|
||||||
|
END(__bionic_clone)
|
||||||
34
libc/arch-arm64/bionic/__get_sp.S
Normal file
34
libc/arch-arm64/bionic/__get_sp.S
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY(__get_sp)
|
||||||
|
mov x0, sp
|
||||||
|
ret
|
||||||
|
END(__get_sp)
|
||||||
34
libc/arch-arm64/bionic/__rt_sigreturn.S
Normal file
34
libc/arch-arm64/bionic/__rt_sigreturn.S
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
|
||||||
|
ENTRY_PRIVATE(__rt_sigreturn)
|
||||||
|
mov x8, __NR_rt_sigreturn
|
||||||
|
svc #0
|
||||||
|
END(__rt_sigreturn)
|
||||||
31
libc/arch-arm64/bionic/__set_tls.c
Normal file
31
libc/arch-arm64/bionic/__set_tls.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void __set_tls(void* tls) {
|
||||||
|
asm("msr tpidr_el0, %0" : : "r" (tls));
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 The Android Open Source Project
|
* Copyright (C) 2013 The Android Open Source Project
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -25,16 +25,17 @@
|
|||||||
* 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 <unistd.h>
|
|
||||||
#include <sys/ipc.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
key_t ftok(const char* path, int id)
|
#include <private/bionic_asm.h>
|
||||||
{
|
|
||||||
struct stat st;
|
|
||||||
|
|
||||||
if ( lstat(path, &st) < 0 )
|
// void _exit_with_stack_teardown(void* stackBase, size_t stackSize)
|
||||||
return -1;
|
ENTRY(_exit_with_stack_teardown)
|
||||||
|
mov w8, __NR_munmap
|
||||||
|
svc #0
|
||||||
|
// If munmap failed, we ignore the failure and exit anyway.
|
||||||
|
|
||||||
return (key_t)( (st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 255) << 24) );
|
mov x0, #0
|
||||||
}
|
mov w8, __NR_exit
|
||||||
|
svc #0
|
||||||
|
// The exit syscall does not return.
|
||||||
|
END(_exit_with_stack_teardown)
|
||||||
111
libc/arch-arm64/bionic/_setjmp.S
Normal file
111
libc/arch-arm64/bionic/_setjmp.S
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
#include <machine/setjmp.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C library - _setjmp, _longjmp
|
||||||
|
*
|
||||||
|
* _longjmp(jmp_buf state, int value)
|
||||||
|
* will generate a "return(v)" from the last call to _setjmp(state) by restoring
|
||||||
|
* registers from the stack. The previous signal state is NOT restored.
|
||||||
|
*
|
||||||
|
* NOTE: x0 return value
|
||||||
|
* x9-x15 temporary registers
|
||||||
|
*/
|
||||||
|
|
||||||
|
ENTRY(_setjmp)
|
||||||
|
/* store magic number */
|
||||||
|
ldr w9, .L_setjmp_magic
|
||||||
|
str w9, [x0, #(_JB_MAGIC * 4)]
|
||||||
|
|
||||||
|
/* store core registers */
|
||||||
|
mov x10, sp
|
||||||
|
stp x30, x10, [x0, #(_JB_CORE_BASE * 4 + 16 * 0)]
|
||||||
|
stp x28, x29, [x0, #(_JB_CORE_BASE * 4 + 16 * 1)]
|
||||||
|
stp x26, x27, [x0, #(_JB_CORE_BASE * 4 + 16 * 2)]
|
||||||
|
stp x24, x25, [x0, #(_JB_CORE_BASE * 4 + 16 * 3)]
|
||||||
|
stp x22, x23, [x0, #(_JB_CORE_BASE * 4 + 16 * 4)]
|
||||||
|
stp x20, x21, [x0, #(_JB_CORE_BASE * 4 + 16 * 5)]
|
||||||
|
str x19, [x0, #(_JB_CORE_BASE * 4 + 16 * 6)]
|
||||||
|
|
||||||
|
/* store floating point registers */
|
||||||
|
stp d14, d15, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 0)]
|
||||||
|
stp d12, d13, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 1)]
|
||||||
|
stp d10, d11, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 2)]
|
||||||
|
stp d8, d9, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 3)]
|
||||||
|
|
||||||
|
mov w0, wzr
|
||||||
|
ret
|
||||||
|
END(_setjmp)
|
||||||
|
|
||||||
|
.L_setjmp_magic:
|
||||||
|
.word _JB_MAGIC__SETJMP
|
||||||
|
|
||||||
|
ENTRY(_longjmp)
|
||||||
|
/* check magic */
|
||||||
|
ldr w9, .L_setjmp_magic
|
||||||
|
ldr w10, [x0, #(_JB_MAGIC * 4)]
|
||||||
|
cmp w9, w10
|
||||||
|
b.ne botch
|
||||||
|
|
||||||
|
/* restore core registers */
|
||||||
|
ldp x30, x10, [x0, #(_JB_CORE_BASE * 4 + 16 * 0)]
|
||||||
|
mov sp, x10
|
||||||
|
ldp x28, x29, [x0, #(_JB_CORE_BASE * 4 + 16 * 1)]
|
||||||
|
ldp x26, x27, [x0, #(_JB_CORE_BASE * 4 + 16 * 2)]
|
||||||
|
ldp x24, x25, [x0, #(_JB_CORE_BASE * 4 + 16 * 3)]
|
||||||
|
ldp x22, x23, [x0, #(_JB_CORE_BASE * 4 + 16 * 4)]
|
||||||
|
ldp x20, x21, [x0, #(_JB_CORE_BASE * 4 + 16 * 5)]
|
||||||
|
ldr x19, [x0, #(_JB_CORE_BASE * 4 + 16 * 6)]
|
||||||
|
|
||||||
|
/* restore floating point registers */
|
||||||
|
ldp d14, d15, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 0)]
|
||||||
|
ldp d12, d13, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 1)]
|
||||||
|
ldp d10, d11, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 2)]
|
||||||
|
ldp d8, d9, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 3)]
|
||||||
|
|
||||||
|
/* validate sp (sp mod 16 = 0) and lr (lr mod 4 = 0) */
|
||||||
|
tst x30, #3
|
||||||
|
b.ne botch
|
||||||
|
mov x10, sp
|
||||||
|
tst x10, #15
|
||||||
|
b.ne botch
|
||||||
|
|
||||||
|
/* set return value */
|
||||||
|
cmp w1, wzr
|
||||||
|
csinc w0, w1, wzr, ne
|
||||||
|
ret
|
||||||
|
|
||||||
|
/* validation failed, die die die */
|
||||||
|
botch:
|
||||||
|
bl PIC_SYM(longjmperror, PLT)
|
||||||
|
bl PIC_SYM(abort, PLT)
|
||||||
|
b . - 8 /* Cannot get here */
|
||||||
|
END(_longjmp)
|
||||||
33
libc/arch-arm64/bionic/bzero_arm64.c
Normal file
33
libc/arch-arm64/bionic/bzero_arm64.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* 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 <string.h>
|
||||||
|
|
||||||
|
void bzero(void* s, size_t n) {
|
||||||
|
memset(s, '\0', n);
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 The Android Open Source Project
|
* Copyright (C) 2013 The Android Open Source Project
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -25,10 +25,45 @@
|
|||||||
* 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 <stddef.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
|
|
||||||
ssize_t send(int socket, const void *buf, size_t buflen, unsigned int flags)
|
#include "../../bionic/libc_init_common.h"
|
||||||
{
|
#include <stddef.h>
|
||||||
return (ssize_t) sendto(socket, buf, buflen, flags, NULL, 0);
|
#include <stdint.h>
|
||||||
|
|
||||||
|
__attribute__ ((section (".preinit_array")))
|
||||||
|
void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
|
||||||
|
|
||||||
|
__attribute__ ((section (".init_array")))
|
||||||
|
void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1;
|
||||||
|
|
||||||
|
__attribute__ ((section (".fini_array")))
|
||||||
|
void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
|
||||||
|
|
||||||
|
|
||||||
|
__LIBC_HIDDEN__ void do_arm64_start(void* raw_args) {
|
||||||
|
structors_array_t array;
|
||||||
|
array.preinit_array = &__PREINIT_ARRAY__;
|
||||||
|
array.init_array = &__INIT_ARRAY__;
|
||||||
|
array.fini_array = &__FINI_ARRAY__;
|
||||||
|
__libc_init(raw_args, NULL, &main, &array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Put the value of sp in x0 and call do_arm64_init(). The latter will then
|
||||||
|
* then be able to access the stack as prepared by the kernel's execve system
|
||||||
|
* call (via the first argument).
|
||||||
|
*/
|
||||||
|
__asm__ (
|
||||||
|
" .text \n"
|
||||||
|
" .align 2 \n"
|
||||||
|
" .global _start \n"
|
||||||
|
" .hidden _start \n"
|
||||||
|
" .type _start, %function \n"
|
||||||
|
"_start: \n"
|
||||||
|
" add x0, sp, xzr \n"
|
||||||
|
" b do_arm64_start \n"
|
||||||
|
" .size _start, .-_start \n"
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "../../arch-common/bionic/__dso_handle.h"
|
||||||
|
#include "../../arch-common/bionic/atexit.h"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 The Android Open Source Project
|
* Copyright (C) 2013 The Android Open Source Project
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -26,50 +26,61 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* implement flockfile(), ftrylockfile() and funlockfile()
|
#include <private/bionic_asm.h>
|
||||||
*
|
|
||||||
* we can't use the OpenBSD implementation which uses kernel-specific
|
|
||||||
* APIs not available on Linux.
|
|
||||||
*
|
|
||||||
* Instead, we use a pthread_mutex_t within the FILE* internal state.
|
|
||||||
* See fileext.h for details.
|
|
||||||
*
|
|
||||||
* the behaviour, if fclose() is called while the corresponding
|
|
||||||
* file is locked is totally undefined.
|
|
||||||
*/
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include "fileext.h"
|
|
||||||
|
|
||||||
|
#define FUTEX_WAIT 0
|
||||||
|
#define FUTEX_WAKE 1
|
||||||
|
|
||||||
void
|
// int __futex_syscall4(volatile void* ftx, int op, int val, const struct timespec* timeout)
|
||||||
flockfile(FILE * fp)
|
ENTRY(__futex_syscall4)
|
||||||
{
|
stp x29, x30, [sp, #-16]!
|
||||||
if (fp != NULL) {
|
mov x29, sp
|
||||||
_FLOCK_LOCK(fp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
str x8, [sp, #-16]!
|
||||||
|
mov x8, __NR_futex
|
||||||
|
svc #0
|
||||||
|
ldr x8, [sp], #16
|
||||||
|
|
||||||
int
|
ldp x29, x30, [sp], #16
|
||||||
ftrylockfile(FILE *fp)
|
ret
|
||||||
{
|
END(__futex_syscall4)
|
||||||
/* The specification for ftrylockfile() says it returns 0 on success,
|
|
||||||
* or non-zero on error. So return an errno code directly on error.
|
|
||||||
*/
|
|
||||||
int ret = EINVAL;
|
|
||||||
|
|
||||||
if (fp != NULL) {
|
// int __futex_syscall3(volatile void* ftx, int op, int count)
|
||||||
ret = _FLOCK_TRYLOCK(fp);
|
ENTRY(__futex_syscall3)
|
||||||
}
|
b __futex_syscall4
|
||||||
return ret;
|
END(__futex_syscall3)
|
||||||
}
|
|
||||||
|
|
||||||
void
|
// int __futex_wait(volatile void* ftx, int val, const struct timespec* timeout)
|
||||||
funlockfile(FILE * fp)
|
ENTRY(__futex_wait)
|
||||||
{
|
stp x29, x30, [sp, #-16]!
|
||||||
if (fp != NULL) {
|
mov x29, sp
|
||||||
_FLOCK_UNLOCK(fp);
|
|
||||||
}
|
mov x3, x2
|
||||||
}
|
mov x2, x1
|
||||||
|
mov x1, #FUTEX_WAIT
|
||||||
|
|
||||||
|
str x8, [sp, #-16]!
|
||||||
|
mov x8, __NR_futex
|
||||||
|
svc #0
|
||||||
|
ldr x8, [sp], #16
|
||||||
|
|
||||||
|
ldp x29, x30, [sp], #16
|
||||||
|
ret
|
||||||
|
END(__futex_wait)
|
||||||
|
|
||||||
|
// int __futex_wake(volatile void* ftx, int count)
|
||||||
|
ENTRY(__futex_wake)
|
||||||
|
stp x29, x30, [sp, #-16]!
|
||||||
|
mov x29, sp
|
||||||
|
|
||||||
|
mov x2, x1
|
||||||
|
mov x1, #FUTEX_WAKE
|
||||||
|
|
||||||
|
str x8, [sp, #-16]!
|
||||||
|
mov x8, __NR_futex
|
||||||
|
svc #0
|
||||||
|
ldr x8, [sp], #16
|
||||||
|
|
||||||
|
ldp x29, x30, [sp], #16
|
||||||
|
ret
|
||||||
|
END(__futex_wake)
|
||||||
123
libc/arch-arm64/bionic/setjmp.S
Normal file
123
libc/arch-arm64/bionic/setjmp.S
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* 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 <private/bionic_asm.h>
|
||||||
|
#include <machine/setjmp.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C library - _setjmp, _longjmp
|
||||||
|
*
|
||||||
|
* _longjmp(jmp_buf state, int value)
|
||||||
|
* will generate a "return(v)" from the last call to _setjmp(state) by restoring
|
||||||
|
* registers from the stack. The previous signal state is NOT restored.
|
||||||
|
*
|
||||||
|
* NOTE: x0 return value
|
||||||
|
* x9-x15 temporary registers
|
||||||
|
*/
|
||||||
|
|
||||||
|
ENTRY(setjmp)
|
||||||
|
/* block all signals an retrieve signal mask */
|
||||||
|
stp x0, x30, [sp, #-16]!
|
||||||
|
|
||||||
|
mov x0, xzr
|
||||||
|
bl PIC_SYM(sigblock, PLT)
|
||||||
|
mov w1, w0
|
||||||
|
|
||||||
|
ldp x0, x30, [sp], #16
|
||||||
|
|
||||||
|
/* store signal mask */
|
||||||
|
str w1, [x0, #(_JB_SIGMASK *4)]
|
||||||
|
|
||||||
|
/* store magic number */
|
||||||
|
ldr w9, .L_setjmp_magic
|
||||||
|
str w9, [x0, #(_JB_MAGIC * 4)]
|
||||||
|
|
||||||
|
/* store core registers */
|
||||||
|
mov x10, sp
|
||||||
|
stp x30, x10, [x0, #(_JB_CORE_BASE * 4 + 16 * 0)]
|
||||||
|
stp x28, x29, [x0, #(_JB_CORE_BASE * 4 + 16 * 1)]
|
||||||
|
stp x26, x27, [x0, #(_JB_CORE_BASE * 4 + 16 * 2)]
|
||||||
|
stp x24, x25, [x0, #(_JB_CORE_BASE * 4 + 16 * 3)]
|
||||||
|
stp x22, x23, [x0, #(_JB_CORE_BASE * 4 + 16 * 4)]
|
||||||
|
stp x20, x21, [x0, #(_JB_CORE_BASE * 4 + 16 * 5)]
|
||||||
|
str x19, [x0, #(_JB_CORE_BASE * 4 + 16 * 6)]
|
||||||
|
|
||||||
|
/* store floating point registers */
|
||||||
|
stp d14, d15, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 0)]
|
||||||
|
stp d12, d13, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 1)]
|
||||||
|
stp d10, d11, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 2)]
|
||||||
|
stp d8, d9, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 3)]
|
||||||
|
|
||||||
|
mov w0, wzr
|
||||||
|
ret
|
||||||
|
END(setjmp)
|
||||||
|
|
||||||
|
.L_setjmp_magic:
|
||||||
|
.word _JB_MAGIC__SETJMP
|
||||||
|
|
||||||
|
ENTRY(longjmp)
|
||||||
|
/* check magic */
|
||||||
|
ldr w9, .L_setjmp_magic
|
||||||
|
ldr w10, [x0, #(_JB_MAGIC * 4)]
|
||||||
|
cmp w9, w10
|
||||||
|
b.ne botch
|
||||||
|
|
||||||
|
/* restore core registers */
|
||||||
|
ldp x30, x10, [x0, #(_JB_CORE_BASE * 4 + 16 * 0)]
|
||||||
|
mov sp, x10
|
||||||
|
ldp x28, x29, [x0, #(_JB_CORE_BASE * 4 + 16 * 1)]
|
||||||
|
ldp x26, x27, [x0, #(_JB_CORE_BASE * 4 + 16 * 2)]
|
||||||
|
ldp x24, x25, [x0, #(_JB_CORE_BASE * 4 + 16 * 3)]
|
||||||
|
ldp x22, x23, [x0, #(_JB_CORE_BASE * 4 + 16 * 4)]
|
||||||
|
ldp x20, x21, [x0, #(_JB_CORE_BASE * 4 + 16 * 5)]
|
||||||
|
ldr x19, [x0, #(_JB_CORE_BASE * 4 + 16 * 6)]
|
||||||
|
|
||||||
|
/* restore floating point registers */
|
||||||
|
ldp d14, d15, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 0)]
|
||||||
|
ldp d12, d13, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 1)]
|
||||||
|
ldp d10, d11, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 2)]
|
||||||
|
ldp d8, d9, [x0, #(_JB_FLOAT_BASE * 4 + 16 * 3)]
|
||||||
|
|
||||||
|
/* validate sp (sp mod 16 = 0) and lr (lr mod 4 = 0) */
|
||||||
|
tst x30, #3
|
||||||
|
b.ne botch
|
||||||
|
mov x10, sp
|
||||||
|
tst x10, #15
|
||||||
|
b.ne botch
|
||||||
|
|
||||||
|
/* set return value */
|
||||||
|
cmp w1, wzr
|
||||||
|
csinc w0, w1, wzr, ne
|
||||||
|
ret
|
||||||
|
|
||||||
|
/* validation failed, die die die */
|
||||||
|
botch:
|
||||||
|
bl PIC_SYM(longjmperror, PLT)
|
||||||
|
bl PIC_SYM(abort, PLT)
|
||||||
|
b . - 8 /* Cannot get here */
|
||||||
|
END(longjmp)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2010 The Android Open Source Project
|
* Copyright (C) 2013 The Android Open Source Project
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -25,15 +25,27 @@
|
|||||||
* 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 <wchar.h>
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
#include <machine/setjmp.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compare strings using the current locale. Since Bionic really does not
|
* int sigsetjmp(sigjmp_buf env, int savesigs);
|
||||||
* support locales, we assume we always use the C locale and call wcscmp.
|
* void siglongjmp(sigjmp_buf env, int val);
|
||||||
*
|
|
||||||
* This function is provided to make libstdc++-v3 usable.
|
|
||||||
*/
|
*/
|
||||||
int
|
|
||||||
wcscoll(const wchar_t *ws1, const wchar_t *ws2)
|
ENTRY(sigsetjmp)
|
||||||
{
|
cbz w1, PIC_SYM(_setjmp, PLT)
|
||||||
return wcscmp(ws1, ws2);
|
b PIC_SYM(setjmp, PLT)
|
||||||
}
|
END(sigsetjmp)
|
||||||
|
|
||||||
|
.L_setjmp_magic:
|
||||||
|
.word _JB_MAGIC__SETJMP
|
||||||
|
|
||||||
|
ENTRY(siglongjmp)
|
||||||
|
ldr w2, .L_setjmp_magic
|
||||||
|
ldr w3, [x0]
|
||||||
|
cmp w2, w3
|
||||||
|
b.eq PIC_SYM(_longjmp, PLT)
|
||||||
|
b PIC_SYM(longjmp, PLT)
|
||||||
|
END(siglongjmp)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 The Android Open Source Project
|
* Copyright (C) 2013 The Android Open Source Project
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -25,18 +25,36 @@
|
|||||||
* 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.
|
||||||
*/
|
*/
|
||||||
#ifndef _ARCH_MIPS_KERNEL_H
|
|
||||||
#define _ARCH_MIPS_KERNEL_H
|
|
||||||
|
|
||||||
/* this file contains kernel-specific definitions that were optimized out of
|
#include <private/bionic_asm.h>
|
||||||
our processed kernel headers, but still useful nonetheless... */
|
|
||||||
|
|
||||||
typedef unsigned long __kernel_blkcnt_t;
|
ENTRY(syscall)
|
||||||
typedef unsigned long __kernel_blksize_t;
|
/* create AAPCS frame pointer */
|
||||||
|
stp x29, x30, [sp, #-16]!
|
||||||
|
mov x29, sp
|
||||||
|
|
||||||
/* these aren't really defined by the kernel headers though... */
|
/* store x8 */
|
||||||
typedef unsigned long __kernel_fsblkcnt_t;
|
str x8, [sp, #-16]!
|
||||||
typedef unsigned long __kernel_fsfilcnt_t;
|
|
||||||
typedef unsigned int __kernel_id_t;
|
|
||||||
|
|
||||||
#endif /* _ARCH_MIPS_KERNEL_H */
|
/* Move syscall No. from x0 to x8 */
|
||||||
|
mov x8, x0
|
||||||
|
/* Move syscall parameters from x1 thru x6 to x0 thru x5 */
|
||||||
|
mov x0, x1
|
||||||
|
mov x1, x2
|
||||||
|
mov x2, x3
|
||||||
|
mov x3, x4
|
||||||
|
mov x4, x5
|
||||||
|
mov x5, x6
|
||||||
|
svc #0
|
||||||
|
|
||||||
|
/* restore x8 */
|
||||||
|
ldr x8, [sp], #16
|
||||||
|
ldp x29, x30, [sp], #16
|
||||||
|
|
||||||
|
/* check if syscall returned successfully */
|
||||||
|
cmn x0, #(MAX_ERRNO + 1)
|
||||||
|
cneg x0, x0, hi
|
||||||
|
b.hi __set_errno
|
||||||
|
|
||||||
|
ret
|
||||||
|
END(syscall)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 The Android Open Source Project
|
* Copyright (C) 2013 The Android Open Source Project
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -25,25 +25,26 @@
|
|||||||
* 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.
|
||||||
*/
|
*/
|
||||||
#ifndef _SYS_DIRENT_H_
|
|
||||||
#define _SYS_DIRENT_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <private/bionic_asm.h>
|
||||||
#include <sys/cdefs.h>
|
#include <asm/signal.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
ENTRY(vfork)
|
||||||
|
mov x0, #(CLONE_VM | CLONE_VFORK | SIGCHLD)
|
||||||
|
mov x1, xzr
|
||||||
|
mov x2, xzr
|
||||||
|
mov x3, xzr
|
||||||
|
mov x4, xzr
|
||||||
|
|
||||||
/* this corresponds to the kernel dirent64 */
|
str x8, [sp, #-16]!
|
||||||
struct dirent {
|
mov x8, __NR_clone
|
||||||
uint64_t d_ino;
|
svc #0
|
||||||
int64_t d_off;
|
ldr x8, [sp], #16
|
||||||
unsigned short d_reclen;
|
|
||||||
unsigned char d_type;
|
|
||||||
char d_name[256];
|
|
||||||
};
|
|
||||||
|
|
||||||
extern int getdents(unsigned int, struct dirent *, unsigned int);
|
cmn x0, #(MAX_ERRNO + 1)
|
||||||
|
cneg x0, x0, hi
|
||||||
|
b.hi __set_errno
|
||||||
|
|
||||||
__END_DECLS
|
ret
|
||||||
|
END(vfork)
|
||||||
#endif /* _SYS_DIRENT_H_ */
|
|
||||||
155
libc/arch-arm64/generic/bionic/memcmp.S
Normal file
155
libc/arch-arm64/generic/bionic/memcmp.S
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
/* Copyright (c) 2014, Linaro Limited
|
||||||
|
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.
|
||||||
|
* Neither the name of the Linaro 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 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
|
||||||
|
HOLDER 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Assumptions:
|
||||||
|
*
|
||||||
|
* ARMv8-a, AArch64
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <private/bionic_asm.h>
|
||||||
|
|
||||||
|
/* Parameters and result. */
|
||||||
|
#define src1 x0
|
||||||
|
#define src2 x1
|
||||||
|
#define limit x2
|
||||||
|
#define result x0
|
||||||
|
|
||||||
|
/* Internal variables. */
|
||||||
|
#define data1 x3
|
||||||
|
#define data1w w3
|
||||||
|
#define data2 x4
|
||||||
|
#define data2w w4
|
||||||
|
#define has_nul x5
|
||||||
|
#define diff x6
|
||||||
|
#define endloop x7
|
||||||
|
#define tmp1 x8
|
||||||
|
#define tmp2 x9
|
||||||
|
#define tmp3 x10
|
||||||
|
#define pos x11
|
||||||
|
#define limit_wd x12
|
||||||
|
#define mask x13
|
||||||
|
|
||||||
|
ENTRY(memcmp)
|
||||||
|
cbz limit, .Lret0
|
||||||
|
eor tmp1, src1, src2
|
||||||
|
tst tmp1, #7
|
||||||
|
b.ne .Lmisaligned8
|
||||||
|
ands tmp1, src1, #7
|
||||||
|
b.ne .Lmutual_align
|
||||||
|
add limit_wd, limit, #7
|
||||||
|
lsr limit_wd, limit_wd, #3
|
||||||
|
/* Start of performance-critical section -- one 64B cache line. */
|
||||||
|
.Lloop_aligned:
|
||||||
|
ldr data1, [src1], #8
|
||||||
|
ldr data2, [src2], #8
|
||||||
|
.Lstart_realigned:
|
||||||
|
subs limit_wd, limit_wd, #1
|
||||||
|
eor diff, data1, data2 /* Non-zero if differences found. */
|
||||||
|
csinv endloop, diff, xzr, ne /* Last Dword or differences. */
|
||||||
|
cbz endloop, .Lloop_aligned
|
||||||
|
/* End of performance-critical section -- one 64B cache line. */
|
||||||
|
|
||||||
|
/* Not reached the limit, must have found a diff. */
|
||||||
|
cbnz limit_wd, .Lnot_limit
|
||||||
|
|
||||||
|
/* Limit % 8 == 0 => all bytes significant. */
|
||||||
|
ands limit, limit, #7
|
||||||
|
b.eq .Lnot_limit
|
||||||
|
|
||||||
|
lsl limit, limit, #3 /* Bits -> bytes. */
|
||||||
|
mov mask, #~0
|
||||||
|
#ifdef __AARCH64EB__
|
||||||
|
lsr mask, mask, limit
|
||||||
|
#else
|
||||||
|
lsl mask, mask, limit
|
||||||
|
#endif
|
||||||
|
bic data1, data1, mask
|
||||||
|
bic data2, data2, mask
|
||||||
|
|
||||||
|
orr diff, diff, mask
|
||||||
|
.Lnot_limit:
|
||||||
|
|
||||||
|
#ifndef __AARCH64EB__
|
||||||
|
rev diff, diff
|
||||||
|
rev data1, data1
|
||||||
|
rev data2, data2
|
||||||
|
#endif
|
||||||
|
/* The MS-non-zero bit of DIFF marks either the first bit
|
||||||
|
that is different, or the end of the significant data.
|
||||||
|
Shifting left now will bring the critical information into the
|
||||||
|
top bits. */
|
||||||
|
clz pos, diff
|
||||||
|
lsl data1, data1, pos
|
||||||
|
lsl data2, data2, pos
|
||||||
|
/* But we need to zero-extend (char is unsigned) the value and then
|
||||||
|
perform a signed 32-bit subtraction. */
|
||||||
|
lsr data1, data1, #56
|
||||||
|
sub result, data1, data2, lsr #56
|
||||||
|
ret
|
||||||
|
|
||||||
|
.Lmutual_align:
|
||||||
|
/* Sources are mutually aligned, but are not currently at an
|
||||||
|
alignment boundary. Round down the addresses and then mask off
|
||||||
|
the bytes that precede the start point. */
|
||||||
|
bic src1, src1, #7
|
||||||
|
bic src2, src2, #7
|
||||||
|
add limit, limit, tmp1 /* Adjust the limit for the extra. */
|
||||||
|
lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */
|
||||||
|
ldr data1, [src1], #8
|
||||||
|
neg tmp1, tmp1 /* Bits to alignment -64. */
|
||||||
|
ldr data2, [src2], #8
|
||||||
|
mov tmp2, #~0
|
||||||
|
#ifdef __AARCH64EB__
|
||||||
|
/* Big-endian. Early bytes are at MSB. */
|
||||||
|
lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
|
||||||
|
#else
|
||||||
|
/* Little-endian. Early bytes are at LSB. */
|
||||||
|
lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
|
||||||
|
#endif
|
||||||
|
add limit_wd, limit, #7
|
||||||
|
orr data1, data1, tmp2
|
||||||
|
orr data2, data2, tmp2
|
||||||
|
lsr limit_wd, limit_wd, #3
|
||||||
|
b .Lstart_realigned
|
||||||
|
|
||||||
|
.Lret0:
|
||||||
|
mov result, #0
|
||||||
|
ret
|
||||||
|
|
||||||
|
.p2align 6
|
||||||
|
.Lmisaligned8:
|
||||||
|
sub limit, limit, #1
|
||||||
|
1:
|
||||||
|
/* Perhaps we can do better than this. */
|
||||||
|
ldrb data1w, [src1], #1
|
||||||
|
ldrb data2w, [src2], #1
|
||||||
|
subs limit, limit, #1
|
||||||
|
ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
|
||||||
|
b.eq 1b
|
||||||
|
sub result, data1, data2
|
||||||
|
ret
|
||||||
|
END(memcmp)
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user