mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* defines.h (FLUSH_REGISTER_WINDOWS): Make the flushw call an
inline function instead so it can be used as an expression. * eval.c (EXEC_TAG, THREAD_SAVE_CONTEXT): Consistently call FLUSH_REGISTER_WINDOWS before calling setjmp(). (I suspect that every setjmp() implementation should take care of register windows, though) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b369eea79f
commit
50e62191ec
4 changed files with 25 additions and 9 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Sun Jan 5 03:43:47 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* defines.h (FLUSH_REGISTER_WINDOWS): Make the flushw call an
|
||||
inline function instead so it can be used as an expression.
|
||||
|
||||
* eval.c (EXEC_TAG, THREAD_SAVE_CONTEXT): Consistently call
|
||||
FLUSH_REGISTER_WINDOWS before calling setjmp(). (I suspect that
|
||||
every setjmp() implementation should take care of register
|
||||
windows, though)
|
||||
|
||||
Sun Jan 5 03:12:32 2003 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* file.c (utimbuf): use utimbuf instead of _utimbuf if defined _WIN32.
|
||||
|
|
15
defines.h
15
defines.h
|
@ -138,13 +138,18 @@ void xfree _((void*));
|
|||
#endif
|
||||
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
# if defined(linux) || defined(__linux__)
|
||||
#define FLUSH_REGISTER_WINDOWS asm("ta 0x83")
|
||||
# elif defined(__FreeBSD__) && defined(__sparc64__)
|
||||
#define FLUSH_REGISTER_WINDOWS asm volatile("flushw" : :)
|
||||
static inline void
|
||||
flush_register_windows(void)
|
||||
{
|
||||
# if defined(__sparc_v9__) || defined(__arch64__)
|
||||
asm volatile ("flushw" : :);
|
||||
# elif defined(linux) || defined(__linux__)
|
||||
asm volatile ("ta 0x83");
|
||||
# else /* Solaris, OpenBSD, NetBSD, etc. */
|
||||
#define FLUSH_REGISTER_WINDOWS asm("ta 0x03")
|
||||
asm volatile ("ta 0x03");
|
||||
# endif /* trap always to flush register windows if we are on a Sparc system */
|
||||
}
|
||||
#define FLUSH_REGISTER_WINDOWS flush_register_windows()
|
||||
#else /* Not a sparc, so */
|
||||
#define FLUSH_REGISTER_WINDOWS /* empty -- nothing to do here */
|
||||
#endif
|
||||
|
|
5
eval.c
5
eval.c
|
@ -825,7 +825,7 @@ static struct tag *prot_tag;
|
|||
#define PROT_FUNC -1
|
||||
#define PROT_THREAD -2
|
||||
|
||||
#define EXEC_TAG() setjmp(prot_tag->buf)
|
||||
#define EXEC_TAG() (FLUSH_REGISTER_WINDOWS, setjmp(prot_tag->buf))
|
||||
|
||||
#define JUMP_TAG(st) do { \
|
||||
ruby_frame = prot_tag->frame; \
|
||||
|
@ -7753,7 +7753,8 @@ thread_switch(n)
|
|||
}
|
||||
|
||||
#define THREAD_SAVE_CONTEXT(th) \
|
||||
(rb_thread_save_context(th),thread_switch(setjmp((th)->context)))
|
||||
(rb_thread_save_context(th),\
|
||||
thread_switch((FLUSH_REGISTER_WINDOWS, setjmp((th)->context))))
|
||||
|
||||
static void rb_thread_restore_context _((rb_thread_t,int));
|
||||
|
||||
|
|
2
gc.c
2
gc.c
|
@ -374,7 +374,7 @@ static unsigned int STACK_LEVEL_MAX = 655300;
|
|||
# endif
|
||||
# define STACK_END (stack_end)
|
||||
#endif
|
||||
#ifdef __sparc__
|
||||
#if defined(sparc) || defined(__sparc__)
|
||||
# define STACK_LENGTH (rb_gc_stack_start - STACK_END + 0x80)
|
||||
#else
|
||||
# define STACK_LENGTH ((STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END\
|
||||
|
|
Loading…
Reference in a new issue