Kaffe 0.84/JIT on netbsd-m68k (long)

Hauke Fath hauke@Espresso.Rhein-Neckar.DE
Wed, 4 Feb 1998 21:21:25 +0100


At 22:39 Uhr +0100 03.02.1998, Ignatios Souvatzis wrote:


>Ok. JIT compilation sound like creation of 68k code on-the-fly. Did you add
>the correct cachectl() pseudo-syscalls, to synchronize the I-cache with the
>D-cache? If no, look at
>
>	src/gnu/usr.bin/ld/arch/m68k/mdprologue.S
>
>it should contain what you need.

*Bingo!*

I hacked the asm code snippet in (gcc inline assembler is ugly as hell) and
Kaffe 0.84 JIT compiles & runs "HelloWorldApp" now.  =8)

On the other hand...

The JIT code (#define'd in jit.h) calls __clear_cache() from libgcc.a. The
comment says...

/* On the 68040 (and 060 I presume) we need to flush the instruction
   cache before running new code.  Stupidly, Motorola made cpush a
   privledged instruction, so we have to get operating system help
   for this.  Naturally, there is no standard there.

   We are partially rescued by gcc, which must be taught how to do this
   in order to build bound-function trampolines.  This works at least
   for A/UX, Linux and NeXT.  The rest of you with 040's should
   consider fixing gcc, as you are broken there too.

   For those with 020's and 030's, this is effectively a no-op.  */

#define FLUSH_DCACHE(beg, end)	__clear_cache((beg), (end))


-- Is this always a no-op for NetBSD/m68k? Is the routine from
arch/m68k/mdprologue.S globally available?

From looking in gcc/libgcc2.c, there seem to be more preprocessor symbols
than actual code so I don't exactly get what's going on. But I didn't see
any obvious function call or trap there.

Thanks again for the pointer,

	hauke



--
"It's never straight up and down"     (DEVO)