Hi, On 2022-01-19 12:06, Jinoh Kang wrote:
+#if defined(__GNUC__) +#if defined(__x86_64__) +static FORCEINLINE DECLSPEC_NORETURN void __fastfail(unsigned int code) +{ + register ULONGLONG val __asm__("rcx") = code; + __asm__ __volatile__( "int $0x29" :: "r" (val) : "memory" );
Any reason to prefer this "manual move" into a register over specifying r/ecx as an input into the assembly block? I.e. __asm__ __volatile__( "int $0x29" :: "c" ((ULONG_PTR)code) : "memory" ); As an added bonus, that would make the function identical between x64 and x86. (The cast to ULONG_PTR is to make the compiler aware that the upper bits of rcx _must_ be zero, rather than just letting it happen incidentally.) Something similar might be applicable to ARM, too, but I'm not sure. Thanks, Thomas