Project

General

Profile

Bug #5244 » flush_windows.patch

jurij (Jurij Smakov), 11/03/2011 07:58 AM

View differences:

configure.in 2011-10-30 15:51:33.000000000 +0000 → configure.in 2011-11-02 20:09:13.000000000 +0000
[CFLAGS="-mieee $CFLAGS"],
[osf*], # ccc
[CFLAGS="-ieee $CFLAGS"],
)])
)],
[sparc*], [AC_LIBOBJ([sparc])])
ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
if test "$ac_cv_header_net_socket_h" = yes; then
include/ruby/defines.h 2011-10-25 13:54:21.000000000 +0100 → include/ruby/defines.h 2011-11-02 20:07:56.000000000 +0000
/* MB_CUR_MAX will not work well in C locale */
#endif
#if defined(__sparc)
static inline void
flush_register_windows(void)
{
asm
#ifdef __GNUC__
volatile
#endif
# if SIZEOF_VOIDP > 4 /* workaround for Debian Sparc quirk */
("flushw")
# else
("ta 0x03")
# endif /* trap always to flush register windows if we are on a Sparc system */
;
}
# define FLUSH_REGISTER_WINDOWS flush_register_windows()
#if defined(sparc) || defined(__sparc__)
void flush_sparc_register_windows();
#define FLUSH_REGISTER_WINDOWS flush_sparc_register_windows()
#elif defined(__ia64)
void *rb_ia64_bsp(void);
void rb_ia64_flushrs(void);
sparc.c 1970-01-01 01:00:00.000000000 +0100 → sparc.c 2011-11-02 20:07:56.000000000 +0000
/********************************************************************
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.
See http://redmine.ruby-lang.org/issues/5244 for discussion.
*********************************************************************/
void flush_sparc_register_windows()
{
asm
#ifdef __GNUC__
__volatile__
#endif
/* This condition should be in sync with one in configure.in */
#if defined(__sparcv9) || defined(__sparc_v9__)
("flushw" : : : "%o7")
#else
("ta 0x03")
#endif
;
}
(2-2/2)