--- trunk/src/memory_rw.c 2007/10/08 16:21:17 34 +++ trunk/src/memory_rw.c 2007/10/08 16:22:11 40 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: memory_rw.c,v 1.101 2007/02/10 14:04:51 debug Exp $ + * $Id: memory_rw.c,v 1.102 2007/04/16 15:13:44 debug Exp $ * * Generic memory_rw(), with special hacks for specific CPU families. * @@ -373,10 +373,14 @@ paddr & ~offset_mask); /* - * If writing, then invalidate code translations for the (physical) - * page address: + * If writing, or if mapping a page where writing is ok later on, + * then invalidate code translations for the (physical) page address: */ - if (writeflag == MEM_WRITE && cpu->invalidate_code_translation != NULL) + if ((writeflag == MEM_WRITE +#if !defined(MEM_USERLAND) + || ok == 2 +#endif + ) && cpu->invalidate_code_translation != NULL) cpu->invalidate_code_translation(cpu, paddr, INVALIDATE_PADDR); if ((paddr&((1< (1<