Subject: Re: Kaffe 0.84/JIT on netbsd-m68k (long)
To: Gordon W. Ross <firstname.lastname@example.org>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Date: 02/07/1998 14:12:00
At 4:12 Uhr +0100 05.02.1998, Gordon W. Ross wrote:
>It would be nice if we could let a simple "trap #2" do the job of
>flushing the I-cache as needed for self-modifying code to work.
>That's what "trap #2" does on SunOS (their dynamic linker uses it).
>Also it was implemented as a "fast trap" (no "rei" check, just rte)
>so we could do the same and let both our executables and SunOS
>enjoy the availability of a very cheap I-cache flush.
>BTW, we no longer use "trap #2" for kernel breakpoints, so we
>could now easily let it mean "flush the I-cache". Good idea?
...but the 1.3B arch/mac68k/mac68k/trap.c has
/* $NetBSD: trap.c,v 1.55 1997/11/07 07:33:15 scottr Exp $ */
* Trace traps.
* M68k NetBSD uses trap #2,
* SUN 3.x uses trap #15,
* KGDB uses trap #15 (for kernel breakpoints; handled elsewhere).
* M68k NetBSD traps get mapped by locore.s into T_TRACE.
* SUN 3.x traps get passed through as T_TRAP15 and are not really
* supported yet.
case T_TRACE: /* Kernel trace trap */
case T_TRAP15: /* SUN trace trap */
case T_TRACE|T_USER: /* user trace trap */
case T_TRAP15|T_USER: /* Sun user trace trap */
* SunOS uses Trap #2 for a "CPU cache flush"
* Just flush the on-chip caches and return.
* XXX - Too bad NetBSD uses trap 2...
>Again, gcc could just do "trap #2" on both SunOS and NetBSD...
"It's never straight up and down" (DEVO)