sim-se: Refactor clone to avoid most ifdefs
authorAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 9 Jan 2019 14:50:27 +0000 (14:50 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Thu, 10 Jan 2019 17:55:42 +0000 (17:55 +0000)
commit0a36956261c67d61def90e1aefeb6c46568ff167
tree5f6d72f83185698d45e1f4b3eba1537f1c370167
parent13daa2e0620e71a1c11f94d1f8a864f73a52b94d
sim-se: Refactor clone to avoid most ifdefs

Some parts of clone are architecture dependent. In some cases, we are
able to use architecture-specific helper functions or register
aliases. However, there is still some architecture-specific that is
protected by ifdefs in the common clone implementation.

Move these architecture-specific bits to the architecture-specific OS
class instead to avoid these ifdefs and make the code a bit more
readable.

Change-Id: Ia0903d738d0ba890863bddfa77e3b717db7f45de
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Cc: Giacomo Travaglini <giacomo.travaglini@arm.com>
Cc: Javier Setoain <javier.setoain@arm.com>
Cc: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15435
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
src/arch/alpha/linux/linux.hh
src/arch/arm/linux/linux.hh
src/arch/riscv/linux/linux.hh
src/arch/sparc/linux/linux.hh
src/arch/x86/linux/linux.hh
src/sim/syscall_emul.hh