summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-04 18:48:24 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-04 18:48:24 +0000
commit50e62191ecf65a7118041447da8e629b2ff62e7a (patch)
treed4c4bf1801116dffb61ad9f214dc0f83c42cace6 /defines.h
parentb369eea79f5ef06a8b314e5ef3a25a0db36db410 (diff)
* defines.h (FLUSH_REGISTER_WINDOWS): Make the flushw call an
inline function instead so it can be used as an expression. * eval.c (EXEC_TAG, THREAD_SAVE_CONTEXT): Consistently call FLUSH_REGISTER_WINDOWS before calling setjmp(). (I suspect that every setjmp() implementation should take care of register windows, though) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/defines.h b/defines.h
index cb488d7..0d115a4 100644
--- a/defines.h
+++ b/defines.h
@@ -138,15 +138,20 @@ void xfree _((void*));
#endif
#if defined(sparc) || defined(__sparc__)
-# if defined(linux) || defined(__linux__)
-#define FLUSH_REGISTER_WINDOWS asm("ta 0x83")
-# elif defined(__FreeBSD__) && defined(__sparc64__)
-#define FLUSH_REGISTER_WINDOWS asm volatile("flushw" : :)
+static inline void
+flush_register_windows(void)
+{
+# if defined(__sparc_v9__) || defined(__arch64__)
+ asm volatile ("flushw" : :);
+# elif defined(linux) || defined(__linux__)
+ asm volatile ("ta 0x83");
# else /* Solaris, OpenBSD, NetBSD, etc. */
-#define FLUSH_REGISTER_WINDOWS asm("ta 0x03")
+ asm volatile ("ta 0x03");
# endif /* trap always to flush register windows if we are on a Sparc system */
+}
+#define FLUSH_REGISTER_WINDOWS flush_register_windows()
#else /* Not a sparc, so */
-#define FLUSH_REGISTER_WINDOWS /* empty -- nothing to do here */
+#define FLUSH_REGISTER_WINDOWS /* empty -- nothing to do here */
#endif
#if defined(DOSISH)