aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/s390x/sigp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c
index 9dd9773..ad0ad61 100644
--- a/target/s390x/sigp.c
+++ b/target/s390x/sigp.c
@@ -11,6 +11,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "s390x-internal.h"
+#include "hw/boards.h"
#include "sysemu/hw_accel.h"
#include "sysemu/runstate.h"
#include "exec/address-spaces.h"
@@ -435,6 +436,22 @@ static int sigp_set_architecture(S390CPU *cpu, uint32_t param,
return SIGP_CC_STATUS_STORED;
}
+S390CPU *s390_cpu_addr2state(uint16_t cpu_addr)
+{
+ static MachineState *ms;
+
+ if (!ms) {
+ ms = MACHINE(qdev_get_machine());
+ g_assert(ms->possible_cpus);
+ }
+
+ /* CPU address corresponds to the core_id and the index */
+ if (cpu_addr >= ms->possible_cpus->len) {
+ return NULL;
+ }
+ return S390_CPU(ms->possible_cpus->cpus[cpu_addr].cpu);
+}
+
int handle_sigp(CPUS390XState *env, uint8_t order, uint64_t r1, uint64_t r3)
{
uint64_t *status_reg = &env->regs[r1];