1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00
emacs/exec/config-mips.m4.in
Po Lu 5bf86e2be0 Port recent Android changes to mips64el
* exec/config-mips.m4.in (DADDI2, DADDI3): Disable at-clobbering
by assembler macros expressly.

* exec/loader-mips64el.s: Adapt from loader-mipsel.s.

* exec/configure.ac (exec_cv_as_daddi): Properly escape reg
names.

* exec/exec.c (struct exec_jump_command, exec_0): Don't define
or set `fpu_mode' if __LP64__.

* exec/exec.h (struct exec_tracee): New field `callno'.

* exec/trace.c (process_system_call): Always record the current
system call number in TRACEE lest it should be required once it
has been overwritten upon the syscall's completion.
(seccomp_system_call): Likewise.
(after_fork): Clear `tracee->callno'.
2025-04-15 16:17:14 +08:00

48 lines
1.9 KiB
Text

dnl Assembler templates for MIPS computers.
dnl
dnl Copyright (C) 2023-2025 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Emacs.
dnl
dnl GNU Emacs is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl GNU Emacs is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
define(`SYSCALL_open', `ifelse(`@MIPS_N32@',`yes',`6002',`4005')')
dnl define(`SYSCALL_openat', `ifelse(`@MIPS_N32@',`yes',`6251',`4288')')
define(`SYSCALL_close', `ifelse(`@MIPS_N32@',`yes',`6003',`4006')')
define(`SYSCALL_mmap', `ifelse(`@MIPS_N32@',`yes',`6009',`4090')')
define(`SYSCALL_nanosleep', `ifelse(`@MIPS_N32@',`yes',`6034',`4166')')
define(`SYSCALL_exit', `ifelse(`@MIPS_N32@',`yes',`6058',`4001')')
define(`SYSCALL_prctl', `ifelse(`@MIPS_N32@',`yes',`6153',`4192')')
define(`SYSCALL', `ifelse(`@MIPS_N32@',`yes',` move $a4, $1
move $a5, $2
move $a6, $3
move $a7, $4',` addi $sp, -32
sw $1, 16($sp)
sw $2, 20($sp)
sw $3, 24($sp)
sw $4, 28($sp)')')
define(`RESTORE', `ifelse(`@MIPS_N32@',`yes',` nop',` addi $sp, 32')')
define(`FP', `ifelse(`@MIPS_N32@',`yes',`$s8',`$fp')')
dnl For mips64. Some assemblers don't want to assemble `daddi'.
define(`DADDI2', `ifelse(`@DADDI_BROKEN@',`yes',`.set noat
li $at, $2
dadd $1, $1, $at
.set at',` daddi $1, $2')')
define(`DADDI3', `ifelse(`@DADDI_BROKEN@',`yes',`.set noat
li $at, $3
dadd $1, $2, $at
.set at',` daddi $1, $2, $3')')