]> Git Repo - qemu.git/blob - target-s390x/interrupt.c
Merge remote-tracking branch 'remotes/bonzini/configure' into staging
[qemu.git] / target-s390x / interrupt.c
1 /*
2  * QEMU S/390 Interrupt support
3  *
4  * Copyright IBM Corp. 2012, 2014
5  *
6  * This work is licensed under the terms of the GNU GPL, version 2 or (at your
7  * option) any later version.  See the COPYING file in the top-level directory.
8  */
9
10 #include "cpu.h"
11 #include "sysemu/kvm.h"
12
13 /*
14  * All of the following interrupts are floating, i.e. not per-vcpu.
15  * We just need a dummy cpustate in order to be able to inject in the
16  * non-kvm case.
17  */
18 #if !defined(CONFIG_USER_ONLY)
19 void s390_sclp_extint(uint32_t parm)
20 {
21     if (kvm_enabled()) {
22         kvm_s390_service_interrupt(parm);
23     } else {
24         S390CPU *dummy_cpu = s390_cpu_addr2state(0);
25         CPUS390XState *env = &dummy_cpu->env;
26
27         env->psw.addr += 4;
28         cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0);
29     }
30 }
31
32 void s390_virtio_irq(int config_change, uint64_t token)
33 {
34     if (kvm_enabled()) {
35         kvm_s390_virtio_irq(config_change, token);
36     } else {
37         S390CPU *dummy_cpu = s390_cpu_addr2state(0);
38
39         cpu_inject_ext(dummy_cpu, EXT_VIRTIO, config_change, token);
40     }
41 }
42
43 void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
44                        uint32_t io_int_parm, uint32_t io_int_word)
45 {
46     if (kvm_enabled()) {
47         kvm_s390_io_interrupt(subchannel_id, subchannel_nr, io_int_parm,
48                               io_int_word);
49     } else {
50         S390CPU *dummy_cpu = s390_cpu_addr2state(0);
51
52         cpu_inject_io(dummy_cpu, subchannel_id, subchannel_nr, io_int_parm,
53                       io_int_word);
54     }
55 }
56
57 void s390_crw_mchk(void)
58 {
59     if (kvm_enabled()) {
60         kvm_s390_crw_mchk();
61     } else {
62         S390CPU *dummy_cpu = s390_cpu_addr2state(0);
63
64         cpu_inject_crw_mchk(dummy_cpu);
65     }
66 }
67
68 #endif
This page took 0.027091 seconds and 4 git commands to generate.