1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

Merge of IA64 fix from CVS HEAD.

This commit is contained in:
Neil Jerram 2007-01-28 16:36:38 +00:00
parent 00b86455bd
commit 97084119ee
10 changed files with 114 additions and 42 deletions

View file

@ -52,11 +52,19 @@
* configure.in (AM_PROG_CC_C_O): New macro, needed by automake 1.10
for per-target cflags in libguile/Makefile.am.
2006-11-08 Ludovic Courtès <ludovic.courtes@laas.fr>
2006-11-08 Ludovic Courtès <ludovic.courtes@laas.fr>
* configure.in: Pass `bug-guile@gnu.org' as a third argument to
`AC_INIT'.
2006-10-25 Neil Jerram <neil@ossau.uklinux.net>
(Merged from CVS HEAD on 2007-01-28.)
IA64 HP-UX patch from Hrvoje Nikšić. (Thanks!)
* configure.in: New check for uca lib (needed for IA64 on HP-UX).
2006-10-06 Rob Browning <rlb@defaultvalue.org>
Guile 1.8.1 released.
@ -82,7 +90,7 @@
* configure.in (complex.h, complex double, csqrt): New tests.
2006-09-20 Ludovic Courtès <ludovic.courtes@laas.fr>
2006-09-20 Ludovic Courtès <ludovic.courtes@laas.fr>
* configure.in: Check for `isblank ()'.
@ -108,7 +116,7 @@
* configure.in (AC_CHECK_MEMBERS): Test struct tm.tm_gmtoff.
2006-06-13 Ludovic Courtès <ludovic.courtes@laas.fr>
2006-06-13 Ludovic Courtès <ludovic.courtes@laas.fr>
* NEWS: Mentioned the new behavior of `equal?' for structures.
@ -309,7 +317,7 @@
* acinclude.m4 (ACX_PTHREAD): New.
* configure.in: Use it instead of simply looking for -lpthread.
Thanks to Andreas Vögele!
Thanks to Andreas Vögele!
2004-09-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
@ -362,7 +370,7 @@
2004-07-09 Marius Vollmer <mvo@zagadka.de>
* configure.in: Bugfix: set SCM_I_GSC_T_UINTMAX, not
SCM_I_GSC_T_INTMAX in two places. Thanks to Andreas Vögele!
SCM_I_GSC_T_INTMAX in two places. Thanks to Andreas Vögele!
2004-07-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
@ -2081,7 +2089,7 @@ Tue Dec 14 09:12:22 1999 Greg J. Badros <gjb@cs.washington.edu>
1999-07-19 Jim Blandy <jimb@savonarola.red-bean.com>
Fixes for EMX from Mikael Ståldal.
Fixes for EMX from Mikael Ståldal.
* configure.in: Check for <io.h>.
* configure: Regenerated.

View file

@ -221,6 +221,7 @@ if test "$enable_elisp" = yes; then
else
SCM_I_GSC_ENABLE_ELISP=0
fi
AC_CHECK_LIB(uca, __uc_get_ar_bsp)
AC_C_CONST
@ -233,6 +234,7 @@ if test "$ac_cv_c_inline" != no; then
else
SCM_I_GSC_C_INLINE=NULL
fi
AC_CHECK_LIB(uca, __uc_get_ar_bsp)
AC_C_BIGENDIAN

View file

