1/********************************************************************
2 Flush register windows on sparc.
3
4 This function is in a separate file to prevent inlining. The "flushw"
5 assembler instruction used on sparcv9 flushes all register windows
6 except the current one, so if it is inlined, the current register
7 window of the process executing the instruction will not be flushed
8 correctly.
9
10 See http://bugs.ruby-lang.org/issues/5244 for discussion.
11*********************************************************************/
12void
13rb_sparc_flush_register_windows(void)
14{
15    asm
16#ifdef __GNUC__
17    __volatile__
18#endif
19
20/* This condition should be in sync with one in configure.in */
21#if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__)
22# ifdef __GNUC__
23    ("flushw" : : : "%o7")
24# else
25    ("flushw")
26# endif /* __GNUC__ */
27#else
28    ("ta 0x03")
29#endif
30    ;
31}
32