PERFORCE change 227731 for review

Philip Withnall prw35 at FreeBSD.org
Mon Apr 15 14:21:14 UTC 2013


http://p4web.freebsd.org/@@227731?ac=10

Change 227731 by prw35 at pwithnall_zenith on 2013/04/15 14:20:28

	Force 32-byte stack alignment in GCC on MIPS
	
	This is necessary for CHERI, where capabilities must be 32-byte aligned,
	so the stack must always be 32-byte aligned to allow capabilities to be
	stored there.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/contrib/gcc/config/mips/mips.h#2 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/contrib/gcc/config/mips/mips.h#2 (text+ko) ====

@@ -2000,9 +2000,10 @@
 #define EPILOGUE_USES(REGNO) ((REGNO) == 31)
 
 /* Treat LOC as a byte offset from the stack pointer and round it up
-   to the next fully-aligned offset.  */
-#define MIPS_STACK_ALIGN(LOC) \
-  (TARGET_NEWABI ? ((LOC) + 15) & -16 : ((LOC) + 7) & -8)
+   to the next fully-aligned offset.
+   For CHERI, this has to be 32 bytes to allow capabilities to be
+   stored on the stack.  */
+#define MIPS_STACK_ALIGN(LOC) (((LOC) + 31) & -32)
 
 
 /* Implement `va_start' for varargs and stdarg.  */


More information about the p4-projects mailing list