aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/cpu.h
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-25 07:42:14 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-25 07:42:14 +0000
commitc19148bd8f5c2800265372d3554035efde1c5517 (patch)
tree48865e441f51604f9df6268a38b82063cf75eba1 /target-sparc/cpu.h
parente7d05e6f1d39b913a15911c35a857965e696fa65 (diff)
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/cpu.h')
-rw-r--r--target-sparc/cpu.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index ab04f381cc..2574690434 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -252,13 +252,15 @@ typedef struct CPUSPARCState {
float128 qt0, qt1;
float_status fp_status;
#if defined(TARGET_SPARC64)
-#define MAXTL 4
+#define MAXTL_MAX 8
+#define MAXTL_MASK (MAXTL_MAX - 1)
trap_state *tsptr;
- trap_state ts[MAXTL];
+ trap_state ts[MAXTL_MAX];
uint32_t xcc; /* Extended integer condition codes */
uint32_t asi;
uint32_t pstate;
uint32_t tl;
+ uint32_t maxtl;
uint32_t cansave, canrestore, otherwin, wstate, cleanwin;
uint64_t agregs[8]; /* alternate general registers */
uint64_t bgregs[8]; /* backup for normal global registers */
@@ -270,7 +272,7 @@ typedef struct CPUSPARCState {
uint64_t gsr;
uint32_t gl; // UA2005
/* UA 2005 hyperprivileged registers */
- uint64_t hpstate, htstate[MAXTL], hintp, htba, hver, hstick_cmpr, ssr;
+ uint64_t hpstate, htstate[MAXTL_MAX], hintp, htba, hver, hstick_cmpr, ssr;
void *hstick; // UA 2005
#endif
uint32_t features;