sparc.c

Go to the documentation of this file.
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 /*
00016  * gcc doesn't provide "asm" keyword if -ansi and the various -std options
00017  * are given.
00018  * http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
00019  */
00020 #ifndef __GNUC__
00021 #define __asm__ asm
00022 #endif
00023 
00024     __asm__
00025 #ifdef __GNUC__
00026     __volatile__
00027 #endif
00028 
00029 /* This condition should be in sync with one in configure.in */
00030 #if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__)
00031 # ifdef __GNUC__
00032     ("flushw" : : : "%o7")
00033 # else
00034     ("flushw")
00035 # endif /* __GNUC__ */
00036 #else
00037     ("ta 0x03")
00038 #endif
00039     ;
00040 }
00041 

Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7