1 #ifndef WDT_DIAG288_H 2 #define WDT_DIAG288_H 3 4 #include "hw/qdev-core.h" 5 #include "qom/object.h" 6 7 #define TYPE_WDT_DIAG288 "diag288" 8 typedef struct DIAG288Class DIAG288Class; 9 typedef struct DIAG288State DIAG288State; 10 #define DIAG288(obj) \ 11 OBJECT_CHECK(DIAG288State, (obj), TYPE_WDT_DIAG288) 12 #define DIAG288_CLASS(klass) \ 13 OBJECT_CLASS_CHECK(DIAG288Class, (klass), TYPE_WDT_DIAG288) 14 #define DIAG288_GET_CLASS(obj) \ 15 OBJECT_GET_CLASS(DIAG288Class, (obj), TYPE_WDT_DIAG288) 16 17 #define WDT_DIAG288_INIT 0 18 #define WDT_DIAG288_CHANGE 1 19 #define WDT_DIAG288_CANCEL 2 20 21 struct DIAG288State { 22 /*< private >*/ 23 DeviceState parent_obj; 24 QEMUTimer *timer; 25 bool enabled; 26 27 /*< public >*/ 28 }; 29 30 struct DIAG288Class { 31 /*< private >*/ 32 DeviceClass parent_class; 33 34 /*< public >*/ 35 int (*handle_timer)(DIAG288State *dev, 36 uint64_t func, uint64_t timeout); 37 }; 38 39 #endif /* WDT_DIAG288_H */ 40