Backport #5636 ยป backport-r33757-r33758.patch
ruby_1_9_3/include/ruby/defines.h (working copy) | ||
---|---|---|
268 | 268 |
#endif |
269 | 269 | |
270 | 270 |
#if defined(sparc) || defined(__sparc__) |
271 |
static inline void |
|
272 |
flush_register_windows(void) |
|
273 |
{ |
|
274 |
asm |
|
275 |
#ifdef __GNUC__ |
|
276 |
volatile |
|
277 |
#endif |
|
278 |
# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__) |
|
279 |
("flushw") |
|
280 |
# else |
|
281 |
("ta 0x03") |
|
282 |
# endif /* trap always to flush register windows if we are on a Sparc system */ |
|
283 |
; |
|
284 |
} |
|
285 |
# define FLUSH_REGISTER_WINDOWS flush_register_windows() |
|
271 |
void rb_sparc_flush_register_windows(void); |
|
272 |
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows() |
|
286 | 273 |
#elif defined(__ia64) |
287 | 274 |
void *rb_ia64_bsp(void); |
288 | 275 |
void rb_ia64_flushrs(void); |
ruby_1_9_3/configure.in (working copy) | ||
---|---|---|
1131 | 1131 |
[CFLAGS="-mieee $CFLAGS"], |
1132 | 1132 |
[osf*], # ccc |
1133 | 1133 |
[CFLAGS="-ieee $CFLAGS"], |
1134 |
)]) |
|
1134 |
)], |
|
1135 |
[sparc*], [AC_LIBOBJ([sparc])]) |
|
1135 | 1136 | |
1136 | 1137 |
ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no} |
1137 | 1138 |
if test "$ac_cv_header_net_socket_h" = yes; then |
ruby_1_9_3/sparc.c (revision 0) | ||
---|---|---|
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://redmine.ruby-lang.org/issues/5244 for discussion. |
|
11 |
*********************************************************************/ |
|
12 |
void rb_sparc_flush_register_windows(void) |
|
13 |
{ |
|
14 |
asm |
|
15 |
#ifdef __GNUC__ |
|
16 |
__volatile__ |
|
17 |
#endif |
|
18 | ||
19 |
/* This condition should be in sync with one in configure.in */ |
|
20 |
#if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__) |
|
21 |
# ifdef __GNUC__ |
|
22 |
("flushw" : : : "%o7") |
|
23 |
# else |
|
24 |
("flushw") |
|
25 |
# endif /* __GNUC__ */ |
|
26 |
#else |
|
27 |
("ta 0x03") |
|
28 |
#endif |
|
29 |
; |
|
30 |
} |