2011-11-15 08:42:31 +04:00
|
|
|
/********************************************************************
|
|
|
|
Flush register windows on sparc.
|
|
|
|
|
|
|
|
This function is in a separate file to prevent inlining. The "flushw"
|
|
|
|
assembler instruction used on sparcv9 flushes all register windows
|
|
|
|
except the current one, so if it is inlined, the current register
|
|
|
|
window of the process executing the instruction will not be flushed
|
|
|
|
correctly.
|
|
|
|
|
2011-12-20 01:07:09 +04:00
|
|
|
See http://bugs.ruby-lang.org/issues/5244 for discussion.
|
2011-11-15 08:42:31 +04:00
|
|
|
*********************************************************************/
|
2012-06-27 09:37:15 +04:00
|
|
|
void
|
|
|
|
rb_sparc_flush_register_windows(void)
|
2011-11-15 08:42:31 +04:00
|
|
|
{
|
2013-04-27 14:06:20 +04:00
|
|
|
/*
|
|
|
|
* gcc doesn't provide "asm" keyword if -ansi and the various -std options
|
|
|
|
* are given.
|
|
|
|
* http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
|
|
|
|
*/
|
|
|
|
#ifndef __GNUC__
|
|
|
|
#define __asm__ asm
|
|
|
|
#endif
|
|
|
|
|
|
|
|
__asm__
|
2011-11-15 08:42:31 +04:00
|
|
|
#ifdef __GNUC__
|
|
|
|
__volatile__
|
|
|
|
#endif
|
|
|
|
|
2017-09-29 16:21:17 +03:00
|
|
|
/* This condition should be in sync with one in configure.ac */
|
2011-11-15 08:42:31 +04:00
|
|
|
#if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__)
|
|
|
|
# ifdef __GNUC__
|
|
|
|
("flushw" : : : "%o7")
|
|
|
|
# else
|
|
|
|
("flushw")
|
|
|
|
# endif /* __GNUC__ */
|
|
|
|
#else
|
|
|
|
("ta 0x03")
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
}
|