[rtems commit] powerpc: Add PPC_STACK_ALIGN_POWER

Sebastian Huber sebh at rtems.org
Fri Jan 9 13:09:38 UTC 2015


Module:    rtems
Branch:    master
Commit:    0d0095f1f051aa32f2f8bc4710602c6f71418fc2
Changeset: http://git.rtems.org/rtems/commit/?id=0d0095f1f051aa32f2f8bc4710602c6f71418fc2

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Dec 23 11:46:08 2014 +0100

powerpc: Add PPC_STACK_ALIGN_POWER

Simplify PPC_STACK_ALIGNMENT definition.

---

 cpukit/score/cpu/powerpc/rtems/score/powerpc.h | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/cpukit/score/cpu/powerpc/rtems/score/powerpc.h b/cpukit/score/cpu/powerpc/rtems/score/powerpc.h
index 90cbbd1..7eaa237 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/powerpc.h
+++ b/cpukit/score/cpu/powerpc/rtems/score/powerpc.h
@@ -108,23 +108,13 @@ extern "C" {
 #define PPC_ABI PPC_ABI_EABI
 #endif
 
-#if (PPC_ABI == PPC_ABI_SVR4) || defined(__ALTIVEC__)
-#define PPC_STACK_ALIGNMENT	16
-#elif (PPC_ABI == PPC_ABI_EABI)
-#if 1
-/* Till.S: 2008/07/10; AFAIK, the CPU_STACK_ALIGNMENT is only
- * used to align the top of the stack. We don't lose much
- * if we always align TOS to 16-bytes but we then are always
- * OK, even if the user tells the compiler to generate 16-byte
- * alignment.
+/*
+ *  Use worst case stack alignment.  For the EABI an 8-byte alignment would be
+ *  sufficient.
  */
-#define PPC_STACK_ALIGNMENT	16
-#else
-#define PPC_STACK_ALIGNMENT	8
-#endif
-#else
-#error  "PPC_ABI is not properly defined"
-#endif
+
+#define PPC_STACK_ALIGN_POWER 4
+#define PPC_STACK_ALIGNMENT (1 << PPC_STACK_ALIGN_POWER)
 
 /*
  *  Assume PPC_HAS_FPU to be a synonym for _SOFT_FLOAT.



More information about the vc mailing list