summary refs log tree commit diff stats
path: root/linux-user/elfload.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* linux-user/sh4: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-14/+13
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/openrisc: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-8/+8
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/microblaze: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-12/+12
| | | | | | | While we're at it, drop "pos++" and simply open-code indexes. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/mips: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-15/+15
| | | | | | | | While we're at it, merge the store of TARGET_EF_R0 into the loop over all R0 registers. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/loongarch64: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-9/+9
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/ppc: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-9/+11
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/aarch64: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-9/+8
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/arm: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-22/+10
| | | | | | | | While we're at it, loop over the general registers rather than open-code them. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/i386: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-20/+22
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/x86_64: Convert target_elf_gregset_t to a structRichard Henderson2025-08-301-30/+32
| | | | | | | A structure typedef may be abstract, while an array typedef cannot. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Remove do_init_main_threadRichard Henderson2025-08-281-46/+0
| | | | | | | | All targets have been converted, so we can call init_main_thread directly. Remove do_init_main_thread and HAVE_INIT_MAIN_THREAD. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/hexagon: Create init_main_threadRichard Henderson2025-08-281-6/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/xtensa: Create init_main_threadRichard Henderson2025-08-281-17/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/hppa: Create init_main_threadRichard Henderson2025-08-281-12/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/riscv: Create init_main_threadRichard Henderson2025-08-281-6/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/s390x: Create init_main_threadRichard Henderson2025-08-281-8/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/alpha: Create init_main_threadRichard Henderson2025-08-281-7/+1
| | | | | | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Note that init_thread had set ps in target_pt_regs, but target_cpu_copy_regs did not copy to env. This turns out to be ok because alpha_cpu_initfn initializes flags properly. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/m68k: Create init_main_threadRichard Henderson2025-08-281-10/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/sh4: Create init_main_threadRichard Henderson2025-08-281-7/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/openrisc: Create init_main_threadRichard Henderson2025-08-281-6/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/microblaze: Create init_main_threadRichard Henderson2025-08-281-7/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/mips: Create init_main_threadRichard Henderson2025-08-281-7/+1
| | | | | | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Note that init_thread had set cp0_status in target_pt_regs, but target_cpu_copy_regs did not copy to env. This turns out to be ok because mips_cpu_reset_hold initializes CP0_Status properly. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/loongarch64: Create init_main_threadRichard Henderson2025-08-281-8/+1
| | | | | | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Note that init_thread had set crmd in target_pt_regs, but target_cpu_copy_regs did not copy to env. This turns out to be ok because loongarch_cpu_reset_hold initializes CRMD properly. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/ppc: Create init_main_threadRichard Henderson2025-08-281-16/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/sparc: Create init_main_threadRichard Henderson2025-08-281-10/+2
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/aarch64: Create init_main_threadRichard Henderson2025-08-281-9/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/arm: Create init_main_threadRichard Henderson2025-08-281-40/+1
| | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/i386: Create init_main_threadRichard Henderson2025-08-281-23/+6
| | | | | | | | | Merge init_thread and target_cpu_copy_regs. There's no point going through a target_pt_regs intermediate. Temporarily introduce HAVE_INIT_MAIN_THREAD during conversion. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Create do_init_main_threadRichard Henderson2025-08-281-2/+5
| | | | | | | | Provide a unified function to initialize the main thread. Keep target_pt_regs isolated to this function. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_base_platform to mips/elfload.cRichard Henderson2025-08-281-36/+4
| | | | | | | | | Pass in CPUState; define HAVE_ELF_BASE_PLATFORM. Since this was the only instance of ELF_BASE_PLATFORM, go ahead and provide the stub definition for other platforms. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Remove ELF_PLATFORMRichard Henderson2025-08-281-14/+4
| | | | | | | | | All real definitions of ELF_PLATFORM are now identical, and the stub definitions are NULL. Use HAVE_ELF_PLATFORM and provide a stub as a fallback definition of get_elf_platform. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/hppa: Create get_elf_platformRichard Henderson2025-08-281-1/+1
| | | | | | | Move the string literal to a new function. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/loongarch64: Create get_elf_platformRichard Henderson2025-08-281-1/+1
| | | | | | | Move the string literal to a new function. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_platform to arm/elfload.cRichard Henderson2025-08-281-36/+2
| | | | | | | | | | | | | Move the aarch32 get_elf_platform to arm/elfload.c; pass in CPUState. Create a simple version in aarch64/elfload.c, which we must do at the same time because of the ifdef dependency between TARGET_AARCH64 and TARGET_ARM. Since all versions of get_elf_platform now have the same signature, remove the ifdef from the declaration in loader.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_platform to {i386,x86_64}/elfload.cRichard Henderson2025-08-281-16/+2
| | | | | | | | | Move get_elf_platform to i386/elfload.c; pass in CPUState. Create a simple get_elf_platform for x86_64. Introduce HAVE_ELF_PLATFORM. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Remove ELF_HWCAP2Richard Henderson2025-08-281-13/+10
| | | | | | | | All definitions of ELF_HWCAP2 are now identical. Provide a not-reached stub as a fallback definition of get_elf_hwcap2. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Remove ELF_HWCAPRichard Henderson2025-08-281-23/+12
| | | | | | | | All real definitions of ELF_HWCAP are now identical, and the stub definitions are 0. Provide zero stub as a fallback definition. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_hwcap to riscv/elfload.cRichard Henderson2025-08-281-13/+1
| | | | | | | | | Change the return type to abi_ulong, and pass in the cpu. As this is the last instance of get_elf_hwcap to be converted, remove the ifdef around the declaration in loader.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move hwcap functions to s390x/elfload.cRichard Henderson2025-08-281-59/+1
| | | | | | | | For get_elf_hwcap, change the return type to abi_ulong and pass in the cpu. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_hwcap to sh4/elfload.cRichard Henderson2025-08-281-28/+1
| | | | | | | Change the return type to abi_ulong, and pass in the cpu. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_hwcap to mips/elfload.cRichard Henderson2025-08-281-51/+1
| | | | | | | Change the return type to abi_ulong, and pass in the cpu. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_hwcap to loongarch64/elfload.cRichard Henderson2025-08-281-48/+1
| | | | | | | Change the return type to abi_ulong, and pass in the cpu. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move hwcap functions to ppc/elfload.cRichard Henderson2025-08-281-114/+2
| | | | | | | Change the return type to abi_ulong, and pass in the cpu. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_hwcap to sparc/elfload.cRichard Henderson2025-08-281-29/+1
| | | | | | | Change the return type to abi_ulong, and pass in the cpu. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move hwcap functions to {arm,aarch64}/elfload.cRichard Henderson2025-08-281-501/+4
| | | | | | | | | | For get_elf_hwcap and get_elf_hwcap2, change the return type to abi_ulong, and pass in the cpu. We must do these targets at the same time because of the ifdef dependency between TARGET_AARCH64 and TARGET_ARM. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move get_elf_hwcap to {i386,x86_64}/elfload.cRichard Henderson2025-08-281-8/+1
| | | | | | | | | Change the return type to abi_ulong, and pass in the cpu. Duplicate the one line function between i386 and x86_64, as most other additions to elfload.c won't be common. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user: Move ppc uabi/asm/elf.h workaround to osdep.hRichard Henderson2025-08-281-10/+0
| | | | | | | | | | | | | Move the workaround out of linux-user/elfload.c, so that we don't have to replicate it in many places. Place it immediately after the include of <signal.h>, which draws in the relevant symbols. Note that ARCH_DLINFO is not defined by the kernel header, and so there's no need to undef it either. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* linux-user/aarch64: Set hwcap bits for SME2p1/SVE2p1Richard Henderson2025-07-041-0/+8
| | | | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20250704142112.1018902-108-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* linux-user/aarch64: Update hwcap bits from 6.14Richard Henderson2025-06-231-3/+72
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* accel/tcg: Use vaddr for walk_memory_regions callbackRichard Henderson2025-04-301-10/+9
| | | | | | | | | | | Use vaddr instead of target_ulong. At the same time, use int instead of unsigned long for flags, to match page_set_flags(). Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>