Compare commits
386 Commits
android-1.
...
froyo
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9163872132 | ||
![]() |
7e0bfb511e | ||
![]() |
4e383b81d0 | ||
![]() |
5207d78c32 | ||
![]() |
b5e4a41606 | ||
![]() |
377d4c979d | ||
![]() |
709a898de8 | ||
![]() |
88f06cd84a | ||
![]() |
1825fb5d5f | ||
![]() |
c0e464268d | ||
![]() |
ee7b077abf | ||
![]() |
e2a8b1fd19 | ||
![]() |
ede2e75f49 | ||
![]() |
b0ae864dff | ||
![]() |
40e6b82286 | ||
![]() |
a9c41a8e0a | ||
![]() |
3f192f55f0 | ||
![]() |
dd8f3c80f1 | ||
![]() |
5586838bab | ||
![]() |
8641833b62 | ||
![]() |
ba9c6f0989 | ||
![]() |
1cfbda826c | ||
![]() |
ecede40222 | ||
![]() |
8132626b71 | ||
![]() |
92e712f60d | ||
![]() |
55cd975f34 | ||
![]() |
d378c68d74 | ||
![]() |
d7ed1ae982 | ||
![]() |
3c543e1da9 | ||
![]() |
cb58a8221c | ||
![]() |
f199d2d503 | ||
![]() |
2e5491b8f2 | ||
![]() |
71fbeecdbd | ||
![]() |
fd5b1bb85d | ||
![]() |
9f6915631b | ||
![]() |
bd9a90c443 | ||
![]() |
eb9d5ed347 | ||
![]() |
8f8b5310d2 | ||
![]() |
1f6f493963 | ||
![]() |
9ab75d4cc8 | ||
![]() |
75c5e25ae3 | ||
![]() |
b55462328f | ||
![]() |
75fba6888a | ||
![]() |
e31c1d0b48 | ||
![]() |
f31fceaae6 | ||
![]() |
4f920f685b | ||
![]() |
294dd0b86b | ||
![]() |
2e1a03c16f | ||
![]() |
1dcf07a84c | ||
![]() |
5c734644ee | ||
![]() |
e100f52f4a | ||
![]() |
16f7d16f9f | ||
![]() |
49f0a8f23b | ||
![]() |
53691d7df2 | ||
![]() |
58060c50bc | ||
![]() |
ee424e23c1 | ||
![]() |
34e6991c97 | ||
![]() |
699237baf5 | ||
![]() |
291100c795 | ||
![]() |
a28336c735 | ||
![]() |
3b06c128cf | ||
![]() |
1db874720a | ||
![]() |
ba8bfedd04 | ||
![]() |
2721fbd208 | ||
![]() |
34f411e5fd | ||
![]() |
c0472409d1 | ||
![]() |
7ec87a1926 | ||
![]() |
d0996bb4cd | ||
![]() |
276313ec18 | ||
![]() |
cdcc2648ba | ||
![]() |
30a419afc3 | ||
![]() |
8f92500fa9 | ||
![]() |
e964f3a095 | ||
![]() |
f597049b40 | ||
![]() |
97cf7f3394 | ||
![]() |
90f82e5868 | ||
![]() |
1a2917ca95 | ||
![]() |
d6bf8f9229 | ||
![]() |
fc10b24acc | ||
![]() |
8c59d96e24 | ||
![]() |
64ceac3f49 | ||
![]() |
c29731a491 | ||
![]() |
e9d08ba523 | ||
![]() |
2497f65fee | ||
![]() |
d1cfc947f9 | ||
![]() |
4fa7b10564 | ||
![]() |
3839580cd9 | ||
![]() |
278d157f43 | ||
![]() |
a809abb086 | ||
![]() |
6458c49c96 | ||
![]() |
0b5db51ea6 | ||
![]() |
ee84231886 | ||
![]() |
70b5ddafd4 | ||
![]() |
99d7907611 | ||
![]() |
278d960aae | ||
![]() |
44358b9fed | ||
![]() |
4cf30fb534 | ||
![]() |
f197147a78 | ||
![]() |
caa17a905a | ||
![]() |
ca07064c9e | ||
![]() |
be71c8142d | ||
![]() |
d548a265ca | ||
![]() |
5f53a18204 | ||
![]() |
20b3097d4c | ||
![]() |
f7ee5739fa | ||
![]() |
754c178ae5 | ||
![]() |
a0783df14e | ||
![]() |
ece132df48 | ||
![]() |
df55c64203 | ||
![]() |
e1e684920f | ||
![]() |
ff3c8dfced | ||
![]() |
aeebf717ad | ||
![]() |
a3de55c831 | ||
![]() |
db63eff2d5 | ||
![]() |
fe62de1ad0 | ||
![]() |
7b12b4a349 | ||
![]() |
5cdb2b73d2 | ||
![]() |
3bbac05726 | ||
![]() |
c1202510b6 | ||
![]() |
780775c812 | ||
![]() |
ae77aae80c | ||
![]() |
07401a681f | ||
![]() |
157cdf42d7 | ||
![]() |
cd5df2d92c | ||
![]() |
00da948b09 | ||
![]() |
a5d9651368 | ||
![]() |
21195bbaf1 | ||
![]() |
8d7c695337 | ||
![]() |
7e61789985 | ||
![]() |
25f8ea4d40 | ||
![]() |
01a1f8b080 | ||
![]() |
b5239ed16a | ||
![]() |
62a1bb5acf | ||
![]() |
9cb69cf4dc | ||
![]() |
8a2658a342 | ||
![]() |
25a3a3ea8c | ||
![]() |
a6083b7768 | ||
![]() |
870fa11830 | ||
![]() |
fdfa16776c | ||
![]() |
362b2aabee | ||
![]() |
b74ceb25aa | ||
![]() |
83d3d7491a | ||
![]() |
ebf3ea006e | ||
![]() |
34ea5117db | ||
![]() |
0493b61c1a | ||
![]() |
a7f8f312e0 | ||
![]() |
2db97868f8 | ||
![]() |
95604529ec | ||
![]() |
0896a3a9f0 | ||
![]() |
817b4c45f0 | ||
![]() |
84adfb759c | ||
![]() |
195082ab52 | ||
![]() |
e8870ffc96 | ||
![]() |
a7b5e20e9c | ||
![]() |
110044b131 | ||
![]() |
194d3fa048 | ||
![]() |
9d52bdfb95 | ||
![]() |
03c643b493 | ||
![]() |
71c0aeb44f | ||
![]() |
b152dde4ca | ||
![]() |
83362689f5 | ||
![]() |
10be95cffc | ||
![]() |
ad13c57298 | ||
![]() |
92b10af793 | ||
![]() |
2d04a78477 | ||
![]() |
ecac54db21 | ||
![]() |
3ba822cc3f | ||
![]() |
47c5e30b61 | ||
![]() |
199f9d9238 | ||
![]() |
e823807dc2 | ||
![]() |
f1729553e3 | ||
![]() |
9e78de3e3c | ||
![]() |
53b32f8b7e | ||
![]() |
70bba5160f | ||
![]() |
763ac28357 | ||
![]() |
943043583a | ||
![]() |
a6210dc510 | ||
![]() |
05324b36c1 | ||
![]() |
18af6efefa | ||
![]() |
0703efeae2 | ||
![]() |
96bbbe2177 | ||
![]() |
bb9eedeff4 | ||
![]() |
af7315acf6 | ||
![]() |
50d233fdce | ||
![]() |
581f43056b | ||
![]() |
214dec2811 | ||
![]() |
76ef331cd6 | ||
![]() |
7e7d6c48a0 | ||
![]() |
dfb93b8914 | ||
![]() |
b3cfdb6220 | ||
![]() |
eeaf6544b6 | ||
![]() |
79d23e28ed | ||
![]() |
5d436ddcae | ||
![]() |
cd23098828 | ||
![]() |
8213d5c3c0 | ||
![]() |
ff7b46b87c | ||
![]() |
7934a799e1 | ||
![]() |
9c46315800 | ||
![]() |
b63e4e88b0 | ||
![]() |
5f32207a3d | ||
![]() |
35af95026e | ||
![]() |
051736be13 | ||
![]() |
539f046a55 | ||
![]() |
6ffc625a7a | ||
![]() |
72540134bd | ||
![]() |
b9c37d7186 | ||
![]() |
1902b53152 | ||
![]() |
73981476a3 | ||
![]() |
a8f96cf3f9 | ||
![]() |
7fbe3c8b78 | ||
![]() |
60c221ccfa | ||
![]() |
0619f2e744 | ||
![]() |
5c32826841 | ||
![]() |
0e24d2c944 | ||
![]() |
3c99876116 | ||
![]() |
f3b3c91e7d | ||
![]() |
0d19cef4c1 | ||
![]() |
51192d546d | ||
![]() |
f406a20519 | ||
![]() |
d704c4d711 | ||
![]() |
9a96aaa8ef | ||
![]() |
ab9a0025d5 | ||
![]() |
1f2a381e84 | ||
![]() |
5be45ce0cf | ||
![]() |
e36502673d | ||
![]() |
fdc5c1f56f | ||
![]() |
cf399f77b8 | ||
![]() |
1e40783d9a | ||
![]() |
44e55ba8eb | ||
![]() |
fe46030cdd | ||
![]() |
0893d49187 | ||
![]() |
7a9e06fa7e | ||
![]() |
2a7ad97539 | ||
![]() |
4a9afcb101 | ||
![]() |
9ea64da6c5 | ||
![]() |
6ed80c8814 | ||
![]() |
2d77d4dbd6 | ||
![]() |
ee223d02d9 | ||
![]() |
10093276e9 | ||
![]() |
468fc8c533 | ||
![]() |
33acbf0719 | ||
![]() |
76e3d69330 | ||
![]() |
4e5a965d6a | ||
![]() |
8d0c0334f1 | ||
![]() |
dfa87a200f | ||
![]() |
f355096a64 | ||
![]() |
7e5e9f4270 | ||
![]() |
bc10cd2900 | ||
![]() |
9641805419 | ||
![]() |
d154954f02 | ||
![]() |
7910e39d19 | ||
![]() |
3f56b7f65a | ||
![]() |
4a05d12cf5 | ||
![]() |
4e30c09e57 | ||
![]() |
7ed086eb99 | ||
![]() |
916edf2a3f | ||
![]() |
5632aeb838 | ||
![]() |
5672726b44 | ||
![]() |
895244b2ab | ||
![]() |
a246a71975 | ||
![]() |
5cf640c926 | ||
![]() |
c7f65a01e5 | ||
![]() |
77e9c05988 | ||
![]() |
252c576d7e | ||
![]() |
b8a18d059b | ||
![]() |
bd192b470b | ||
![]() |
cdeb4c8afa | ||
![]() |
a4e67f4512 | ||
![]() |
c88110e284 | ||
![]() |
664dac1e95 | ||
![]() |
824201294b | ||
![]() |
0dfd94cff4 | ||
![]() |
4e57cf3f8c | ||
![]() |
2093d350be | ||
![]() |
842cdcd2f6 | ||
![]() |
9e74f697e0 | ||
![]() |
76ec6891e2 | ||
![]() |
c0ed422958 | ||
![]() |
b4423ff7df | ||
![]() |
1bbc56cd22 | ||
![]() |
00fb8b45d9 | ||
![]() |
ce0595d01d | ||
![]() |
a90528ad34 | ||
![]() |
efecfde19a | ||
![]() |
d87945b4e7 | ||
![]() |
2e5bd8f8aa | ||
![]() |
cc05d12716 | ||
![]() |
8f53951b05 | ||
![]() |
f76b577fed | ||
![]() |
898cc98f3d | ||
![]() |
fcb10796ec | ||
![]() |
30eb40241c | ||
![]() |
ac68b70ed9 | ||
![]() |
44ac5d5d93 | ||
![]() |
bb08537104 | ||
![]() |
81fa6d5f94 | ||
![]() |
4c4a9632bd | ||
![]() |
3d8f4ada56 | ||
![]() |
6e36f86333 | ||
![]() |
2b45974837 | ||
![]() |
d5f72afd49 | ||
![]() |
c1e553a9cf | ||
![]() |
8b09aa39c3 | ||
![]() |
61e844f48e | ||
![]() |
e5bcc9dc5c | ||
![]() |
9cfb12e6bc | ||
![]() |
eda65ce1a5 | ||
![]() |
e7274663f1 | ||
![]() |
1d763d50e7 | ||
![]() |
70f1280ca9 | ||
![]() |
e40fb3d68f | ||
![]() |
d5b3513cca | ||
![]() |
d63185fd88 | ||
![]() |
a22c04502a | ||
![]() |
09131482e7 | ||
![]() |
08a85b69b4 | ||
![]() |
4553a785e2 | ||
![]() |
bf8947da81 | ||
![]() |
b7681167cb | ||
![]() |
a2f5e21244 | ||
![]() |
733f7deeb7 | ||
![]() |
fc8b178759 | ||
![]() |
267e23ae99 | ||
![]() |
4a1fe7167b | ||
![]() |
37429fff41 | ||
![]() |
336efb5267 | ||
![]() |
838ac974f4 | ||
![]() |
bf013b1951 | ||
![]() |
3772217641 | ||
![]() |
5c3b16c576 | ||
![]() |
fc90c51f72 | ||
![]() |
25e3c33488 | ||
![]() |
4b91ef8348 | ||
![]() |
ec6c274da2 | ||
![]() |
c52c174e41 | ||
![]() |
5b67764a5a | ||
![]() |
2f4ce43033 | ||
![]() |
040ae31701 | ||
![]() |
f24799580f | ||
![]() |
1b02faeea6 | ||
![]() |
f30dae9cf4 | ||
![]() |
654476654e | ||
![]() |
563b15dbfe | ||
![]() |
e76de9a8ca | ||
![]() |
b489245af2 | ||
![]() |
4cab53af77 | ||
![]() |
1ff2ee440b | ||
![]() |
b572dc4b51 | ||
![]() |
bdde630b4a | ||
![]() |
d7f5035959 | ||
![]() |
38460b45bc | ||
![]() |
24a41091f4 | ||
![]() |
a48fa7f4de | ||
![]() |
a0508577c9 | ||
![]() |
3ccce08bf8 | ||
![]() |
cd64095ad1 | ||
![]() |
6c9f88d15c | ||
![]() |
bc89169b5e | ||
![]() |
9122f51d44 | ||
![]() |
3707ba5132 | ||
![]() |
5a2edd681c | ||
![]() |
68f25c31f8 | ||
![]() |
51cec57e44 | ||
![]() |
ee40369656 | ||
862ed2d3db | |||
69b1a8ac50 | |||
d99f61fda8 | |||
c2fc66958c | |||
29a2875eaa | |||
3e294b91a0 | |||
![]() |
a35df3487b | ||
50524197fc | |||
![]() |
8c0b2e6875 | ||
a80a1dcf13 | |||
![]() |
90ec5f2a3f | ||
ff9ce60919 | |||
![]() |
edbe7fc97b | ||
![]() |
0b251a1b9c | ||
![]() |
c2f23bb1cd | ||
![]() |
8af5c80fb8 | ||
![]() |
658d73ad10 | ||
![]() |
b675146ae7 | ||
![]() |
e0055e0f99 | ||
![]() |
39c8f369ef | ||
![]() |
74dca85302 | ||
![]() |
33767fc71b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
*.pyc
|
||||
*.*~
|
||||
libc/kernel/original
|
||||
|
49
CleanSpec.mk
Normal file
49
CleanSpec.mk
Normal file
@@ -0,0 +1,49 @@
|
||||
# Copyright (C) 2007 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
# If you don't need to do a full clean build but would like to touch
|
||||
# a file or delete some intermediate files, add a clean step to the end
|
||||
# of the list. These steps will only be run once, if they haven't been
|
||||
# run before.
|
||||
#
|
||||
# E.g.:
|
||||
# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
|
||||
# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
|
||||
#
|
||||
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
|
||||
# files that are missing or have been moved.
|
||||
#
|
||||
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
|
||||
# Use $(OUT_DIR) to refer to the "out" directory.
|
||||
#
|
||||
# If you need to re-do something that's already mentioned, just copy
|
||||
# the command and add it to the bottom of the list. E.g., if a change
|
||||
# that you made last week required touching a file and a change you
|
||||
# made today requires touching the same file, just copy the old
|
||||
# touch step and add it to the end of the list.
|
||||
#
|
||||
# ************************************************
|
||||
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
||||
# ************************************************
|
||||
|
||||
# For example:
|
||||
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
|
||||
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
|
||||
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
|
||||
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
|
||||
|
||||
# ************************************************
|
||||
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
||||
# ************************************************
|
6
MAINTAINERS
Normal file
6
MAINTAINERS
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
Bionic support for SuperH
|
||||
-------------------------
|
||||
Bionic support for SuperH architecture is written by
|
||||
Shin-ichiro KAWASAKI <shinichiro.kawasaki.mg@hitachi.com>
|
||||
and Contributed to Android by Hitachi, Ltd. and Renesas Solutions Corp.
|
150
libc/Android.mk
150
libc/Android.mk
@@ -26,6 +26,7 @@ libc_common_src_files := \
|
||||
unistd/initgroups.c \
|
||||
unistd/isatty.c \
|
||||
unistd/issetugid.c \
|
||||
unistd/killpg.c \
|
||||
unistd/lseek64.c \
|
||||
unistd/mmap.c \
|
||||
unistd/nice.c \
|
||||
@@ -46,12 +47,16 @@ libc_common_src_files := \
|
||||
unistd/sbrk.c \
|
||||
unistd/send.c \
|
||||
unistd/setegid.c \
|
||||
unistd/setuid.c \
|
||||
unistd/seteuid.c \
|
||||
unistd/setreuid.c \
|
||||
unistd/setresuid.c \
|
||||
unistd/setpgrp.c \
|
||||
unistd/sigblock.c \
|
||||
unistd/siginterrupt.c \
|
||||
unistd/siglist.c \
|
||||
unistd/signal.c \
|
||||
unistd/signame.c \
|
||||
unistd/sigsetmask.c \
|
||||
unistd/sigsuspend.c \
|
||||
unistd/sigwait.c \
|
||||
@@ -175,7 +180,6 @@ libc_common_src_files := \
|
||||
string/memccpy.c \
|
||||
string/memchr.c \
|
||||
string/memmem.c \
|
||||
string/memmove.c.arm \
|
||||
string/memrchr.c \
|
||||
string/memswap.c \
|
||||
string/strcasecmp.c \
|
||||
@@ -218,14 +222,19 @@ libc_common_src_files := \
|
||||
bionic/__errno.c \
|
||||
bionic/__set_errno.c \
|
||||
bionic/_rand48.c \
|
||||
bionic/cpuacct.c \
|
||||
bionic/arc4random.c \
|
||||
bionic/basename.c \
|
||||
bionic/basename_r.c \
|
||||
bionic/clearenv.c \
|
||||
bionic/dirname.c \
|
||||
bionic/dirname_r.c \
|
||||
bionic/drand48.c \
|
||||
bionic/erand48.c \
|
||||
bionic/err.c \
|
||||
bionic/fdprintf.c \
|
||||
bionic/fork.c \
|
||||
bionic/fts.c \
|
||||
bionic/if_nametoindex.c \
|
||||
bionic/if_indextoname.c \
|
||||
bionic/ioctl.c \
|
||||
@@ -259,7 +268,7 @@ libc_common_src_files := \
|
||||
netbsd/resolv/res_mkquery.c \
|
||||
netbsd/resolv/res_query.c \
|
||||
netbsd/resolv/res_send.c \
|
||||
netbsd/resolv/res_state.c.arm \
|
||||
netbsd/resolv/res_state.c \
|
||||
netbsd/resolv/res_cache.c \
|
||||
netbsd/net/nsdispatch.c \
|
||||
netbsd/net/getaddrinfo.c \
|
||||
@@ -273,13 +282,18 @@ libc_common_src_files := \
|
||||
netbsd/nameser/ns_ttl.c \
|
||||
netbsd/nameser/ns_netint.c \
|
||||
netbsd/nameser/ns_print.c \
|
||||
netbsd/nameser/ns_samedomain.c
|
||||
netbsd/nameser/ns_samedomain.c \
|
||||
regex/regcomp.c \
|
||||
regex/regerror.c \
|
||||
regex/regexec.c \
|
||||
regex/regfree.c \
|
||||
|
||||
# Architecture specific source files go here
|
||||
# =========================================================
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
libc_common_src_files += \
|
||||
bionic/eabi.c \
|
||||
bionic/bionic_clone.c \
|
||||
arch-arm/bionic/__get_pc.S \
|
||||
arch-arm/bionic/__get_sp.S \
|
||||
arch-arm/bionic/_exit_with_stack_teardown.S \
|
||||
@@ -288,6 +302,7 @@ libc_common_src_files += \
|
||||
arch-arm/bionic/clone.S \
|
||||
arch-arm/bionic/ffs.S \
|
||||
arch-arm/bionic/kill.S \
|
||||
arch-arm/bionic/libgcc_compat.c \
|
||||
arch-arm/bionic/tkill.S \
|
||||
arch-arm/bionic/memcmp.S \
|
||||
arch-arm/bionic/memcmp16.S \
|
||||
@@ -297,6 +312,7 @@ libc_common_src_files += \
|
||||
arch-arm/bionic/sigsetjmp.S \
|
||||
arch-arm/bionic/strlen.c.arm \
|
||||
arch-arm/bionic/syscall.S \
|
||||
string/memmove.c.arm \
|
||||
unistd/socketcalls.c
|
||||
|
||||
# These files need to be arm so that gdbserver
|
||||
@@ -327,11 +343,13 @@ libc_common_src_files += \
|
||||
arch-x86/bionic/setjmp.S \
|
||||
arch-x86/bionic/_setjmp.S \
|
||||
arch-x86/bionic/vfork.S \
|
||||
arch-x86/bionic/syscall.S \
|
||||
arch-x86/string/bzero.S \
|
||||
arch-x86/string/memset.S \
|
||||
arch-x86/string/memcmp.S \
|
||||
arch-x86/string/memcpy.S \
|
||||
arch-x86/string/strlen.S \
|
||||
string/memmove.c \
|
||||
bionic/pthread.c \
|
||||
bionic/pthread-timers.c \
|
||||
bionic/ptrace.c
|
||||
@@ -341,7 +359,38 @@ libc_arch_static_src_files := \
|
||||
arch-x86/bionic/dl_iterate_phdr_static.c
|
||||
|
||||
libc_arch_dynamic_src_files :=
|
||||
endif # x86
|
||||
else # !x86
|
||||
|
||||
ifeq ($(TARGET_ARCH),sh)
|
||||
libc_common_src_files += \
|
||||
arch-sh/bionic/__get_pc.S \
|
||||
arch-sh/bionic/__get_sp.S \
|
||||
arch-sh/bionic/_exit_with_stack_teardown.S \
|
||||
arch-sh/bionic/_setjmp.S \
|
||||
arch-sh/bionic/atomics_sh.c \
|
||||
arch-sh/bionic/atomic_cmpxchg.S \
|
||||
arch-sh/bionic/clone.S \
|
||||
arch-sh/bionic/pipe.S \
|
||||
arch-sh/bionic/memcpy.S \
|
||||
arch-sh/bionic/memset.S \
|
||||
arch-sh/bionic/bzero.S \
|
||||
arch-sh/bionic/setjmp.S \
|
||||
arch-sh/bionic/sigsetjmp.S \
|
||||
arch-sh/bionic/syscall.S \
|
||||
arch-sh/bionic/memmove.S \
|
||||
arch-sh/bionic/__set_tls.c \
|
||||
arch-sh/bionic/__get_tls.c \
|
||||
arch-sh/bionic/ffs.S \
|
||||
string/memcmp.c \
|
||||
string/strlen.c \
|
||||
bionic/eabi.c \
|
||||
bionic/pthread.c \
|
||||
bionic/pthread-timers.c \
|
||||
bionic/ptrace.c \
|
||||
unistd/socketcalls.c
|
||||
endif # sh
|
||||
|
||||
endif # !x86
|
||||
endif # !arm
|
||||
|
||||
# Define some common cflags
|
||||
@@ -357,7 +406,16 @@ libc_common_cflags := \
|
||||
-DNEED_PSELECT=1 \
|
||||
-DINET6 \
|
||||
-I$(LOCAL_PATH)/private \
|
||||
-DUSE_DL_PREFIX
|
||||
-DUSE_DL_PREFIX \
|
||||
-DPOSIX_MISTAKE
|
||||
|
||||
# these macro definitions are required to implement the
|
||||
# 'timezone' and 'daylight' global variables, as well as
|
||||
# properly update the 'tm_gmtoff' field in 'struct tm'.
|
||||
#
|
||||
libc_common_cflags += \
|
||||
-DTM_GMTOFF=tm_gmtoff \
|
||||
-DUSG_COMPAT=1
|
||||
|
||||
ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
|
||||
libc_common_cflags += -DDEBUG
|
||||
@@ -366,6 +424,16 @@ endif
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
libc_common_cflags += -fstrict-aliasing
|
||||
libc_crt_target_cflags := -mthumb-interwork
|
||||
#
|
||||
# Define HAVE_ARM_TLS_REGISTER macro to indicate to the C library
|
||||
# that it should access the hardware TLS register directly in
|
||||
# private/bionic_tls.h
|
||||
#
|
||||
# The value must match your kernel configuration
|
||||
#
|
||||
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
|
||||
libc_common_cflags += -DHAVE_ARM_TLS_REGISTER
|
||||
endif
|
||||
else # !arm
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
libc_crt_target_cflags := -m32
|
||||
@@ -477,17 +545,12 @@ include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES := \
|
||||
$(libc_arch_static_src_files) \
|
||||
bionic/dlmalloc.c \
|
||||
bionic/malloc_debug_common.c \
|
||||
bionic/libc_init_static.c
|
||||
|
||||
LOCAL_CFLAGS := $(libc_common_cflags)
|
||||
|
||||
ifeq ($(WITH_MALLOC_CHECK_LIBC_A),true)
|
||||
LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
|
||||
LOCAL_SRC_FILES += bionic/malloc_leak.c.arm
|
||||
endif
|
||||
|
||||
LOCAL_CFLAGS := $(libc_common_cflags) \
|
||||
-DLIBC_STATIC
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
|
||||
LOCAL_MODULE := libc
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
|
||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
@@ -506,7 +569,7 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
LOCAL_SRC_FILES := \
|
||||
$(libc_arch_dynamic_src_files) \
|
||||
bionic/dlmalloc.c \
|
||||
bionic/malloc_leak.c.arm \
|
||||
bionic/malloc_debug_common.c \
|
||||
bionic/libc_init_dynamic.c
|
||||
|
||||
LOCAL_MODULE:= libc
|
||||
@@ -526,8 +589,16 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
# For all builds, except for the -user build we will enable memory
|
||||
# allocation checking (including memory leaks, buffer overwrites, etc.)
|
||||
# Note that all these checks are also controlled by env. settings
|
||||
# that can enable, or disable specific checks. Note also that some of
|
||||
# the checks are available only in emulator and are implemeted in
|
||||
# libc_malloc_qemu_instrumented.so.
|
||||
ifneq ($(TARGET_BUILD_VARIANT),user)
|
||||
|
||||
# ========================================================
|
||||
# libc_debug.so
|
||||
# libc_malloc_debug_leak.so
|
||||
# ========================================================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
@@ -538,30 +609,49 @@ LOCAL_CFLAGS := \
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(libc_arch_dynamic_src_files) \
|
||||
bionic/dlmalloc.c \
|
||||
bionic/malloc_leak.c.arm \
|
||||
bionic/libc_init_dynamic.c
|
||||
bionic/malloc_debug_leak.c
|
||||
|
||||
LOCAL_MODULE:= libc_debug
|
||||
LOCAL_MODULE:= libc_malloc_debug_leak
|
||||
|
||||
# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
|
||||
# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
|
||||
# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
|
||||
# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
|
||||
# should, instead relying on the external symbols from the dependent libraries. That would
|
||||
# create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
|
||||
# you wanted!
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libdl
|
||||
LOCAL_SHARED_LIBRARIES := libc
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
|
||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
# Don't prelink
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
# Don't install on release build
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
LOCAL_MODULE_TAGS := eng debug
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
# ========================================================
|
||||
# libc_malloc_debug_qemu.so
|
||||
# ========================================================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(libc_common_cflags) \
|
||||
-DMALLOC_QEMU_INSTRUMENT
|
||||
|
||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
bionic/malloc_debug_qemu.c
|
||||
|
||||
LOCAL_MODULE:= libc_malloc_debug_qemu
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libc
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
|
||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
||||
# Don't prelink
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
# Don't install on release build
|
||||
LOCAL_MODULE_TAGS := eng debug
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
endif #!user
|
||||
|
||||
|
||||
# ========================================================
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
|
@@ -1,4 +1,5 @@
|
||||
Welcome to Bionic, Android small and custom C library for the Android platform
|
||||
Welcome to Bionic, Android's small and custom C library for the Android
|
||||
platform.
|
||||
|
||||
Bionic is mainly a port of the BSD C library to our Linux kernel with the
|
||||
following additions/changes:
|
||||
|
@@ -22,6 +22,9 @@
|
||||
# assembler template for the syscall; it's up to the bionic implementation to provide
|
||||
# a relevant C stub
|
||||
#
|
||||
# - additionally, if the syscall number is different amoung ARM, x86 and SuperH, use:
|
||||
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,superh_number
|
||||
#
|
||||
# the file is processed by a python script named gensyscalls.py
|
||||
#
|
||||
|
||||
@@ -31,10 +34,15 @@ void _exit_thread:exit (int) 1
|
||||
pid_t __fork:fork (void) 2
|
||||
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7
|
||||
int waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284
|
||||
pid_t __clone:clone(int (*fn)(void*), void *child_stack, int flags, void *arg) 120
|
||||
|
||||
# NOTE: this system call is never called directly, but we list it there
|
||||
# to have __NR_clone properly defined.
|
||||
#
|
||||
pid_t __sys_clone:clone (int, void*, int*, void*, int*) 120
|
||||
|
||||
int execve (const char*, char* const*, char* const*) 11
|
||||
|
||||
int setuid:setuid32 (uid_t) 213
|
||||
int __setuid:setuid32 (uid_t) 213
|
||||
uid_t getuid:getuid32 () 199
|
||||
gid_t getgid:getgid32 () 200
|
||||
uid_t geteuid:geteuid32 () 201
|
||||
@@ -48,8 +56,8 @@ pid_t getppid() 64
|
||||
pid_t setsid() 66
|
||||
int setgid:setgid32(gid_t) 214
|
||||
int seteuid:seteuid32(uid_t) stub
|
||||
int setreuid:setreuid32(uid_t, uid_t) 203
|
||||
int setresuid:setresuid32(uid_t, uid_t, uid_t) 208
|
||||
int __setreuid:setreuid32(uid_t, uid_t) 203
|
||||
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208
|
||||
int setresgid:setresgid32(gid_t, gid_t, gid_t) 210
|
||||
void* __brk:brk(void*) 45
|
||||
# see comments in arch-arm/bionic/kill.S to understand why we don't generate an ARM stub for kill/tkill
|
||||
@@ -65,12 +73,13 @@ int getrusage(int who, struct rusage* r_usage) 77
|
||||
int setgroups:setgroups32(int, const gid_t *) 206
|
||||
pid_t getpgrp(void) stub
|
||||
int setpgid(pid_t, pid_t) 57
|
||||
pid_t vfork(void) 190,-1
|
||||
pid_t vfork(void) 190,-1,190
|
||||
int setregid:setregid32(gid_t, gid_t) 204
|
||||
int chroot(const char *) 61
|
||||
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172
|
||||
int capget(cap_user_header_t header, cap_user_data_t data) 184
|
||||
int capset(cap_user_header_t header, const cap_user_data_t data) 185
|
||||
int sigaltstack(const stack_t*, stack_t*) 186
|
||||
int acct(const char* filepath) 51
|
||||
|
||||
# file descriptors
|
||||
@@ -102,7 +111,7 @@ int __fcntl:fcntl(int, int, void*) 55
|
||||
int flock(int, int) 143
|
||||
int fchmod(int, mode_t) 94
|
||||
int dup(int) 41
|
||||
int pipe(int *) 42
|
||||
int pipe(int *) 42,42,-1
|
||||
int dup2(int, int) 63
|
||||
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 142
|
||||
int ftruncate(int, off_t) 93
|
||||
@@ -190,21 +199,24 @@ int sendmsg(int, const struct msghdr *, unsigned int) 296,-1
|
||||
int recvmsg(int, struct msghdr *, unsigned int) 297,-1
|
||||
|
||||
# sockets for x86. These are done as an "indexed" call to socketcall syscall.
|
||||
int socket:socketcall:1 (int, int, int) -1,102
|
||||
int bind:socketcall:2 (int, struct sockaddr *, int) -1,102
|
||||
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,102
|
||||
int listen:socketcall:4(int, int) -1,102
|
||||
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,102
|
||||
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,102
|
||||
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,102
|
||||
int socketpair:socketcall:8(int, int, int, int*) -1,102
|
||||
int sendto:socketcall:11(int, const void *, size_t, int, const struct sockaddr *, socklen_t) -1,102
|
||||
int recvfrom:socketcall:12(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) -1,102
|
||||
int shutdown:socketcall:13(int, int) -1,102
|
||||
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,102
|
||||
int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1,102
|
||||
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102
|
||||
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102
|
||||
int socket:socketcall:1 (int, int, int) -1,102,-1
|
||||
int bind:socketcall:2 (int, struct sockaddr *, int) -1,102,-1
|
||||
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,102,-1
|
||||
int listen:socketcall:4(int, int) -1,102,-1
|
||||
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int socketpair:socketcall:8(int, int, int, int*) -1,102,-1
|
||||
int sendto:socketcall:11(int, const void *, size_t, int, const struct sockaddr *, socklen_t) -1,102,-1
|
||||
int recvfrom:socketcall:12(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) -1,102,-1
|
||||
int shutdown:socketcall:13(int, int) -1,102,-1
|
||||
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,102,-1
|
||||
int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1,102,-1
|
||||
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102,-1
|
||||
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102,-1
|
||||
|
||||
# sockets for sh.
|
||||
int __socketcall:__socketcall(int, unsigned long*) -1,-1,102
|
||||
|
||||
# scheduler & real-time
|
||||
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156
|
||||
@@ -216,6 +228,10 @@ int sched_get_priority_max(int policy) 159
|
||||
int sched_get_priority_min(int policy) 160
|
||||
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161
|
||||
|
||||
# io priorities
|
||||
int ioprio_set(int which, int who, int ioprio) 314,289
|
||||
int ioprio_get(int which, int who) 315,290
|
||||
|
||||
# other
|
||||
int uname(struct utsname *) 122
|
||||
pid_t __wait4:wait4(pid_t pid, int *status, int options, struct rusage *rusage) 114
|
||||
@@ -234,9 +250,9 @@ int epoll_create(int size) 250,254
|
||||
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255
|
||||
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 252,256
|
||||
|
||||
int inotify_init(void) 316,291
|
||||
int inotify_add_watch(int, const char *, unsigned int) 317,292
|
||||
int inotify_rm_watch(int, unsigned int) 318,293
|
||||
int inotify_init(void) 316,291,290
|
||||
int inotify_add_watch(int, const char *, unsigned int) 317,292,291
|
||||
int inotify_rm_watch(int, unsigned int) 318,293,292
|
||||
|
||||
int poll(struct pollfd *, unsigned int, long) 168
|
||||
|
||||
|
@@ -26,6 +26,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
.global __get_pc
|
||||
.type __get_pc, %function
|
||||
|
||||
__get_pc:
|
||||
mov r0, pc
|
||||
|
@@ -26,6 +26,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
.global __get_sp
|
||||
.type __get_sp, %function
|
||||
|
||||
__get_sp:
|
||||
mov r0, sp
|
||||
|
@@ -28,11 +28,13 @@
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.global __atomic_cmpxchg
|
||||
.type __atomic_cmpxchg, %function
|
||||
.global __atomic_swap
|
||||
.type __atomic_swap, %function
|
||||
.global __atomic_dec
|
||||
.type __atomic_dec, %function
|
||||
.global __atomic_inc
|
||||
.global __futex_wait
|
||||
.global __futex_wake
|
||||
.type __atomic_inc, %function
|
||||
|
||||
#define FUTEX_WAIT 0
|
||||
#define FUTEX_WAKE 1
|
||||
@@ -41,6 +43,8 @@
|
||||
.equ kernel_cmpxchg, 0xFFFF0FC0
|
||||
.equ kernel_atomic_base, 0xFFFF0FFF
|
||||
__atomic_dec:
|
||||
.fnstart
|
||||
.save {r4, lr}
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r2, r0
|
||||
1: @ atomic_dec
|
||||
@@ -53,8 +57,11 @@ __atomic_dec:
|
||||
add r0, r1, #1
|
||||
ldmia sp!, {r4, lr}
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
__atomic_inc:
|
||||
.fnstart
|
||||
.save {r4, lr}
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r2, r0
|
||||
1: @ atomic_inc
|
||||
@@ -67,9 +74,12 @@ __atomic_inc:
|
||||
sub r0, r1, #1
|
||||
ldmia sp!, {r4, lr}
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
|
||||
__atomic_cmpxchg:
|
||||
.fnstart
|
||||
.save {r4, lr}
|
||||
stmdb sp!, {r4, lr}
|
||||
mov r4, r0 /* r4 = save oldvalue */
|
||||
1: @ atomic_cmpxchg
|
||||
@@ -84,6 +94,7 @@ __atomic_cmpxchg:
|
||||
2: @ atomic_cmpxchg
|
||||
ldmia sp!, {r4, lr}
|
||||
bx lr
|
||||
.fnend
|
||||
#else
|
||||
#define KUSER_CMPXCHG 0xffffffc0
|
||||
|
||||
@@ -129,15 +140,49 @@ __atomic_inc:
|
||||
#endif
|
||||
|
||||
/* r0(new) r1(addr) -> r0(old) */
|
||||
/* replaced swp instruction with ldrex/strex for ARMv6 & ARMv7 */
|
||||
__atomic_swap:
|
||||
#if defined (_ARM_HAVE_LDREX_STREX)
|
||||
1: ldrex r2, [r1]
|
||||
strex r3, r0, [r1]
|
||||
teq r3, #0
|
||||
bne 1b
|
||||
mov r0, r2
|
||||
mcr p15, 0, r0, c7, c10, 5 /* or, use dmb */
|
||||
#else
|
||||
swp r0, r0, [r1]
|
||||
#endif
|
||||
bx lr
|
||||
|
||||
/* __futex_wait(*ftx, val, *timespec) */
|
||||
/* __futex_syscall(*ftx, op, val, *timespec, *addr2, val3) */
|
||||
/* __futex_wake(*ftx, counter) */
|
||||
/* __futex_syscall3(*ftx, op, val) */
|
||||
/* __futex_syscall4(*ftx, op, val, *timespec) */
|
||||
|
||||
.global __futex_wait
|
||||
.type __futex_wait, %function
|
||||
|
||||
.global __futex_wake
|
||||
.type __futex_wake, %function
|
||||
|
||||
.global __futex_syscall3
|
||||
.type __futex_syscall3, %function
|
||||
|
||||
.global __futex_syscall4
|
||||
.type __futex_syscall4, %function
|
||||
|
||||
#if __ARM_EABI__
|
||||
|
||||
__futex_syscall3:
|
||||
.fnstart
|
||||
stmdb sp!, {r4, r7}
|
||||
.save {r4, r7}
|
||||
ldr r7, =__NR_futex
|
||||
swi #0
|
||||
ldmia sp!, {r4, r7}
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
__futex_wait:
|
||||
.fnstart
|
||||
stmdb sp!, {r4, r7}
|
||||
@@ -162,6 +207,10 @@ __futex_wake:
|
||||
|
||||
#else
|
||||
|
||||
__futex_syscall3:
|
||||
swi #__NR_futex
|
||||
bx lr
|
||||
|
||||
__futex_wait:
|
||||
mov r3, r2
|
||||
mov r2, r1
|
||||
@@ -176,3 +225,6 @@ __futex_wake:
|
||||
bx lr
|
||||
|
||||
#endif
|
||||
|
||||
__futex_syscall4:
|
||||
b __futex_syscall3
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* Copyright (C) 2008-2010 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -27,48 +27,102 @@
|
||||
*/
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __pthread_clone, #function
|
||||
.global __pthread_clone
|
||||
.align 4
|
||||
|
||||
__pthread_clone:
|
||||
@ insert the args onto the new stack
|
||||
str r0, [r1, #-4]
|
||||
str r3, [r1, #-8]
|
||||
.text
|
||||
.type __pthread_clone, #function
|
||||
.global __pthread_clone
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
__pthread_clone:
|
||||
@ insert the args onto the new stack
|
||||
str r0, [r1, #-4]
|
||||
str r3, [r1, #-8]
|
||||
|
||||
@ do the system call
|
||||
@ get flags
|
||||
|
||||
@ do the system call
|
||||
@ get flags
|
||||
|
||||
mov r0, r2
|
||||
|
||||
|
||||
@ new sp is already in r1
|
||||
|
||||
#if __ARM_EABI__
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_clone
|
||||
swi #0
|
||||
swi #0
|
||||
#else
|
||||
swi #__NR_clone
|
||||
swi #__NR_clone
|
||||
#endif
|
||||
|
||||
movs r0, r0
|
||||
movs r0, r0
|
||||
#if __ARM_EABI__
|
||||
ldmnefd sp!, {r4, r7}
|
||||
#endif
|
||||
blt __error
|
||||
bxne lr
|
||||
blt __error
|
||||
bxne lr
|
||||
|
||||
|
||||
@ pick the function arg and call address off the stack and jump
|
||||
@ to the C __thread_entry function which does some setup and then
|
||||
@ calls the thread's start function
|
||||
@ pick the function arg and call address off the stack and jump
|
||||
@ to the C __thread_entry function which does some setup and then
|
||||
@ calls the thread's start function
|
||||
|
||||
ldr r0, [sp, #-4]
|
||||
ldr r1, [sp, #-8]
|
||||
mov r2, sp @ __thread_entry needs the TLS pointer
|
||||
b __thread_entry
|
||||
ldr r0, [sp, #-4]
|
||||
ldr r1, [sp, #-8]
|
||||
mov r2, sp @ __thread_entry needs the TLS pointer
|
||||
b __thread_entry
|
||||
|
||||
__error:
|
||||
mov r0, #-1
|
||||
bx lr
|
||||
mov r0, #-1
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
|
||||
#
|
||||
# This function is defined as:
|
||||
#
|
||||
# pid_t __bionic_clone( int flags, void *child_stack,
|
||||
# pid_t *pid, void *tls, pid_t *ctid,
|
||||
# int (*fn)(void *), void* arg );
|
||||
#
|
||||
# NOTE: This is not the same signature than the GLibc
|
||||
# __clone function here !! Placing 'fn' and 'arg'
|
||||
# at the end of the parameter list makes the
|
||||
# implementation much simpler.
|
||||
#
|
||||
.type __bionic_clone, #function
|
||||
.globl __bionic_clone
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
__bionic_clone:
|
||||
mov ip, sp
|
||||
.save {r4, r5, r6, r7}
|
||||
|
||||
# save registers to parent stack
|
||||
stmfd sp!, {r4, r5, r6, r7}
|
||||
|
||||
# load extra parameters
|
||||
ldmfd ip, {r4, r5, r6}
|
||||
|
||||
# store 'fn' and 'arg' to the child stack
|
||||
str r5, [r1, #-4]
|
||||
str r6, [r1, #-8]
|
||||
|
||||
# system call
|
||||
ldr r7, =__NR_clone
|
||||
swi #0
|
||||
movs r0, r0
|
||||
beq 1f
|
||||
|
||||
# in parent, reload saved registers
|
||||
# then either exit or error
|
||||
#
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
bxne lr
|
||||
b __set_syscall_errno
|
||||
|
||||
1: # in the child - pick arguments
|
||||
ldr r0, [sp, #-4]
|
||||
ldr r1, [sp, #-8]
|
||||
b __bionic_clone_entry
|
||||
|
||||
.fnend
|
||||
|
152
libc/arch-arm/bionic/libgcc_compat.c
Normal file
152
libc/arch-arm/bionic/libgcc_compat.c
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* This file contains dummy references to libgcc.a functions to force the
|
||||
* dynamic linker to copy their definition into the final libc.so binary.
|
||||
*
|
||||
* They are required to ensure backwards binary compatibility with
|
||||
* Android 1.5 and Android 1.6 system images. Some applications built
|
||||
* using the NDK require them to be here.
|
||||
*
|
||||
* Now, for a more elaborate description of the issue:
|
||||
*
|
||||
* libgcc.a is a compiler-specific library containing various helper
|
||||
* functions used to implement certain operations that are not necessarily
|
||||
* supported by the target CPU. For example, integer division doesn't have a
|
||||
* corresponding CPU instruction on ARMv5, and is instead implemented in the
|
||||
* compiler-generated machine code as a call to an __idiv helper function.
|
||||
*
|
||||
* Normally, one has to place libgcc.a in the link command used to generate
|
||||
* target binaries (shared libraries and executables) after all objects and
|
||||
* static libraries, but before dependent shared libraries, i.e. something
|
||||
* like:
|
||||
* gcc <options> -o libfoo.so foo.a libgcc.a -lc -lm
|
||||
*
|
||||
* This ensures that any helper function needed by the code in foo.a is copied
|
||||
* into the final libfoo.so. Unfortunately, the Android build system has been
|
||||
* using this instead:
|
||||
*
|
||||
* gcc <options> -o libfoo.so foo.a -lc -lm libgcc.a
|
||||
*
|
||||
* The problem with this is that if one helper function needed by foo.a has
|
||||
* already been copied into libc.so or libm.so, then nothing will be copied
|
||||
* into libfoo.so. Instead, a symbol import definition will be added to it
|
||||
* so libfoo.so can directly call the one in libc.so at runtime.
|
||||
*
|
||||
* When changing toolchains for 2.0, the set of helper functions copied to
|
||||
* libc.so changed, which resulted in some native shared libraries generated
|
||||
* with the NDK to fail to load properly.
|
||||
*
|
||||
* The NDK has been fixed after 1.6_r1 to use the correct link command, so
|
||||
* any native shared library generated with it should now be safe from that
|
||||
* problem. On the other hand, existing shared libraries distributed with
|
||||
* applications that were generated with a previous version of the NDK
|
||||
* still need all 1.5/1.6 helper functions in libc.so and libn.so
|
||||
*
|
||||
* Final note: some of the functions below should really be in libm.so to
|
||||
* completely reflect the state of 1.5/1.6 system images. However,
|
||||
* since libm.so depends on libc.so, it's easier to put all of
|
||||
* these in libc.so instead, since the dynamic linker will always
|
||||
* search in libc.so before libm.so for dependencies.
|
||||
*/
|
||||
|
||||
#define COMPAT_FUNCTIONS_LIST \
|
||||
XX(__adddf3) \
|
||||
XX(__addsf3) \
|
||||
XX(__aeabi_cdcmpeq) \
|
||||
XX(__aeabi_cdcmple) \
|
||||
XX(__aeabi_cdrcmple) \
|
||||
XX(__aeabi_d2f) \
|
||||
XX(__aeabi_d2iz) \
|
||||
XX(__aeabi_dadd) \
|
||||
XX(__aeabi_dcmpeq) \
|
||||
XX(__aeabi_dcmpge) \
|
||||
XX(__aeabi_dcmpgt) \
|
||||
XX(__aeabi_dcmple) \
|
||||
XX(__aeabi_dcmplt) \
|
||||
XX(__aeabi_dcmpun) \
|
||||
XX(__aeabi_ddiv) \
|
||||
XX(__aeabi_dmul) \
|
||||
XX(__aeabi_drsub) \
|
||||
XX(__aeabi_dsub) \
|
||||
XX(__aeabi_f2d) \
|
||||
XX(__aeabi_f2iz) \
|
||||
XX(__aeabi_fadd) \
|
||||
XX(__aeabi_fcmpun) \
|
||||
XX(__aeabi_fdiv) \
|
||||
XX(__aeabi_fmul) \
|
||||
XX(__aeabi_frsub) \
|
||||
XX(__aeabi_fsub) \
|
||||
XX(__aeabi_i2d) \
|
||||
XX(__aeabi_i2f) \
|
||||
XX(__aeabi_l2d) \
|
||||
XX(__aeabi_l2f) \
|
||||
XX(__aeabi_lmul) \
|
||||
XX(__aeabi_ui2d) \
|
||||
XX(__aeabi_ui2f) \
|
||||
XX(__aeabi_ul2d) \
|
||||
XX(__aeabi_ul2f) \
|
||||
XX(__cmpdf2) \
|
||||
XX(__divdf3) \
|
||||
XX(__divsf3) \
|
||||
XX(__eqdf2) \
|
||||
XX(__extendsfdf2) \
|
||||
XX(__fixdfsi) \
|
||||
XX(__fixsfsi) \
|
||||
XX(__floatdidf) \
|
||||
XX(__floatdisf) \
|
||||
XX(__floatsidf) \
|
||||
XX(__floatsisf) \
|
||||
XX(__floatundidf) \
|
||||
XX(__floatundisf) \
|
||||
XX(__floatunsidf) \
|
||||
XX(__floatunsisf) \
|
||||
XX(__gedf2) \
|
||||
XX(__gtdf2) \
|
||||
XX(__ledf2) \
|
||||
XX(__ltdf2) \
|
||||
XX(__muldf3) \
|
||||
XX(__muldi3) \
|
||||
XX(__mulsf3) \
|
||||
XX(__nedf2) \
|
||||
XX(__subdf3) \
|
||||
XX(__subsf3) \
|
||||
XX(__truncdfsf2) \
|
||||
XX(__unorddf2) \
|
||||
XX(__unordsf2) \
|
||||
|
||||
#define XX(f) extern void f(void);
|
||||
COMPAT_FUNCTIONS_LIST
|
||||
#undef XX
|
||||
|
||||
void __bionic_libgcc_compat_hooks(void)
|
||||
{
|
||||
#define XX(f) f();
|
||||
COMPAT_FUNCTIONS_LIST
|
||||
#undef XX
|
||||
}
|
@@ -44,6 +44,7 @@
|
||||
*/
|
||||
|
||||
memcmp:
|
||||
.fnstart
|
||||
PLD (r0, #0)
|
||||
PLD (r1, #0)
|
||||
|
||||
@@ -53,6 +54,7 @@ memcmp:
|
||||
moveq r0, #0
|
||||
bxeq lr
|
||||
|
||||
.save {r4, lr}
|
||||
/* save registers */
|
||||
stmfd sp!, {r4, lr}
|
||||
|
||||
@@ -174,6 +176,7 @@ memcmp:
|
||||
9: /* restore registers and return */
|
||||
ldmfd sp!, {r4, lr}
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
|
||||
|
||||
|
@@ -44,6 +44,7 @@
|
||||
*/
|
||||
|
||||
__memcmp16:
|
||||
.fnstart
|
||||
PLD (r0, #0)
|
||||
PLD (r1, #0)
|
||||
|
||||
@@ -79,6 +80,7 @@ __memcmp16:
|
||||
bx lr
|
||||
|
||||
|
||||
.save {r4, lr}
|
||||
/* save registers */
|
||||
0: stmfd sp!, {r4, lr}
|
||||
|
||||
@@ -93,6 +95,7 @@ __memcmp16:
|
||||
/* restore registers and return */
|
||||
ldmnefd sp!, {r4, lr}
|
||||
bxne lr
|
||||
.fnend
|
||||
|
||||
|
||||
|
||||
|
@@ -28,6 +28,127 @@
|
||||
|
||||
#include <machine/cpu-features.h>
|
||||
|
||||
#if defined(__ARM_NEON__)
|
||||
|
||||
.text
|
||||
.fpu neon
|
||||
|
||||
.global memcpy
|
||||
.type memcpy, %function
|
||||
.align 4
|
||||
|
||||
/* a prefetch distance of 4 cache-lines works best experimentally */
|
||||
#define CACHE_LINE_SIZE 64
|
||||
#define PREFETCH_DISTANCE (CACHE_LINE_SIZE*4)
|
||||
|
||||
memcpy:
|
||||
.fnstart
|
||||
.save {r0, lr}
|
||||
stmfd sp!, {r0, lr}
|
||||
|
||||
/* start preloading as early as possible */
|
||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*1)]
|
||||
|
||||
/* do we have at least 16-bytes to copy (needed for alignment below) */
|
||||
cmp r2, #16
|
||||
blo 5f
|
||||
|
||||
/* align destination to half cache-line for the write-buffer */
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0xF
|
||||
beq 0f
|
||||
|
||||
/* copy up to 15-bytes (count in r3) */
|
||||
sub r2, r2, r3
|
||||
movs ip, r3, lsl #31
|
||||
ldrmib lr, [r1], #1
|
||||
strmib lr, [r0], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
movs ip, r3, lsl #29
|
||||
bge 1f
|
||||
// copies 4 bytes, destination 32-bits aligned
|
||||
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
|
||||
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]!
|
||||
1: bcc 2f
|
||||
// copies 8 bytes, destination 64-bits aligned
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0, :64]!
|
||||
2:
|
||||
|
||||
0: /* preload immediately the next cache line, which we may need */
|
||||
pld [r1, #(CACHE_LINE_SIZE*0)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*1)]
|
||||
|
||||
/* make sure we have at least 64 bytes to copy */
|
||||
subs r2, r2, #64
|
||||
blo 2f
|
||||
|
||||
/* preload all the cache lines we need.
|
||||
* NOTE: the number of pld below depends on PREFETCH_DISTANCE,
|
||||
* ideally would would increase the distance in the main loop to
|
||||
* avoid the goofy code below. In practice this doesn't seem to make
|
||||
* a big difference.
|
||||
*/
|
||||
pld [r1, #(CACHE_LINE_SIZE*2)]
|
||||
pld [r1, #(CACHE_LINE_SIZE*3)]
|
||||
pld [r1, #(PREFETCH_DISTANCE)]
|
||||
|
||||
1: /* The main loop copies 64 bytes at a time */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
vld1.8 {d4 - d7}, [r1]!
|
||||
pld [r1, #(PREFETCH_DISTANCE)]
|
||||
subs r2, r2, #64
|
||||
vst1.8 {d0 - d3}, [r0, :128]!
|
||||
vst1.8 {d4 - d7}, [r0, :128]!
|
||||
bhs 1b
|
||||
|
||||
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
|
||||
add r2, r2, #64
|
||||
subs r2, r2, #32
|
||||
blo 4f
|
||||
|
||||
3: /* 32 bytes at a time. These cache lines were already preloaded */
|
||||
vld1.8 {d0 - d3}, [r1]!
|
||||
subs r2, r2, #32
|
||||
vst1.8 {d0 - d3}, [r0, :128]!
|
||||
bhs 3b
|
||||
|
||||
4: /* less than 32 left */
|
||||
add r2, r2, #32
|
||||
tst r2, #0x10
|
||||
beq 5f
|
||||
// copies 16 bytes, 128-bits aligned
|
||||
vld1.8 {d0, d1}, [r1]!
|
||||
vst1.8 {d0, d1}, [r0, :128]!
|
||||
|
||||
5: /* copy up to 15-bytes (count in r2) */
|
||||
movs ip, r2, lsl #29
|
||||
bcc 1f
|
||||
vld1.8 {d0}, [r1]!
|
||||
vst1.8 {d0}, [r0]!
|
||||
1: bge 2f
|
||||
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
|
||||
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]!
|
||||
2: movs ip, r2, lsl #31
|
||||
ldrmib r3, [r1], #1
|
||||
ldrcsb ip, [r1], #1
|
||||
ldrcsb lr, [r1], #1
|
||||
strmib r3, [r0], #1
|
||||
strcsb ip, [r0], #1
|
||||
strcsb lr, [r0], #1
|
||||
|
||||
ldmfd sp!, {r0, lr}
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
|
||||
#else /* __ARM_ARCH__ < 7 */
|
||||
|
||||
|
||||
.text
|
||||
|
||||
.global memcpy
|
||||
@@ -40,9 +161,9 @@
|
||||
* note that memcpy() always returns the destination pointer,
|
||||
* so we have to preserve R0.
|
||||
*/
|
||||
|
||||
memcpy:
|
||||
/* The stack must always be 64-bits aligned to be compliant with the
|
||||
|
||||
memcpy:
|
||||
/* The stack must always be 64-bits aligned to be compliant with the
|
||||
* ARM ABI. Since we have to save R0, we might as well save R4
|
||||
* which we can use for better pipelining of the reads below
|
||||
*/
|
||||
@@ -82,10 +203,10 @@ memcpy:
|
||||
strmib r3, [r0], #1
|
||||
strcsb r4, [r0], #1
|
||||
strcsb r12,[r0], #1
|
||||
|
||||
|
||||
src_aligned:
|
||||
|
||||
/* see if src and dst are aligned together (congruent) */
|
||||
/* see if src and dst are aligned together (congruent) */
|
||||
eor r12, r0, r1
|
||||
tst r12, #3
|
||||
bne non_congruent
|
||||
@@ -103,7 +224,7 @@ src_aligned:
|
||||
andhi r3, r2, #0x1C
|
||||
|
||||
/* conditionnaly copies 0 to 7 words (length in r3) */
|
||||
movs r12, r3, lsl #28
|
||||
movs r12, r3, lsl #28
|
||||
ldmcsia r1!, {r4, r5, r6, r7} /* 16 bytes */
|
||||
ldmmiia r1!, {r8, r9} /* 8 bytes */
|
||||
stmcsia r0!, {r4, r5, r6, r7}
|
||||
@@ -124,7 +245,7 @@ cached_aligned32:
|
||||
|
||||
/*
|
||||
* We preload a cache-line up to 64 bytes ahead. On the 926, this will
|
||||
* stall only until the requested world is fetched, but the linefill
|
||||
* stall only until the requested world is fetched, but the linefill
|
||||
* continues in the the background.
|
||||
* While the linefill is going, we write our previous cache-line
|
||||
* into the write-buffer (which should have some free space).
|
||||
@@ -150,19 +271,19 @@ cached_aligned32:
|
||||
|
||||
// NOTE: if r12 is more than 64 ahead of r1, the following ldrhi
|
||||
// for ARM9 preload will not be safely guarded by the preceding subs.
|
||||
// When it is safely guarded the only possibility to have SIGSEGV here
|
||||
// When it is safely guarded the only possibility to have SIGSEGV here
|
||||
// is because the caller overstates the length.
|
||||
ldrhi r3, [r12], #32 /* cheap ARM9 preload */
|
||||
stmia r0!, { r4-r11 }
|
||||
bhs 1b
|
||||
|
||||
|
||||
add r2, r2, #32
|
||||
|
||||
|
||||
|
||||
|
||||
less_than_32_left:
|
||||
/*
|
||||
/*
|
||||
* less than 32 bytes left at this point (length in r2)
|
||||
*/
|
||||
|
||||
@@ -174,7 +295,7 @@ less_than_32_left:
|
||||
beq 1f
|
||||
|
||||
/* conditionnaly copies 0 to 31 bytes */
|
||||
movs r12, r2, lsl #28
|
||||
movs r12, r2, lsl #28
|
||||
ldmcsia r1!, {r4, r5, r6, r7} /* 16 bytes */
|
||||
ldmmiia r1!, {r8, r9} /* 8 bytes */
|
||||
stmcsia r0!, {r4, r5, r6, r7}
|
||||
@@ -182,7 +303,7 @@ less_than_32_left:
|
||||
movs r12, r2, lsl #30
|
||||
ldrcs r3, [r1], #4 /* 4 bytes */
|
||||
ldrmih r4, [r1], #2 /* 2 bytes */
|
||||
strcs r3, [r0], #4
|
||||
strcs r3, [r0], #4
|
||||
strmih r4, [r0], #2
|
||||
tst r2, #0x1
|
||||
ldrneb r3, [r1] /* last byte */
|
||||
@@ -200,34 +321,34 @@ non_congruent:
|
||||
* here source is aligned to 4 bytes
|
||||
* but destination is not.
|
||||
*
|
||||
* in the code below r2 is the number of bytes read
|
||||
* in the code below r2 is the number of bytes read
|
||||
* (the number of bytes written is always smaller, because we have
|
||||
* partial words in the shift queue)
|
||||
*/
|
||||
cmp r2, #4
|
||||
blo copy_last_3_and_return
|
||||
|
||||
|
||||
/* Use post-incriment mode for stm to spill r5-r11 to reserved stack
|
||||
* frame. Don't update sp.
|
||||
*/
|
||||
stmea sp, {r5-r11}
|
||||
|
||||
|
||||
/* compute shifts needed to align src to dest */
|
||||
rsb r5, r0, #0
|
||||
and r5, r5, #3 /* r5 = # bytes in partial words */
|
||||
mov r12, r5, lsl #3 /* r12 = right */
|
||||
mov r12, r5, lsl #3 /* r12 = right */
|
||||
rsb lr, r12, #32 /* lr = left */
|
||||
|
||||
|
||||
/* read the first word */
|
||||
ldr r3, [r1], #4
|
||||
sub r2, r2, #4
|
||||
|
||||
|
||||
/* write a partial word (0 to 3 bytes), such that destination
|
||||
* becomes aligned to 32 bits (r5 = nb of words to copy for alignment)
|
||||
*/
|
||||
movs r5, r5, lsl #31
|
||||
strmib r3, [r0], #1
|
||||
movmi r3, r3, lsr #8
|
||||
movmi r3, r3, lsr #8
|
||||
strcsb r3, [r0], #1
|
||||
movcs r3, r3, lsr #8
|
||||
strcsb r3, [r0], #1
|
||||
@@ -235,7 +356,7 @@ non_congruent:
|
||||
|
||||
cmp r2, #4
|
||||
blo partial_word_tail
|
||||
|
||||
|
||||
/* Align destination to 32 bytes (cache line boundary) */
|
||||
1: tst r0, #0x1c
|
||||
beq 2f
|
||||
@@ -366,7 +487,7 @@ partial_word_tail:
|
||||
strcsb r3, [r0], #1
|
||||
movcs r3, r3, lsr #8
|
||||
strcsb r3, [r0], #1
|
||||
|
||||
|
||||
/* Refill spilled registers from the stack. Don't update sp. */
|
||||
ldmfd sp, {r5-r11}
|
||||
|
||||
@@ -385,3 +506,5 @@ copy_last_3_and_return:
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
|
||||
#endif /* __ARM_ARCH__ < 7 */
|
||||
|
@@ -80,7 +80,7 @@ memset:
|
||||
|
||||
rsb r3, r0, #0
|
||||
ands r3, r3, #0x1C
|
||||
beq aligned32
|
||||
beq 3f
|
||||
cmp r3, r2
|
||||
andhi r3, r2, #0x1C
|
||||
sub r2, r2, r3
|
||||
@@ -93,7 +93,7 @@ memset:
|
||||
movs r3, r3, lsl #2
|
||||
strcs r1, [r0], #4
|
||||
|
||||
aligned32:
|
||||
3:
|
||||
subs r2, r2, #32
|
||||
mov r3, r1
|
||||
bmi 2f
|
||||
|
@@ -149,6 +149,13 @@
|
||||
# define __ARM_HAVE_PC_INTERWORK
|
||||
#endif
|
||||
|
||||
/* define _ARM_HAVE_LDREX_STREX for ARMv6 and ARMv7 architecure to be
|
||||
* used in replacement of depricated swp instruction
|
||||
*/
|
||||
#if __ARM_ARCH__ >= 6
|
||||
# define _ARM_HAVE_LDREX_STREX
|
||||
#endif
|
||||
|
||||
|
||||
/* Assembly-only macros */
|
||||
|
||||
|
@@ -4,9 +4,9 @@ syscall_src += arch-arm/syscalls/_exit.S
|
||||
syscall_src += arch-arm/syscalls/_exit_thread.S
|
||||
syscall_src += arch-arm/syscalls/__fork.S
|
||||
syscall_src += arch-arm/syscalls/waitid.S
|
||||
syscall_src += arch-arm/syscalls/__clone.S
|
||||
syscall_src += arch-arm/syscalls/__sys_clone.S
|
||||
syscall_src += arch-arm/syscalls/execve.S
|
||||
syscall_src += arch-arm/syscalls/setuid.S
|
||||
syscall_src += arch-arm/syscalls/__setuid.S
|
||||
syscall_src += arch-arm/syscalls/getuid.S
|
||||
syscall_src += arch-arm/syscalls/getgid.S
|
||||
syscall_src += arch-arm/syscalls/geteuid.S
|
||||
@@ -19,8 +19,8 @@ syscall_src += arch-arm/syscalls/getpgid.S
|
||||
syscall_src += arch-arm/syscalls/getppid.S
|
||||
syscall_src += arch-arm/syscalls/setsid.S
|
||||
syscall_src += arch-arm/syscalls/setgid.S
|
||||
syscall_src += arch-arm/syscalls/setreuid.S
|
||||
syscall_src += arch-arm/syscalls/setresuid.S
|
||||
syscall_src += arch-arm/syscalls/__setreuid.S
|
||||
syscall_src += arch-arm/syscalls/__setresuid.S
|
||||
syscall_src += arch-arm/syscalls/setresgid.S
|
||||
syscall_src += arch-arm/syscalls/__brk.S
|
||||
syscall_src += arch-arm/syscalls/__ptrace.S
|
||||
@@ -37,6 +37,7 @@ syscall_src += arch-arm/syscalls/chroot.S
|
||||
syscall_src += arch-arm/syscalls/prctl.S
|
||||
syscall_src += arch-arm/syscalls/capget.S
|
||||
syscall_src += arch-arm/syscalls/capset.S
|
||||
syscall_src += arch-arm/syscalls/sigaltstack.S
|
||||
syscall_src += arch-arm/syscalls/acct.S
|
||||
syscall_src += arch-arm/syscalls/read.S
|
||||
syscall_src += arch-arm/syscalls/write.S
|
||||
@@ -150,6 +151,8 @@ syscall_src += arch-arm/syscalls/sched_getparam.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_rr_get_interval.S
|
||||
syscall_src += arch-arm/syscalls/ioprio_set.S
|
||||
syscall_src += arch-arm/syscalls/ioprio_get.S
|
||||
syscall_src += arch-arm/syscalls/uname.S
|
||||
syscall_src += arch-arm/syscalls/__wait4.S
|
||||
syscall_src += arch-arm/syscalls/umask.S
|
||||
|
@@ -2,12 +2,12 @@
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type setresuid, #function
|
||||
.globl setresuid
|
||||
.type __setresuid, #function
|
||||
.globl __setresuid
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
setresuid:
|
||||
__setresuid:
|
||||
.save {r4, r7}
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_setresuid32
|
@@ -2,12 +2,12 @@
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type setreuid, #function
|
||||
.globl setreuid
|
||||
.type __setreuid, #function
|
||||
.globl __setreuid
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
setreuid:
|
||||
__setreuid:
|
||||
.save {r4, r7}
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_setreuid32
|
@@ -2,12 +2,12 @@
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type setuid, #function
|
||||
.globl setuid
|
||||
.type __setuid, #function
|
||||
.globl __setuid
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
setuid:
|
||||
__setuid:
|
||||
.save {r4, r7}
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_setuid32
|
21
libc/arch-arm/syscalls/__sys_clone.S
Normal file
21
libc/arch-arm/syscalls/__sys_clone.S
Normal file
@@ -0,0 +1,21 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __sys_clone, #function
|
||||
.globl __sys_clone
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
__sys_clone:
|
||||
mov ip, sp
|
||||
.save {r4, r5, r6, r7}
|
||||
stmfd sp!, {r4, r5, r6, r7}
|
||||
ldmfd ip, {r4, r5, r6}
|
||||
ldr r7, =__NR_clone
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r5, r6, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
.fnend
|
@@ -2,15 +2,15 @@
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __clone, #function
|
||||
.globl __clone
|
||||
.type ioprio_get, #function
|
||||
.globl ioprio_get
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
__clone:
|
||||
ioprio_get:
|
||||
.save {r4, r7}
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_clone
|
||||
ldr r7, =__NR_ioprio_get
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r7}
|
||||
movs r0, r0
|
19
libc/arch-arm/syscalls/ioprio_set.S
Normal file
19
libc/arch-arm/syscalls/ioprio_set.S
Normal file
@@ -0,0 +1,19 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type ioprio_set, #function
|
||||
.globl ioprio_set
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
ioprio_set:
|
||||
.save {r4, r7}
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_ioprio_set
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
.fnend
|
19
libc/arch-arm/syscalls/sigaltstack.S
Normal file
19
libc/arch-arm/syscalls/sigaltstack.S
Normal file
@@ -0,0 +1,19 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type sigaltstack, #function
|
||||
.globl sigaltstack
|
||||
.align 4
|
||||
.fnstart
|
||||
|
||||
sigaltstack:
|
||||
.save {r4, r7}
|
||||
stmfd sp!, {r4, r7}
|
||||
ldr r7, =__NR_sigaltstack
|
||||
swi #0
|
||||
ldmfd sp!, {r4, r7}
|
||||
movs r0, r0
|
||||
bxpl lr
|
||||
b __set_syscall_errno
|
||||
.fnend
|
37
libc/arch-sh/bionic/__get_pc.S
Normal file
37
libc/arch-sh/bionic/__get_pc.S
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
.text
|
||||
.type __get_pc, @function
|
||||
.globl __get_pc
|
||||
.align 4
|
||||
|
||||
__get_pc:
|
||||
mova 1f, r0
|
||||
rts
|
||||
1: nop
|
||||
|
36
libc/arch-sh/bionic/__get_sp.S
Normal file
36
libc/arch-sh/bionic/__get_sp.S
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
.text
|
||||
.type __get_sp, @function
|
||||
.globl __get_sp
|
||||
.align 4
|
||||
|
||||
__get_sp:
|
||||
rts
|
||||
mov r15, r0
|
||||
|
37
libc/arch-sh/bionic/__get_tls.c
Normal file
37
libc/arch-sh/bionic/__get_tls.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
/* see the implementation of __set_tls and pthread.c to understand this
|
||||
* code. Basically, the content of fs:[0] always is a pointer to the base
|
||||
* address of the tls region
|
||||
*/
|
||||
void *__get_tls(void)
|
||||
{
|
||||
void *tls;
|
||||
asm volatile("stc gbr, %0" : "=r"(tls));
|
||||
return tls;
|
||||
}
|
37
libc/arch-sh/bionic/__set_tls.c
Normal file
37
libc/arch-sh/bionic/__set_tls.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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 <pthread.h>
|
||||
|
||||
/*
|
||||
* Simply set tls address into GBR.
|
||||
*/
|
||||
int __set_tls(void *ptr)
|
||||
{
|
||||
asm volatile("ldc %0, gbr" : /* no output */ : "r" (ptr));
|
||||
return 0;
|
||||
}
|
52
libc/arch-sh/bionic/_exit_with_stack_teardown.S
Normal file
52
libc/arch-sh/bionic/_exit_with_stack_teardown.S
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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 <asm/unistd.h>
|
||||
|
||||
.text
|
||||
.type _exit_with_stack_teardown, @function
|
||||
.globl _exit_with_stack_teardown
|
||||
.align 4
|
||||
|
||||
# void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode)
|
||||
|
||||
_exit_with_stack_teardown:
|
||||
mov r6, r8 /* save retCode : breaks r8 value */
|
||||
mov.l 0f, r3 /* system call number */
|
||||
trapa #(2 + 0x10) /* invoke system call with num of args */
|
||||
|
||||
mov r8, r4 /* restore retCode */
|
||||
mov.l 1f, r3 /* system call number */
|
||||
trapa #(1 + 0x10) /* invoke system call with num of args */
|
||||
|
||||
/* exit() should never return, cause a crash if it does */
|
||||
mov #0, r0
|
||||
mov.l @r0, r0
|
||||
|
||||
.align 2
|
||||
0: .long __NR_munmap
|
||||
1: .long __NR_exit
|
125
libc/arch-sh/bionic/_setjmp.S
Normal file
125
libc/arch-sh/bionic/_setjmp.S
Normal file
@@ -0,0 +1,125 @@
|
||||
/* $OpenBSD: _setjmp.S,v 1.2 2007/03/02 06:11:54 miod Exp $ */
|
||||
/* $NetBSD: _setjmp.S,v 1.7 2006/01/05 02:04:41 uwe Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* 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: @(#)_setjmp.s 5.1 (Berkeley) 4/23/90
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
/*
|
||||
* C library -- _setjmp, _longjmp
|
||||
*
|
||||
* _longjmp(a,v)
|
||||
* will generate a "return(v)" from the last call to
|
||||
* _setjmp(a)
|
||||
* by restoring registers from the stack.
|
||||
* The previous signal state is NOT restored.
|
||||
*/
|
||||
|
||||
ENTRY(_setjmp)
|
||||
xor r0, r0
|
||||
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
|
||||
add #(_JBLEN * 4), r4
|
||||
sts fpscr, r1
|
||||
mov.l r1, @-r4
|
||||
lds r0, fpscr
|
||||
sts.l fpul, @-r4
|
||||
fmov.s fr15, @-r4
|
||||
fmov.s fr14, @-r4
|
||||
fmov.s fr13, @-r4
|
||||
fmov.s fr12, @-r4
|
||||
frchg
|
||||
fmov.s fr15, @-r4
|
||||
fmov.s fr14, @-r4
|
||||
fmov.s fr13, @-r4
|
||||
fmov.s fr12, @-r4
|
||||
lds r1, fpscr
|
||||
#else
|
||||
add #((_JBLEN - 10) * 4), r4
|
||||
#endif
|
||||
sts.l mach, @-r4
|
||||
sts.l macl, @-r4
|
||||
mov.l r15, @-r4
|
||||
mov.l r14, @-r4
|
||||
mov.l r13, @-r4
|
||||
mov.l r12, @-r4
|
||||
mov.l r11, @-r4
|
||||
mov.l r10, @-r4
|
||||
mov.l r9, @-r4
|
||||
mov.l r8, @-r4
|
||||
sts.l pr, @-r4
|
||||
mov.l r0, @-r4 /* dummy signal mask */
|
||||
rts
|
||||
mov.l r0, @-r4 /* no saved signal mask */
|
||||
SET_ENTRY_SIZE(_setjmp)
|
||||
|
||||
ENTRY(_longjmp)
|
||||
add #8, r4
|
||||
lds.l @r4+, pr
|
||||
mov.l @r4+, r8
|
||||
mov.l @r4+, r9
|
||||
mov.l @r4+, r10
|
||||
mov.l @r4+, r11
|
||||
mov.l @r4+, r12
|
||||
mov.l @r4+, r13
|
||||
mov.l @r4+, r14
|
||||
mov.l @r4+, r15
|
||||
lds.l @r4+, macl
|
||||
lds.l @r4+, mach
|
||||
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
|
||||
xor r0, r0
|
||||
lds r0, fpscr
|
||||
frchg
|
||||
fmov.s @r4+, fr12
|
||||
fmov.s @r4+, fr13
|
||||
fmov.s @r4+, fr14
|
||||
fmov.s @r4+, fr15
|
||||
frchg
|
||||
fmov.s @r4+, fr12
|
||||
fmov.s @r4+, fr13
|
||||
fmov.s @r4+, fr14
|
||||
fmov.s @r4+, fr15
|
||||
lds.l @r4+, fpul
|
||||
lds.l @r4+, fpscr
|
||||
#endif
|
||||
|
||||
mov r5, r0
|
||||
tst r0, r0
|
||||
bf .L0
|
||||
add #1, r0
|
||||
.L0:
|
||||
rts
|
||||
nop
|
||||
SET_ENTRY_SIZE(_longjmp)
|
50
libc/arch-sh/bionic/atomic_cmpxchg.S
Normal file
50
libc/arch-sh/bionic/atomic_cmpxchg.S
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
.text
|
||||
.type __atomic_cmpxchg, @function
|
||||
.globl __atomic_cmpxchg
|
||||
.align 4
|
||||
|
||||
__atomic_cmpxchg:
|
||||
mova 1f, r0
|
||||
nop
|
||||
mov r15, r1
|
||||
mov #-8, r15 /* critical region start */
|
||||
0: mov.l @r6, r2
|
||||
cmp/eq r2, r4
|
||||
bt not_yet_modified
|
||||
mov #1, r0
|
||||
bra done
|
||||
nop
|
||||
not_yet_modified:
|
||||
mov #0, r0
|
||||
mov.l r5, @r6
|
||||
done:
|
||||
1: mov r1, r15 /* critical region end */
|
||||
rts
|
||||
nop
|
110
libc/arch-sh/bionic/atomics_sh.c
Normal file
110
libc/arch-sh/bionic/atomics_sh.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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 <pthread.h>
|
||||
#include <linux/futex.h>
|
||||
|
||||
#define SWAP_LOCK_COUNT 32U
|
||||
static pthread_mutex_t _swap_locks[SWAP_LOCK_COUNT];
|
||||
|
||||
#define SWAP_LOCK(addr) \
|
||||
&_swap_locks[((unsigned)(void *)(addr) >> 3U) % SWAP_LOCK_COUNT]
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Only this function is moved to atomic_cmpxchg.S, and
|
||||
* implemented with gUSA framework.
|
||||
*/
|
||||
int __atomic_cmpxchg(int old, int _new, volatile int *ptr)
|
||||
{
|
||||
int result;
|
||||
pthread_mutex_t *lock = SWAP_LOCK(ptr);
|
||||
|
||||
pthread_mutex_lock(lock);
|
||||
|
||||
if (*ptr == old) {
|
||||
*ptr = _new;
|
||||
result = 0;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
pthread_mutex_unlock(lock);
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
extern int __atomic_cmpxchg(int old, int _new, volatile int *ptr);
|
||||
#endif
|
||||
|
||||
int __atomic_swap(int _new, volatile int *ptr)
|
||||
{
|
||||
int oldValue;
|
||||
do {
|
||||
oldValue = *ptr;
|
||||
} while (__atomic_cmpxchg(oldValue, _new, ptr));
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
int __atomic_dec(volatile int *ptr)
|
||||
{
|
||||
int oldValue;
|
||||
do {
|
||||
oldValue = *ptr;
|
||||
} while (__atomic_cmpxchg(oldValue, oldValue-1, ptr));
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
int __atomic_inc(volatile int *ptr)
|
||||
{
|
||||
int32_t oldValue;
|
||||
do {
|
||||
oldValue = *ptr;
|
||||
} while (__atomic_cmpxchg(oldValue, oldValue+1, ptr));
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
extern int futex(volatile void *, int, int, void *, void *, int);
|
||||
|
||||
int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout)
|
||||
{
|
||||
return futex(ftx, FUTEX_WAIT, val, (void *)timeout, NULL, 0);
|
||||
}
|
||||
|
||||
int __futex_wake(volatile void *ftx, int count)
|
||||
{
|
||||
return futex(ftx, FUTEX_WAKE, count, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
int __futex_syscall3(volatile void *ftx, int op, int val)
|
||||
{
|
||||
return futex(ftx, op, val, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
int __futex_syscall4(volative void *ftx, int op, int val, const struct timespec *timeout)
|
||||
{
|
||||
return futex(ftx, op, val, (void *)timeout, NULL, 0);
|
||||
}
|
29
libc/arch-sh/bionic/bzero.S
Normal file
29
libc/arch-sh/bionic/bzero.S
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
#define BZERO
|
||||
#include "memset.S"
|
79
libc/arch-sh/bionic/clone.S
Normal file
79
libc/arch-sh/bionic/clone.S
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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 <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __pthread_clone, @function
|
||||
.globl __pthread_clone
|
||||
.align 4
|
||||
|
||||
__pthread_clone:
|
||||
/* insert the args onto the new stack */
|
||||
mov r5, r0
|
||||
mov.l r4, @-r0 /* func */
|
||||
mov.l r7, @-r0 /* arg */
|
||||
|
||||
/* do the system call */
|
||||
mov r6, r4 /* Set clone_flags. new sp is ready in r5. */
|
||||
mov.l 0f, r3
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check error */
|
||||
cmp/pz r0
|
||||
bf __error
|
||||
|
||||
/* check if parent or child */
|
||||
cmp/pl r0
|
||||
bt __return
|
||||
|
||||
/* prepare args for __thread_entry */
|
||||
mov #8, r1
|
||||
sub r1, r15 /* -8 */
|
||||
mov.l @r15+, r5 /* +4 */ /* arg */
|
||||
mov.l @r15+, r4 /* +4 */ /* func */
|
||||
mov r15, r6 /* tls */
|
||||
|
||||
/* jump to __thread_entry */
|
||||
mov.l 1f, r0
|
||||
jmp @r0
|
||||
nop
|
||||
|
||||
__error:
|
||||
mov #-1, r0
|
||||
__return:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_clone
|
||||
1: .long __thread_entry
|
||||
|
||||
/* XXX: TODO: Add __bionic_clone here
|
||||
* See bionic/bionic_clone.c and arch-arm/bionic/clone.S
|
||||
* for more details...
|
||||
*/
|
95
libc/arch-sh/bionic/crtbegin_dynamic.S
Normal file
95
libc/arch-sh/bionic/crtbegin_dynamic.S
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
.text
|
||||
.align 4
|
||||
.type _start,#function
|
||||
.globl _start
|
||||
|
||||
# this is the small startup code that is first run when
|
||||
# any executable that is statically-linked with Bionic
|
||||
# runs.
|
||||
#
|
||||
# it's purpose is to call __libc_init with appropriate
|
||||
# arguments, which are:
|
||||
#
|
||||
# - the address of the raw data block setup by the Linux
|
||||
# kernel ELF loader
|
||||
#
|
||||
# - address of an "onexit" function, not used on any
|
||||
# platform supported by Bionic
|
||||
#
|
||||
# - address of the "main" function of the program. We
|
||||
# can't hard-code it in the adr pseudo instruction
|
||||
# so we use a tiny trampoline that will get relocated
|
||||
# by the dynamic linker before this code runs
|
||||
#
|
||||
# - address of the constructor list
|
||||
#
|
||||
_start:
|
||||
mov r15, r4
|
||||
mov #0, r5
|
||||
mov.l 0f, r6
|
||||
mova 2f, r0
|
||||
mov r0, r7
|
||||
mov.l 1f, r0
|
||||
jmp @r0
|
||||
nop
|
||||
|
||||
.balign 4
|
||||
0: .long main
|
||||
1: .long __libc_init
|
||||
2: .long __PREINIT_ARRAY__
|
||||
.long __INIT_ARRAY__
|
||||
.long __FINI_ARRAY__
|
||||
.long __CTOR_LIST__
|
||||
|
||||
# the .ctors section contains a list of pointers to "constructor"
|
||||
# functions that need to be called in order during C library initialization,
|
||||
# just before the program is being run. This is a C++ requirement
|
||||
#
|
||||
# the last entry shall be 0, and is defined in crtend.S
|
||||
#
|
||||
.section .preinit_array, "aw"
|
||||
.globl __PREINIT_ARRAY__
|
||||
__PREINIT_ARRAY__:
|
||||
.long -1
|
||||
|
||||
.section .init_array, "aw"
|
||||
.globl __INIT_ARRAY__
|
||||
__INIT_ARRAY__:
|
||||
.long -1
|
||||
|
||||
.section .fini_array, "aw"
|
||||
.globl __FINI_ARRAY__
|
||||
__FINI_ARRAY__:
|
||||
.long -1
|
||||
|
||||
.section .ctors, "aw"
|
||||
.globl __CTOR_LIST__
|
||||
__CTOR_LIST__:
|
||||
.long -1
|
96
libc/arch-sh/bionic/crtbegin_static.S
Normal file
96
libc/arch-sh/bionic/crtbegin_static.S
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
.text
|
||||
.align 4
|
||||
.type _start,#function
|
||||
.globl _start
|
||||
|
||||
# this is the small startup code that is first run when
|
||||
# any executable that is statically-linked with Bionic
|
||||
# runs.
|
||||
#
|
||||
# it's purpose is to call __libc_init with appropriate
|
||||
# arguments, which are:
|
||||
#
|
||||
# - the address of the raw data block setup by the Linux
|
||||
# kernel ELF loader
|
||||
#
|
||||
# - address of an "onexit" function, not used on any
|
||||
# platform supported by Bionic
|
||||
#
|
||||
# - address of the "main" function of the program. We
|
||||
# can't hard-code it in the adr pseudo instruction
|
||||
# so we use a tiny trampoline that will get relocated
|
||||
# by the dynamic linker before this code runs
|
||||
#
|
||||
# - address of the constructor list
|
||||
#
|
||||
_start:
|
||||
mov r15, r4
|
||||
mov #0, r5
|
||||
mov.l 0f, r6
|
||||
mova 2f, r0
|
||||
mov r0, r7
|
||||
mov.l 1f, r0
|
||||
jmp @r0
|
||||
nop
|
||||
|
||||
.balign 4
|
||||
0: .long main
|
||||
1: .long __libc_init
|
||||
2: .long __PREINIT_ARRAY__
|
||||
.long __INIT_ARRAY__
|
||||
.long __FINI_ARRAY__
|
||||
.long __CTOR_LIST__
|
||||
|
||||
# the .ctors section contains a list of pointers to "constructor"
|
||||
# functions that need to be called in order during C library initialization,
|
||||
# just before the program is being run. This is a C++ requirement
|
||||
#
|
||||
# the last entry shall be 0, and is defined in crtend.S
|
||||
#
|
||||
.section .preinit_array, "aw"
|
||||
.globl __PREINIT_ARRAY__
|
||||
__PREINIT_ARRAY__:
|
||||
.long -1
|
||||
|
||||
.section .init_array, "aw"
|
||||
.globl __INIT_ARRAY__
|
||||
__INIT_ARRAY__:
|
||||
.long -1
|
||||
|
||||
.section .fini_array, "aw"
|
||||
.globl __FINI_ARRAY__
|
||||
__FINI_ARRAY__:
|
||||
.long -1
|
||||
|
||||
.section .ctors, "aw"
|
||||
.globl __CTOR_LIST__
|
||||
__CTOR_LIST__:
|
||||
.long -1
|
||||
|
39
libc/arch-sh/bionic/crtend.S
Normal file
39
libc/arch-sh/bionic/crtend.S
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
|
||||
.section .preinit_array, "aw"
|
||||
.long 0
|
||||
|
||||
.section .init_array, "aw"
|
||||
.long 0
|
||||
|
||||
.section .fini_array, "aw"
|
||||
.long 0
|
||||
|
||||
.section .ctors, "aw"
|
||||
.long 0
|
103
libc/arch-sh/bionic/ffs.S
Normal file
103
libc/arch-sh/bionic/ffs.S
Normal file
@@ -0,0 +1,103 @@
|
||||
/* $NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by ITOH Yasufumi.
|
||||
*
|
||||
* 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 NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
RCSID("$NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $")
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ffs - find first bit set
|
||||
*
|
||||
* This code makes use of ``test 8bit'' and ``shift 8bit'' instructions.
|
||||
* The remaining 8bit is tested in every 2bit.
|
||||
*/
|
||||
|
||||
ENTRY(ffs)
|
||||
mov r4,r0 ! using r0 specific instructions
|
||||
tst #0xff,r0
|
||||
bf/s L8bit
|
||||
mov #0+1,r1 ! ret = 1..8
|
||||
|
||||
tst r0,r0 ! ffs(0) is 0
|
||||
bt Lzero ! testing here to accelerate ret=1..8 cases
|
||||
|
||||
shlr8 r0
|
||||
tst #0xff,r0
|
||||
bf/s L8bit
|
||||
mov #8+1,r1 ! ret = 9..16
|
||||
|
||||
shlr8 r0
|
||||
tst #0xff,r0
|
||||
bf/s L8bit
|
||||
mov #16+1,r1 ! ret = 17..24
|
||||
|
||||
shlr8 r0
|
||||
mov #24+1,r1 ! ret = 25..32
|
||||
|
||||
L8bit:
|
||||
tst #0x0f,r0
|
||||
bt 4f
|
||||
|
||||
tst #0x03,r0
|
||||
bt 2f
|
||||
tst #0x01,r0 ! not bit 0 -> T
|
||||
mov #0,r0
|
||||
rts
|
||||
addc r1,r0 ! 0 + r1 + T -> r0
|
||||
|
||||
2: tst #0x04,r0
|
||||
mov #2,r0
|
||||
rts
|
||||
addc r1,r0
|
||||
|
||||
4: tst #0x30,r0
|
||||
bt 6f
|
||||
tst #0x10,r0
|
||||
mov #4,r0
|
||||
rts
|
||||
addc r1,r0
|
||||
|
||||
6: tst #0x40,r0
|
||||
mov #6,r0
|
||||
rts
|
||||
addc r1,r0
|
||||
|
||||
Lzero: rts
|
||||
nop
|
268
libc/arch-sh/bionic/memcpy.S
Normal file
268
libc/arch-sh/bionic/memcpy.S
Normal file
@@ -0,0 +1,268 @@
|
||||
/* $OpenBSD: memcpy.S,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $ */
|
||||
/* $NetBSD: memcpy.S,v 1.2 2006/04/22 23:53:47 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 SHIMIZU Ryo <ryo@misakimix.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
#if !defined(MEMCOPY) && !defined(MEMMOVE) && !defined(BCOPY)
|
||||
#define MEMCOPY
|
||||
#endif
|
||||
|
||||
#if defined(MEMCOPY) || defined(MEMMOVE)
|
||||
#define REG_DST0 r3
|
||||
#define REG_SRC r5
|
||||
#define REG_DST r4
|
||||
#else
|
||||
#define REG_SRC r4
|
||||
#define REG_DST r5
|
||||
#endif
|
||||
|
||||
#define REG_LEN r6
|
||||
|
||||
#if defined(MEMCOPY)
|
||||
ENTRY(memcpy)
|
||||
#elif defined(MEMMOVE)
|
||||
ENTRY(memmove)
|
||||
#elif defined(BCOPY)
|
||||
ENTRY(bcopy)
|
||||
#endif
|
||||
#ifdef REG_DST0
|
||||
mov REG_DST,REG_DST0
|
||||
#endif
|
||||
cmp/eq REG_DST,REG_SRC /* if ( src == dst ) return; */
|
||||
bt/s bcopy_return
|
||||
cmp/hi REG_DST,REG_SRC
|
||||
bf/s bcopy_overlap
|
||||
|
||||
mov REG_SRC,r0
|
||||
xor REG_DST,r0
|
||||
and #3,r0
|
||||
mov r0,r1
|
||||
tst r0,r0 /* (src ^ dst) & 3 */
|
||||
bf/s word_align
|
||||
|
||||
longword_align:
|
||||
tst REG_LEN,REG_LEN /* if ( len==0 ) return; */
|
||||
bt/s bcopy_return
|
||||
|
||||
|
||||
mov REG_SRC,r0
|
||||
tst #1,r0 /* if ( src & 1 ) */
|
||||
bt 1f
|
||||
mov.b @REG_SRC+,r0 /* *dst++ = *src++; */
|
||||
add #-1,REG_LEN
|
||||
mov.b r0,@REG_DST
|
||||
add #1,REG_DST
|
||||
1:
|
||||
|
||||
|
||||
mov #1,r0
|
||||
cmp/hi r0,REG_LEN /* if ( (len > 1) && */
|
||||
bf/s 1f
|
||||
mov REG_SRC,r0
|
||||
tst #2,r0 /* (src & 2) { */
|
||||
bt 1f
|
||||
mov.w @REG_SRC+,r0 /* *((unsigned short*)dst)++ = *((unsigned short*)src)++; */
|
||||
add #-2,REG_LEN /* len -= 2; */
|
||||
mov.w r0,@REG_DST
|
||||
add #2,REG_DST /* } */
|
||||
1:
|
||||
|
||||
|
||||
mov #3,r1
|
||||
cmp/hi r1,REG_LEN /* while ( len > 3 ) { */
|
||||
bf/s no_align_delay
|
||||
tst REG_LEN,REG_LEN
|
||||
2:
|
||||
mov.l @REG_SRC+,r0 /* *((unsigned long*)dst)++ = *((unsigned long*)src)++; */
|
||||
add #-4,REG_LEN /* len -= 4; */
|
||||
mov.l r0,@REG_DST
|
||||
cmp/hi r1,REG_LEN
|
||||
bt/s 2b
|
||||
add #4,REG_DST /* } */
|
||||
|
||||
bra no_align_delay
|
||||
tst REG_LEN,REG_LEN
|
||||
|
||||
|
||||
word_align:
|
||||
mov r1,r0
|
||||
tst #1,r0
|
||||
bf/s no_align_delay
|
||||
tst REG_LEN,REG_LEN /* if ( len == 0 ) return; */
|
||||
bt bcopy_return
|
||||
|
||||
|
||||
mov REG_SRC,r0 /* if ( src & 1 ) */
|
||||
tst #1,r0
|
||||
bt 1f
|
||||
mov.b @REG_SRC+,r0 /* *dst++ = *src++; */
|
||||
add #-1,REG_LEN
|
||||
mov.b r0,@REG_DST
|
||||
add #1,REG_DST
|
||||
1:
|
||||
|
||||
|
||||
mov #1,r1
|
||||
cmp/hi r1,REG_LEN /* while ( len > 1 ) { */
|
||||
bf/s no_align_delay
|
||||
tst REG_LEN,REG_LEN
|
||||
2:
|
||||
mov.w @REG_SRC+,r0 /* *((unsigned short*)dst)++ = *((unsigned short*)src)++; */
|
||||
add #-2,REG_LEN /* len -= 2; */
|
||||
mov.w r0,@REG_DST
|
||||
cmp/hi r1,REG_LEN
|
||||
bt/s 2b
|
||||
add #2,REG_DST /* } */
|
||||
|
||||
|
||||
no_align:
|
||||
tst REG_LEN,REG_LEN /* while ( len!= ) { */
|
||||
no_align_delay:
|
||||
bt bcopy_return
|
||||
1:
|
||||
mov.b @REG_SRC+,r0 /* *dst++ = *src++; */
|
||||
add #-1,REG_LEN /* len--; */
|
||||
mov.b r0,@REG_DST
|
||||
tst REG_LEN,REG_LEN
|
||||
bf/s 1b
|
||||
add #1,REG_DST /* } */
|
||||
bcopy_return:
|
||||
rts
|
||||
#ifdef REG_DST0
|
||||
mov REG_DST0,r0
|
||||
#else
|
||||
nop
|
||||
#endif
|
||||
|
||||
|
||||
bcopy_overlap:
|
||||
add REG_LEN,REG_SRC
|
||||
add REG_LEN,REG_DST
|
||||
|
||||
mov REG_SRC,r0
|
||||
xor REG_DST,r0
|
||||
and #3,r0
|
||||
mov r0,r1
|
||||
tst r0,r0 /* (src ^ dst) & 3 */
|
||||
bf/s ov_word_align
|
||||
|
||||
ov_longword_align:
|
||||
tst REG_LEN,REG_LEN /* if ( len==0 ) return; */
|
||||
bt/s bcopy_return
|
||||
|
||||
|
||||
mov REG_SRC,r0
|
||||
tst #1,r0 /* if ( src & 1 ) */
|
||||
bt 1f
|
||||
add #-1,REG_SRC /* *--dst = *--src; */
|
||||
mov.b @REG_SRC,r0
|
||||
mov.b r0,@-REG_DST
|
||||
add #-1,REG_LEN
|
||||
1:
|
||||
|
||||
|
||||
mov #1,r0
|
||||
cmp/hi r0,REG_LEN /* if ( (len > 1) && */
|
||||
bf/s 1f
|
||||
mov REG_SRC,r0
|
||||
tst #2,r0 /* (src & 2) { */
|
||||
bt 1f
|
||||
add #-2,REG_SRC /* *--((unsigned short*)dst) = *--((unsigned short*)src); */
|
||||
mov.w @REG_SRC,r0
|
||||
add #-2,REG_LEN /* len -= 2; */
|
||||
mov.w r0,@-REG_DST /* } */
|
||||
1:
|
||||
|
||||
|
||||
mov #3,r1
|
||||
cmp/hi r1,REG_LEN /* while ( len > 3 ) { */
|
||||
bf/s ov_no_align_delay
|
||||
tst REG_LEN,REG_LEN
|
||||
2:
|
||||
add #-4,REG_SRC
|
||||
mov.l @REG_SRC,r0 /* *((unsigned long*)dst)++ = *((unsigned long*)src)++; */
|
||||
add #-4,REG_LEN /* len -= 4; */
|
||||
cmp/hi r1,REG_LEN
|
||||
bt/s 2b
|
||||
mov.l r0,@-REG_DST /* } */
|
||||
|
||||
bra ov_no_align_delay
|
||||
tst REG_LEN,REG_LEN
|
||||
|
||||
|
||||
ov_word_align:
|
||||
mov r1,r0
|
||||
tst #1,r0
|
||||
bf/s ov_no_align_delay
|
||||
tst REG_LEN,REG_LEN /* if ( len == 0 ) return; */
|
||||
bt bcopy_return
|
||||
|
||||
|
||||
mov REG_SRC,r0 /* if ( src & 1 ) */
|
||||
tst #1,r0
|
||||
bt 1f
|
||||
add #-1,REG_SRC
|
||||
mov.b @REG_SRC,r0 /* *--dst = *--src; */
|
||||
add #-1,REG_LEN
|
||||
mov.b r0,@-REG_DST
|
||||
1:
|
||||
|
||||
|
||||
mov #1,r1
|
||||
cmp/hi r1,REG_LEN /* while ( len > 1 ) { */
|
||||
bf/s ov_no_align_delay
|
||||
tst REG_LEN,REG_LEN
|
||||
2:
|
||||
add #-2,REG_SRC
|
||||
mov.w @REG_SRC,r0 /* *--((unsigned short*)dst) = *--((unsigned short*)src); */
|
||||
add #-2,REG_LEN /* len -= 2; */
|
||||
cmp/hi r1,REG_LEN
|
||||
bt/s 2b
|
||||
mov.w r0,@-REG_DST /* } */
|
||||
|
||||
|
||||
ov_no_align:
|
||||
tst REG_LEN,REG_LEN /* while ( len!= ) { */
|
||||
ov_no_align_delay:
|
||||
bt 9f
|
||||
1:
|
||||
add #-1,REG_SRC
|
||||
mov.b @REG_SRC,r0 /* *--dst = *--src; */
|
||||
add #-1,REG_LEN /* len--; */
|
||||
tst REG_LEN,REG_LEN
|
||||
bf/s 1b
|
||||
mov.b r0,@-REG_DST /* } */
|
||||
9:
|
||||
rts
|
||||
#ifdef REG_DST0
|
||||
mov REG_DST0,r0
|
||||
#else
|
||||
nop
|
||||
#endif
|
5
libc/arch-sh/bionic/memmove.S
Normal file
5
libc/arch-sh/bionic/memmove.S
Normal file
@@ -0,0 +1,5 @@
|
||||
/* $OpenBSD: memmove.S,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $ */
|
||||
/* $NetBSD: memmove.S,v 1.2 2006/04/22 23:53:47 uwe Exp $ */
|
||||
|
||||
#define MEMMOVE
|
||||
#include "memcpy.S"
|
295
libc/arch-sh/bionic/memset.S
Normal file
295
libc/arch-sh/bionic/memset.S
Normal file
@@ -0,0 +1,295 @@
|
||||
/* $OpenBSD: memset.S,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $ */
|
||||
/* $NetBSD: memset.S,v 1.1 2005/12/20 19:28:50 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 SHIMIZU Ryo. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
#define REG_PTR r0
|
||||
#define REG_TMP1 r1
|
||||
|
||||
#ifdef BZERO
|
||||
# define REG_C r2
|
||||
# define REG_DST r4
|
||||
# define REG_LEN r5
|
||||
#else
|
||||
# define REG_DST0 r3
|
||||
# define REG_DST r4
|
||||
# define REG_C r5
|
||||
# define REG_LEN r6
|
||||
#endif
|
||||
|
||||
#ifdef BZERO
|
||||
ENTRY(bzero)
|
||||
#else
|
||||
ENTRY(memset)
|
||||
mov REG_DST,REG_DST0 /* for return value */
|
||||
#endif
|
||||
/* small amount to fill ? */
|
||||
mov #28,REG_TMP1
|
||||
cmp/hs REG_TMP1,REG_LEN /* if (len >= 28) goto large; */
|
||||
bt/s large
|
||||
mov #12,REG_TMP1 /* if (len >= 12) goto small; */
|
||||
cmp/hs REG_TMP1,REG_LEN
|
||||
bt/s small
|
||||
#ifdef BZERO
|
||||
mov #0,REG_C
|
||||
#endif
|
||||
/* very little fill (0 ~ 11 bytes) */
|
||||
tst REG_LEN,REG_LEN
|
||||
add REG_DST,REG_LEN
|
||||
bt/s done
|
||||
add #1,REG_DST
|
||||
|
||||
/* unroll 4 loops */
|
||||
cmp/eq REG_DST,REG_LEN
|
||||
1: mov.b REG_C,@-REG_LEN
|
||||
bt/s done
|
||||
cmp/eq REG_DST,REG_LEN
|
||||
mov.b REG_C,@-REG_LEN
|
||||
bt/s done
|
||||
cmp/eq REG_DST,REG_LEN
|
||||
mov.b REG_C,@-REG_LEN
|
||||
bt/s done
|
||||
cmp/eq REG_DST,REG_LEN
|
||||
mov.b REG_C,@-REG_LEN
|
||||
bf/s 1b
|
||||
cmp/eq REG_DST,REG_LEN
|
||||
done:
|
||||
#ifdef BZERO
|
||||
rts
|
||||
nop
|
||||
#else
|
||||
rts
|
||||
mov REG_DST0,r0
|
||||
#endif
|
||||
|
||||
|
||||
small:
|
||||
mov REG_DST,r0
|
||||
tst #1,r0
|
||||
bt/s small_aligned
|
||||
mov REG_DST,REG_TMP1
|
||||
shll REG_LEN
|
||||
mova 1f,r0 /* 1f must be 4bytes aligned! */
|
||||
add #16,REG_TMP1 /* REG_TMP1 = dst+16; */
|
||||
sub REG_LEN,r0
|
||||
jmp @r0
|
||||
mov REG_C,r0
|
||||
|
||||
.align 2
|
||||
mov.b r0,@(15,REG_TMP1)
|
||||
mov.b r0,@(14,REG_TMP1)
|
||||
mov.b r0,@(13,REG_TMP1)
|
||||
mov.b r0,@(12,REG_TMP1)
|
||||
mov.b r0,@(11,REG_TMP1)
|
||||
mov.b r0,@(10,REG_TMP1)
|
||||
mov.b r0,@(9,REG_TMP1)
|
||||
mov.b r0,@(8,REG_TMP1)
|
||||
mov.b r0,@(7,REG_TMP1)
|
||||
mov.b r0,@(6,REG_TMP1)
|
||||
mov.b r0,@(5,REG_TMP1)
|
||||
mov.b r0,@(4,REG_TMP1)
|
||||
mov.b r0,@(3,REG_TMP1)
|
||||
mov.b r0,@(2,REG_TMP1)
|
||||
mov.b r0,@(1,REG_TMP1)
|
||||
mov.b r0,@REG_TMP1
|
||||
mov.b r0,@(15,REG_DST)
|
||||
mov.b r0,@(14,REG_DST)
|
||||
mov.b r0,@(13,REG_DST)
|
||||
mov.b r0,@(12,REG_DST)
|
||||
mov.b r0,@(11,REG_DST)
|
||||
mov.b r0,@(10,REG_DST)
|
||||
mov.b r0,@(9,REG_DST)
|
||||
mov.b r0,@(8,REG_DST)
|
||||
mov.b r0,@(7,REG_DST)
|
||||
mov.b r0,@(6,REG_DST)
|
||||
mov.b r0,@(5,REG_DST)
|
||||
mov.b r0,@(4,REG_DST)
|
||||
mov.b r0,@(3,REG_DST)
|
||||
mov.b r0,@(2,REG_DST)
|
||||
mov.b r0,@(1,REG_DST)
|
||||
#ifdef BZERO
|
||||
rts
|
||||
1: mov.b r0,@REG_DST
|
||||
#else
|
||||
mov.b r0,@REG_DST
|
||||
1: rts
|
||||
mov REG_DST0,r0
|
||||
#endif
|
||||
|
||||
|
||||
/* 2 bytes aligned small fill */
|
||||
small_aligned:
|
||||
#ifndef BZERO
|
||||
extu.b REG_C,REG_TMP1 /* REG_C = ??????xx, REG_TMP1 = ????00xx */
|
||||
shll8 REG_C /* REG_C = ????xx00, REG_TMP1 = ????00xx */
|
||||
or REG_TMP1,REG_C /* REG_C = ????xxxx */
|
||||
#endif
|
||||
|
||||
mov REG_LEN,r0
|
||||
tst #1,r0 /* len is aligned? */
|
||||
bt/s 1f
|
||||
add #-1,r0
|
||||
mov.b REG_C,@(r0,REG_DST) /* fill last a byte */
|
||||
mov r0,REG_LEN
|
||||
1:
|
||||
|
||||
mova 1f,r0 /* 1f must be 4bytes aligned! */
|
||||
sub REG_LEN,r0
|
||||
jmp @r0
|
||||
mov REG_C,r0
|
||||
|
||||
.align 2
|
||||
mov.w r0,@(30,REG_DST)
|
||||
mov.w r0,@(28,REG_DST)
|
||||
mov.w r0,@(26,REG_DST)
|
||||
mov.w r0,@(24,REG_DST)
|
||||
mov.w r0,@(22,REG_DST)
|
||||
mov.w r0,@(20,REG_DST)
|
||||
mov.w r0,@(18,REG_DST)
|
||||
mov.w r0,@(16,REG_DST)
|
||||
mov.w r0,@(14,REG_DST)
|
||||
mov.w r0,@(12,REG_DST)
|
||||
mov.w r0,@(10,REG_DST)
|
||||
mov.w r0,@(8,REG_DST)
|
||||
mov.w r0,@(6,REG_DST)
|
||||
mov.w r0,@(4,REG_DST)
|
||||
mov.w r0,@(2,REG_DST)
|
||||
#ifdef BZERO
|
||||
rts
|
||||
1: mov.w r0,@REG_DST
|
||||
#else
|
||||
mov.w r0,@REG_DST
|
||||
1: rts
|
||||
mov REG_DST0,r0
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
.align 2
|
||||
large:
|
||||
#ifdef BZERO
|
||||
mov #0,REG_C
|
||||
#else
|
||||
extu.b REG_C,REG_TMP1 /* REG_C = ??????xx, REG_TMP1 = ????00xx */
|
||||
shll8 REG_C /* REG_C = ????xx00, REG_TMP1 = ????00xx */
|
||||
or REG_C,REG_TMP1 /* REG_C = ????xx00, REG_TMP1 = ????xxxx */
|
||||
swap.w REG_TMP1,REG_C /* REG_C = xxxx????, REG_TMP1 = ????xxxx */
|
||||
xtrct REG_TMP1,REG_C /* REG_C = xxxxxxxx */
|
||||
#endif
|
||||
|
||||
mov #3,REG_TMP1
|
||||
tst REG_TMP1,REG_DST
|
||||
mov REG_DST,REG_PTR
|
||||
bf/s unaligned_dst
|
||||
add REG_LEN,REG_PTR /* REG_PTR = dst + len; */
|
||||
tst REG_TMP1,REG_LEN
|
||||
bf/s unaligned_len
|
||||
|
||||
aligned:
|
||||
/* fill 32*n bytes */
|
||||
mov #32,REG_TMP1
|
||||
cmp/hi REG_LEN,REG_TMP1
|
||||
bt 9f
|
||||
.align 2
|
||||
1: sub REG_TMP1,REG_PTR
|
||||
mov.l REG_C,@REG_PTR
|
||||
sub REG_TMP1,REG_LEN
|
||||
mov.l REG_C,@(4,REG_PTR)
|
||||
cmp/hi REG_LEN,REG_TMP1
|
||||
mov.l REG_C,@(8,REG_PTR)
|
||||
mov.l REG_C,@(12,REG_PTR)
|
||||
mov.l REG_C,@(16,REG_PTR)
|
||||
mov.l REG_C,@(20,REG_PTR)
|
||||
mov.l REG_C,@(24,REG_PTR)
|
||||
bf/s 1b
|
||||
mov.l REG_C,@(28,REG_PTR)
|
||||
9:
|
||||
|
||||
/* fill left 4*n bytes */
|
||||
cmp/eq REG_DST,REG_PTR
|
||||
bt 9f
|
||||
add #4,REG_DST
|
||||
cmp/eq REG_DST,REG_PTR
|
||||
1: mov.l REG_C,@-REG_PTR
|
||||
bt/s 9f
|
||||
cmp/eq REG_DST,REG_PTR
|
||||
mov.l REG_C,@-REG_PTR
|
||||
bt/s 9f
|
||||
cmp/eq REG_DST,REG_PTR
|
||||
mov.l REG_C,@-REG_PTR
|
||||
bt/s 9f
|
||||
cmp/eq REG_DST,REG_PTR
|
||||
mov.l REG_C,@-REG_PTR
|
||||
bf/s 1b
|
||||
cmp/eq REG_DST,REG_PTR
|
||||
9:
|
||||
#ifdef BZERO
|
||||
rts
|
||||
nop
|
||||
#else
|
||||
rts
|
||||
mov REG_DST0,r0
|
||||
#endif
|
||||
|
||||
|
||||
unaligned_dst:
|
||||
mov #1,REG_TMP1
|
||||
tst REG_TMP1,REG_DST /* if (dst & 1) { */
|
||||
add #1,REG_TMP1
|
||||
bt/s 2f
|
||||
tst REG_TMP1,REG_DST
|
||||
mov.b REG_C,@REG_DST /* *dst++ = c; */
|
||||
add #1,REG_DST
|
||||
tst REG_TMP1,REG_DST
|
||||
2: /* } */
|
||||
/* if (dst & 2) { */
|
||||
bt 4f
|
||||
mov.w REG_C,@REG_DST /* *(u_int16_t*)dst++ = c; */
|
||||
add #2,REG_DST
|
||||
4: /* } */
|
||||
|
||||
|
||||
tst #3,REG_PTR /* if (ptr & 3) { */
|
||||
bt/s 4f /* */
|
||||
unaligned_len:
|
||||
tst #1,REG_PTR /* if (ptr & 1) { */
|
||||
bt/s 2f
|
||||
tst #2,REG_PTR
|
||||
mov.b REG_C,@-REG_PTR /* --ptr = c; */
|
||||
2: /* } */
|
||||
/* if (ptr & 2) { */
|
||||
bt 4f
|
||||
mov.w REG_C,@-REG_PTR /* *--(u_int16_t*)ptr = c; */
|
||||
4: /* } */
|
||||
/* } */
|
||||
|
||||
mov REG_PTR,REG_LEN
|
||||
bra aligned
|
||||
sub REG_DST,REG_LEN
|
||||
|
63
libc/arch-sh/bionic/pipe.S
Normal file
63
libc/arch-sh/bionic/pipe.S
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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 <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type pipe, @function
|
||||
.globl pipe
|
||||
.align 4
|
||||
|
||||
pipe:
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(0 + 0x10)
|
||||
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt setfds
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
bra end
|
||||
nop
|
||||
setfds:
|
||||
mov.l r0, @r4
|
||||
add #4, r4
|
||||
mov.l r1, @r4
|
||||
end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_pipe
|
||||
1: .long __set_syscall_errno
|
167
libc/arch-sh/bionic/setjmp.S
Normal file
167
libc/arch-sh/bionic/setjmp.S
Normal file
@@ -0,0 +1,167 @@
|
||||
/* $OpenBSD: setjmp.S,v 1.2 2007/03/02 06:11:54 miod Exp $ */
|
||||
/* $NetBSD: setjmp.S,v 1.10 2006/01/05 19:21:37 uwe Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* 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: @(#)setjmp.s 5.1 (Berkeley) 4/23/90
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
/*
|
||||
* C library -- setjmp, longjmp
|
||||
*
|
||||
* longjmp(a,v)
|
||||
* will generate a "return(v)" from the last call to
|
||||
* setjmp(a)
|
||||
* by restoring registers from the stack.
|
||||
* The previous signal state is restored.
|
||||
*/
|
||||
|
||||
ENTRY(setjmp)
|
||||
PIC_PROLOGUE(.L_got_1)
|
||||
sts.l pr, @-sp
|
||||
mov.l r4, @-sp
|
||||
|
||||
mov.l .L_sigprocmask_1, r0
|
||||
mov r4, r6
|
||||
mov #1, r4 /* how = SIG_BLOCK */
|
||||
mov #0, r5 /* new = NULL */
|
||||
1: CALL r0
|
||||
add #4, r6 /* old = &sigmask */
|
||||
|
||||
mov.l @sp+, r4
|
||||
lds.l @sp+, pr
|
||||
PIC_EPILOGUE
|
||||
|
||||
/* identical to _setjmp except that the first word is non-zero */
|
||||
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
|
||||
add #(_JBLEN * 4), r4
|
||||
sts fpscr, r1
|
||||
xor r0, r0
|
||||
mov.l r1, @-r4
|
||||
lds r0, fpscr
|
||||
sts.l fpul, @-r4
|
||||
fmov.s fr15, @-r4
|
||||
fmov.s fr14, @-r4
|
||||
fmov.s fr13, @-r4
|
||||
fmov.s fr12, @-r4
|
||||
frchg
|
||||
fmov.s fr15, @-r4
|
||||
fmov.s fr14, @-r4
|
||||
fmov.s fr13, @-r4
|
||||
fmov.s fr12, @-r4
|
||||
lds r1, fpscr
|
||||
#else
|
||||
add #((_JBLEN - 10) * 4), r4
|
||||
#endif
|
||||
sts.l mach, @-r4
|
||||
sts.l macl, @-r4
|
||||
mov.l r15, @-r4
|
||||
mov.l r14, @-r4
|
||||
mov.l r13, @-r4
|
||||
mov.l r12, @-r4
|
||||
mov.l r11, @-r4
|
||||
mov.l r10, @-r4
|
||||
mov.l r9, @-r4
|
||||
mov.l r8, @-r4
|
||||
sts.l pr, @-r4
|
||||
add #-4, r4 /* skip signal mask */
|
||||
mov #1, r0
|
||||
mov.l r0, @-r4 /* has signal mask */
|
||||
rts
|
||||
xor r0, r0
|
||||
|
||||
.align 2
|
||||
.L_got_1: PIC_GOT_DATUM
|
||||
.L_sigprocmask_1: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
|
||||
SET_ENTRY_SIZE(setjmp)
|
||||
|
||||
ENTRY(longjmp)
|
||||
/* we won't return here, so we don't need to save pr and r12 */
|
||||
PIC_PROLOGUE_NOSAVE(.L_got_2)
|
||||
mov.l r5, @-sp
|
||||
mov.l r4, @-sp
|
||||
|
||||
mov.l .L_sigprocmask_2, r0
|
||||
mov r4, r5
|
||||
mov #3, r4 /* how = SIG_SETMASK */
|
||||
add #4, r5 /* new = &sigmask */
|
||||
1: CALL r0
|
||||
mov #0, r6 /* old = NULL */
|
||||
|
||||
mov.l @sp+, r4
|
||||
mov.l @sp+, r5
|
||||
|
||||
/* identical to _longjmp */
|
||||
add #8, r4
|
||||
lds.l @r4+, pr
|
||||
mov.l @r4+, r8
|
||||
mov.l @r4+, r9
|
||||
mov.l @r4+, r10
|
||||
mov.l @r4+, r11
|
||||
mov.l @r4+, r12
|
||||
mov.l @r4+, r13
|
||||
mov.l @r4+, r14
|
||||
mov.l @r4+, r15
|
||||
lds.l @r4+, macl
|
||||
lds.l @r4+, mach
|
||||
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
|
||||
xor r0, r0
|
||||
lds r0, fpscr
|
||||
frchg
|
||||
fmov.s @r4+, fr12
|
||||
fmov.s @r4+, fr13
|
||||
fmov.s @r4+, fr14
|
||||
fmov.s @r4+, fr15
|
||||
frchg
|
||||
fmov.s @r4+, fr12
|
||||
fmov.s @r4+, fr13
|
||||
fmov.s @r4+, fr14
|
||||
fmov.s @r4+, fr15
|
||||
lds.l @r4+, fpul
|
||||
lds.l @r4+, fpscr
|
||||
#endif
|
||||
|
||||
mov r5, r0
|
||||
tst r0, r0 /* make sure return value is non-zero */
|
||||
bf .L0
|
||||
add #1, r0
|
||||
.L0:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
.L_got_2: PIC_GOT_DATUM
|
||||
.L_sigprocmask_2: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
|
||||
SET_ENTRY_SIZE(longjmp)
|
166
libc/arch-sh/bionic/sigsetjmp.S
Normal file
166
libc/arch-sh/bionic/sigsetjmp.S
Normal file
@@ -0,0 +1,166 @@
|
||||
/* $OpenBSD: sigsetjmp.S,v 1.2 2007/03/02 06:11:54 miod Exp $ */
|
||||
/* $NetBSD: sigsetjmp.S,v 1.9 2006/01/05 19:21:37 uwe Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* 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: @(#)setjmp.s 5.1 (Berkeley) 4/23/90
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
#include <machine/setjmp.h>
|
||||
|
||||
ENTRY(sigsetjmp)
|
||||
tst r5, r5 /* if (savemask == 0) */
|
||||
bt 2f
|
||||
|
||||
/* identical to setjmp */
|
||||
PIC_PROLOGUE(.L_got_1)
|
||||
sts.l pr, @-sp
|
||||
mov.l r4, @-sp
|
||||
mov.l r5, @-sp
|
||||
|
||||
mov.l .L_sigprocmask_1, r0
|
||||
mov r4, r6
|
||||
mov #1, r4 /* how = SIG_BLOCK */
|
||||
mov #0, r5 /* new = NULL */
|
||||
1: CALL r0
|
||||
add #4, r6 /* old = &sigmask */
|
||||
|
||||
mov.l @sp+, r5
|
||||
mov.l @sp+, r4
|
||||
lds.l @sp+, pr
|
||||
PIC_EPILOGUE
|
||||
|
||||
2: /* identical to _setjmp except that first word is in r5 */
|
||||
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
|
||||
add #(_JBLEN * 4), r4
|
||||
sts fpscr, r1
|
||||
xor r0, r0
|
||||
mov.l r1, @-r4
|
||||
lds r0, fpscr
|
||||
sts.l fpul, @-r4
|
||||
fmov.s fr15, @-r4
|
||||
fmov.s fr14, @-r4
|
||||
fmov.s fr13, @-r4
|
||||
fmov.s fr12, @-r4
|
||||
frchg
|
||||
fmov.s fr15, @-r4
|
||||
fmov.s fr14, @-r4
|
||||
fmov.s fr13, @-r4
|
||||
fmov.s fr12, @-r4
|
||||
lds r1, fpscr
|
||||
#else
|
||||
add #((_JBLEN - 10) * 4), r4
|
||||
#endif
|
||||
sts.l mach, @-r4
|
||||
sts.l macl, @-r4
|
||||
mov.l r15, @-r4
|
||||
mov.l r14, @-r4
|
||||
mov.l r13, @-r4
|
||||
mov.l r12, @-r4
|
||||
mov.l r11, @-r4
|
||||
mov.l r10, @-r4
|
||||
mov.l r9, @-r4
|
||||
mov.l r8, @-r4
|
||||
sts.l pr, @-r4
|
||||
add #-4, r4 /* skip signal mask */
|
||||
mov.l r5, @-r4 /* has signal mask? */
|
||||
rts
|
||||
xor r0, r0
|
||||
|
||||
.align 2
|
||||
.L_got_1: PIC_GOT_DATUM
|
||||
.L_sigprocmask_1: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
|
||||
SET_ENTRY_SIZE(sigsetjmp)
|
||||
|
||||
ENTRY(siglongjmp)
|
||||
mov.l @r4+, r0
|
||||
tst r0, r0
|
||||
bt 2f /* if no mask */
|
||||
|
||||
/* identical to longjmp */
|
||||
/* we won't return here, so we don't need to save pr and r12 */
|
||||
PIC_PROLOGUE_NOSAVE(.L_got_2)
|
||||
mov.l r5, @-sp
|
||||
mov.l r4, @-sp
|
||||
|
||||
mov.l .L_sigprocmask_2, r0
|
||||
mov r4, r5 /* new = &sigmask */
|
||||
mov #3, r4 /* how = SIG_SETMASK */
|
||||
1: CALL r0
|
||||
mov #0, r6 /* old = NULL */
|
||||
|
||||
mov.l @sp+, r4
|
||||
mov.l @sp+, r5
|
||||
|
||||
2: /* identical to _longjmp */
|
||||
add #4, r4
|
||||
lds.l @r4+, pr
|
||||
mov.l @r4+, r8
|
||||
mov.l @r4+, r9
|
||||
mov.l @r4+, r10
|
||||
mov.l @r4+, r11
|
||||
mov.l @r4+, r12
|
||||
mov.l @r4+, r13
|
||||
mov.l @r4+, r14
|
||||
mov.l @r4+, r15
|
||||
lds.l @r4+, macl
|
||||
lds.l @r4+, mach
|
||||
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
|
||||
xor r0, r0
|
||||
lds r0, fpscr
|
||||
frchg
|
||||
fmov.s @r4+, fr12
|
||||
fmov.s @r4+, fr13
|
||||
fmov.s @r4+, fr14
|
||||
fmov.s @r4+, fr15
|
||||
frchg
|
||||
fmov.s @r4+, fr12
|
||||
fmov.s @r4+, fr13
|
||||
fmov.s @r4+, fr14
|
||||
fmov.s @r4+, fr15
|
||||
lds.l @r4+, fpul
|
||||
lds.l @r4+, fpscr
|
||||
#endif
|
||||
|
||||
mov r5, r0
|
||||
tst r0, r0 /* make sure return value is non-zero */
|
||||
bf .L0
|
||||
add #1, r0
|
||||
.L0:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
.L_got_2: PIC_GOT_DATUM
|
||||
.L_sigprocmask_2: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
|
||||
SET_ENTRY_SIZE(siglongjmp)
|
69
libc/arch-sh/bionic/syscall.S
Normal file
69
libc/arch-sh/bionic/syscall.S
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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 <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type syscall, @function
|
||||
.globl syscall
|
||||
.align 4
|
||||
|
||||
/*
|
||||
* Current implementation assumes that the all syscall
|
||||
* has maximum 7 arguments.
|
||||
*/
|
||||
syscall:
|
||||
/* get args */
|
||||
mov r4, r3 /* system call number */
|
||||
mov r5, r4
|
||||
mov r6, r5
|
||||
mov r7, r6
|
||||
mov.l @r15, r7
|
||||
mov.l @(4, r15), r0
|
||||
mov.l @(8, r15), r1
|
||||
mov.l @(12, r15), r2
|
||||
|
||||
/* invoke trap */
|
||||
trapa #(7 + 0x10) /* assuming 7 arguments */
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt end
|
||||
|
||||
/* keep error number */
|
||||
mov.l r0, @-r15
|
||||
mov.l 0f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
mov.l @r15+, r0
|
||||
|
||||
end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __set_errno
|
30
libc/arch-sh/bionic/unwind.c
Normal file
30
libc/arch-sh/bionic/unwind.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
|
||||
typedef long unsigned int *_Unwind_Ptr;
|
||||
|
39
libc/arch-sh/include/endian.h
Normal file
39
libc/arch-sh/include/endian.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* $OpenBSD: endian.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
|
||||
/* $NetBSD: endian.h,v 1.4 2000/03/17 00:09:25 mycroft Exp $ */
|
||||
|
||||
/* Written by Manuel Bouyer. Public domain */
|
||||
|
||||
#ifndef _SH_ENDIAN_H_
|
||||
#define _SH_ENDIAN_H_
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define __swap64md __swap64gen
|
||||
|
||||
#define __swap16md(x) ({ \
|
||||
uint16_t rval; \
|
||||
\
|
||||
__asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x)); \
|
||||
\
|
||||
rval; \
|
||||
})
|
||||
|
||||
#define __swap32md(x) ({ \
|
||||
uint32_t rval; \
|
||||
\
|
||||
__asm volatile ("swap.b %1,%0; swap.w %0,%0; swap.b %0,%0" \
|
||||
: "=r"(rval) : "r"(x)); \
|
||||
\
|
||||
rval; \
|
||||
})
|
||||
|
||||
#define MD_SWAP
|
||||
|
||||
#endif /* __GNUC_ */
|
||||
|
||||
#define _BYTE_ORDER _LITTLE_ENDIAN
|
||||
#include <sys/endian.h>
|
||||
|
||||
#define __STRICT_ALIGNMENT
|
||||
|
||||
#endif /* !_SH_ENDIAN_H_ */
|
126
libc/arch-sh/include/machine/_types.h
Normal file
126
libc/arch-sh/include/machine/_types.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/* $OpenBSD: _types.h,v 1.6 2008/07/21 20:50:55 martynas 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 _SH__TYPES_H_
|
||||
#define _SH__TYPES_H_
|
||||
|
||||
#if defined(_KERNEL)
|
||||
typedef struct label_t {
|
||||
int val[9];
|
||||
} label_t;
|
||||
#endif
|
||||
|
||||
/* 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 long __intptr_t;
|
||||
typedef unsigned long __uintptr_t;
|
||||
|
||||
/* 7.18.1.5 Greatest-width integer types */
|
||||
typedef __int64_t __intmax_t;
|
||||
typedef __uint64_t __uintmax_t;
|
||||
|
||||
/* Register size */
|
||||
typedef __uint32_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 long __off_t;
|
||||
typedef long __ptrdiff_t;
|
||||
#if 0
|
||||
/* cut it off for Android-SH */
|
||||
typedef unsigned long __size_t;
|
||||
#endif
|
||||
typedef long __ssize_t;
|
||||
typedef int __time_t;
|
||||
typedef int __timer_t;
|
||||
#if defined(__GNUC__) && __GNUC__ >= 3
|
||||
typedef __builtin_va_list __va_list;
|
||||
#else
|
||||
struct __va_list_tag;
|
||||
typedef struct __va_list_tag * __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;
|
||||
|
||||
/* Feature test macros */
|
||||
#define __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
|
||||
#endif /* _SH__TYPES_H_ */
|
217
libc/arch-sh/include/machine/asm.h
Normal file
217
libc/arch-sh/include/machine/asm.h
Normal file
@@ -0,0 +1,217 @@
|
||||
/* $OpenBSD: asm.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
|
||||
/* $NetBSD: asm.h,v 1.25 2006/01/20 22:02:40 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* William Jolitz.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @(#)asm.h 5.5 (Berkeley) 5/7/91
|
||||
*/
|
||||
|
||||
#ifndef _SH_ASM_H_
|
||||
#define _SH_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
|
||||
|
||||
/* let kernels and others override entrypoint alignment */
|
||||
#ifndef _ALIGN_TEXT
|
||||
# define _ALIGN_TEXT .align 2
|
||||
#endif
|
||||
|
||||
#ifdef __ELF__
|
||||
#define _ENTRY(x) \
|
||||
.text ;\
|
||||
_ALIGN_TEXT ;\
|
||||
.globl x ;\
|
||||
.type x,@function ;\
|
||||
x:
|
||||
#else /* !__ELF__ */
|
||||
#define _ENTRY(x) \
|
||||
.text ;\
|
||||
_ALIGN_TEXT ;\
|
||||
.globl x ;\
|
||||
x:
|
||||
#endif /* !__ELF__ */
|
||||
|
||||
#ifdef GPROF
|
||||
#define _PROF_PROLOGUE \
|
||||
mov.l 1f,r1 ; \
|
||||
mova 2f,r0 ; \
|
||||
jmp @r1 ; \
|
||||
nop ; \
|
||||
.align 2 ; \
|
||||
1: .long __mcount ; \
|
||||
2:
|
||||
#else /* !GPROF */
|
||||
#define _PROF_PROLOGUE
|
||||
#endif /* !GPROF */
|
||||
|
||||
#define ENTRY(y) _ENTRY(_C_LABEL(y)) _PROF_PROLOGUE
|
||||
#define NENTRY(y) _ENTRY(_C_LABEL(y))
|
||||
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)) _PROF_PROLOGUE
|
||||
|
||||
#define SET_ENTRY_SIZE(y) \
|
||||
.size _C_LABEL(y), . - _C_LABEL(y)
|
||||
|
||||
#define SET_ASENTRY_SIZE(y) \
|
||||
.size _ASM_LABEL(y), . - _ASM_LABEL(y)
|
||||
|
||||
#ifdef __ELF__
|
||||
#define ALTENTRY(name) \
|
||||
.globl _C_LABEL(name) ;\
|
||||
.type _C_LABEL(name),@function ;\
|
||||
_C_LABEL(name):
|
||||
#else
|
||||
#define ALTENTRY(name) \
|
||||
.globl _C_LABEL(name) ;\
|
||||
_C_LABEL(name):
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Hide the gory details of PIC calls vs. normal calls. Use as in the
|
||||
* following example:
|
||||
*
|
||||
* sts.l pr, @-sp
|
||||
* PIC_PROLOGUE(.L_got, r0) ! saves old r12 on stack
|
||||
* ...
|
||||
* mov.l .L_function_1, r0
|
||||
* 1: CALL r0 ! each call site needs a label
|
||||
* nop
|
||||
* ...
|
||||
* mov.l .L_function_2, r0
|
||||
* 2: CALL r0
|
||||
* nop
|
||||
* ...
|
||||
* PIC_EPILOGUE ! restores r12 from stack
|
||||
* lds.l @sp+, pr ! so call in right order
|
||||
* rts
|
||||
* nop
|
||||
*
|
||||
* .align 2
|
||||
* .L_got:
|
||||
* PIC_GOT_DATUM
|
||||
* .L_function_1: ! if you call the same function twice
|
||||
* CALL_DATUM(function, 1b) ! provide call datum for each call
|
||||
* .L_function_2:
|
||||
* CALL_DATUM(function, 2b)
|
||||
*/
|
||||
|
||||
#ifdef PIC
|
||||
|
||||
#define PIC_PLT(x) x@PLT
|
||||
#define PIC_GOT(x) x@GOT
|
||||
#define PIC_GOTOFF(x) x@GOTOFF
|
||||
|
||||
#define PIC_PROLOGUE(got) \
|
||||
mov.l r12, @-sp; \
|
||||
PIC_PROLOGUE_NOSAVE(got)
|
||||
|
||||
/*
|
||||
* Functions that do non local jumps don't need to preserve r12,
|
||||
* so we can shave off two instructions to save/restore it.
|
||||
*/
|
||||
#define PIC_PROLOGUE_NOSAVE(got) \
|
||||
mov.l got, r12; \
|
||||
mova got, r0; \
|
||||
add r0, r12
|
||||
|
||||
#define PIC_EPILOGUE \
|
||||
mov.l @sp+, r12
|
||||
|
||||
#define PIC_EPILOGUE_SLOT \
|
||||
PIC_EPILOGUE
|
||||
|
||||
#define PIC_GOT_DATUM \
|
||||
.long _GLOBAL_OFFSET_TABLE_
|
||||
|
||||
#define CALL bsrf
|
||||
#define JUMP braf
|
||||
|
||||
#define CALL_DATUM(function, lpcs) \
|
||||
.long PIC_PLT(function) - ((lpcs) + 4 - (.))
|
||||
|
||||
/*
|
||||
* This will result in text relocations in the shared library,
|
||||
* unless the function is local or has hidden or protected visibility.
|
||||
* Does not require PIC prologue.
|
||||
*/
|
||||
#define CALL_DATUM_LOCAL(function, lpcs) \
|
||||
.long function - ((lpcs) + 4)
|
||||
|
||||
#else /* !PIC */
|
||||
|
||||
#define PIC_PROLOGUE(label)
|
||||
#define PIC_PROLOGUE_NOSAVE(label)
|
||||
#define PIC_EPILOGUE
|
||||
#define PIC_EPILOGUE_SLOT nop
|
||||
#define PIC_GOT_DATUM
|
||||
|
||||
#define CALL jsr @
|
||||
#define JUMP jmp @
|
||||
|
||||
#define CALL_DATUM(function, lpcs) \
|
||||
.long function
|
||||
|
||||
#define CALL_DATUM_LOCAL(function, lpcs) \
|
||||
.long function
|
||||
|
||||
#endif /* !PIC */
|
||||
|
||||
|
||||
#define ASMSTR .asciz
|
||||
|
||||
#ifdef __ELF__
|
||||
#define WEAK_ALIAS(alias,sym) \
|
||||
.weak _C_LABEL(alias); \
|
||||
_C_LABEL(alias) = _C_LABEL(sym)
|
||||
#endif
|
||||
|
||||
#define WARN_REFERENCES(_sym,_msg) \
|
||||
.section .gnu.warning._sym; .ascii _msg; .previous
|
||||
|
||||
#endif /* !_SH_ASM_H_ */
|
35
libc/arch-sh/include/machine/exec.h
Normal file
35
libc/arch-sh/include/machine/exec.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* $OpenBSD: exec.h,v 1.2 2006/11/10 20:34:06 drahn Exp $ */
|
||||
/* $NetBSD: elf_machdep.h,v 1.8 2002/04/28 17:10:34 uch Exp $ */
|
||||
|
||||
#define __LDPGSZ 4096
|
||||
|
||||
#define NATIVE_EXEC_ELF
|
||||
|
||||
#define ARCH_ELFSIZE 32 /* MD native binary size */
|
||||
#define ELF_TARG_CLASS ELFCLASS32
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define ELF_TARG_DATA ELFDATA2LSB
|
||||
#else
|
||||
#define ELF_TARG_DATA ELFDATA2MSB
|
||||
#endif
|
||||
#define ELF_TARG_MACH EM_SH
|
||||
|
||||
#define _KERN_DO_ELF
|
||||
#define _NLIST_DO_ELF
|
||||
|
||||
/*
|
||||
* SuperH ELF header flags.
|
||||
*/
|
||||
#define EF_SH_MACH_MASK 0x1f
|
||||
|
||||
#define EF_SH_UNKNOWN 0x00
|
||||
#define EF_SH_SH1 0x01
|
||||
#define EF_SH_SH2 0x02
|
||||
#define EF_SH_SH3 0x03
|
||||
#define EF_SH_DSP 0x04
|
||||
#define EF_SH_SH3_DSP 0x05
|
||||
#define EF_SH_SH3E 0x08
|
||||
#define EF_SH_SH4 0x09
|
||||
|
||||
#define EF_SH_HAS_DSP(x) ((x) & EF_SH_DSP)
|
||||
#define EF_SH_HAS_FP(x) ((x) & EF_SH_SH3E)
|
132
libc/arch-sh/include/machine/ieee.h
Normal file
132
libc/arch-sh/include/machine/ieee.h
Normal file
@@ -0,0 +1,132 @@
|
||||
/* $OpenBSD: ieee.h,v 1.2 2006/11/10 20:29:36 otto 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. 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. It does *not* define (yet?) any of the rounding
|
||||
* mode bits, exceptions, and so forth.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
#define SNG_EXPBITS 8
|
||||
#define SNG_FRACBITS 23
|
||||
|
||||
#define DBL_EXPBITS 11
|
||||
#define DBL_FRACBITS 52
|
||||
|
||||
#define EXT_EXPBITS 15
|
||||
#define EXT_FRACBITS 112
|
||||
|
||||
struct ieee_single {
|
||||
u_int sng_frac:23;
|
||||
u_int sng_exp:8;
|
||||
u_int sng_sign:1;
|
||||
};
|
||||
|
||||
struct ieee_double {
|
||||
u_int dbl_fracl;
|
||||
u_int dbl_frach:20;
|
||||
u_int dbl_exp:11;
|
||||
u_int dbl_sign:1;
|
||||
};
|
||||
|
||||
struct ieee_ext {
|
||||
u_int ext_sign:1;
|
||||
u_int ext_exp:15;
|
||||
u_int ext_frach:16;
|
||||
u_int ext_frachm;
|
||||
u_int ext_fraclm;
|
||||
u_int ext_fracl;
|
||||
};
|
||||
|
||||
/*
|
||||
* 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
|
||||
#define EXT_EXP_INFNAN 32767
|
||||
|
||||
#if 0
|
||||
#define SNG_QUIETNAN (1 << 22)
|
||||
#define DBL_QUIETNAN (1 << 19)
|
||||
#define EXT_QUIETNAN (1 << 15)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Exponent biases.
|
||||
*/
|
||||
#define SNG_EXP_BIAS 127
|
||||
#define DBL_EXP_BIAS 1023
|
||||
#define EXT_EXP_BIAS 16383
|
6
libc/arch-sh/include/machine/internal_types.h
Normal file
6
libc/arch-sh/include/machine/internal_types.h
Normal file
@@ -0,0 +1,6 @@
|
||||
/* $OpenBSD: internal_types.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
|
||||
/* Public domain */
|
||||
#ifndef _SH_INTERNAL_TYPES_H_
|
||||
#define _SH_INTERNAL_TYPES_H_
|
||||
|
||||
#endif
|
42
libc/arch-sh/include/machine/kernel.h
Normal file
42
libc/arch-sh/include/machine/kernel.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2009 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.
|
||||
*/
|
||||
#ifndef _ARCH_SH_KERNEL_H
|
||||
#define _ARCH_SH_KERNEL_H
|
||||
|
||||
/* this file contains kernel-specific definitions that were optimized out of
|
||||
our processed kernel headers, but still useful nonetheless... */
|
||||
|
||||
typedef unsigned long __kernel_blkcnt_t;
|
||||
typedef unsigned long __kernel_blksize_t;
|
||||
|
||||
/* these aren't really defined by the kernel headers though... */
|
||||
typedef unsigned long __kernel_fsblkcnt_t;
|
||||
typedef unsigned long __kernel_fsfilcnt_t;
|
||||
typedef unsigned int __kernel_id_t;
|
||||
|
||||
#endif /* _ARCH_SH_KERNEL_H */
|
60
libc/arch-sh/include/machine/limits.h
Normal file
60
libc/arch-sh/include/machine/limits.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* $OpenBSD: limits.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
|
||||
/* $NetBSD: limits.h,v 1.1 1996/09/30 16:34:28 ws Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
* Copyright (C) 1995, 1996 TooLs GmbH.
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by TooLs GmbH.
|
||||
* 4. The name of TooLs GmbH may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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.
|
||||
*/
|
||||
|
||||
#ifndef _SH_LIMITS_H_
|
||||
#define _SH_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
|
||||
#define SSIZE_MAX INT_MAX /* max value for a ssize_t */
|
||||
|
||||
#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 /* _SH_LIMITS_H_ */
|
7
libc/arch-sh/include/machine/setjmp.h
Normal file
7
libc/arch-sh/include/machine/setjmp.h
Normal file
@@ -0,0 +1,7 @@
|
||||
/* $OpenBSD: setjmp.h,v 1.2 2007/03/02 06:11:54 miod Exp $ */
|
||||
/* $NetBSD: setjmp.h,v 1.3 2006/01/05 00:50:23 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* machine/setjmp.h: machine dependent setjmp-related information.
|
||||
*/
|
||||
|
160
libc/arch-sh/syscalls.mk
Normal file
160
libc/arch-sh/syscalls.mk
Normal file
@@ -0,0 +1,160 @@
|
||||
# auto-generated by gensyscalls.py, do not touch
|
||||
syscall_src :=
|
||||
syscall_src += arch-sh/syscalls/_exit.S
|
||||
syscall_src += arch-sh/syscalls/_exit_thread.S
|
||||
syscall_src += arch-sh/syscalls/__fork.S
|
||||
syscall_src += arch-sh/syscalls/_waitpid.S
|
||||
syscall_src += arch-sh/syscalls/waitid.S
|
||||
syscall_src += arch-sh/syscalls/__sys_clone.S
|
||||
syscall_src += arch-sh/syscalls/execve.S
|
||||
syscall_src += arch-sh/syscalls/__setuid.S
|
||||
syscall_src += arch-sh/syscalls/getuid.S
|
||||
syscall_src += arch-sh/syscalls/getgid.S
|
||||
syscall_src += arch-sh/syscalls/geteuid.S
|
||||
syscall_src += arch-sh/syscalls/getegid.S
|
||||
syscall_src += arch-sh/syscalls/getresuid.S
|
||||
syscall_src += arch-sh/syscalls/getresgid.S
|
||||
syscall_src += arch-sh/syscalls/gettid.S
|
||||
syscall_src += arch-sh/syscalls/getgroups.S
|
||||
syscall_src += arch-sh/syscalls/getpgid.S
|
||||
syscall_src += arch-sh/syscalls/getppid.S
|
||||
syscall_src += arch-sh/syscalls/setsid.S
|
||||
syscall_src += arch-sh/syscalls/setgid.S
|
||||
syscall_src += arch-sh/syscalls/__setreuid.S
|
||||
syscall_src += arch-sh/syscalls/__setresuid.S
|
||||
syscall_src += arch-sh/syscalls/setresgid.S
|
||||
syscall_src += arch-sh/syscalls/__brk.S
|
||||
syscall_src += arch-sh/syscalls/kill.S
|
||||
syscall_src += arch-sh/syscalls/tkill.S
|
||||
syscall_src += arch-sh/syscalls/__ptrace.S
|
||||
syscall_src += arch-sh/syscalls/__set_thread_area.S
|
||||
syscall_src += arch-sh/syscalls/__getpriority.S
|
||||
syscall_src += arch-sh/syscalls/setpriority.S
|
||||
syscall_src += arch-sh/syscalls/setrlimit.S
|
||||
syscall_src += arch-sh/syscalls/getrlimit.S
|
||||
syscall_src += arch-sh/syscalls/getrusage.S
|
||||
syscall_src += arch-sh/syscalls/setgroups.S
|
||||
syscall_src += arch-sh/syscalls/setpgid.S
|
||||
syscall_src += arch-sh/syscalls/vfork.S
|
||||
syscall_src += arch-sh/syscalls/setregid.S
|
||||
syscall_src += arch-sh/syscalls/chroot.S
|
||||
syscall_src += arch-sh/syscalls/prctl.S
|
||||
syscall_src += arch-sh/syscalls/capget.S
|
||||
syscall_src += arch-sh/syscalls/capset.S
|
||||
syscall_src += arch-sh/syscalls/sigaltstack.S
|
||||
syscall_src += arch-sh/syscalls/acct.S
|
||||
syscall_src += arch-sh/syscalls/read.S
|
||||
syscall_src += arch-sh/syscalls/write.S
|
||||
syscall_src += arch-sh/syscalls/__pread64.S
|
||||
syscall_src += arch-sh/syscalls/__pwrite64.S
|
||||
syscall_src += arch-sh/syscalls/__open.S
|
||||
syscall_src += arch-sh/syscalls/__openat.S
|
||||
syscall_src += arch-sh/syscalls/close.S
|
||||
syscall_src += arch-sh/syscalls/lseek.S
|
||||
syscall_src += arch-sh/syscalls/__llseek.S
|
||||
syscall_src += arch-sh/syscalls/getpid.S
|
||||
syscall_src += arch-sh/syscalls/__mmap2.S
|
||||
syscall_src += arch-sh/syscalls/munmap.S
|
||||
syscall_src += arch-sh/syscalls/mremap.S
|
||||
syscall_src += arch-sh/syscalls/msync.S
|
||||
syscall_src += arch-sh/syscalls/mprotect.S
|
||||
syscall_src += arch-sh/syscalls/madvise.S
|
||||
syscall_src += arch-sh/syscalls/mlock.S
|
||||
syscall_src += arch-sh/syscalls/munlock.S
|
||||
syscall_src += arch-sh/syscalls/mincore.S
|
||||
syscall_src += arch-sh/syscalls/__ioctl.S
|
||||
syscall_src += arch-sh/syscalls/readv.S
|
||||
syscall_src += arch-sh/syscalls/writev.S
|
||||
syscall_src += arch-sh/syscalls/__fcntl.S
|
||||
syscall_src += arch-sh/syscalls/flock.S
|
||||
syscall_src += arch-sh/syscalls/fchmod.S
|
||||
syscall_src += arch-sh/syscalls/dup.S
|
||||
syscall_src += arch-sh/syscalls/dup2.S
|
||||
syscall_src += arch-sh/syscalls/select.S
|
||||
syscall_src += arch-sh/syscalls/ftruncate.S
|
||||
syscall_src += arch-sh/syscalls/getdents.S
|
||||
syscall_src += arch-sh/syscalls/fsync.S
|
||||
syscall_src += arch-sh/syscalls/fchown.S
|
||||
syscall_src += arch-sh/syscalls/sync.S
|
||||
syscall_src += arch-sh/syscalls/__fcntl64.S
|
||||
syscall_src += arch-sh/syscalls/fstatfs.S
|
||||
syscall_src += arch-sh/syscalls/sendfile.S
|
||||
syscall_src += arch-sh/syscalls/fstatat.S
|
||||
syscall_src += arch-sh/syscalls/mkdirat.S
|
||||
syscall_src += arch-sh/syscalls/fchownat.S
|
||||
syscall_src += arch-sh/syscalls/fchmodat.S
|
||||
syscall_src += arch-sh/syscalls/renameat.S
|
||||
syscall_src += arch-sh/syscalls/link.S
|
||||
syscall_src += arch-sh/syscalls/unlink.S
|
||||
syscall_src += arch-sh/syscalls/unlinkat.S
|
||||
syscall_src += arch-sh/syscalls/chdir.S
|
||||
syscall_src += arch-sh/syscalls/mknod.S
|
||||
syscall_src += arch-sh/syscalls/chmod.S
|
||||
syscall_src += arch-sh/syscalls/chown.S
|
||||
syscall_src += arch-sh/syscalls/lchown.S
|
||||
syscall_src += arch-sh/syscalls/mount.S
|
||||
syscall_src += arch-sh/syscalls/umount2.S
|
||||
syscall_src += arch-sh/syscalls/fstat.S
|
||||
syscall_src += arch-sh/syscalls/stat.S
|
||||
syscall_src += arch-sh/syscalls/lstat.S
|
||||
syscall_src += arch-sh/syscalls/mkdir.S
|
||||
syscall_src += arch-sh/syscalls/readlink.S
|
||||
syscall_src += arch-sh/syscalls/rmdir.S
|
||||
syscall_src += arch-sh/syscalls/rename.S
|
||||
syscall_src += arch-sh/syscalls/__getcwd.S
|
||||
syscall_src += arch-sh/syscalls/access.S
|
||||
syscall_src += arch-sh/syscalls/symlink.S
|
||||
syscall_src += arch-sh/syscalls/fchdir.S
|
||||
syscall_src += arch-sh/syscalls/truncate.S
|
||||
syscall_src += arch-sh/syscalls/__statfs64.S
|
||||
syscall_src += arch-sh/syscalls/pause.S
|
||||
syscall_src += arch-sh/syscalls/gettimeofday.S
|
||||
syscall_src += arch-sh/syscalls/settimeofday.S
|
||||
syscall_src += arch-sh/syscalls/times.S
|
||||
syscall_src += arch-sh/syscalls/nanosleep.S
|
||||
syscall_src += arch-sh/syscalls/clock_gettime.S
|
||||
syscall_src += arch-sh/syscalls/clock_settime.S
|
||||
syscall_src += arch-sh/syscalls/clock_getres.S
|
||||
syscall_src += arch-sh/syscalls/clock_nanosleep.S
|
||||
syscall_src += arch-sh/syscalls/getitimer.S
|
||||
syscall_src += arch-sh/syscalls/setitimer.S
|
||||
syscall_src += arch-sh/syscalls/__timer_create.S
|
||||
syscall_src += arch-sh/syscalls/__timer_settime.S
|
||||
syscall_src += arch-sh/syscalls/__timer_gettime.S
|
||||
syscall_src += arch-sh/syscalls/__timer_getoverrun.S
|
||||
syscall_src += arch-sh/syscalls/__timer_delete.S
|
||||
syscall_src += arch-sh/syscalls/utimes.S
|
||||
syscall_src += arch-sh/syscalls/sigaction.S
|
||||
syscall_src += arch-sh/syscalls/sigprocmask.S
|
||||
syscall_src += arch-sh/syscalls/__sigsuspend.S
|
||||
syscall_src += arch-sh/syscalls/__rt_sigaction.S
|
||||
syscall_src += arch-sh/syscalls/__rt_sigprocmask.S
|
||||
syscall_src += arch-sh/syscalls/__rt_sigtimedwait.S
|
||||
syscall_src += arch-sh/syscalls/sigpending.S
|
||||
syscall_src += arch-sh/syscalls/__socketcall.S
|
||||
syscall_src += arch-sh/syscalls/sched_setscheduler.S
|
||||
syscall_src += arch-sh/syscalls/sched_getscheduler.S
|
||||
syscall_src += arch-sh/syscalls/sched_yield.S
|
||||
syscall_src += arch-sh/syscalls/sched_setparam.S
|
||||
syscall_src += arch-sh/syscalls/sched_getparam.S
|
||||
syscall_src += arch-sh/syscalls/sched_get_priority_max.S
|
||||
syscall_src += arch-sh/syscalls/sched_get_priority_min.S
|
||||
syscall_src += arch-sh/syscalls/sched_rr_get_interval.S
|
||||
syscall_src += arch-sh/syscalls/ioprio_set.S
|
||||
syscall_src += arch-sh/syscalls/ioprio_get.S
|
||||
syscall_src += arch-sh/syscalls/uname.S
|
||||
syscall_src += arch-sh/syscalls/__wait4.S
|
||||
syscall_src += arch-sh/syscalls/umask.S
|
||||
syscall_src += arch-sh/syscalls/__reboot.S
|
||||
syscall_src += arch-sh/syscalls/__syslog.S
|
||||
syscall_src += arch-sh/syscalls/init_module.S
|
||||
syscall_src += arch-sh/syscalls/delete_module.S
|
||||
syscall_src += arch-sh/syscalls/klogctl.S
|
||||
syscall_src += arch-sh/syscalls/futex.S
|
||||
syscall_src += arch-sh/syscalls/epoll_create.S
|
||||
syscall_src += arch-sh/syscalls/epoll_ctl.S
|
||||
syscall_src += arch-sh/syscalls/epoll_wait.S
|
||||
syscall_src += arch-sh/syscalls/inotify_init.S
|
||||
syscall_src += arch-sh/syscalls/inotify_add_watch.S
|
||||
syscall_src += arch-sh/syscalls/inotify_rm_watch.S
|
||||
syscall_src += arch-sh/syscalls/poll.S
|
32
libc/arch-sh/syscalls/__brk.S
Normal file
32
libc/arch-sh/syscalls/__brk.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __brk, @function
|
||||
.globl __brk
|
||||
.align 4
|
||||
|
||||
__brk:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_brk_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_brk_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_brk
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__fcntl.S
Normal file
32
libc/arch-sh/syscalls/__fcntl.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __fcntl, @function
|
||||
.globl __fcntl
|
||||
.align 4
|
||||
|
||||
__fcntl:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_fcntl_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_fcntl_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_fcntl
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__fcntl64.S
Normal file
32
libc/arch-sh/syscalls/__fcntl64.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __fcntl64, @function
|
||||
.globl __fcntl64
|
||||
.align 4
|
||||
|
||||
__fcntl64:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_fcntl64_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_fcntl64_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_fcntl64
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__fork.S
Normal file
32
libc/arch-sh/syscalls/__fork.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __fork, @function
|
||||
.globl __fork
|
||||
.align 4
|
||||
|
||||
__fork:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_fork_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_fork_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_fork
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__getcwd.S
Normal file
32
libc/arch-sh/syscalls/__getcwd.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __getcwd, @function
|
||||
.globl __getcwd
|
||||
.align 4
|
||||
|
||||
__getcwd:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_getcwd_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_getcwd_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_getcwd
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__getpriority.S
Normal file
32
libc/arch-sh/syscalls/__getpriority.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __getpriority, @function
|
||||
.globl __getpriority
|
||||
.align 4
|
||||
|
||||
__getpriority:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_getpriority_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_getpriority_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_getpriority
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__ioctl.S
Normal file
32
libc/arch-sh/syscalls/__ioctl.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __ioctl, @function
|
||||
.globl __ioctl
|
||||
.align 4
|
||||
|
||||
__ioctl:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_ioctl_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_ioctl_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_ioctl
|
||||
1: .long __set_syscall_errno
|
35
libc/arch-sh/syscalls/__llseek.S
Normal file
35
libc/arch-sh/syscalls/__llseek.S
Normal file
@@ -0,0 +1,35 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __llseek, @function
|
||||
.globl __llseek
|
||||
.align 4
|
||||
|
||||
__llseek:
|
||||
|
||||
/* get ready for additonal arg */
|
||||
mov.l @r15, r0
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(5 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR__llseek_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR__llseek_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR__llseek
|
||||
1: .long __set_syscall_errno
|
36
libc/arch-sh/syscalls/__mmap2.S
Normal file
36
libc/arch-sh/syscalls/__mmap2.S
Normal file
@@ -0,0 +1,36 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __mmap2, @function
|
||||
.globl __mmap2
|
||||
.align 4
|
||||
|
||||
__mmap2:
|
||||
|
||||
/* get ready for additonal arg */
|
||||
mov.l @r15, r0
|
||||
mov.l @(4, r15), r1
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(6 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_mmap2_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_mmap2_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_mmap2
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__open.S
Normal file
32
libc/arch-sh/syscalls/__open.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __open, @function
|
||||
.globl __open
|
||||
.align 4
|
||||
|
||||
__open:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_open_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_open_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_open
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__openat.S
Normal file
32
libc/arch-sh/syscalls/__openat.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __openat, @function
|
||||
.globl __openat
|
||||
.align 4
|
||||
|
||||
__openat:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_openat_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_openat_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_openat
|
||||
1: .long __set_syscall_errno
|
35
libc/arch-sh/syscalls/__pread64.S
Normal file
35
libc/arch-sh/syscalls/__pread64.S
Normal file
@@ -0,0 +1,35 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __pread64, @function
|
||||
.globl __pread64
|
||||
.align 4
|
||||
|
||||
__pread64:
|
||||
|
||||
/* get ready for additonal arg */
|
||||
mov.l @r15, r0
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(5 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_pread64_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_pread64_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_pread64
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__ptrace.S
Normal file
32
libc/arch-sh/syscalls/__ptrace.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __ptrace, @function
|
||||
.globl __ptrace
|
||||
.align 4
|
||||
|
||||
__ptrace:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_ptrace_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_ptrace_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_ptrace
|
||||
1: .long __set_syscall_errno
|
35
libc/arch-sh/syscalls/__pwrite64.S
Normal file
35
libc/arch-sh/syscalls/__pwrite64.S
Normal file
@@ -0,0 +1,35 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __pwrite64, @function
|
||||
.globl __pwrite64
|
||||
.align 4
|
||||
|
||||
__pwrite64:
|
||||
|
||||
/* get ready for additonal arg */
|
||||
mov.l @r15, r0
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(5 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_pwrite64_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_pwrite64_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_pwrite64
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__reboot.S
Normal file
32
libc/arch-sh/syscalls/__reboot.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __reboot, @function
|
||||
.globl __reboot
|
||||
.align 4
|
||||
|
||||
__reboot:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_reboot_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_reboot_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_reboot
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__rt_sigaction.S
Normal file
32
libc/arch-sh/syscalls/__rt_sigaction.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __rt_sigaction, @function
|
||||
.globl __rt_sigaction
|
||||
.align 4
|
||||
|
||||
__rt_sigaction:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_rt_sigaction_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_rt_sigaction_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_rt_sigaction
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__rt_sigprocmask.S
Normal file
32
libc/arch-sh/syscalls/__rt_sigprocmask.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __rt_sigprocmask, @function
|
||||
.globl __rt_sigprocmask
|
||||
.align 4
|
||||
|
||||
__rt_sigprocmask:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_rt_sigprocmask_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_rt_sigprocmask_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_rt_sigprocmask
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__rt_sigtimedwait.S
Normal file
32
libc/arch-sh/syscalls/__rt_sigtimedwait.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __rt_sigtimedwait, @function
|
||||
.globl __rt_sigtimedwait
|
||||
.align 4
|
||||
|
||||
__rt_sigtimedwait:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_rt_sigtimedwait_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_rt_sigtimedwait_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_rt_sigtimedwait
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__set_thread_area.S
Normal file
32
libc/arch-sh/syscalls/__set_thread_area.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __set_thread_area, @function
|
||||
.globl __set_thread_area
|
||||
.align 4
|
||||
|
||||
__set_thread_area:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_set_thread_area_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_set_thread_area_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_set_thread_area
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__setresuid.S
Normal file
32
libc/arch-sh/syscalls/__setresuid.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __setresuid, @function
|
||||
.globl __setresuid
|
||||
.align 4
|
||||
|
||||
__setresuid:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_setresuid32_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_setresuid32_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_setresuid32
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__setreuid.S
Normal file
32
libc/arch-sh/syscalls/__setreuid.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __setreuid, @function
|
||||
.globl __setreuid
|
||||
.align 4
|
||||
|
||||
__setreuid:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_setreuid32_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_setreuid32_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_setreuid32
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__setuid.S
Normal file
32
libc/arch-sh/syscalls/__setuid.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __setuid, @function
|
||||
.globl __setuid
|
||||
.align 4
|
||||
|
||||
__setuid:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_setuid32_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_setuid32_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_setuid32
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__sigsuspend.S
Normal file
32
libc/arch-sh/syscalls/__sigsuspend.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __sigsuspend, @function
|
||||
.globl __sigsuspend
|
||||
.align 4
|
||||
|
||||
__sigsuspend:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_sigsuspend_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_sigsuspend_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_sigsuspend
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__socketcall.S
Normal file
32
libc/arch-sh/syscalls/__socketcall.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __socketcall, @function
|
||||
.globl __socketcall
|
||||
.align 4
|
||||
|
||||
__socketcall:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR___socketcall_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR___socketcall_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR___socketcall
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__statfs64.S
Normal file
32
libc/arch-sh/syscalls/__statfs64.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __statfs64, @function
|
||||
.globl __statfs64
|
||||
.align 4
|
||||
|
||||
__statfs64:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_statfs64_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_statfs64_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_statfs64
|
||||
1: .long __set_syscall_errno
|
35
libc/arch-sh/syscalls/__sys_clone.S
Normal file
35
libc/arch-sh/syscalls/__sys_clone.S
Normal file
@@ -0,0 +1,35 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __sys_clone, @function
|
||||
.globl __sys_clone
|
||||
.align 4
|
||||
|
||||
__sys_clone:
|
||||
|
||||
/* get ready for additonal arg */
|
||||
mov.l @r15, r0
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(5 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_clone_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_clone_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_clone
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__syslog.S
Normal file
32
libc/arch-sh/syscalls/__syslog.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __syslog, @function
|
||||
.globl __syslog
|
||||
.align 4
|
||||
|
||||
__syslog:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_syslog_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_syslog_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_syslog
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__timer_create.S
Normal file
32
libc/arch-sh/syscalls/__timer_create.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __timer_create, @function
|
||||
.globl __timer_create
|
||||
.align 4
|
||||
|
||||
__timer_create:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_timer_create_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_timer_create_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_timer_create
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__timer_delete.S
Normal file
32
libc/arch-sh/syscalls/__timer_delete.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __timer_delete, @function
|
||||
.globl __timer_delete
|
||||
.align 4
|
||||
|
||||
__timer_delete:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_timer_delete_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_timer_delete_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_timer_delete
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__timer_getoverrun.S
Normal file
32
libc/arch-sh/syscalls/__timer_getoverrun.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __timer_getoverrun, @function
|
||||
.globl __timer_getoverrun
|
||||
.align 4
|
||||
|
||||
__timer_getoverrun:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_timer_getoverrun_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_timer_getoverrun_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_timer_getoverrun
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__timer_gettime.S
Normal file
32
libc/arch-sh/syscalls/__timer_gettime.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __timer_gettime, @function
|
||||
.globl __timer_gettime
|
||||
.align 4
|
||||
|
||||
__timer_gettime:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_timer_gettime_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_timer_gettime_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_timer_gettime
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__timer_settime.S
Normal file
32
libc/arch-sh/syscalls/__timer_settime.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __timer_settime, @function
|
||||
.globl __timer_settime
|
||||
.align 4
|
||||
|
||||
__timer_settime:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_timer_settime_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_timer_settime_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_timer_settime
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/__wait4.S
Normal file
32
libc/arch-sh/syscalls/__wait4.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type __wait4, @function
|
||||
.globl __wait4
|
||||
.align 4
|
||||
|
||||
__wait4:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_wait4_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_wait4_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_wait4
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/_exit.S
Normal file
32
libc/arch-sh/syscalls/_exit.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type _exit, @function
|
||||
.globl _exit
|
||||
.align 4
|
||||
|
||||
_exit:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_exit_group_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_exit_group_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_exit_group
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/_exit_thread.S
Normal file
32
libc/arch-sh/syscalls/_exit_thread.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type _exit_thread, @function
|
||||
.globl _exit_thread
|
||||
.align 4
|
||||
|
||||
_exit_thread:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_exit_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_exit_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_exit
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/_waitpid.S
Normal file
32
libc/arch-sh/syscalls/_waitpid.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type _waitpid, @function
|
||||
.globl _waitpid
|
||||
.align 4
|
||||
|
||||
_waitpid:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(4 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_waitpid_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_waitpid_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_waitpid
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/access.S
Normal file
32
libc/arch-sh/syscalls/access.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type access, @function
|
||||
.globl access
|
||||
.align 4
|
||||
|
||||
access:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_access_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_access_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_access
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/acct.S
Normal file
32
libc/arch-sh/syscalls/acct.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type acct, @function
|
||||
.globl acct
|
||||
.align 4
|
||||
|
||||
acct:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_acct_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_acct_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_acct
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/capget.S
Normal file
32
libc/arch-sh/syscalls/capget.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type capget, @function
|
||||
.globl capget
|
||||
.align 4
|
||||
|
||||
capget:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_capget_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_capget_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_capget
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/capset.S
Normal file
32
libc/arch-sh/syscalls/capset.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type capset, @function
|
||||
.globl capset
|
||||
.align 4
|
||||
|
||||
capset:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_capset_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_capset_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_capset
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/chdir.S
Normal file
32
libc/arch-sh/syscalls/chdir.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type chdir, @function
|
||||
.globl chdir
|
||||
.align 4
|
||||
|
||||
chdir:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_chdir_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_chdir_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_chdir
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/chmod.S
Normal file
32
libc/arch-sh/syscalls/chmod.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type chmod, @function
|
||||
.globl chmod
|
||||
.align 4
|
||||
|
||||
chmod:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(2 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_chmod_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_chmod_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_chmod
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/chown.S
Normal file
32
libc/arch-sh/syscalls/chown.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type chown, @function
|
||||
.globl chown
|
||||
.align 4
|
||||
|
||||
chown:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(3 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_chown32_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_chown32_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_chown32
|
||||
1: .long __set_syscall_errno
|
32
libc/arch-sh/syscalls/chroot.S
Normal file
32
libc/arch-sh/syscalls/chroot.S
Normal file
@@ -0,0 +1,32 @@
|
||||
/* autogenerated by gensyscalls.py */
|
||||
#include <sys/linux-syscalls.h>
|
||||
|
||||
.text
|
||||
.type chroot, @function
|
||||
.globl chroot
|
||||
.align 4
|
||||
|
||||
chroot:
|
||||
|
||||
/* invoke trap */
|
||||
mov.l 0f, r3 /* trap num */
|
||||
trapa #(1 + 0x10)
|
||||
|
||||
/* check return value */
|
||||
cmp/pz r0
|
||||
bt __NR_chroot_end
|
||||
|
||||
/* keep error number */
|
||||
sts.l pr, @-r15
|
||||
mov.l 1f, r1
|
||||
jsr @r1
|
||||
mov r0, r4
|
||||
lds.l @r15+, pr
|
||||
|
||||
__NR_chroot_end:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
0: .long __NR_chroot
|
||||
1: .long __set_syscall_errno
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user