]> git.proxmox.com Git - mirror_qemu.git/blobdiff - include/hw/watchdog/cmsdk-apb-watchdog.h
Use DECLARE_*CHECKER* macros
[mirror_qemu.git] / include / hw / watchdog / cmsdk-apb-watchdog.h
index ab8b5987a1917e709114e0b636dea7486a077d52..63f4becf867d957728b00abe442afbcb0b313552 100644 (file)
 
 #include "hw/sysbus.h"
 #include "hw/ptimer.h"
+#include "qom/object.h"
 
 #define TYPE_CMSDK_APB_WATCHDOG "cmsdk-apb-watchdog"
-#define CMSDK_APB_WATCHDOG(obj) OBJECT_CHECK(CMSDKAPBWatchdog, (obj), \
-                                              TYPE_CMSDK_APB_WATCHDOG)
+typedef struct CMSDKAPBWatchdog CMSDKAPBWatchdog;
+DECLARE_INSTANCE_CHECKER(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG,
+                         TYPE_CMSDK_APB_WATCHDOG)
 
-typedef struct CMSDKAPBWatchdog {
+/*
+ * This shares the same struct (and cast macro) as the base
+ * cmsdk-apb-watchdog device.
+ */
+#define TYPE_LUMINARY_WATCHDOG "luminary-watchdog"
+
+struct CMSDKAPBWatchdog {
     /*< private >*/
     SysBusDevice parent_obj;
 
@@ -46,6 +54,7 @@ typedef struct CMSDKAPBWatchdog {
     MemoryRegion iomem;
     qemu_irq wdogint;
     uint32_t wdogclk_frq;
+    bool is_luminary;
     struct ptimer_state *timer;
 
     uint32_t control;
@@ -54,6 +63,7 @@ typedef struct CMSDKAPBWatchdog {
     uint32_t itcr;
     uint32_t itop;
     uint32_t resetstatus;
-} CMSDKAPBWatchdog;
+    const uint32_t *id;
+};
 
 #endif