hw/m68k/next-cube: Move register/interrupt functionality into a device
commit660bef339043eca5a067d9dc2284c0a9776a600c
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 15 Jan 2021 20:11:57 +0000 (15 20:11 +0000)
committerThomas Huth <huth@tuxfamily.org>
Tue, 19 Jan 2021 08:10:53 +0000 (19 09:10 +0100)
tree1448feeca75724b6d8d4d86d9dc8bb1ab0dfc800
parentc8abcc87b1d61d61ca51a3cbe5002fcdee8fa724
hw/m68k/next-cube: Move register/interrupt functionality into a device

Currently the next-cube board code open-codes a lot of handling of
interrupts and some miscellaneous registers.  Move this into a proper
QOM device.

In the real hardware this functionality seems to be the
responsibility of the Peripheral Controller (PC) chip, so name the
device that.

There are several different things that will need to be moved into
this device:
 * the mmio_iops register set
 * the scr_ops register set
 * the next_irq IRQ handling

To ease review, we structure the change as a sequence of commits: in
this first commit we create the skeleton of the NeXTPC device with no
content, but with a backdoor pointer to the NeXTState machine's state
struct so we can move parts of the code and still have refactored and
non-refactored code using the same struct data fields.  Further
commits will move functionality into the new device piece by piece.
At the end we will be able to remove the backdoor pointer because all
the data fields will be in the NeXTPC struct and not the NeXTState
struct.

We'll add the VMState for the new device at the end of all that; this
is in theory a migration compatibility break but this machine does
not currently support migration at all anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210115201206.17347-3-peter.maydell@linaro.org>
[huth: Add a comment in front of struct NeXTPC]
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
hw/m68k/next-cube.c