diff options
-rw-r--r-- | target-s390x/helper.h | 2 | ||||
-rw-r--r-- | target-s390x/insn-data.def | 4 | ||||
-rw-r--r-- | target-s390x/misc_helper.c | 8 | ||||
-rw-r--r-- | target-s390x/translate.c | 32 |
4 files changed, 22 insertions, 24 deletions
diff --git a/target-s390x/helper.h b/target-s390x/helper.h index a55aa9f4d7..d7736e3aa1 100644 --- a/target-s390x/helper.h +++ b/target-s390x/helper.h @@ -89,7 +89,7 @@ DEF_HELPER_2(stcke, i32, env, i64) DEF_HELPER_FLAGS_2(sckc, TCG_CALL_NO_RWG, void, env, i64) DEF_HELPER_FLAGS_1(stckc, TCG_CALL_NO_RWG, i64, env) DEF_HELPER_FLAGS_2(spt, TCG_CALL_NO_RWG, void, env, i64) -DEF_HELPER_FLAGS_2(stpt, TCG_CALL_NO_RWG, void, env, i64) +DEF_HELPER_FLAGS_1(stpt, TCG_CALL_NO_RWG, i64, env) DEF_HELPER_4(stsi, i32, env, i64, i32, i32) DEF_HELPER_4(lctl, void, env, i32, i64, i32) DEF_HELPER_4(lctlg, void, env, i32, i64, i32) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index 06c780ba21..a45454c4b9 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -638,6 +638,8 @@ C(0xb204, SCK, S, Z, 0, 0, 0, 0, 0, 0) /* SET CLOCK COMPARATOR */ C(0xb206, SCKC, S, Z, 0, m2_64, 0, 0, sckc, 0) +/* SET CPU TIMER */ + C(0xb208, SPT, S, Z, 0, m2_64, 0, 0, spt, 0) /* SET SYSTEM MASK */ C(0x8000, SSM, S, Z, 0, m2_8u, 0, 0, ssm, 0) /* SIGNAL PROCESSOR */ @@ -652,6 +654,8 @@ C(0xeb25, STCTG, RSY_a, Z, 0, a2, 0, 0, stctg, 0) /* STORE CPU ID */ C(0xb202, STIDP, S, Z, la2, 0, new, m1_64, stidp, 0) +/* STORE CPU TIMER */ + C(0xb209, STPT, S, Z, la2, 0, new, m1_64, stpt, 0) /* STORE THEN AND SYSTEM MASK */ C(0xac00, STNSM, SI, Z, la1, 0, 0, 0, stnosm, 0) /* STORE THEN OR SYSTEM MASK */ diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index 9263ae727f..431824249c 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -196,10 +196,8 @@ uint64_t HELPER(stckc)(CPUS390XState *env) } /* Set CPU Timer */ -void HELPER(spt)(CPUS390XState *env, uint64_t a1) +void HELPER(spt)(CPUS390XState *env, uint64_t time) { - uint64_t time = cpu_ldq_data(env, a1); - if (time == -1ULL) { return; } @@ -211,10 +209,10 @@ void HELPER(spt)(CPUS390XState *env, uint64_t a1) } /* Store CPU Timer */ -void HELPER(stpt)(CPUS390XState *env, uint64_t a1) +uint64_t HELPER(stpt)(CPUS390XState *env) { /* XXX implement */ - cpu_stq_data(env, a1, 0); + return 0; } /* Store System Information */ diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 30c7acec22..a31849253b 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -1033,24 +1033,6 @@ static void disas_b2(CPUS390XState *env, DisasContext *s, int op, LOG_DISAS("disas_b2: op 0x%x r1 %d r2 %d\n", op, r1, r2); switch (op) { - case 0x08: /* SPT D2(B2) [S] */ - /* Set CPU Timer */ - check_privileged(s); - decode_rs(s, insn, &r1, &r3, &b2, &d2); - tmp = get_address(s, 0, b2, d2); - potential_page_fault(s); - gen_helper_spt(cpu_env, tmp); - tcg_temp_free_i64(tmp); - break; - case 0x09: /* STPT D2(B2) [S] */ - /* Store CPU Timer */ - check_privileged(s); - decode_rs(s, insn, &r1, &r3, &b2, &d2); - tmp = get_address(s, 0, b2, d2); - potential_page_fault(s); - gen_helper_stpt(cpu_env, tmp); - tcg_temp_free_i64(tmp); - break; case 0x0a: /* SPKA D2(B2) [S] */ /* Set PSW Key from Address */ check_privileged(s); @@ -2950,6 +2932,20 @@ static ExitStatus op_stidp(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_spt(DisasContext *s, DisasOps *o) +{ + check_privileged(s); + gen_helper_spt(cpu_env, o->in2); + return NO_EXIT; +} + +static ExitStatus op_stpt(DisasContext *s, DisasOps *o) +{ + check_privileged(s); + gen_helper_stpt(o->out, cpu_env); + return NO_EXIT; +} + static ExitStatus op_stnosm(DisasContext *s, DisasOps *o) { uint64_t i2 = get_field(s->fields, i2); |