diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-25 07:42:14 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-25 07:42:14 +0000 |
commit | c19148bd8f5c2800265372d3554035efde1c5517 (patch) | |
tree | 48865e441f51604f9df6268a38b82063cf75eba1 /target-sparc/machine.c | |
parent | e7d05e6f1d39b913a15911c35a857965e696fa65 (diff) | |
download | qemu-c19148bd8f5c2800265372d3554035efde1c5517.zip qemu-c19148bd8f5c2800265372d3554035efde1c5517.tar.gz qemu-c19148bd8f5c2800265372d3554035efde1c5517.tar.bz2 |
Make MAXTL dynamic, bounds check tl when indexing
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4942 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/machine.c')
-rw-r--r-- | target-sparc/machine.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); |