Remove sysbus_add_memory and sysbus_del_memory
Status from this message: Applied. Thanks.
Get series with b4
b4 am [email protected]Versions newest first
Changes in v3 from the cover letter
* changed field name of parent obj in MusicPalMiscState to 'parent_obj' as per convention
* rebased on master
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | sysbus: make SysBusDeviceClass::init optionalhw/ | +3 | 0 replies | |
| 2/5 | musicpal: qdevify musicpal-mischw/ | +23 | 1 reply | |
| 3/5 | milkymist-minimac2: Just expose buffers as a sysbus mmio regionhw/ hw/ | +2 | 0 replies | |
| 4/5 | milkymist-softusb: Don't map RAM memory regions in the device itselfhw/ hw/ | +13 | 4 replies | |
| 5/5 | sysbus: Remove sysbus_add_memory and sysbus_del_memoryhw/ hw/ | +0 | 0 replies |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Andreas Färber | Peter Crosthwaite | Michael Walle |
|---|---|---|---|
| 1/5 | A-b | R-b | |
| 2/5 | R-b | R-b | |
| 3/5 | R-b | A-b | |
| 4/5 | R-b | A-b | |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [Qemu-devel] [PATCH v3 0/5] Remove sysbus_add_memory and sysbus_del_memory
The functions sysbus_add_memory and sysbus_del_memory are odd wrappers around around memory_region_add/del_subregion, and their presence is an encouragement to devices to try to map their own memory regions into the system address space.
Since they're only used in a couple of places in the milkymist and musicpal platforms, rewrite those uses to have the sysbus devices expose the memory regions as sysbus mmio regions, and then have the creator of the device (ie board code) map them in the right places. Then we can remove the functions altogether.
The series includes a trivial patch to sysbus to make the init method optional, since (as part of the move towards using only instance_init and realize) it's now possible to have a simple functional device which only needs an instance_init method and no realize or init [the musicpal-misc device introduced in patch 2 being one such example].
Tested on both musicpal and milkymist.
I rather suspect sysbus_add_io and sysbus_del_io should also be removed, but since their users are in PPC and x86 platforms I'll let somebody else do that part :-)
Changes v2->v3:
* changed field name of parent obj in MusicPalMiscState to 'parent_obj' as per convention
* rebased on master
Changes v1->v2:
* updated 'qdevify musicpal-misc' to drop unneeded typedef and QOM macros, as per review discussion
Peter Maydell (5):
sysbus: make SysBusDeviceClass::init optional
musicpal: qdevify musicpal-misc
milkymist-minimac2: Just expose buffers as a sysbus mmio region
milkymist-softusb: Don't map RAM memory regions in the device itself
sysbus: Remove sysbus_add_memory and sysbus_del_memory
hw/arm/musicpal.c | 28 +++++++++++++++++++++++----- hw/milkymist-hw.h | 6 +++--- hw/milkymist-minimac2.c | 5 +---- hw/milkymist-softusb.c | 21 +++++++++++---------- hw/sysbus.c | 21 +++------------------ hw/sysbus.h | 5 ----- 6 files changed, 41 insertions(+), 45 deletions(-)
Signature · 1 line
1.7.9.5