4ce6243dc6
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>
17 lines
424 B
C
17 lines
424 B
C
struct target_pt_regs {
|
|
abi_ulong psr;
|
|
abi_ulong pc;
|
|
abi_ulong npc;
|
|
abi_ulong y;
|
|
abi_ulong u_regs[16];
|
|
};
|
|
|
|
#define UNAME_MACHINE "sun4"
|
|
|
|
/* SPARC kernels don't define this in their Kconfig, but they have the
|
|
* same ABI as if they did, implemented by sparc-specific code which fishes
|
|
* directly in the u_regs() struct for half the parameters in sparc_do_fork()
|
|
* and copy_thread().
|
|
*/
|
|
#define TARGET_CLONE_BACKWARDS
|