--- nono/vm/windrv.cpp 2026/04/29 17:05:29 1.1.1.2 +++ nono/vm/windrv.cpp 2026/04/29 17:06:00 1.1.1.5 @@ -24,8 +24,9 @@ #include "hostwindrv.h" #include "mainbus.h" #include "mpu680x0.h" +#include "mytime.h" #include -#include +#include #include // コンストラクタ @@ -61,8 +62,11 @@ WindrvDevice::Create() if (IsWindrv()) { // 対応するホストドライバを作成。 // 今はまだ1つのみ。 - hosts[0].reset(new HostWindrv(this)); + try { + hosts[0].reset(new HostWindrv(this)); + } catch (...) { } if ((bool)hosts[0] == false) { + warnx("Failed to initialize HostWindrv at %s", __method__); return false; } } @@ -86,10 +90,6 @@ WindrvDevice::SetLogLevel(int loglevel_) bool WindrvDevice::Init() { - if (inherited::Init() == false) { - return false; - } - mainbus = GetMainbusDevice(); mpu680x0 = GetMPU680x0Device(mpu); @@ -1758,10 +1758,7 @@ FilesBuf::Init(uint32 key_, HostWindrv * void FilesBuf::UpdateATime() { - struct timeval tv; - - gettimeofday(&tv, NULL); - atime = (uint64)tv.tv_sec * 1000'000 + (uint64)tv.tv_usec; + atime = get_hosttime_usec(); } @@ -2302,10 +2299,7 @@ VDir::MatchName(const std::string& name, void VDir::UpdateATime() { - struct timeval tv; - - gettimeofday(&tv, NULL); - atime = (uint64)tv.tv_sec * 1000'000 + (uint64)tv.tv_usec; + atime = get_hosttime_usec(); }