make things run in sparc-64

This commit is contained in:
Vitor Santos Costa 2010-04-16 12:12:23 +01:00
parent 1cf17cc2fe
commit d68c7854bd
2 changed files with 14 additions and 73 deletions

View File

@ -31,12 +31,12 @@
#undef PUSH_X
#endif
#ifdef __x86_64__
#undef PUSH_REGS
#ifdef sparc
#define PUSH_REGS 1
#undef PUSH_X
#endif
#if defined(sparc) || defined(__sparc)
#ifdef __x86_64__
#undef PUSH_REGS
#undef PUSH_X
#endif
@ -202,66 +202,7 @@ extern int Yap_stack_overflows;
#define YENV_ADDRESS (&(YENV))
#define MEM2YENV
#if defined(__GNUC__) && defined(sparc) && !defined(__NetBSD__) && !defined(THREADS)
#define P Yap_REGS.P_ /* prolog machine program counter */
#define YENV Yap_REGS.YENV_ /* current environment (may differ from ENV)*/
#define S Yap_REGS.S_ /* structure pointer */
register CELL *H asm ("g5");
#define TR Yap_REGS.TR_ /* latest choice point */
#define B Yap_REGS.B_ /* latest choice point */
#define CP Yap_REGS.CP_ /* continuation program counter */
#define HB Yap_REGS.HB_ /* heap (global) stack top at time of latest c.p. */
#define CreepFlag Yap_REGS.CreepFlag_
EXTERN inline void save_machine_regs(void) {
Yap_REGS.H_ = H;
}
EXTERN inline void restore_machine_regs(void) {
H = Yap_REGS.H_;
}
#define BACKUP_MACHINE_REGS() \
CELL *BK_H = H; \
restore_machine_regs()
#define RECOVER_MACHINE_REGS() \
save_machine_regs(); \
H = BK_H
EXTERN inline void save_H(void) {
Yap_REGS.H_ = H;
}
EXTERN inline void restore_H(void) {
H = Yap_REGS.H_;
}
#define BACKUP_H() CELL *BK_H = H; restore_H()
#define RECOVER_H() save_H(); H = BK_H
EXTERN inline void save_B(void) {
}
EXTERN inline void restore_B(void) {
}
#if defined(__svr4__)
#define BACKUP_B()
#define RECOVER_B()
#else
#define BACKUP_B()
#define RECOVER_B()
#endif
#define restore_TR()
#elif defined(__GNUC__) && defined(__alpha)
#if defined(__GNUC__) && defined(__alpha)
#define P Yap_REGS.P_ /* prolog machine program counter */
#define YENV Yap_REGS.YENV_ /* current environment (may differ from ENV) */

View File

@ -36,16 +36,6 @@ static char SccsId[] = "%W% %G%";
*/
#ifdef __GNUC__
#if defined(sparc) || defined(__sparc)
#define SHADOW_P 1
#define SHADOW_Y 1
#define SHADOW_S 1
#define SHADOW_REGS 1
#define SHADOW_CP 1
#define SHADOW_HB 1
#define USE_PREFETCH 1
#endif
#ifdef hppa
#define SHADOW_P 1
#define SHADOW_Y 1
@ -91,6 +81,16 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */
#endif /* BP_FREE */
#endif /* i386 */
#ifdef sparc
#define SHADOW_P 1
#ifdef BP_FREE
#undef BP_FREE
#endif
#define S_IN_MEM 1
#define Y_IN_MEM 1
#define TR_IN_MEM 1
#endif /* sparc_ */
#ifdef __x86_64__
#define SHADOW_P 1
#ifdef BP_FREE