summaryrefslogtreecommitdiffstats
path: root/linux-user/xtensa
Commit message (Collapse)AuthorAgeFilesLines
* linux-user: Don't call gdb_handlesig() before queue_signal()Peter Maydell2018-11-121-7/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | The CPU main-loop routines for linux-user generally call gdb_handlesig() when they're about to queue a SIGTRAP signal. This is wrong, because queue_signal() will cause us to pend a signal, and process_pending_signals() will then call gdb_handlesig() itself. So the effect is that we notify gdb of the SIGTRAP, and then if gdb says "OK, continue with signal X" we will incorrectly notify gdb of the signal X as well. We don't do this double-notify for anything else, only SIGTRAP. Remove this unnecessary and incorrect code from all the targets except for nios2 (whose main loop is doing something different and broken, and will be handled in a separate patch). This bug only manifests if the user responds to the reported SIGTRAP using "signal SIGFOO" rather than "continue"; since the latter is the overwhelmingly common thing to do after a breakpoint most people won't have hit this. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20181019174958.26616-2-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
* linux-user: xtensa: enable bFLT supportMax Filippov2018-10-201-0/+10
| | | | | | | | | | - request bflt support in configure; - implement custom linux-user/xtensa/target_flat.h that doesn't put envp on stack; - fix #include "target_flat.h" in flatload.c so that it first search for arch-customized version of the header. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* linux-user: move generic signal definitions to generic/signal.hLaurent Vivier2018-06-041-0/+2
| | | | | | | No code change. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20180529194207.31503-10-laurent@vivier.eu>
* linux-user: move get_sp_from_cpustate() to target_cpu.hLaurent Vivier2018-06-043-7/+4Star
| | | | | | | | | 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>
* linux-user: move generic fcntl definitions to generic/fcntl.hLaurent Vivier2018-06-041-0/+11
| | | | | | | | | 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>
* linux-user: move socket.h generic definitions to generic/sockbits.hLaurent Vivier2018-05-251-0/+1
| | | | | | | | and include the file from architectures without specific definitions Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180519092956.15134-5-laurent@vivier.eu>
* linux-user: introduce target_sigsp() and target_save_altstack()Laurent Vivier2018-05-031-11/+4Star
| | | | | | Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180411192347.30228-1-laurent@vivier.eu>
* linux-user: move xtensa cpu loop to xtensa directoryLaurent Vivier2018-04-301-0/+241
| | | | | | | | | No code change, only move code from main.c to xtensa/cpu_loop.c. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180411185651.21351-20-laurent@vivier.eu>
* linux-user: create a dummy per arch cpu_loop.cLaurent Vivier2018-04-301-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>
* linux-user: define TARGET_ARCH_HAS_SETUP_FRAMELaurent Vivier2018-04-301-4/+0Star
| | | | | | | | | | | | | 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>
* linux-user: move xtensa signal.c parts to xtensa directoryLaurent Vivier2018-04-302-0/+253
| | | | | | | | | | | No code change, only move code from signal.c to xtensa/signal.c, except adding includes and exporting setup_rt_frame(). 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-16-laurent@vivier.eu>
* linux-user: create a dummy per arch signal.cLaurent Vivier2018-04-301-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>
* target/xtensa: linux-user: fix sysv IPC structuresMax Filippov2018-04-011-7/+30
| | | | | | | | | | | | | | | - make target_ipc_perm fields match kernel definitions for xtensa; - add target_semid64_ds with proper order of times and reserved fields for little/big endian specific for xtensa; - add missing reserved fields after time fields to the target_shmid_ds; - fix types of shm_cpid, shm_lpid and shm_nattch fields of target_shmid_ds to match kernel definitions for xtensa. These changes fix guest ipcs output and fix glibc testsuite tests sysvipc/test-sysvsem and sysvipc/test-sysvshm. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* linux-user/xtensa: remove stray syscall.hMax Filippov2018-03-261-0/+0
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target/xtensa: add linux-user supportMax Filippov2018-03-168-0/+908
Import list of syscalls from the kernel source. Conditionalize code/data that is only used with softmmu. Implement exception handlers. Implement signal hander (only the core registers for now, no coprocessors or TIE). Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>