Annotation of gforth/arch/m68k/machine.h, revision 1.20
1.1 anton 1: /* This is the machine-specific part for the 68000 and family
2:
1.19 anton 3: Copyright (C) 1995,1996,1997,1998,2000,2003,2005 Free Software Foundation, Inc.
1.1 anton 4:
5: This file is part of Gforth.
6:
7: Gforth is free software; you can redistribute it and/or
8: modify it under the terms of the GNU General Public License
1.20 ! anton 9: as published by the Free Software Foundation, either version 3
1.1 anton 10: of the License, or (at your option) any later version.
11:
12: This program is distributed in the hope that it will be useful,
13: but WITHOUT ANY WARRANTY; without even the implied warranty of
14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: GNU General Public License for more details.
16:
17: You should have received a copy of the GNU General Public License
1.20 ! anton 18: along with this program; if not, see http://www.gnu.org/licenses/.
1.1 anton 19: */
20:
1.2 anton 21: #if !defined USE_NO_TOS && !defined USE_TOS
22: #define USE_TOS
23: #endif
24:
1.3 jwilke 25: #include "../generic/machine.h"
1.8 anton 26: #include <sys/types.h>
1.1 anton 27:
28: /* Clearing the whole cache is a bit drastic, but this is the only
29: * cache control available on the apollo and NeXT
30: */
31: #if defined(apollo)
32: # define FLUSH_ICACHE(addr,size) cache_$clear()
1.17 anton 33: #elif defined(__NetBSD__)
34: # define FLUSH_ICACHE(addr,size) do { \
35: register void *addr_ asm("a1") = (addr); \
36: register int size_ asm("d1") = (size); \
37: register int cmd_ asm("d0") = 0x80000004; \
38: asm volatile(" trap #12" \
39: : "=a" (addr_), "=d" (size_), "=d" (cmd_) \
40: : "0" (addr_), "1" (size_), "2" (cmd_) : "a0"); \
41: } while (0)
42: #elif defined(NeXT) || defined(sun)
1.1 anton 43: # define FLUSH_ICACHE(addr,size) asm("trap #2");
44: #elif defined(hpux)
45: # include <sys/cache.h>
46: # define FLUSH_ICACHE(addr,size) cachectl(CC_IPURGE,(addr),(size))
1.2 anton 47: #elif defined(linux)
48: #include <asm/cachectl.h>
49: extern int cacheflush(void *, int, int, size_t);
50: #define FLUSH_ICACHE(addr,size) \
51: cacheflush(addr, FLUSH_SCOPE_LINE, FLUSH_CACHE_INSN, (size_t)(size) + 15)
1.4 anton 52: #elif defined(amigaos)
53: # define FLUSH_ICACHE(addr,size) \
54: asm(" move.l a6,-(sp); \
55: move.l _SysBase,a6; \
56: jsr -636(a6); \
57: move.l (sp)+,a6; \
58: ")
1.1 anton 59: #else
1.13 anton 60: # warning no FLUSH_ICACHE defined. Dynamic native code generation disabled.
61: # warning CODE words will not work.
1.1 anton 62: #endif
63:
1.2 anton 64: #ifdef FORCE_REG /* highly recommended */
1.4 anton 65: #if defined(amigaos)
1.5 pazsan 66: # define IPREG asm("%a6")
1.4 anton 67: #else
1.5 pazsan 68: # define IPREG asm("%a5")
1.4 anton 69: #endif
1.2 anton 70: #define SPREG asm("%a4")
71: #define RPREG asm("%a3")
72: #define CFAREG asm("%a2")
73: #define TOSREG asm("%d3")
74: #define LPREG asm("%d2")
75: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>