aboutsummaryrefslogtreecommitdiffstats
path: root/exec/loader-mips64el.s
diff options
context:
space:
mode:
authorPo Lu2023-05-01 11:28:22 +0800
committerPo Lu2023-05-01 11:28:22 +0800
commitddc16de86964d445309dd38175a85221c14f05ab (patch)
tree42b7b7d86abd636e90dbc914f347b32b7099ef33 /exec/loader-mips64el.s
parenta8f9a4d2d9bc982217b4be783b236778f9d6dd32 (diff)
downloademacs-ddc16de86964d445309dd38175a85221c14f05ab.tar.gz
emacs-ddc16de86964d445309dd38175a85221c14f05ab.zip
Update Android port
* Makefile.in (extraclean): Clean in exec as well. * configure.ac: Fix detection of absolute srcdir. Also, pass CFLAGS. * exec/Makefile.in: (.c.o): Add -I. so config.h can be found.:(.s.o): Don't create m4 temporary in srcdir. * exec/config-mips.m4.in (DADDI2, DADDI3): New macros. Define to substitute if as cannot assemble daddi. * exec/configure.ac (user_h): Look for user.h in asm/ as well. Use new user.h. Also look in ptrace.h on arm systems. Check if as supports daddi on mips64. * exec/exec.c (check_interpreter): Fix char signedness bug. * exec/loader-mips64el.s (__start): Use DADDI2 and DADDI3 for two- and 3-operand daddi. * exec/mipsel-user.h: Don't include sgidefs.h. * java/INSTALL: Document that m4 is now required. * src/android.c (android_rewrite_spawn_argv): Add missing NULL.
Diffstat (limited to 'exec/loader-mips64el.s')
-rw-r--r--exec/loader-mips64el.s45
1 files changed, 24 insertions, 21 deletions
diff --git a/exec/loader-mips64el.s b/exec/loader-mips64el.s
index ccebdfe72f6..73dc8c63fe8 100644
--- a/exec/loader-mips64el.s
+++ b/exec/loader-mips64el.s
@@ -15,7 +15,10 @@
15# You should have received a copy of the GNU General Public License 15# You should have received a copy of the GNU General Public License
16# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 16# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
17 17
18include(`config-mips.m4')
19
18 .set noreorder # delay slots managed by hand 20 .set noreorder # delay slots managed by hand
21 .set noat # no assembler macros
19 .section .text 22 .section .text
20 .global __start 23 .global __start
21__start: 24__start:
@@ -24,8 +27,8 @@ dnl dla $a0, .timespec # rqtp
24dnl li $a1, 0 # rmtp 27dnl li $a1, 0 # rmtp
25dnl syscall # syscall 28dnl syscall # syscall
26 ld $s2, ($sp) # original stack pointer 29 ld $s2, ($sp) # original stack pointer
27 daddi $s0, $sp, 16 # start of load area 30 DADDI3( $s0, $sp, 16) # start of load area
28 daddi $sp, -16 # primary fd, secondary fd 31 DADDI2( $sp, -16) # primary fd, secondary fd
29 li $t0, -1 # secondary fd 32 li $t0, -1 # secondary fd
30 sd $t0, 8($sp) # initialize secondary fd 33 sd $t0, 8($sp) # initialize secondary fd
31.next_action: 34.next_action:
@@ -33,7 +36,7 @@ dnl syscall # syscall
33 andi $t0, $s1, 15 # t0 = action number & 15 36 andi $t0, $s1, 15 # t0 = action number & 15
34 beqz $t0, .open_file # open file? 37 beqz $t0, .open_file # open file?
35 nop # delay slot 38 nop # delay slot
36 daddi $t0, -3 # t0 -= 3 39 DADDI2( $t0, -3) # t0 -= 3
37 beqz $t0, .rest_of_exec # jump to code 40 beqz $t0, .rest_of_exec # jump to code
38 nop # delay slot 41 nop # delay slot
39 li $t1, 1 42 li $t1, 1
@@ -76,30 +79,30 @@ dnl syscall # syscall
76 bne $t2, $zero, .fillb # fill bytes 79 bne $t2, $zero, .fillb # fill bytes
77 nop # delay slot 80 nop # delay slot
78 sd $zero, ($t1) # zero doubleword 81 sd $zero, ($t1) # zero doubleword
79 daddi $t1, 8 # next doubleword 82 DADDI2( $t1, 8) # next doubleword
80 sd $zero, ($t1) # zero doubleword 83 sd $zero, ($t1) # zero doubleword
81 daddi $t1, 8 # next doubleword 84 DADDI2( $t1, 8) # next doubleword
82 sd $zero, ($t1) # zero doubleword 85 sd $zero, ($t1) # zero doubleword
83 daddi $t1, 8 # next doubleword 86 DADDI2( $t1, 8) # next doubleword
84 sd $zero, ($t1) # zero doubleword 87 sd $zero, ($t1) # zero doubleword
85 daddi $t1, 8 # next doubleword 88 DADDI2( $t1, 8) # next doubleword
86 sd $zero, ($t1) # zero doubleword 89 sd $zero, ($t1) # zero doubleword
87 daddi $t1, 8 # next doubleword 90 DADDI2( $t1, 8) # next doubleword
88 sd $zero, ($t1) # zero doubleword 91 sd $zero, ($t1) # zero doubleword
89 daddi $t1, 8 # next doubleword 92 DADDI2( $t1, 8) # next doubleword
90 sd $zero, ($t1) # zero doubleword 93 sd $zero, ($t1) # zero doubleword
91 daddi $t1, 8 # next doubleword 94 DADDI2( $t1, 8) # next doubleword
92 sd $zero, ($t1) # zero doubleword 95 sd $zero, ($t1) # zero doubleword
93 daddi $t1, 8 # next doubleword 96 DADDI2( $t1, 8) # next doubleword
94 j .filld # fill either doubleword or byte 97 j .filld # fill either doubleword or byte
95 nop # delay slot 98 nop # delay slot
96.fillb: 99.fillb:
97 beq $t0, $t1, .continue # already finished? 100 beq $t0, $t1, .continue # already finished?
98 nop # delay slot 101 nop # delay slot
99 sb $zero, ($t1) # clear byte 102 sb $zero, ($t1) # clear byte
100 daddi $t1, $t1, 1 # t1++ 103 DADDI2( $t1, 1) # t1++
101.continue: 104.continue:
102 daddi $s0, $s0, 56 # s0 = next action 105 DADDI2( $s0, 56) # s0 = next action
103 j .next_action # next action 106 j .next_action # next action
104 nop # delay slot 107 nop # delay slot
105.do_mmap_anon: 108.do_mmap_anon:
@@ -113,26 +116,26 @@ dnl syscall # syscall
113 nop # branch delay slot 116 nop # branch delay slot
114.open_file: 117.open_file:
115 li $v0, 5002 # SYS_open 118 li $v0, 5002 # SYS_open
116 daddi $a0, $s0, 8 # start of name 119 DADDI3( $a0, $s0, 8) # start of name
117 move $a1, $zero # flags = O_RDONLY 120 move $a1, $zero # flags = O_RDONLY
118 move $a2, $zero # mode = 0 121 move $a2, $zero # mode = 0
119 syscall # syscall 122 syscall # syscall
120 bne $a3, $zero, .perror # perror 123 bne $a3, $zero, .perror # perror
121 nop # delay slot 124 nop # delay slot
122 daddi $s0, $s0, 8 # start of string 125 DADDI2( $s0, 8) # start of string
123.nextc: 126.nextc:
124 lb $t0, ($s0) # load byte 127 lb $t0, ($s0) # load byte
125 daddi $s0, $s0, 1 # s0++ 128 DADDI2( $s0, 1) # s0++
126 bne $t0, $zero, .nextc # next character? 129 bne $t0, $zero, .nextc # next character?
127 nop # delay slot 130 nop # delay slot
128 daddi $s0, $s0, 7 # adjust for round 131 DADDI2( $s0, 7) # adjust for round
129 li $t2, -8 # t2 = -8 132 li $t2, -8 # t2 = -8
130 and $s0, $s0, $t2 # mask for round 133 and $s0, $s0, $t2 # mask for round
131 andi $t0, $s1, 16 # t1 = s1 & 16 134 andi $t0, $s1, 16 # t1 = s1 & 16
132 move $t1, $sp # address of primary fd 135 move $t1, $sp # address of primary fd
133 beqz $t0, .primary # primary fd? 136 beqz $t0, .primary # primary fd?
134 nop # delay slot 137 nop # delay slot
135 daddi $t1, $t1, 8 # address of secondary fd 138 DADDI2( $t1, 8) # address of secondary fd
136.primary: 139.primary:
137 sd $v0, ($t1) # store fd 140 sd $v0, ($t1) # store fd
138 j .next_action # next action 141 j .next_action # next action
@@ -145,11 +148,11 @@ dnl syscall # syscall
145 move $s1, $s2 # original SP 148 move $s1, $s2 # original SP
146 ld $t0, ($s1) # argc 149 ld $t0, ($s1) # argc
147 dsll $t0, $t0, 3 # argc *= 3 150 dsll $t0, $t0, 3 # argc *= 3
148 daddi $t0, $t0, 16 # argc += 16 151 DADDI2( $t0, 16) # argc += 16
149 dadd $s1, $s1, $t0 # s1 = start of envp 152 dadd $s1, $s1, $t0 # s1 = start of envp
150.skipenv: 153.skipenv:
151 ld $t0, ($s1) # t0 = *s1 154 ld $t0, ($s1) # t0 = *s1
152 daddi $s1, $s1, 8 # s1++ 155 DADDI2( $s1, 8) # s1++
153 bne $t0, $zero, .skipenv # skip again 156 bne $t0, $zero, .skipenv # skip again
154 nop # delay slot 157 nop # delay slot
155 dla $t3, .auxvtab # address of auxv table 158 dla $t3, .auxvtab # address of auxv table
@@ -170,7 +173,7 @@ dnl syscall # syscall
170 ld $t2, ($t2) # t2 = *t2 173 ld $t2, ($t2) # t2 = *t2
171 sd $t2, 8($s1) # set auxv value 174 sd $t2, 8($s1) # set auxv value
172.next: 175.next:
173 daddi $s1, $s1, 16 # next auxv 176 DADDI2( $s1, 16) # next auxv
174 j .one_auxv # next auxv 177 j .one_auxv # next auxv
175 nop # delay slot 178 nop # delay slot
176.finish: 179.finish: