chiark / gitweb /
base/asm-common.h, *.S: Include metadata for 64-bit Windows stack unwinding.
[catacomb] / base / asm-common.h
index 0b5f2238a2b658373f0b4715f01ab4e5ac78f989..0d32ccf90952bd5272236a75d4e12bf214078b85 100644 (file)
@@ -100,6 +100,14 @@ name:
 // Set the function hooks.
 #define FUNC_PREHOOK(_) .balign 16
 
+// On Windows, arrange to install stack-unwinding data.
+#if CPUFAM_AMD64 && ABI_WIN
+#  define FUNC_POSTHOOK(name) .seh_proc name
+#  define ENDFUNC_HOOK(_) .seh_endproc
+// Procedures are expected to invoke `.seh_setframe' if necessary, and
+// `.seh_pushreg' and friends, and `.seh_endprologue'.
+#endif
+
 // Don't use the wretched AT&T syntax.  It's festooned with pointless
 // punctuation, and all of the data movement is backwards.  Ugh!
        .intel_syntax noprefix