--- nono/vm/goldfish_timer.h 2026/04/29 17:05:29 1.1.1.2 +++ nono/vm/goldfish_timer.h 2026/04/29 17:06:00 1.1.1.5 @@ -9,8 +9,6 @@ // #include "device.h" -#include "event.h" -#include "monitor.h" class GFRTCDevice; class InterruptDevice; @@ -35,10 +33,10 @@ class GFTimerDevice : public IODevice busdata PeekPort(uint32 offset); private: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); - void CallbackVT(Event& ev); - void CallbackRT(Event& ev); + void CallbackVT(Event *); + void CallbackRT(Event *); void ChangeInterrupt(); // アラーム開始。 @@ -48,32 +46,32 @@ class GFTimerDevice : public IODevice uint64 Now() const; // TIMER レジスタ読み出し値。(アラームの基準点としても使う) - uint64 elapsed {}; + union64 elapsed {}; // アラーム予定時刻 (0 ならアラームなし) - uint64 alarm {}; + union64 alarm {}; // 先に書き込まれた上位側を一旦保持しておくところ。 - uint64 alarm_high {}; + uint32 alarm_high {}; bool sync_rt {}; // 実時間同期用 uint64 mtime_epoch {}; // 調整実時間軸の起点(仮想時刻) - uint64 mtime {}; // 自身の調整実時間 + uint64 mtime {}; // 自身の調整実時間。(mtime_epoch からの経過時間) bool intr_enable {}; // 割り込み許可 bool intr_assert {}; // 割り込み発生 - Event event { this }; + Event *event {}; - Monitor monitor { this }; + Monitor *monitor {}; GFRTCDevice *gfrtc {}; InterruptDevice *interrupt {}; Syncer *syncer {}; }; -static inline GFTimerDevice *GetGFTimerDevice() { +inline GFTimerDevice *GetGFTimerDevice() { return Object::GetObject(OBJ_GFTIMER); }