summaryrefslogtreecommitdiff
path: root/arch/mipsn32/syscall_arch.h
AgeCommit message (Collapse)AuthorLines
2019-07-16clean up mips64/n32 syscall asm constraintsRich Felker-27/+28
ever since inline syscalls were added for (o32) mips in commit 328810d32524e4928fec50b57e37e1bf330b2e40, the asm has nonsensically loaded the syscall number, rather than taking $2 as an input constraint to let the compiler load it. commit cfc09b1ecf0c6981494fd73dffe234416f66af10 improved on this somewhat by allowing a constant syscall number to propagate into an immediate, but missed that the whole operation made no sense. now, only $4, $5, $6, $8, and $9 are potential input-only registers. $2 is always input and output, and $7 is both when it's an argument, otherwise output-only. previously, $7 was treated as an input (with a "1" constraint matching its output position) even when it was not an input, which was arguably undefined behavior (asm input from indeterminate value). this is corrected.
2019-07-16deduplicate mips64/n32 syscall clobbered register listsRich Felker-14/+11
this patch is not purely non-functional changes, since before, $8 and $9 were wrongly in the clobberlist for syscalls with fewer than 5 or 6 arguments. of course it's impossible for syscalls to have different clobbers depending on their number of arguments. the clobberlist for the recently-added 5- and 6-argument forms was correct, and for the 0- to 4-argument forms was erroneously copied from the mips o32 ABI where the additional arguments had to be passed on the stack. in making this change, I reviewed the kernel sources, and $8 and $9 are always saved for 64-bit kernels since they're part of the syscall argument list for n32 and n64 ABIs.
2019-05-05fix build regression on mips n32 due to typo in new inline syscallRich Felker-1/+1
commit 1bcdaeee6e659f1d856717c9aa562a068f2f3bd4 introduced the regression.
2019-04-10implement inline 5- and 6-argument syscalls for mipsn32 and mips64Rich Felker-6/+25
n32 and n64 ABIs add new argument registers vs o32, so that passing on the stack is not necessary, so it's not clear why the 5- and 6-argument versions were special-cased to begin with; it seems to have been pattern-copying from arch/mips (o32). i've treated the new argument registers like the first 4 in terms of clobber status (non-clobbered). hopefully this is correct.
2018-09-05define and use internal macros for hidden visibility, weak refsRich Felker-2/+1
this cleans up what had become widespread direct inline use of "GNU C" style attributes directly in the source, and lowers the barrier to increased use of hidden visibility, which will be useful to recovering some of the efficiency lost when the protected visibility hack was dropped in commit dc2f368e565c37728b0d620380b849c3a1ddd78f, especially on archs where the PLT ABI is costly.
2017-09-06make syscall.h consistent with linuxSzabolcs Nagy-3/+3
most of the found naming differences don't matter to musl, because internally it unifies the syscall names that vary across targets, but for external code the names should match the kernel uapi. aarch64: __NR_fstatat is called __NR_newfstatat in linux. __NR_or1k_atomic got mistakenly copied from or1k. arm: __NR_arm_sync_file_range is an alias for __NR_sync_file_range2 __NR_fadvise64_64 is called __NR_arm_fadvise64_64 in linux, the old non-arm name is kept too, it should not cause issues. (powerpc has similar nonstandard fadvise and it uses the normal name.) i386: __NR_madvise1 was removed from linux in commit 303395ac3bf3e2cb488435537d416bc840438fcb 2011-11-11 microblaze: __NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite had different name in linux. mips: __NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite, __NR_select had different name in linux. mipsn32: __NR_fstatat is called __NR_newfstatat in linux. or1k: __NR__llseek is called __NR_llseek in linux. the old name is kept too because that's the name musl uses internally. powerpc: __NR_{get,set}res{gid,uid}32 was never present in powerpc linux. __NR_timerfd was briefly defined in linux but then got renamed.
2017-05-31remove long-obsolete clang workarounds from mips* syscall_arch.h filesRich Felker-41/+0
at one point, clang reportedly failed to support the asm register constraints needed for inline syscalls. versions of clang that old have much bigger problems that preclude using them to compile musl libc.
2016-04-18add mips n32 port (ILP32 ABI for mips64)Rich Felker-0/+165
based on patch submitted by Jaydeep Patil, with minor changes.