Author: tfaber
Date: Sat Oct 4 12:03:37 2014
New Revision: 64519
URL:
http://svn.reactos.org/svn/reactos?rev=64519&view=rev
Log:
[CRT]
- Add __fastfail intrinsic implementation for GCC and MSVC <= 2010. Patch by Timo
Kreuzer.
CORE-8419
Modified:
trunk/reactos/include/crt/mingw32/intrin_x86.h
trunk/reactos/include/crt/msc/intrin.h
Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Sat Oct 4 12:03:37 2014
@@ -1504,6 +1504,7 @@
__INTRIN_INLINE void _disable(void);
__INTRIN_INLINE void _enable(void);
__INTRIN_INLINE void __halt(void);
+__declspec(noreturn) __INTRIN_INLINE void __fastfail(unsigned int Code);
#ifdef __clang__
#define __debugbreak() __asm__("int $3")
@@ -1532,7 +1533,13 @@
__INTRIN_INLINE void __halt(void)
{
- __asm__("hlt\n\t" : : : "memory");
+ __asm__("hlt" : : : "memory");
+}
+
+__declspec(noreturn)
+__INTRIN_INLINE void __fastfail(unsigned int Code)
+{
+ __asm__("int $0x29" : : "c"(Code) : "memory");
}
/*** Protected memory management ***/
Modified: trunk/reactos/include/crt/msc/intrin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/msc/intrin.h?r…
==============================================================================
--- trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] Sat Oct 4 12:03:37 2014
@@ -587,6 +587,16 @@
#if (_MSC_VER >= 1700)
__declspec(noreturn) void __fastfail(unsigned int Code);
#pragma intrinsic(__fastfail)
+#else
+__declspec(noreturn) __forceinline
+void __fastfail(unsigned int Code)
+{
+ __asm
+ {
+ mov ecx, Code
+ int 29h
+ }
+}
#endif
#endif
#if defined(_M_ARM)