diff options
author | David Hildenbrand <david@redhat.com> | 2017-09-28 22:36:41 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2017-10-20 13:32:10 +0200 |
commit | 14ca122e753c7bc925e6cedc4f16588bc154090d (patch) | |
tree | 289c4be39f20c20f69cd02d51f51199e6347b97e /target/s390x/interrupt.c | |
parent | d516f74c99b1a2c289cfba0bacf125cbc9b681e3 (diff) | |
download | qemu-14ca122e753c7bc925e6cedc4f16588bc154090d.zip qemu-14ca122e753c7bc925e6cedc4f16588bc154090d.tar.gz qemu-14ca122e753c7bc925e6cedc4f16588bc154090d.tar.bz2 |
s390x/tcg: injection of emergency signals and external calls
Preparation for new TCG SIGP code. Especially also prepare for
indicating that another external call is already pending.
Take care of interrupt priority.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170928203708.9376-4-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/interrupt.c')
-rw-r--r-- | target/s390x/interrupt.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c index edcc2e9..bb7cc7f 100644 --- a/target/s390x/interrupt.c +++ b/target/s390x/interrupt.c @@ -81,6 +81,32 @@ void cpu_inject_cpu_timer(S390CPU *cpu) cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD); } +void cpu_inject_emergency_signal(S390CPU *cpu, uint16_t src_cpu_addr) +{ + CPUS390XState *env = &cpu->env; + + g_assert(src_cpu_addr < S390_MAX_CPUS); + set_bit(src_cpu_addr, env->emergency_signals); + + env->pending_int |= INTERRUPT_EMERGENCY_SIGNAL; + cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD); +} + +int cpu_inject_external_call(S390CPU *cpu, uint16_t src_cpu_addr) +{ + CPUS390XState *env = &cpu->env; + + g_assert(src_cpu_addr < S390_MAX_CPUS); + if (env->pending_int & INTERRUPT_EXTERNAL_CALL) { + return -EBUSY; + } + env->external_call_addr = src_cpu_addr; + + env->pending_int |= INTERRUPT_EXTERNAL_CALL; + cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD); + return 0; +} + static void cpu_inject_io(S390CPU *cpu, uint16_t subchannel_id, uint16_t subchannel_number, uint32_t io_int_parm, uint32_t io_int_word) |