From b3ab8c804ef4c0e2d71ccfdb78f3b45fc6f57be6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 3 Sep 2007 10:22:13 +0000 Subject: [PATCH] Align stack to 16 bytes on mips svn path=/trunk/; revision=28810 --- reactos/lib/3rdparty/mingw/crt1.c | 7 +++++++ reactos/lib/3rdparty/mingw/wcrt1.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/reactos/lib/3rdparty/mingw/crt1.c b/reactos/lib/3rdparty/mingw/crt1.c index 706f6f5ba90..d7961b8b0eb 100644 --- a/reactos/lib/3rdparty/mingw/crt1.c +++ b/reactos/lib/3rdparty/mingw/crt1.c @@ -215,9 +215,16 @@ __mingw_CRTStartup (void) /* 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 diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c index a9a71db69c4..25a6306e3d6 100644 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ b/reactos/lib/3rdparty/mingw/wcrt1.c @@ -216,10 +216,13 @@ __mingw_wCRTStartup (void) /* 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 -- 2.17.1