--- nono/vm/goldfish_timer.h 2026/04/29 17:05:25 1.1 +++ nono/vm/goldfish_timer.h 2026/04/29 17:05:50 1.1.1.4 @@ -9,8 +9,6 @@ // #include "device.h" -#include "event.h" -#include "monitor.h" class GFRTCDevice; class InterruptDevice; @@ -27,15 +25,18 @@ class GFTimerDevice : public IODevice bool Init() override; void ResetHard(bool poweron) override; - busdata Read32(uint32 addr) override; - busdata Write32(uint32 addr, uint32 data) override; - busdata Peek8(uint32 addr) override; + protected: + // BusIO インタフェース + static const uint32 NPORT = 0x1000 >> 2; + busdata ReadPort(uint32 offset); + busdata WritePort(uint32 offset, uint32 data); + busdata PeekPort(uint32 offset); private: DECLARE_MONITOR_CALLBACK(MonitorUpdate); - void CallbackVT(Event& ev); - void CallbackRT(Event& ev); + void CallbackVT(Event *); + void CallbackRT(Event *); void ChangeInterrupt(); // アラーム開始。 @@ -57,14 +58,14 @@ class GFTimerDevice : public IODevice // 実時間同期用 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 {};