qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] hw/m68k/next-cube: refactor to fix Coverity issue
@ 2021-01-15 20:11 Peter Maydell
  2021-01-15 20:11 ` [PATCH 01/11] hw/m68k/next-cube: Make next_irq() function static Peter Maydell
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Peter Maydell @ 2021-01-15 20:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, Laurent Vivier

Currently the next-cube board code open-codes a lot of handling of
interrupts and some miscellaneous registers. This series refactors
that to move most of it into a proper QOM device. (The main motivation
here is to fix the Coverity issue CID 1421962 which is a trivial
memory leak of the memory returned by qemu_allocate_irqs().)
    
In the real hardware this functionality seems to be the responsibility
of the Peripheral Controller (PC) chip, so we name the device that.

To ease review, I structured the change as a sequence of commits:
the first commit creates the skeleton of the NeXTPC device with no
content, but with a backdoor pointer to the NeXTState machine's state
struct. That allows subsequent commits to move parts of the code and
still have refactored and non-refactored code using the same struct
data fields.  Eventually all the code and data fields can be
transferred to the new device, and we remove the backdoor pointer.

Tested with make check and make check-acceptance (which does have
a boot test for the board.)

thanks
-- PMM

Peter Maydell (11):
  hw/m68k/next-cube: Make next_irq() function static
  hw/m68k/next-cube: Move register/interrupt functionality into a device
  hw/m68k/next-cube: Move mmio_ops into NeXTPC device
  hw/m68k/next-cube: Move scr_ops into NeXTPC device
  hw/m68k/next-cube: Make next_irq take NeXTPC* as its opaque
  hw/m68k/next-cube: Move int_status and int_mask to NeXTPC struct
  hw/m68k/next-cube: Make next_irq GPIO inputs to NEXT_PC device
  hw/m68k/next-cube: Move rtc into NeXTPC struct
  hw/m68k/next-cube: Remove unused fields from NeXTState
  hw/m68k/next-cube: Add vmstate for NeXTPC device
  hw/m68k/next-cube: Add missing header comment to next-cube.h

 include/hw/m68k/next-cube.h |  15 ++-
 hw/m68k/next-cube.c         | 238 +++++++++++++++++++++++-------------
 2 files changed, 168 insertions(+), 85 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-01-16 10:45 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-15 20:11 [PATCH 00/11] hw/m68k/next-cube: refactor to fix Coverity issue Peter Maydell
2021-01-15 20:11 ` [PATCH 01/11] hw/m68k/next-cube: Make next_irq() function static Peter Maydell
2021-01-16  6:46   ` Thomas Huth
2021-01-15 20:11 ` [PATCH 02/11] hw/m68k/next-cube: Move register/interrupt functionality into a device Peter Maydell
2021-01-15 20:11 ` [PATCH 03/11] hw/m68k/next-cube: Move mmio_ops into NeXTPC device Peter Maydell
2021-01-16  7:09   ` Thomas Huth
2021-01-15 20:11 ` [PATCH 04/11] hw/m68k/next-cube: Move scr_ops " Peter Maydell
2021-01-16  8:18   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 05/11] hw/m68k/next-cube: Make next_irq take NeXTPC* as its opaque Peter Maydell
2021-01-16  8:39   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 06/11] hw/m68k/next-cube: Move int_status and int_mask to NeXTPC struct Peter Maydell
2021-01-16  8:40   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 07/11] hw/m68k/next-cube: Make next_irq GPIO inputs to NEXT_PC device Peter Maydell
2021-01-16 10:24   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 08/11] hw/m68k/next-cube: Move rtc into NeXTPC struct Peter Maydell
2021-01-16 10:35   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 09/11] hw/m68k/next-cube: Remove unused fields from NeXTState Peter Maydell
2021-01-16 10:43   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 10/11] hw/m68k/next-cube: Add vmstate for NeXTPC device Peter Maydell
2021-01-16 10:44   ` Thomas Huth
2021-01-15 20:12 ` [PATCH 11/11] hw/m68k/next-cube: Add missing header comment to next-cube.h Peter Maydell
2021-01-16  7:36   ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).