aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/int64_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-sparc/int64_helper.c')
-rw-r--r--target-sparc/int64_helper.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/target-sparc/int64_helper.c b/target-sparc/int64_helper.c
index 2bb1910ed9..1d471db999 100644
--- a/target-sparc/int64_helper.c
+++ b/target-sparc/int64_helper.c
@@ -18,6 +18,8 @@
*/
#include "cpu.h"
+#include "helper.h"
+#include "trace.h"
//#define DEBUG_PCALL
@@ -162,3 +164,38 @@ trap_state *cpu_tsptr(CPUState* env)
{
return &env->ts[env->tl & MAXTL_MASK];
}
+
+static bool do_modify_softint(CPUState *env, uint32_t value)
+{
+ if (env->softint != value) {
+ env->softint = value;
+#if !defined(CONFIG_USER_ONLY)
+ if (cpu_interrupts_enabled(env)) {
+ cpu_check_irqs(env);
+ }
+#endif
+ return true;
+ }
+ return false;
+}
+
+void helper_set_softint(CPUState *env, uint64_t value)
+{
+ if (do_modify_softint(env, env->softint | (uint32_t)value)) {
+ trace_int_helper_set_softint(env->softint);
+ }
+}
+
+void helper_clear_softint(CPUState *env, uint64_t value)
+{
+ if (do_modify_softint(env, env->softint & (uint32_t)~value)) {
+ trace_int_helper_clear_softint(env->softint);
+ }
+}
+
+void helper_write_softint(CPUState *env, uint64_t value)
+{
+ if (do_modify_softint(env, (uint32_t)value)) {
+ trace_int_helper_write_softint(env->softint);
+ }
+}