summaryrefslogtreecommitdiffstats
path: root/js/src/ctypes/libffi/testsuite/libffi.go/static-chain.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/ctypes/libffi/testsuite/libffi.go/static-chain.h')
-rw-r--r--js/src/ctypes/libffi/testsuite/libffi.go/static-chain.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/ctypes/libffi/testsuite/libffi.go/static-chain.h b/js/src/ctypes/libffi/testsuite/libffi.go/static-chain.h
new file mode 100644
index 0000000000..3675b40a54
--- /dev/null
+++ b/js/src/ctypes/libffi/testsuite/libffi.go/static-chain.h
@@ -0,0 +1,19 @@
+#ifdef __aarch64__
+# define STATIC_CHAIN_REG "x18"
+#elif defined(__alpha__)
+# define STATIC_CHAIN_REG "$1"
+#elif defined(__arm__)
+# define STATIC_CHAIN_REG "ip"
+#elif defined(__sparc__)
+# if defined(__arch64__) || defined(__sparcv9)
+# define STATIC_CHAIN_REG "g5"
+# else
+# define STATIC_CHAIN_REG "g2"
+# endif
+#elif defined(__x86_64__)
+# define STATIC_CHAIN_REG "r10"
+#elif defined(__i386__)
+# ifndef ABI_NUM
+# define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */
+# endif
+#endif