aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/op_helper.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-20 18:22:16 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-20 18:22:16 +0000
commitfb79ceb91a6ff9ee52265893f9d66dd6833726da (patch)
tree8d8b0e4c325653ca076f76edc1f81e4391ce5486 /target-sparc/op_helper.c
parentcb3df91a7102a79c28bb39113ef1454c342c2c7c (diff)
Make UA200x features selectable, add MMU types
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4911 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/op_helper.c')
-rw-r--r--target-sparc/op_helper.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 96b7320437..73d960b72e 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -1549,7 +1549,8 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign)
#endif
if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
- || (asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV)))
+ || ((env->features & CPU_FEATURE_HYPV) && asi >= 0x30 && asi < 0x80
+ && !(env->hpstate & HS_PRIV)))
raise_exception(TT_PRIV_ACT);
helper_check_align(addr, size - 1);
@@ -1561,7 +1562,7 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign)
case 0x88: // Primary LE
case 0x8a: // Primary no-fault LE
if ((asi & 0x80) && (env->pstate & PS_PRIV)) {
- if (env->hpstate & HS_PRIV) {
+ if ((env->features & CPU_FEATURE_HYPV) && env->hpstate & HS_PRIV) {
switch(size) {
case 1:
ret = ldub_hypv(addr);
@@ -1837,7 +1838,8 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
dump_asi("write", addr, asi, size, val);
#endif
if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
- || (asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV)))
+ || ((env->features & CPU_FEATURE_HYPV) && asi >= 0x30 && asi < 0x80
+ && !(env->hpstate & HS_PRIV)))
raise_exception(TT_PRIV_ACT);
helper_check_align(addr, size - 1);
@@ -1873,7 +1875,7 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
case 0x80: // Primary
case 0x88: // Primary LE
if ((asi & 0x80) && (env->pstate & PS_PRIV)) {
- if (env->hpstate & HS_PRIV) {
+ if ((env->features & CPU_FEATURE_HYPV) && env->hpstate & HS_PRIV) {
switch(size) {
case 1:
stb_hypv(addr, val);
@@ -2153,7 +2155,8 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
void helper_ldda_asi(target_ulong addr, int asi, int rd)
{
if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
- || (asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV)))
+ || ((env->features & CPU_FEATURE_HYPV) && asi >= 0x30 && asi < 0x80
+ && !(env->hpstate & HS_PRIV)))
raise_exception(TT_PRIV_ACT);
switch (asi) {
@@ -2726,7 +2729,8 @@ void change_pstate(uint64_t new_pstate)
void helper_wrpstate(target_ulong new_state)
{
- change_pstate(new_state & 0xf3f);
+ if (!(env->features & CPU_FEATURE_GL))
+ change_pstate(new_state & 0xf3f);
}
void helper_done(void)