summaryrefslogtreecommitdiff
path: root/target/s390x/misc_helper.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2017-08-18 13:43:48 +0200
committerCornelia Huck <cohuck@redhat.com>2017-08-30 18:23:25 +0200
commitd9b8daf9963821ab9a5c812f989f27344ddc10fa (patch)
tree78b01ad942c477f9e7bf8b8fd306249b84cca57a /target/s390x/misc_helper.c
parent52c91545412e71a9fe08655947fff1b619003db6 (diff)
downloadqemu-d9b8daf9963821ab9a5c812f989f27344ddc10fa.zip
target/s390x: move get_per_in_range() to misc_helper.c
Only used in that file. Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20170818114353.13455-14-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/misc_helper.c')
-rw-r--r--target/s390x/misc_helper.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index 34d730ba73..d5497cbcba 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -455,6 +455,17 @@ void HELPER(per_check_exception)(CPUS390XState *env)
}
}
+/* Check if an address is within the PER starting address and the PER
+ ending address. The address range might loop. */
+static inline bool get_per_in_range(CPUS390XState *env, uint64_t addr)
+{
+ if (env->cregs[10] <= env->cregs[11]) {
+ return env->cregs[10] <= addr && addr <= env->cregs[11];
+ } else {
+ return env->cregs[10] <= addr || addr <= env->cregs[11];
+ }
+}
+
void HELPER(per_branch)(CPUS390XState *env, uint64_t from, uint64_t to)
{
if ((env->cregs[9] & PER_CR9_EVENT_BRANCH)) {