Ruby
2.0.0p247(2013-06-27revision41674)
|
00001 /******************************************************************** 00002 Flush register windows on sparc. 00003 00004 This function is in a separate file to prevent inlining. The "flushw" 00005 assembler instruction used on sparcv9 flushes all register windows 00006 except the current one, so if it is inlined, the current register 00007 window of the process executing the instruction will not be flushed 00008 correctly. 00009 00010 See http://bugs.ruby-lang.org/issues/5244 for discussion. 00011 *********************************************************************/ 00012 void 00013 rb_sparc_flush_register_windows(void) 00014 { 00015 asm 00016 #ifdef __GNUC__ 00017 __volatile__ 00018 #endif 00019 00020 /* This condition should be in sync with one in configure.in */ 00021 #if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__) 00022 # ifdef __GNUC__ 00023 ("flushw" : : : "%o7") 00024 # else 00025 ("flushw") 00026 # endif /* __GNUC__ */ 00027 #else 00028 ("ta 0x03") 00029 #endif 00030 ; 00031 } 00032