diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2015-02-06 14:55:51 +1100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-03-09 14:59:58 +0100 |
commit | 28df36a13a3b0b792d9df64f8db8a392df5e0b35 (patch) | |
tree | 3727bc07ee13341dfff801c381b8d6afabf2ca67 /hw/ppc/spapr_events.c | |
parent | f01c5d84775cfc877dc0b537565a168d043394e9 (diff) |
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>
Diffstat (limited to 'hw/ppc/spapr_events.c')
-rw-r--r-- | hw/ppc/spapr_events.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c index 80c02660f7..283e96bca1 100644 --- a/hw/ppc/spapr_events.c +++ b/hw/ppc/spapr_events.c @@ -246,7 +246,7 @@ static void spapr_powerdown_req(Notifier *n, void *opaque) maina->hdr.section_id = cpu_to_be16(RTAS_LOG_V6_SECTION_ID_MAINA); maina->hdr.section_length = cpu_to_be16(sizeof(*maina)); /* FIXME: section version, subtype and creator id? */ - spapr_rtc_read(spapr, &tm, NULL); + spapr_rtc_read(spapr->rtc, &tm, NULL); year = tm.tm_year + 1900; maina->creation_date = cpu_to_be32((to_bcd(year / 100) << 24) | (to_bcd(year % 100) << 16) |