summaryrefslogtreecommitdiff
path: root/sparc.c
blob: fe9dd684f449836922903d0a1ebf91fa510531c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/********************************************************************
 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 https://bugs.ruby-lang.org/issues/5244 for discussion.
*********************************************************************/
void
rb_sparc_flush_register_windows(void)
{
/*
 * gcc doesn't provide "asm" keyword if -ansi and the various -std options
 * are given.
 * https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
 */
#ifndef __GNUC__
#define __asm__ asm
#endif

    __asm__
#ifdef __GNUC__
    __volatile__
#endif

/* This condition should be in sync with one in configure.ac */
#if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__)
# ifdef __GNUC__
    ("flushw" : : : "%o7")
# else
    ("flushw")
# endif /* __GNUC__ */
#else
    ("ta 0x03")
#endif
    ;
}
'2019-09-03 14:22:44 +0900'>2019-09-03Avoid defining unused instructionsTakashi Kokubun 2018-10-14vm_opts.h: share USE_IC_FOR_IVAR as OPT_IC_FOR_IVARk0kubun 2018-09-26fix OPT_CALL_THREADED_CODE issue.ko1 2017-12-24Remove "trace_instruction" compile option.ko1 2015-11-25iseq.h: rename membernobu 2015-10-23* iseq.c (make_compile_option_value): include frozen_string_literal*ko1 2015-08-21* vm_opts.h, iseq.c, iseq.h: add compile option to force frozenko1 2013-04-22fix minor code comment typostmm1