From c19148bd8f5c2800265372d3554035efde1c5517 Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Fri, 25 Jul 2008 07:42:14 +0000 Subject: Make MAXTL dynamic, bounds check tl when indexing git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4942 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/machine.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'target-sparc/machine.c') diff --git a/target-sparc/machine.c b/target-sparc/machine.c index 5d4d2eb..f5a0017 100644 --- a/target-sparc/machine.c +++ b/target-sparc/machine.c @@ -72,7 +72,7 @@ void cpu_save(QEMUFile *f, void *opaque) qemu_put_be64s(f, &env->dtlb_tte[i]); } qemu_put_be32s(f, &env->mmu_version); - for (i = 0; i < MAXTL; i++) { + for (i = 0; i < MAXTL_MAX; i++) { qemu_put_be64s(f, &env->ts[i].tpc); qemu_put_be64s(f, &env->ts[i].tnpc); qemu_put_be64s(f, &env->ts[i].tstate); @@ -103,7 +103,7 @@ void cpu_save(QEMUFile *f, void *opaque) qemu_put_be64s(f, &env->gsr); qemu_put_be32s(f, &env->gl); qemu_put_be64s(f, &env->hpstate); - for (i = 0; i < MAXTL; i++) + for (i = 0; i < MAXTL_MAX; i++) qemu_put_be64s(f, &env->htstate[i]); qemu_put_be64s(f, &env->hintp); qemu_put_be64s(f, &env->htba); @@ -165,7 +165,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) qemu_get_be64s(f, &env->dtlb_tte[i]); } qemu_get_be32s(f, &env->mmu_version); - for (i = 0; i < MAXTL; i++) { + for (i = 0; i < MAXTL_MAX; i++) { qemu_get_be64s(f, &env->ts[i].tpc); qemu_get_be64s(f, &env->ts[i].tnpc); qemu_get_be64s(f, &env->ts[i].tstate); @@ -175,7 +175,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) qemu_get_be32s(f, &env->asi); qemu_get_be32s(f, &env->pstate); qemu_get_be32s(f, &env->tl); - env->tsptr = &env->ts[env->tl]; + env->tsptr = &env->ts[env->tl & MAXTL_MASK]; qemu_get_be32s(f, &env->cansave); qemu_get_be32s(f, &env->canrestore); qemu_get_be32s(f, &env->otherwin); @@ -197,7 +197,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) qemu_get_be64s(f, &env->gsr); qemu_get_be32s(f, &env->gl); qemu_get_be64s(f, &env->hpstate); - for (i = 0; i < MAXTL; i++) + for (i = 0; i < MAXTL_MAX; i++) qemu_get_be64s(f, &env->htstate[i]); qemu_get_be64s(f, &env->hintp); qemu_get_be64s(f, &env->htba); -- cgit v1.1