\ Flush Data Cache so that compiled code can be read into Instruction cache \ \ for HMSL on 68K Macintosh \ \ This will fix a crach that can occur when compiling from the \ editor and executing a word that was just compiled. It is not \ a complete fix for every theoretically possible cache problem \ but it fixed all the problems we were seeing. \ \ Thanks to Chris Rolfe for this fix. anew task-cache_fix.fth \ Cache flushing for 68040 CPU's and some accelerators. $ a89f constant Unimplemented : ?trapImplemented ( trap# -- true|false,) \ ??check for valid trap# range here?? getTrapAddress() Unimplemented getTrapAddress() = NOT \ unimplemented traps are set to some kind of noop ; : cacheFlush() ( --,) $ a0bd ?trapImplemented IF trap: a0bd THEN ; variable cache-flush-needed cache-flush-needed ON : MAYBE.FLUSH.CACHE ( -- , only flush if needed ) cache-flush-needed @ IF cacheFlush() THEN ; \ redefine ; : ; ( --,) [compile] ; maybe.flush.cache ; immediate \ redefine ;M : ;m ( --,) [compile] ;m maybe.flush.cache ; immediate : create ( -- ) create maybe.flush.cache ; : variable ( -- ) variable maybe.flush.cache ; : constant ( n -- ) constant maybe.flush.cache ; \ end of cache flushing.