1995-12-20 02:41:22 -08:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-12-20 02:41:22 -08:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1995-12-20 02:41:22 -08:00
|
|
|
/* Automatique. Distributed only by permission. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/* Machine-dependent macros to access the stack frames. */
|
|
|
|
|
|
|
|
#ifndef _stack_
|
|
|
|
#define _stack_
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TARGET_alpha
|
|
|
|
#define Saved_return_address(sp) *((long *)(sp - 8))
|
|
|
|
#define Already_scanned(sp, retaddr) (retaddr & 1)
|
|
|
|
#define Mark_scanned(sp, retaddr) (*((long *)(sp - 8)) = retaddr | 1)
|
|
|
|
#define Mask_already_scanned(retaddr) (retaddr & ~1)
|
1996-01-07 08:58:44 -08:00
|
|
|
#define Callback_link(sp) ((struct callback_link *)(sp + 16))
|
1995-12-20 02:41:22 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TARGET_sparc
|
|
|
|
#define Saved_return_address(sp) *((long *)(sp + 92))
|
|
|
|
#define Already_scanned(sp, retaddr) (retaddr & 1)
|
|
|
|
#define Mark_scanned(sp, retaddr) (*((long *)(sp + 92)) = retaddr | 1)
|
|
|
|
#define Mask_already_scanned(retaddr) (retaddr & ~1)
|
1996-01-07 08:58:44 -08:00
|
|
|
#define Callback_link(sp) ((struct callback_link *)(sp + 104))
|
1995-12-20 02:41:22 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TARGET_i386
|
|
|
|
#define Saved_return_address(sp) *((long *)(sp - 4))
|
1996-01-07 08:58:44 -08:00
|
|
|
#define Callback_link(sp) ((struct callback_link *)(sp + 8))
|
1995-12-20 02:41:22 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TARGET_mips
|
|
|
|
#define Saved_return_address(sp) *((long *)(sp - 4))
|
|
|
|
#define Already_scanned(sp, retaddr) (retaddr & 1)
|
|
|
|
#define Mark_scanned(sp, retaddr) (*((long *)(sp - 4)) = retaddr | 1)
|
|
|
|
#define Mask_already_scanned(retaddr) (retaddr & ~1)
|
1996-01-07 08:58:44 -08:00
|
|
|
#define Callback_link(sp) ((struct callback_link *)(sp + 8))
|
1995-12-20 02:41:22 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TARGET_hppa
|
|
|
|
#define Stack_grows_upwards
|
|
|
|
#define Saved_return_address(sp) *((long *)sp)
|
|
|
|
#define Already_scanned(sp, retaddr) (retaddr & 0x80000000)
|
|
|
|
#define Mark_scanned(sp, retaddr) (*((long *)sp) = retaddr | 0x80000000)
|
|
|
|
#define Mask_already_scanned(retaddr) (retaddr & ~0x80000000)
|
1996-01-07 08:58:44 -08:00
|
|
|
#define Callback_link(sp) ((struct callback_link *)(sp - 16))
|
1995-12-20 02:41:22 -08:00
|
|
|
#endif
|
|
|
|
|
1996-01-06 10:56:39 -08:00
|
|
|
#ifdef TARGET_power
|
|
|
|
#define Saved_return_address(sp) *((long *)(sp - 4))
|
|
|
|
#define Already_scanned(sp, retaddr) (retaddr & 1)
|
|
|
|
#define Mark_scanned(sp, retaddr) (*((long *)(sp - 4)) = retaddr | 1)
|
|
|
|
#define Mask_already_scanned(retaddr) (retaddr & ~1)
|
1996-07-03 11:39:36 -07:00
|
|
|
#ifdef SYS_aix
|
|
|
|
#define Trap_frame_size 24
|
|
|
|
#else
|
|
|
|
#define Trap_frame_size 8
|
|
|
|
#endif
|
|
|
|
#define Callback_link(sp) ((struct callback_link *)(sp + Trap_frame_size))
|
1996-01-06 10:56:39 -08:00
|
|
|
#endif
|
1995-12-20 02:41:22 -08:00
|
|
|
|
1996-01-07 08:58:44 -08:00
|
|
|
|
1995-12-20 02:41:22 -08:00
|
|
|
#endif /* _stack_ */
|