Add psw.mask register

This commit is contained in:
lazymio 2022-01-10 15:34:04 +01:00
parent 71f044ca50
commit 441afe17e6
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
2 changed files with 9 additions and 0 deletions

View File

@ -128,6 +128,7 @@ typedef enum uc_s390x_reg {
UC_S390X_REG_A15,
UC_S390X_REG_PC, // PC register
UC_S390X_REG_PSWM,
UC_S390X_REG_ENDING, // <-- mark the end of the list or registers

View File

@ -6,6 +6,7 @@
#include "unicorn_common.h"
#include "uc_priv.h"
#include "unicorn.h"
#include "internal.h"
S390CPU *cpu_s390_init(struct uc_struct *uc, const char *cpu_model);
@ -65,6 +66,9 @@ static void reg_read(CPUS390XState *env, unsigned int regid, void *value)
case UC_S390X_REG_PC:
*(uint64_t *)value = env->psw.addr;
break;
case UC_S390X_REG_PSWM:
*(uint64_t *)value = get_psw_mask(env);
break;
}
}
@ -86,6 +90,10 @@ static void reg_write(CPUS390XState *env, unsigned int regid, const void *value)
case UC_S390X_REG_PC:
env->psw.addr = *(uint64_t *)value;
break;
case UC_S390X_REG_PSWM:
env->psw.mask = *(uint64_t *)value;
env->cc_op = (env->psw.mask >> 44) & 3;
break;
}
}