From 46f90fc6aae02d4e588877ad8f277fd0966defed Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 13 Feb 2006 16:58:55 +0000 Subject: [PATCH] fix register recovery after ^c on Macs fix 64 bit complaints. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1542 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/arith1.c | 1 + C/exec.c | 10 +++------- H/Regs.h | 17 ++++++++++++++++- changes-5.1.html | 8 ++++---- library/Tries/yap_tries.c | 4 ++-- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/C/arith1.c b/C/arith1.c index 42f45ee15..efdcf8d64 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -1581,6 +1581,7 @@ p_integer(Term t E_ARGS) #ifdef USE_GMP MP_INT *new = TMP_BIG(); + fprintf(stderr,"dbl is %g\n",dbl); mpz_init_set_d(new, dbl); RBIG(new); #else diff --git a/C/exec.c b/C/exec.c index d86c4afce..7d519be6a 100644 --- a/C/exec.c +++ b/C/exec.c @@ -1239,16 +1239,12 @@ exec_absmi(int top) /* otherwise, SetDBForThrow will fail entering critical mode */ Yap_PrologMode = UserMode; /* find out where to cut to */ -#if defined(__GNUC__) -#if defined(hppa) || defined(__alpha) /* siglongjmp resets the TR hardware register */ + /* TR and B are crucial, they might have been changed, or not */ restore_TR(); -#endif -#if defined(__alpha) - /* siglongjmp resets the H hardware register */ + restore_B(); + /* H is not so important, because we're gonna backtrack */ restore_H(); -#endif -#endif yap_flags[SPY_CREEP_FLAG] = 0; LOCK(SignalLock); CreepFlag = CalculateStackGap(); diff --git a/H/Regs.h b/H/Regs.h index 468277ba3..4821ff98d 100644 --- a/H/Regs.h +++ b/H/Regs.h @@ -10,7 +10,7 @@ * File: Regs.h * * mods: * * comments: YAP abstract machine registers * -* version: $Id: Regs.h,v 1.35 2006-02-01 13:28:56 vsc Exp $ * +* version: $Id: Regs.h,v 1.36 2006-02-13 16:58:55 vsc Exp $ * *************************************************************************/ @@ -445,6 +445,8 @@ EXTERN inline void restore_B(void) { #define RECOVER_B() save_B(); B = BK_B +#define restore_TR() + #elif defined(__GNUC__) && defined(hppa) #define P Yap_REGS.P_ /* prolog machine program counter */ @@ -627,6 +629,17 @@ EXTERN inline void restore_B(void) { #define RECOVER_B() save_B(); B = BK_B +EXTERN void restore_TR(void); +EXTERN void save_TR(void); + +EXTERN inline void save_TR(void) { + Yap_REGS.TR_ = TR; +} + +EXTERN inline void restore_TR(void) { + TR = Yap_REGS.TR_; +} + #else #define CP Yap_REGS.CP_ /* continuation program counter */ @@ -669,6 +682,8 @@ EXTERN inline void restore_B(void) { #define RECOVER_B() +#define restore_TR() + #endif #define AuxSp Yap_REGS.AuxSp_ diff --git a/changes-5.1.html b/changes-5.1.html index f8e42c5d0..903f2f460 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -16,8 +16,9 @@

Yap-5.1.0: