summaryrefslogtreecommitdiffstats
path: root/include/hw/ppc
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2015-02-06 14:55:51 +1100
committerAlexander Graf <agraf@suse.de>2015-03-09 14:59:58 +0100
commit28df36a13a3b0b792d9df64f8db8a392df5e0b35 (patch)
tree3727bc07ee13341dfff801c381b8d6afabf2ca67 /include/hw/ppc
parentf01c5d84775cfc877dc0b537565a168d043394e9 (diff)
downloadhqemu-28df36a13a3b0b792d9df64f8db8a392df5e0b35.zip
hqemu-28df36a13a3b0b792d9df64f8db8a392df5e0b35.tar.gz
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 'include/hw/ppc')
-rw-r--r--include/hw/ppc/spapr.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 0fd4912..80c6e4f 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -15,6 +15,7 @@ typedef struct sPAPREnvironment {
QLIST_HEAD(, sPAPRPHBState) phbs;
struct sPAPRNVRAM *nvram;
XICSState *icp;
+ DeviceState *rtc;
hwaddr ram_limit;
void *htab;
@@ -480,7 +481,9 @@ int spapr_dma_dt(void *fdt, int node_off, const char *propname,
uint32_t liobn, uint64_t window, uint32_t size);
int spapr_tcet_dma_dt(void *fdt, int node_off, const char *propname,
sPAPRTCETable *tcet);
-void spapr_rtc_init(void);
-void spapr_rtc_read(sPAPREnvironment *spapr, struct tm *tm, uint32_t *ns);
+
+#define TYPE_SPAPR_RTC "spapr-rtc"
+
+void spapr_rtc_read(DeviceState *dev, struct tm *tm, uint32_t *ns);
#endif /* !defined (__HW_SPAPR_H__) */
OpenPOWER on IntegriCloud