- Add __fastfail intrinsic implementation for GCC and MSVC <= 2010. Patch by Timo Kreuzer.
CORE-8419

svn path=/trunk/; revision=64519
This commit is contained in:
Thomas Faber 2014-10-04 12:03:37 +00:00
parent 9d68ddc78c
commit 6acee80eb2
2 changed files with 18 additions and 1 deletions

View file

@ -1504,6 +1504,7 @@ __INTRIN_INLINE void __int2c(void);
__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 _enable(void)
__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 ***/

View file

@ -587,6 +587,16 @@ void __ud2(void);
#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)