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
This commit is contained in:
vsc 2006-02-13 16:58:55 +00:00
parent bc82175e5e
commit 46f90fc6aa
5 changed files with 26 additions and 14 deletions

View File

@ -1581,6 +1581,7 @@ p_integer(Term t E_ARGS)
#ifdef USE_GMP #ifdef USE_GMP
MP_INT *new = TMP_BIG(); MP_INT *new = TMP_BIG();
fprintf(stderr,"dbl is %g\n",dbl);
mpz_init_set_d(new, dbl); mpz_init_set_d(new, dbl);
RBIG(new); RBIG(new);
#else #else

View File

@ -1239,16 +1239,12 @@ exec_absmi(int top)
/* otherwise, SetDBForThrow will fail entering critical mode */ /* otherwise, SetDBForThrow will fail entering critical mode */
Yap_PrologMode = UserMode; Yap_PrologMode = UserMode;
/* find out where to cut to */ /* find out where to cut to */
#if defined(__GNUC__)
#if defined(hppa) || defined(__alpha)
/* siglongjmp resets the TR hardware register */ /* siglongjmp resets the TR hardware register */
/* TR and B are crucial, they might have been changed, or not */
restore_TR(); restore_TR();
#endif restore_B();
#if defined(__alpha) /* H is not so important, because we're gonna backtrack */
/* siglongjmp resets the H hardware register */
restore_H(); restore_H();
#endif
#endif
yap_flags[SPY_CREEP_FLAG] = 0; yap_flags[SPY_CREEP_FLAG] = 0;
LOCK(SignalLock); LOCK(SignalLock);
CreepFlag = CalculateStackGap(); CreepFlag = CalculateStackGap();

View File

@ -10,7 +10,7 @@
* File: Regs.h * * File: Regs.h *
* mods: * * mods: *
* comments: YAP abstract machine registers * * 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 RECOVER_B() save_B(); B = BK_B
#define restore_TR()
#elif defined(__GNUC__) && defined(hppa) #elif defined(__GNUC__) && defined(hppa)
#define P Yap_REGS.P_ /* prolog machine program counter */ #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 #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 #else
#define CP Yap_REGS.CP_ /* continuation program counter */ #define CP Yap_REGS.CP_ /* continuation program counter */
@ -669,6 +682,8 @@ EXTERN inline void restore_B(void) {
#define RECOVER_B() #define RECOVER_B()
#define restore_TR()
#endif #endif
#define AuxSp Yap_REGS.AuxSp_ #define AuxSp Yap_REGS.AuxSp_

View File

@ -16,8 +16,9 @@
<h2>Yap-5.1.0:</h2> <h2>Yap-5.1.0:</h2>
<ul> <ul>
<li> FIXED: handle heap overflow from huge atoms in <li> FIXED: ^c should take care about TR and B.</li>
Yap_LookupAtom/scanner (Nuno Fonseca).</li> <li> FIXED: don't pass a pointer to a mpz_t. (Nuno Fonseca)</li>
<li> FIXED: handle heap overflow from huge atoms in Yap_LookupAtom/scanner (Nuno Fonseca).</li>
<li> FIXED: bignum was using int where should be long int (Roberto Bagnara).</li> <li> FIXED: bignum was using int where should be long int (Roberto Bagnara).</li>
<li> NEW: x86_64 should have registers, right? First cut at using them.</li> <li> NEW: x86_64 should have registers, right? First cut at using them.</li>
<li> FIXED: call_n would break under 64 bits, an int problem.</li> <li> FIXED: call_n would break under 64 bits, an int problem.</li>
@ -26,8 +27,7 @@ Yap_LookupAtom/scanner (Nuno Fonseca).</li>
<li> FIXED: ok, MkBigInt shouldn't free the bigint.</li> <li> FIXED: ok, MkBigInt shouldn't free the bigint.</li>
<li> FIXED: MkBigInt already frees bigint.</li> <li> FIXED: MkBigInt already frees bigint.</li>
<li> FIXED: don't pass a pointer to a mpz_t. (Nuno Fonseca)</li> <li> FIXED: don't pass a pointer to a mpz_t. (Nuno Fonseca)</li>
<li> FIXED: YENV may be an HW register ('d break some tabling code) <li> FIXED: YENV may be an HW register (could break some tabling code) (Remko Troncon) </li>
(Remko Troncon) </li>
<li> FIXED: All YAAM instructions are now brackedted, so Op introduced an { and EndOp intr <li> FIXED: All YAAM instructions are now brackedted, so Op introduced an { and EndOp intr
oduces an }. This is because Ricardo assumes that. </li> oduces an }. This is because Ricardo assumes that. </li>
<li> FIXED: compile attvars when COROUTING is undefined. </li> <li> FIXED: compile attvars when COROUTING is undefined. </li>

View File

@ -86,7 +86,7 @@ static int p_open_trie(void) {
/* open trie */ /* open trie */
node = open_trie(); node = open_trie();
if (!YAP_Unify(arg_trie, YAP_MkIntTerm((int) node))) if (!YAP_Unify(arg_trie, YAP_MkIntTerm((YAP_Int) node)))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
@ -136,7 +136,7 @@ static int p_put_trie_entry(void) {
/* put trie entry */ /* put trie entry */
node = put_trie_entry((TrNode) YAP_IntOfTerm(arg_trie), arg_entry, mode); node = put_trie_entry((TrNode) YAP_IntOfTerm(arg_trie), arg_entry, mode);
if (!YAP_Unify(arg_ref, YAP_MkIntTerm((int) node))) if (!YAP_Unify(arg_ref, YAP_MkIntTerm((YAP_Int) node)))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }