[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SPIN! problems unter MiNT



There is a bug in the mint kernel where code loaded with p_exec(3, ...)
doesn't flush the instruction cache.  XFS and XDD code gets called without
the cache being flushed and causes sporadic crashes.  Below is a small
patch to mem.c that flushes the cache whenever code is loaded (in
load_and_relocate).  It is now probably safe to remove the cpush from the
exec_region routine, but I haven't bothered to test that.

harry

This patch will probably fix the SPIN problem:

--- mem.c.orig	Tue Jul 29 21:13:34 1997
+++ mem.c	Tue Jul 29 21:16:52 1997
@@ -1752,6 +1752,7 @@

 	if (fh->reloc != 0 || (*dev->read)(f, (char *)&fixup, 4L) != 4L
 	    || fixup == 0) {
+		cpush((void *)base->p_tbase, base->p_tlen);	/* flush
cache */
 		return 0;	/* no relocation to be performed */
 	}

@@ -1802,7 +1803,7 @@
 		} while (c == 1);
 		fixup += ( (unsigned) c) & 0xff;
 	} while (c);
-
+	cpush((void *)base->p_tbase, base->p_tlen);	/* flush cache */
 	return 0;
 }