Skip to contentSkip to conversation

tcg/ppc: Fix support for 64-bit PPC MacOSX hosts

RFC In review Peter Maydell 3 participants 4 messages Jun 26, 2014 – Jun 29, 2014

lore
Share & tools
lore
#0 lore raw

RFC 1/1 tcg/ppc: Fix support for 64-bit PPC MacOSX hosts

Add back in the support for 64-bit PPC MacOSX hosts that was broken in the recent merge of the 32-bit and 64-bit TCG backends.

---
As per subject, this is totally untested since I don't have any PPC MacOSX hosts; numbers based on the documentation at
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/100-32-bit_PowerPC_Function_Calling_Conventions/32bitPowerPC.html
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/110-64-bit_PowerPC_Function_Calling_Conventions/64bitPowerPC.html

 tcg/ppc/tcg-target.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tcg/ppc/tcg-target.c +3 -3
index c83fd9f..1030318 100644
@@ -1716,6 +1716,9 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
 # define LINK_AREA_SIZE                (6 * SZR)
 # define LR_OFFSET                     (1 * SZR)
 # define TCG_TARGET_CALL_STACK_OFFSET  (LINK_AREA_SIZE + 8 * SZR)
+#elif defined(TCG_TARGET_CALL_DARWIN)
+# define LINK_AREA_SIZE                (6 * SZR)
+# define LR_OFFSET                     (2 * SZR)
 #elif TCG_TARGET_REG_BITS == 64
 # if defined(_CALL_ELF) && _CALL_ELF == 2
 #  define LINK_AREA_SIZE               (4 * SZR)
@@ -1725,9 +1728,6 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
 # if defined(_CALL_SYSV)
 #  define LINK_AREA_SIZE               (2 * SZR)
 #  define LR_OFFSET                    (1 * SZR)
-# elif defined(TCG_TARGET_CALL_DARWIN)
-#  define LINK_AREA_SIZE               24
-#  define LR_OFFSET                    8
 # endif
 #endif
 #ifndef LR_OFFSET
Signature · 1 line
1.9.2
Reviewed-by on v1 1/1
#1 lore raw

tcg/ppc/tcg-target.c static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64) · line 1722

Quoted 9 lines · Peter Maydell

+++ b/tcg/ppc/tcg-target.c

tcg/ppc/tcg-target.c +3 -0
@@ -1716,6 +1716,9 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
 # define LINK_AREA_SIZE                (6 * SZR)
 # define LR_OFFSET                     (1 * SZR)
 # define TCG_TARGET_CALL_STACK_OFFSET  (LINK_AREA_SIZE + 8 * SZR)
+#elif defined(TCG_TARGET_CALL_DARWIN)
+# define LINK_AREA_SIZE                (6 * SZR)
+# define LR_OFFSET                     (2 * SZR)
 #elif TCG_TARGET_REG_BITS == 64

It does indeed give the same layout as before for darwin.

r~

Tested-by on v1 1/1
#2 lore raw
In reply to Peter Maydell

Am 26.06.2014 17:37, schrieb Peter Maydell:

Quoted 3 lines

Add back in the support for 64-bit PPC MacOSX hosts that was broken in the recent merge of the 32-bit and 64-bit TCG backends.

Quoted 1 line

Fixes the build, and i386/x86_64 Haiku guest boots up.

Thanks,
Andreas

#3 lore raw
Quoted 5 lines · Andreas Färber

Am 26.06.2014 17:37, schrieb Peter Maydell:

Quoted 3 lines

Add back in the support for 64-bit PPC MacOSX hosts that was broken in the recent merge of the 32-bit and 64-bit TCG backends.

Quoted 7 lines
Quoted 1 line

Fixes the build, and i386/x86_64 Haiku guest boots up.

Thanks for testing; applied to master as a buildfix.

-- PMM