summaryrefslogtreecommitdiffstats
path: root/bsd-user/i386
Commit message (Collapse)AuthorAgeFilesLines
* Clean up ill-advised or unusual header guardsMarkus Armbruster2022-05-117-21/+24
| | | | | | | | | | | | | | | | | | Leading underscores are ill-advised because such identifiers are reserved. Trailing underscores are merely ugly. Strip both. Our header guards commonly end in _H. Normalize the exceptions. Macros should be ALL_CAPS. Normalize the exception. Done with scripts/clean-header-guards.pl. include/hw/xen/interface/ and tools/virtiofsd/ left alone, because these were imported from Xen and libfuse respectively. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220506134911.2856099-3-armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* Clean up header guards that don't match their file nameMarkus Armbruster2022-05-112-7/+6Star
| | | | | | | | | | | | | Header guard symbols should match their file name to make guard collisions less likely. Cleaned up with scripts/clean-header-guards.pl, followed by some renaming of new guard symbols picked by the script to better ones. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220506134911.2856099-2-armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> [Change to generated file ebpf/rss.bpf.skeleton.h backed out]
* bsd-user: introduce target.hWarner Losh2022-02-271-0/+21
| | | | | | | | | | | | | | | | Create target.h. This file is intended to be simple and describe basic things about the architecture. If something is a basic feature of the architecture, it belongs here. Should we need something that's per-BSD there will be a target-os.h that will live in the per-bsd directories. Define regpairs_aligned to reflect whether or not registers are 'paired' for 64-bit arguments or not. This will be false for all 64-bit targets, and will be true on those architectures that pair (currently just armv7 and powerpc on FreeBSD 14.x). Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user/i386/target_arch_cpu.h: Remove openbsd syscallWarner Losh2022-02-261-47/+37Star
| | | | | | | | | | This doesn't build on openbsd at the moment, and this could should arguably be in bsd-user/*bsd/i386 somewhere. Until we refactor to support OpenBSD/NetBSD again, drop it here. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: Rename arg name for target_cpu_reset to envWarner Losh2022-01-311-2/+2
| | | | | | | | Rename the parameter name for target_cpu_reset's CPUArchState * arg from cpu to env. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user/signal-common.h: Move signal functions prototypes to hereWarner Losh2022-01-281-0/+1
| | | | | Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: Create setup_sigframe_arch to setup sigframe contextWarner Losh2022-01-281-0/+13
| | | | | | | | Define setup_sigframe_arch whose job it is to setup the mcontext for the sigframe. Implement for x86 to just call mcontext. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user/target_os_signal.h: Move signal prototypes to target_os_ucontext.hWarner Losh2022-01-081-9/+0Star
| | | | | | | | Switch to the CPUArchState typedef and move target-provided prototypes to target_os_ucontext.h. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user/i386: Move the inlines into signal.cWarner Losh2022-01-082-36/+63
| | | | | | | Move the (now stubbed out) inlines into bsd-user/i386/signal.c. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user/i386/target_arch_signal.h: Update mcontext_t to match FreeBSDWarner Losh2022-01-081-0/+46
| | | | | | | | Fill in target_mcontext_t to match the FreeBSD mcontex_t. Also tag the current size of mcontext and ucontext to enable size checking for i386. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user/i386/target_arch_signal.h: use new target_os_ucontext.hWarner Losh2022-01-081-8/+1Star
| | | | | Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user/i386/target_arch_signal.h: Remove target_sigcontextWarner Losh2022-01-081-4/+0Star
| | | | | | | | In FreeBSD, sigcontext was retired in favor of ucontext/mcontext. Remove vestigial target_sigcontext. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: create a per-arch signal.c fileWarner Losh2022-01-081-0/+1
| | | | | | | | | Create a place-holder signal.c file for each of the architectures that are currently built. In the future, some code that's currently inlined in target_arch_signal.h will live here. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: move TARGET_MC_GET_CLEAR_RET to target_os_signal.hWarner Losh2021-10-181-2/+0Star
| | | | | | | | | | Move TARGET_MC_GET_CLEAR_RET to freebsd/target_os_signal.h since it's architecture agnostic on FreeBSD. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
* bsd-user: TARGET_RESET define is unused, remove itWarner Losh2021-10-181-2/+0Star
| | | | | | | Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
* user: Remove cpu_get_pic_interrupt() stubsPhilippe Mathieu-Daudé2021-09-141-5/+0Star
| | | | | | | | | | | cpu_get_pic_interrupt() is now unreachable from user-mode, delete the unnecessary stubs. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210911165434.531552-25-f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: Add target_arch_reg to describe a target's register setWarner Losh2021-09-101-0/+82
| | | | | | | | | | target_reg_t is the normal register. target_fpreg_t is the floating point registers. target_copy_regs copies the registers out of CPU context for things like core dumps. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: Add architecture specific signal tramp codeWarner Losh2021-09-101-0/+29
| | | | | | | | | | Add a stubbed out version of setup_sigtramp. This is not yet used for x86, but is used for other architectures. This will be connected in future commits. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: *BSD specific siginfo defintionsWarner Losh2021-09-101-0/+94
| | | | | | | | | | | Add FreeBSD, NetBSD and OpenBSD values for the various signal info types and defines to decode different signals to discover more information about the specific signal types. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Acked-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
* bsd-user: Create target specific vmparam.hWarner Losh2021-09-101-0/+46
| | | | | | | | Target specific values for vm parameters and details. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: pull in target_arch_thread.h update target_arch_elf.hWarner Losh2021-09-102-49/+50
| | | | | | | | | | | | | | | | | | | | Update target_arch_elf.h to remove thread_init. Move its contents to target_arch_thread.h and rename to target_thread_init(). Update elfload.c to call it. Create thread_os_thread.h to hold the os specific parts of the thread and threat manipulation routines. Currently, it just includes target_arch_thread.h. target_arch_thread.h contains the at the moment unused target_thread_set_upcall which will be used in the future when creating actual thread (i386 has this stubbed, but other architectures in the bsd-user tree have real ones). FreeBSD doesn't do AT_HWCAP, so remove that code. Linux does, and this code came from there. These changes are all interrelated and could be brokend down, but seem to represent a reviewable changeset since most of the change is boiler plate. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
* bsd-user: Move per-cpu code into target_arch_cpu.hWarner Losh2021-09-102-0/+210
| | | | | | | | | Move cpu_loop() into target_cpu_loop(), and put that in target_arch_cpu.h for each architecture. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: start to move target CPU functions to target_arch*Warner Losh2021-09-102-0/+106
| | | | | | | | | Move the CPU functions into target_arch_cpu.c that are unique to each CPU. These are defined in target_arch.h. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: move arch specific defines out of elfload.cWarner Losh2021-09-101-0/+81
| | | | | | | | | Move the architecture specific defines to target_arch_elf.h and delete them from elfload.c. Only retain ifdefs appropriate for i386 and x86_64. Add the copyright/license comments, and guard ifdefs. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: remove target_signal.h, it's unusedWarner Losh2021-05-111-20/+0Star
| | | | | | | | Remove the target_signal.h file. None of its contents are currently used and the bsd-user fork doesn't use them (so this reduces the diffs there). Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
* bsd-user: move strace OS/arch dependent code to host/arch dirsStacey Son2021-01-112-0/+96
| | | | | | | | | | | | | This change moves host OS and arch dependent code for the sysarch system call related to the -strace functionality into the appropriate host OS and target arch directories. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Sean Bruno <sburno@FreeBSD.org> [ imp integrated minor build fixes from sbruno ] Signed-off-by: Warner Losh <imp@FreeBSD.org> Message-Id: <20201218205451.10559-4-imp@freebsd.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
* Clean up decorations and whitespace around header guardsMarkus Armbruster2016-07-121-1/+1
| | | | | | | Cleaned up with scripts/clean-header-guards.pl. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
* build: [bsd-user] Rename "syscall.h" to "target_syscall.h" in target directoriesLluís Vilanova2016-02-251-0/+4
| | | | | | | | | This fixes double-definitions in bsd-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: Peter Maydell <peter.maydell@linaro.org>
* bsd-user: FreeBSD updateJuergen Lock2009-10-181-0/+14
| | | | | | | | basic FreeBSD sysarch(2) handling fixed syscall errno return Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* BSD user: initial support for i386 and x86_64 targetsblueswir12009-04-112-0/+167
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7084 c046a42c-6fe2-441c-8c8c-71466251a162