[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/23] s390/sclp: move sclp_service_interrupt into th
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 16/23] s390/sclp: move sclp_service_interrupt into the sclp device |
Date: |
Mon, 7 Sep 2015 16:48:30 +0200 |
From: David Hildenbrand <address@hidden>
Let's make that function a method of the new sclp device, keeping
the wrapper for existing users.
We can now let go of get_event_facility().
Reviewed-by: Matthew Rosato <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/sclp.c | 21 ++++++++++++---------
include/hw/s390x/sclp.h | 1 +
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index c367ff8..87f4902 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -22,12 +22,6 @@
#include "hw/s390x/event-facility.h"
#include "hw/s390x/s390-pci-bus.h"
-static inline SCLPEventFacility *get_event_facility(void)
-{
- return EVENT_FACILITY(object_resolve_path_type("",
TYPE_SCLP_EVENT_FACILITY,
- NULL));
-}
-
static inline SCLPDevice *get_sclp_device(void)
{
return SCLP(object_resolve_path_type("", TYPE_SCLP, NULL));
@@ -417,15 +411,15 @@ int sclp_service_call(CPUS390XState *env, uint64_t sccb,
uint32_t code)
cpu_physical_memory_write(sccb, &work_sccb,
be16_to_cpu(work_sccb.h.length));
- sclp_service_interrupt(sccb);
+ sclp_c->service_interrupt(sclp, sccb);
out:
return r;
}
-void sclp_service_interrupt(uint32_t sccb)
+static void service_interrupt(SCLPDevice *sclp, uint32_t sccb)
{
- SCLPEventFacility *ef = get_event_facility();
+ SCLPEventFacility *ef = sclp->event_facility;
SCLPEventFacilityClass *efc = EVENT_FACILITY_GET_CLASS(ef);
uint32_t param = sccb & ~3;
@@ -440,6 +434,14 @@ void sclp_service_interrupt(uint32_t sccb)
s390_sclp_extint(param);
}
+void sclp_service_interrupt(uint32_t sccb)
+{
+ SCLPDevice *sclp = get_sclp_device();
+ SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
+
+ sclp_c->service_interrupt(sclp, sccb);
+}
+
/* qemu object creation and initialization functions */
void s390_sclp_init(void)
@@ -499,6 +501,7 @@ static void sclp_class_init(ObjectClass *oc, void *data)
sc->unassign_storage = unassign_storage;
sc->read_cpu_info = sclp_read_cpu_info;
sc->execute = sclp_execute;
+ sc->service_interrupt = service_interrupt;
}
static TypeInfo sclp_info = {
diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h
index 60db98c..50094eb 100644
--- a/include/hw/s390x/sclp.h
+++ b/include/hw/s390x/sclp.h
@@ -192,6 +192,7 @@ typedef struct SCLPDeviceClass {
/* public */
void (*execute)(SCLPDevice *sclp, SCCB *sccb, uint32_t code);
+ void (*service_interrupt)(SCLPDevice *sclp, uint32_t sccb);
} SCLPDeviceClass;
typedef struct sclpMemoryHotplugDev sclpMemoryHotplugDev;
--
2.5.1
- [Qemu-devel] [PULL 02/23] s390x/css: ccw-0 enforces count > 0, (continued)
- [Qemu-devel] [PULL 02/23] s390x/css: ccw-0 enforces count > 0, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 03/23] s390x/event-facility: fix receive mask check, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 05/23] s390x/event-facility: fix location of receive mask, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 06/23] pc-bios/s390-ccw: Device detection in higher subchannel sets, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 07/23] pc-bios/s390-ccw: rebuild image, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 11/23] s390/sclp: rework sclp event facility initialization + device realization, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 12/23] s390/sclp: replace sclp event types with proper defines, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 04/23] s390x/css: start with cleared cstat/dstat, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 18/23] s390: disallow memory hotplug for the s390-virtio machine, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 08/23] s390x/kvm: make setting of in-kernel irq routes more efficient, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 16/23] s390/sclp: move sclp_service_interrupt into the sclp device,
Cornelia Huck <=
- [Qemu-devel] [PULL 14/23] s390/sclp: introduce a root sclp device, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 21/23] s390: unify allocation of initial memory, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 19/23] s390/sclp: ignore memory hotplug operations if it is disabled, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 15/23] s390/sclp: move sclp_execute related functions into the SCLP class, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 20/23] s390: move memory calculation into the sclp device, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 09/23] s390x/gdb: support reading/writing of control registers, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 13/23] s390/sclp: temporarily fix unassignment/reassignment of memory subregions, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 22/23] s390/sclp: store the increment_size in the sclp device, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 17/23] s390: no need to manually parse for slots and maxmem, Cornelia Huck, 2015/09/07
- [Qemu-devel] [PULL 23/23] s390/sclp: simplify calculation of rnmax, Cornelia Huck, 2015/09/07