@ -171,6 +171,42 @@
"shared array" example in `vectors.test'). Reported by
Szavai Gyula.
2006-10-25 Neil Jerram <neil@ossau.uklinux.net>
(Merged from CVS HEAD on 2007-01-28.)
IA64 HP-UX GC patch from Hrvoje Nikšić. (Thanks!)
* threads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp() and
scm_ia64_register_backing_store_base() instead of Linux-specific
implementations.
* gc.h (scm_ia64_register_backing_store_base, scm_ia64_ar_bsp):
New declarations.
* gc.c (__libc_ia64_register_backing_store_base): Declaration
removed.
(scm_ia64_register_backing_store_base, scm_ia64_ar_bsp): New, with
implementations for Linux and HP-UX.
* coop-pthreads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp()
and scm_ia64_register_backing_store_base() instead of
Linux-specific implementations.
* continuations.h (__libc_ia64_register_backing_store_base):
Declaration removed.
(scm_t_contregs): New "fresh" field.
* continuations.c (ia64_getcontext): Removed.
(scm_make_continuation): Use continuation fresh field instead of
interpreting getcontext return values (which isn't portable). Use
scm_ia64_ar_bsp() and scm_ia64_register_backing_store_base()
instead of Linux-specific implementations.
(copy_stack_and_call): Use scm_ia64_register_backing_store_base()
instead of Linux-specific implementation.
* _scm.h (__ia64__): Also detect __ia64.
2006-10-03 Kevin Ryde <user42@zip.com.au>
* eval.c (SCM_APPLY): For scm_tc7_subr_2o, throw wrong-num-args on 0

View file

@ -54,6 +54,9 @@
and differences between _scm.h and __scm.h.
**********************************************************************/
#if defined(__ia64) && !defined(__ia64__)
# define __ia64__
#endif
#if HAVE_CONFIG_H
# include <config.h>

View file

@ -92,22 +92,6 @@ continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED)
return 1;
}
#ifdef __ia64__
/* Extern declaration of getcontext()/setcontext() in order to redefine
getcontext() since on ia64-linux the second return value indicates whether
it returned from getcontext() itself or by running setcontext(). */
struct rv
{
long retval;
long first_return;
};
#ifdef __GNUC__
__attribute__ ((returns_twice))
#endif /* __GNUC__ */
extern struct rv ia64_getcontext (ucontext_t *) __asm__ ("getcontext");
#endif /* __ia64__ */
/* this may return more than once: the first time with the escape
procedure, then subsequently with the value to be passed to the
continuation. */
@ -120,9 +104,6 @@ scm_make_continuation (int *first)
scm_t_contregs *continuation;
long stack_size;
SCM_STACKITEM * src;
#ifdef __ia64__
struct rv rv;
#endif /* __ia64__ */
SCM_FLUSH_REGISTER_WINDOWS;
stack_size = scm_stack_size (thread->continuation_base);
@ -144,20 +125,23 @@ scm_make_continuation (int *first)
memcpy (continuation->stack, src, sizeof (SCM_STACKITEM) * stack_size);
#ifdef __ia64__
rv = ia64_getcontext (&continuation->ctx);
if (rv.first_return)
continuation->fresh = 1;
getcontext (&continuation->ctx);
if (continuation->fresh)
{
continuation->backing_store_size =
continuation->ctx.uc_mcontext.sc_ar_bsp -
(unsigned long) __libc_ia64_register_backing_store_base;
continuation->backing_store_size =
(char *) scm_ia64_ar_bsp(&continuation->ctx)
-
(char *) scm_ia64_register_backing_store_base ();
continuation->backing_store = NULL;
continuation->backing_store =
scm_gc_malloc (continuation->backing_store_size,
"continuation backing store");
memcpy (continuation->backing_store,
(void *) __libc_ia64_register_backing_store_base,
(void *) scm_ia64_register_backing_store_base (),
continuation->backing_store_size);
*first = 1;
continuation->fresh = 0;
return cont;
}
else
@ -252,7 +236,7 @@ copy_stack_and_call (scm_t_contregs *continuation, SCM val,
continuation->throw_value = val;
#ifdef __ia64__
memcpy ((void *) __libc_ia64_register_backing_store_base,
memcpy (scm_ia64_register_backing_store_base (),
continuation->backing_store,
continuation->backing_store_size);
setcontext (&continuation->ctx);

View file

@ -27,7 +27,6 @@
#ifdef __ia64__
#include <signal.h>
#include <ucontext.h>
extern unsigned long * __libc_ia64_register_backing_store_base;
#endif /* __ia64__ */
@ -48,6 +47,7 @@ typedef struct
SCM dynenv;
#ifdef __ia64__
ucontext_t ctx;
int fresh;
void *backing_store;
unsigned long backing_store_size;
#endif /* __ia64__ */

View file

@ -31,6 +31,7 @@
#include "libguile/eval.h"
#include "libguile/async.h"
#include "libguile/ports.h"
#include "libguile/gc.h"
#undef DEBUG
@ -847,8 +848,8 @@ scm_threads_init (SCM_STACKITEM *base)
scm_mark_locations ((SCM_STACKITEM *) &ctx.uc_mcontext, \
((size_t) (sizeof (SCM_STACKITEM) - 1 + sizeof ctx.uc_mcontext) \
/ sizeof (SCM_STACKITEM))); \
bot = (SCM_STACKITEM *) __libc_ia64_register_backing_store_base; \
top = (SCM_STACKITEM *) ctx.uc_mcontext.sc_ar_bsp; \
bot = (SCM_STACKITEM *) scm_ia64_register_backing_store_base (); \
top = (SCM_STACKITEM *) scm_ia64_ar_bsp (&ctx); \
scm_mark_locations (bot, top - bot); } while (0)
#else
# define SCM_MARK_BACKING_STORE()

View file

@ -28,11 +28,6 @@
#include <string.h>
#include <assert.h>
#ifdef __ia64__
#include <ucontext.h>
extern unsigned long * __libc_ia64_register_backing_store_base;
#endif
#include "libguile/_scm.h"
#include "libguile/eval.h"
#include "libguile/stime.h"
@ -1030,6 +1025,44 @@ scm_init_gc ()
#include "libguile/gc.x"
}
#ifdef __ia64__
# ifdef __hpux
# include <sys/param.h>
# include <sys/pstat.h>
void *
scm_ia64_register_backing_store_base (void)
{
struct pst_vm_status vm_status;
int i = 0;
while (pstat_getprocvm (&vm_status, sizeof (vm_status), 0, i++) == 1)
if (vm_status.pst_type == PS_RSESTACK)
return (void *) vm_status.pst_vaddr;
abort ();
}
void *
scm_ia64_ar_bsp (const void *ctx)
{
uint64_t bsp;
__uc_get_ar_bsp(ctx, &bsp);
return (void *) bsp;
}
# endif /* hpux */
# ifdef linux
# include <ucontext.h>
void *
scm_ia64_register_backing_store_base (void)
{
extern void *__libc_ia64_register_backing_store_base;
return __libc_ia64_register_backing_store_base;
}
void *
scm_ia64_ar_bsp (const void *opaque)
{
ucontext_t *ctx = opaque;
return (void *) ctx->uc_mcontext.sc_ar_bsp;
}
# endif /* linux */
#endif /* __ia64__ */
void
scm_gc_sweep (void)

View file

@ -246,6 +246,11 @@ SCM_API scm_i_pthread_mutex_t scm_i_gc_admin_mutex;
#define scm_gc_running_p (SCM_I_CURRENT_THREAD->gc_running_p)
SCM_API scm_i_pthread_mutex_t scm_i_sweep_mutex;
#ifdef __ia64__
void *scm_ia64_register_backing_store_base (void);
void *scm_ia64_ar_bsp (const void *);
#endif
#if (SCM_ENABLE_DEPRECATED == 1)

View file

@ -1352,8 +1352,8 @@ SCM_DEFINE (scm_broadcast_condition_variable, "broadcast-condition-variable", 1,
scm_mark_locations ((SCM_STACKITEM *) &ctx.uc_mcontext, \
((size_t) (sizeof (SCM_STACKITEM) - 1 + sizeof ctx.uc_mcontext) \
/ sizeof (SCM_STACKITEM))); \
bot = (SCM_STACKITEM *) __libc_ia64_register_backing_store_base; \
top = (SCM_STACKITEM *) ctx.uc_mcontext.sc_ar_bsp; \
bot = (SCM_STACKITEM *) scm_ia64_register_backing_store_base (); \
top = (SCM_STACKITEM *) scm_ia64_ar_bsp (&ctx); \
scm_mark_locations (bot, top - bot); } while (0)
#else
# define SCM_MARK_BACKING_STORE()