summaryrefslogtreecommitdiff
path: root/arch/mips64/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-04-10implement inline 5- and 6-argument syscalls for mipsn32 and mips64Rich Felker-23/+43
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.
2019-04-10cleanup mips64 syscall_arch functionsRich Felker-18/+9
2017-05-31remove long-obsolete clang workarounds from mips* syscall_arch.h filesRich Felker-75/+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.
2017-05-31fix fstatat syscall on mips64Rich Felker-3/+22
mips64 requires 'struct stat' conversion due to incorrect 32-bit fields where time_t should be in the kernel version of the structure. syscall_arch.h already performed the correct translation for stat, fstat, and lstat syscalls, but omitted special handling for fstatat.
2016-03-06add mips64 portRich Felker-0/+281
patch by Mahesh Bodapati and Jaydeep Patil of Imagination Technologies.