Search
lxdream.org :: lxdream :: r472:8a3ae91eb215
lxdream 0.9.1
released Jun 29
Download Now
changeset472:8a3ae91eb215
parent471:826c89a6f12c
child473:bbbeca9ccf13
authornkeynes
dateWed Oct 31 09:02:18 2007 +0000 (12 years ago)
Ensure xlat cache is flushed on state load and reset
src/sh4/sh4.c
1.1 --- a/src/sh4/sh4.c Wed Oct 31 09:00:50 2007 +0000
1.2 +++ b/src/sh4/sh4.c Wed Oct 31 09:02:18 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: sh4.c,v 1.5 2007-10-06 09:03:24 nkeynes Exp $
1.6 + * $Id: sh4.c,v 1.6 2007-10-31 09:02:18 nkeynes Exp $
1.7 *
1.8 * SH4 parent module for all CPU modes and SH4 peripheral
1.9 * modules.
1.10 @@ -75,6 +75,10 @@
1.11
1.12 void sh4_reset(void)
1.13 {
1.14 + if( sh4_module.run_time_slice == sh4_xlat_run_slice ) {
1.15 + xlat_flush_cache();
1.16 + }
1.17 +
1.18 /* zero everything out, for the sake of having a consistent state. */
1.19 memset( &sh4r, 0, sizeof(sh4r) );
1.20
1.21 @@ -122,6 +126,9 @@
1.22
1.23 int sh4_load_state( FILE * f )
1.24 {
1.25 + if( sh4_module.run_time_slice == sh4_xlat_run_slice ) {
1.26 + xlat_flush_cache();
1.27 + }
1.28 fread( &sh4r, sizeof(sh4r), 1, f );
1.29 sh4r.fr_bank = &sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][0]; // Fixup internal FR pointer
1.30 MMU_load_state( f );
.