diff options
author | Fei Li <sherrylf@linux.vnet.ibm.com> | 2016-11-24 11:10:39 +0100 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2017-04-21 09:32:09 +0200 |
commit | dde522bbc5feb2862afb243bb49c590fe65dce66 (patch) | |
tree | 1823392ac35c26189f22d92b262af2a1bd783f0f /include | |
parent | bc66d6cbca780c5b8c237b9d355caa8274e5b312 (diff) | |
download | qemu-dde522bbc5feb2862afb243bb49c590fe65dce66.zip qemu-dde522bbc5feb2862afb243bb49c590fe65dce66.tar.gz qemu-dde522bbc5feb2862afb243bb49c590fe65dce66.tar.bz2 |
s390x: register I/O adapters per ISC during init
The I/O adapters should exist as soon as the bus/infrastructure
exists, and not only when the guest is actually trying to do something
with them. While the lazy allocation was not wrong, allocating at init
time is cleaner, both for the architecture and the code. Let's adjust
this by having each device type (currently for PCI and virtio-ccw)
register the adapters for each ISC (as now we don't know which ISC the
guest will use) as soon as it initializes.
Use a two-dimensional array io_adapters[type][isc] to store adapters
in ChannelSubSys, so that we can conveniently get the adapter id by
the helper function css_get_adapter_id(type, isc).
Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/s390x/css.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index cdc73fe..f1f0d7f 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -23,6 +23,8 @@ #define MAX_CSSID 255 #define MAX_CHPID 255 +#define MAX_ISC 7 + #define MAX_CIWS 62 #define VIRTUAL_CSSID 0xfe @@ -130,8 +132,9 @@ typedef enum { CSS_IO_ADAPTER_TYPE_NUMS, } CssIoAdapterType; -int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, - bool maskable, uint32_t *id); +uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc); +void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable, + Error **errp); #ifndef CONFIG_USER_ONLY SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid, |