[ros-diffs] [hpoussin] 28810: Align stack to 16 bytes on mips

hpoussin at svn.reactos.org hpoussin at svn.reactos.org
Mon Sep 3 12:22:13 CEST 2007


Author: hpoussin
Date: Mon Sep  3 14:22:13 2007
New Revision: 28810

URL: http://svn.reactos.org/svn/reactos?rev=28810&view=rev
Log:
Align stack to 16 bytes on mips

Modified:
    trunk/reactos/lib/3rdparty/mingw/crt1.c
    trunk/reactos/lib/3rdparty/mingw/wcrt1.c

Modified: trunk/reactos/lib/3rdparty/mingw/crt1.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/mingw/crt1.c?rev=28810&r1=28809&r2=28810&view=diff
==============================================================================
--- trunk/reactos/lib/3rdparty/mingw/crt1.c (original)
+++ trunk/reactos/lib/3rdparty/mingw/crt1.c Mon Sep  3 14:22:13 2007
@@ -215,9 +215,16 @@
    /* Adust references to dllimported data that have non-zero offsets.  */
   _pei386_runtime_relocator ();
 
+#if defined(__i386__)
   /* Align the stack to 16 bytes for the sake of SSE ops in main
      or in functions inlined into main.  */
   asm  __volatile__  ("andl $-16, %%esp" : : : "%esp");
+#elif defined(__mips__)
+  /* Align the stack to 16 bytes */
+  asm  __volatile__  ("andi %sp,%sp,-16" : : : "%sp");
+#else
+#error Unsupported architecture
+#endif
 
   /*
    * Call the main function. If the user does not supply one

Modified: trunk/reactos/lib/3rdparty/mingw/wcrt1.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/mingw/wcrt1.c?rev=28810&r1=28809&r2=28810&view=diff
==============================================================================
--- trunk/reactos/lib/3rdparty/mingw/wcrt1.c (original)
+++ trunk/reactos/lib/3rdparty/mingw/wcrt1.c Mon Sep  3 14:22:13 2007
@@ -216,10 +216,13 @@
    /* Adust references to dllimported data that have non-zero offsets.  */
   _pei386_runtime_relocator ();
 
+#if defined(__i386__)
   /* Align the stack to 16 bytes for the sake of SSE ops in main
      or in functions inlined into main.  */
-#if defined(__i386__)
   asm  __volatile__  ("andl $-16, %%esp" : : : "%esp");
+#elif defined(__mips__)
+  /* Align the stack to 16 bytes */
+  asm  __volatile__  ("andi %sp,%sp,-16" : : : "%sp");
 #else
 #error Unsupported architecture
 #endif




More information about the Ros-diffs mailing list