1: /*
2: $Id: m68k.h,v 1.2 1995/01/18 18:41:41 anton Exp $
3: Copyright 1992 by the ANSI figForth Development Group
4:
5: This is the machine-specific part for the 68000 and family
6: */
7:
8: #include "32bit.h"
9:
10: #ifdef DIRECT_THREADED
11:
12: #define CACHE_FLUSH(addr,size) cache_$clear()
13: /* Clearing the whole cache is a bit drastic, but this is the only
14: cache control available on the apollo.
15: */
16:
17: /* PFA gives the parameter field address corresponding to a cfa */
18: #define PFA(cfa) (((Cell *)cfa)+2)
19: /* PFA1 is a special version for use just after a NEXT1 */
20: #define PFA1(cfa) PFA(cfa)
21: /* CODE_ADDRESS is the address of the code jumped to through the code field */
22: #define CODE_ADDRESS(cfa) (*(Label *)(((char *)(cfa))+2))
23: /* MAKE_CF creates an appropriate code field at the cfa;
24: ca is the code address */
25: #define MAKE_CF(cfa,ca) ({short * _cfa = (short *)cfa; \
26: _cfa[0] = 0x4ef9; /* jmp.l */ \
27: *(long *)(_cfa+1) = (long)(ca);})
28:
29: /* this is the point where the does code starts if label points to the
30: * jump dodoes */
31: #define DOES_CODE(label) ((Xt *)(((char *)CODE_ADDRESS(label))+DOES_HANDLER_SIZE))
32:
33: /* this is a special version of DOES_CODE for use in dodoes */
34: #define DOES_CODE1(label) DOES_CODE(label)
35:
36: /* this stores a call dodoes at addr */
37: #define MAKE_DOES_HANDLER(addr) MAKE_CF(addr,symbols[DODOES])
38:
39: #define DOES_HANDLER_SIZE 8
40:
41: #define MAKE_DOES_CF(addr,doesp) MAKE_CF(addr,((int)(doesp)-8))
42: #endif
43:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>