pseries: Make the PAPR RTC a qdev device
commit28df36a13a3b0b792d9df64f8db8a392df5e0b35
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 6 Feb 2015 03:55:51 +0000 (6 14:55 +1100)
committerAlexander Graf <agraf@suse.de>
Mon, 9 Mar 2015 13:59:58 +0000 (9 14:59 +0100)
tree3727bc07ee13341dfff801c381b8d6afabf2ca67
parentf01c5d84775cfc877dc0b537565a168d043394e9
pseries: Make the PAPR RTC a qdev device

At present the PAPR RTC isn't a "device" as such - it's accessed only via
firmware/hypervisor calls, and is handled in the sPAPR core code.  This
becomes inconvenient as we extend it in various ways.

This patch makes the PAPR RTC a separate device in the qemu device model.

For now, the only piece of device state - the rtc_offset - is still kept in
the global sPAPREnvironment structure.  That's clearly wrong, but leaving
it to be fixed in a following patch makes for a clearer separation between
the internal re-organization of the device, and the behavioural changes
(because the migration stream format needs to change slightly when the
offset is moved into the device's own state).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/spapr.c
hw/ppc/spapr_events.c
hw/ppc/spapr_rtc.c
include/hw/ppc/spapr.h