aboutsummaryrefslogtreecommitdiff
path: root/linux-user/mips64
AgeCommit message (Collapse)AuthorFilesLines
2020-03-20linux-user: update syscall.tbl from linux 0bf999f9c5e7Laurent Vivier2-0/+4
Run scripts/update-syscalltbl.sh with linux commit 0bf999f9c5e7 Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> Message-Id: <20200310103403.3284090-20-laurent@vivier.eu> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-03-20linux-user, mips64: add syscall table generation supportLaurent Vivier5-725/+773
Copy syscall_n32.tbl, syscall_n64.tbl and syscallhdr.sh from linux/arch/parisc/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Move the offsets (6000 for n32 and 5000 for n64) from the file to the Makefile.objs to be passed to syscallhdr.sh Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> Message-Id: <20200310103403.3284090-18-laurent@vivier.eu> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-02-17linux-user: mips: Update syscall numbers to kernel 5.5 levelAleksandar Markovic1-2/+48
Update mips syscall numbers based on Linux kernel tag v5.5. CC: Aurelien Jarno <aurelien@aurel32.net> CC: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <1581596954-2305-6-git-send-email-aleksandar.markovic@rt-rk.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-06-12Supply missing header guardsMarkus Armbruster1-0/+5
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190604181618.19980-5-armbru@redhat.com>
2018-10-29linux-user: Add prctl() PR_SET_FP_MODE and PR_GET_FP_MODE implementationsStefan Markovic1-0/+2
Implement MIPS specific prctl() PR_SET_FP_MODE and PR_GET_FP_MODE emulation. Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
2018-10-18linux-user: Add MIPS-specific prctl() optionsStefan Markovic1-0/+4
Add MIPS-specific prctl() options TARGET_PR_SET_FP_MODE and TARGET_PR_SET_FP_MODE. These values are essentially copied from linux kernel header include/uapi/linux/prctl.h. This is done in a way consistent with a similar case of aarch64-specific prctl() options TARGET_PR_SVE_SET_VL and TARGET_PR_SVE_GET_VL. Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
2018-08-16linux-user: Update MIPS syscall numbers up to kernel 4.18 headersAleksandar Markovic1-0/+18
Synchronize content of linux-user/mips/syscall_nr.h and linux-user/mips64/syscall_nr.h with Linux kernel 4.18 headers. This adds 9 new syscall numbers, the last being NR_io_pgetevents. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
2018-06-04linux-user: move mips signal definitions to mips/target_signal.hLaurent Vivier1-0/+49
No code change. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20180529194207.31503-12-laurent@vivier.eu>
2018-06-04linux-user: move get_sp_from_cpustate() to target_cpu.hLaurent Vivier1-6/+0
Remove useless includes Fix HPPA include guard. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Acked-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180529194207.31503-9-laurent@vivier.eu>
2018-06-04linux-user: move generic fcntl definitions to generic/fcntl.hLaurent Vivier1-0/+1
add a per target target_fcntl.h and include the generic one from them No code change. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20180529194207.31503-2-laurent@vivier.eu>
2018-05-25linux-user: move mips socket.h definitions to mips/sockbits.hLaurent Vivier1-0/+1
No code change. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180519092956.15134-2-laurent@vivier.eu>
2018-04-30linux-user: move mips/mips64 cpu loop to mips directoryLaurent Vivier1-7/+1
No code change, only move code from main.c to mips/cpu_loop.c. Include mips/cpu_loop.c in mips64/cpu_loop.c to avoid to duplicate code. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180411185651.21351-8-laurent@vivier.eu>
2018-04-30linux-user: create a dummy per arch cpu_loop.cLaurent Vivier1-0/+26
Create a cpu_loop-common.h for future use by these new files and use it in the existing main.c Introduce target_cpu_copy_regs(): declare the function in cpu_loop-common.h and an empty function for each target, to move all the cpu_loop prologues to this function. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180411185651.21351-2-laurent@vivier.eu>
2018-04-30linux-user: define TARGET_ARCH_HAS_SETUP_FRAMELaurent Vivier1-4/+0
Instead of calling setup_frame() conditionally to a list of known targets, define TARGET_ARCH_HAS_SETUP_FRAME if the target provides the function and call it only if the macro is defined. Move declarations of setup_frame() and setup_rt_frame() to linux-user/signal-common.h Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180424192635.6027-21-laurent@vivier.eu>
2018-04-30linux-user: move mips/mips64 signal.c parts to mips directoryLaurent Vivier2-1/+5
No code change, only move code from signal.c to mips/signal.c, except adding includes and exporting setup_frame() and setup_rt_frame(). mips64/signal.c includes mips/signal.c Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180424192635.6027-19-laurent@vivier.eu>
2018-04-30linux-user: create a dummy per arch signal.cLaurent Vivier1-0/+18
Create a signal-common.h for future use by these new files and use it in the existing signal.c Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180424192635.6027-2-laurent@vivier.eu>
2018-02-25linux-user: MIPS set cpu to r6 CPU if binary is R6YunQiang Su1-0/+3
So here we need to detect the version of binaries and set cpu_model for it. Signed-off-by: YunQiang Su <syq@debian.org> [lv: original patch modified to move code into cpu_get_model()] Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180220173307.25125-5-laurent@vivier.eu>
2018-02-25linux-user: Move CPU type name selection to a functionLaurent Vivier1-0/+14
Instead of a sequence of "#if ... #endif" move the selection to a function in linux-user/*/target_elf.h We can't add them in linux-user/*/target_cpu.h because we will need to include "elf.h" to use ELF flags with eflags, and including "elf.h" in "target_cpu.h" introduces some conflicts in elfload.c Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180220173307.25125-2-laurent@vivier.eu>
2017-01-22linux-user: Handle ERFKILL and EHWPOISONRichard Henderson1-0/+5
With definitions for generic, alpha and mips taken from 4.9-rc2. Signed-off-by: Richard Henderson <rth@twiddle.net>
2016-10-21linux-user: Redirect termbits.h for Mips64 to termbits.h for Mips32Aleksandar Markovic1-244/+1
linux-user/mips64/termbits.h and linux-user/mips/termbits.h originate from the same files in Linux kernel. There is no plan to split original headers in Linux kernel into Mips32 and Mips64 versions any time soon. Therefore, it is better not to have separate Mips32 and Mips64 variants in Qemu. This patch makes these two files effectively the same, allowing the mainenance by changing only a single file. (This is already done in the same fashion for some other headers in same directories.) Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2016-09-23linux-user: Add missing TARGET_EDQUOT error code for MipsAleksandar Markovic1-0/+2
EDQUOT is defined for Mips platform in Linux kernel in such a way that it has different value than on most other platforms. However, correspondent TARGET_EDQUOT for Mips is missing in Qemu code. Moreover, TARGET_EDQUOT is missing from the table for conversion of error codes from host to target. This patch fixes these problems. Without this patch, syscalls add_key(), keyctl(), link(), mkdir(), mknod(), open(), rename(), request_key(), setxattr(), symlink(), and write() will not be able to return the right error code in some scenarios on Mips platform. (Some of these syscalls are not yet supported in Qemu, but once they are supported, they will need correct EDQUOT handling.) Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Acked-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-09-21linux-user: Use correct target SHMLBA in shmat()Peter Maydell1-0/+7
The shmat() handling needs to do target-specific handling of the attach address for shmat(): * if the SHM_RND flag is passed, the address is rounded down to a SHMLBA boundary * if SHM_RND is not passed, then the call is failed EINVAL if the address is not a multiple of SHMLBA Since SHMLBA is target-specific, we need to do this checking and rounding in QEMU and can't leave it up to the host syscall. Allow targets to define TARGET_FORCE_SHMLBA and provide a target_shmlba() function if appropriate, and update do_shmat() to honour them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2016-07-12linux-user: Clean up target_signal.h header guardsMarkus Armbruster1-3/+3
These headers all use TARGET_SIGNAL_H as header guard symbol. Reuse of the same guard symbol in multiple headers is okay as long as they cannot be included together. Since we can avoid guard symbol reuse easily, do so: use guard symbol $target_TARGET_SIGNAL_H for linux-user/$target/target_signal.h. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2016-07-12linux-user: Clean up target_syscall.h header guardsMarkus Armbruster1-3/+3
Some of them use guard symbol TARGET_SYSCALL_H, but we also have CRIS_SYSCALL_H, MICROBLAZE_SYSCALLS_H, TILEGX_SYSCALLS_H and __UC32_SYSCALL_H__. They all upset scripts/clean-header-guards.pl. Reuse of the same guard symbol TARGET_SYSCALL_H in multiple headers is okay as long as they cannot be included together. The script can't tell, so it warns. The script dislikes the other guard symbols, too. They don't match their file name (they should, to make guard collisions less likely), and __UC32_SYSCALL_H__ is a reserved identifier. Clean them all up: use guard symbol $target_TARGET_SYSCALL_H for linux-user/$target/target_sycall.h. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2016-05-27linux-user: Support for restarting system calls for MIPS targetsTimothy E Baldwin1-0/+1
Update the MIPS main loop code: * on TARGET_ERESTARTSYS, wind guest PC backwards to repeat syscall insn (We already handle TARGET_QEMU_ESIGRETURN.) Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Message-id: 1441497448-32489-7-git-send-email-T.E.Baldwin99@members.leeds.ac.uk Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: tweak commit message; drop TARGET_USE_ERESTARTSYS define] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2016-05-27linux-user: Renumber TARGET_QEMU_ESIGRETURN, make it not arch-specificTimothy E Baldwin1-4/+0
Currently we define a QEMU-internal errno TARGET_QEMU_ESIGRETURN only on the MIPS and PPC targets; move this to errno_defs.h so it is available for all architectures, and renumber it to 513. We pick 513 because this is safe from future use as a system call return value: Linux uses it as ERESTART_NOINTR internally and never allows that errno to escape to userspace. Signed-off-by: Timothy Edward Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Message-id: 1441497448-32489-4-git-send-email-T.E.Baldwin99@members.leeds.ac.uk [PMM: TARGET_ERESTARTSYS split out into preceding patch, add comment] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2016-02-23linux-user: sync syscall numbers with kernelRiku Voipio1-0/+23
Sync syscall numbers to match the linux v4.5-rc1 kernel. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2016-02-23build: [linux-user] Rename "syscall.h" to "target_syscall.h" in target ↵Lluís Vilanova1-0/+4
directories This fixes double-definitions in linux-user builds when using the UST tracing backend (which indirectly includes the system's "syscall.h"). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2015-01-27mips64-linux-user: Fix definition of struct sigaltstackEd Swierk1-1/+1
Without this fix, qemu segfaults when emulating the sigaltstack syscall, because it incorrectly treats the ss_flags field as 64 bits rather than 32 bits. Signed-off-by: Ed Swierk <eswierk@skyportsystems.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-08-22linux-user: Support target-to-host translation of mlockall argumentTom Musta1-0/+2
The argument to the mlockall system call is not necessarily the same on all platforms and thus may require translation prior to passing to the host. For example, PowerPC 64 bit platforms define values for MCL_CURRENT (0x2000) and MCL_FUTURE (0x4000) which are different from Intel platforms (0x1 and 0x2, respectively) Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-08-22linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2Tom Musta1-0/+1
The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was 2048 previously. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-03-10linux-user: set minimum kernel version to 2.6.32Riku Voipio1-0/+1
Popular glibc based distributions[1] require minimum 2.6.32 as kernel version. For some targets 2.6.18 would be enough, but dropping so low would mean some suboptimal system calls could get used. Set the minimum kernel advertized to 2.6.32 for all architectures but aarch64 to ensure working qemu linux-user in case host kernel is older. [1] https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/921078 Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-02-18linux-user: sync syscall numbers upto 3.13Riku Voipio1-0/+13
All others updated except unicore, which doesn't look right to begin with. Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-11-29linux-user: create target_structs header to place ipc_perm and shmid_dsPetar Jovanovic2-0/+20
Creating target_structs header in linux-user/$arch/ and making target_ipc_perm and target_shmid_ds its first inhabitants. The struct defintions may/should be further fine-tuned by arch maintainers. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-22linux-user: Clean up handling of clone() argument orderPeter Maydell1-0/+2
Linux manages to have three separate orderings of the arguments to the clone() syscall on different architectures. In the kernel these are selected via CONFIG_CLONE_BACKWARDS and CONFIG_CLONE_BACKWARDS2. Clean up our implementation of this to use similar #define names rather than a TARGET_* ifdef ladder. This includes behaviour changes fixing bugs on cris, x86-64, m68k, openrisc and unicore32. cris had explicit but wrong handling; the others were just incorrectly using QEMU's default, which happened to be the equivalent of CONFIG_CLONE_BACKWARDS. (unicore32 appears to be broken in the mainline kernel in that it tries to use arg3 for both parent_tidptr and newtls simultaneously -- we don't attempt to emulate this bug...) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-09linux-user: Move cpu_clone_regs() and cpu_set_tls() into linux-userPeter Maydell1-0/+1
The functions cpu_clone_regs() and cpu_set_tls() are not purely CPU related -- they are specific to the TLS ABI for a a particular OS. Move them into the linux-user/ tree where they belong. target-lm32 had entirely unused implementations, since it has no linux-user target; just drop them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-05mipsn32-linux-user: Configure the architecture properlyRichard Henderson2-312/+626
N32 is a 64-bit cpu with a 32-bit address space. We have existing cpp defines for this situation, but weren't using them. This does mean that the linux-user/mipsn32 directory must be merged with the linux-user/mips64 directory, and differences must be resolved via ifdefs. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-02-02linux-user: Define TARGET_QEMU_ESIGRETURN for mips64Andreas Färber1-0/+3
Copied from mips/syscall.h. Signed-off-by: Khansa Butt <khansa@kics.edu.pk> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Add syscall numbers from kernel 2.6.39.2Peter Maydell1-0/+13
Add syscall numbers for new syscall numbers; this brings us into line with Linux 2.6.39.2. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2009-10-01Revert "Get rid of _t suffix"Anthony Liguori1-1/+1
In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Get rid of _t suffixmalc1-1/+1
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
2009-06-16linux-user: update syscall listRiku Voipio1-0/+9
In preparation for supporting pipe2() Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2008-06-27More efficient target register / TC accesses.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4794 c046a42c-6fe2-441c-8c8c-71466251a162
2008-02-12Make MIPS MT implementation more cache friendly.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3981 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-14 Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)blueswir12-11/+11
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3396 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-30Code provision for n32/n64 mips userland emulation. Not functional yet.ths4-0/+779
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3284 c046a42c-6fe2-441c-8c8c-71466251a162