--- nono/vm/goldfish_tty.cpp 2026/04/29 17:05:42 1.1.1.4 +++ nono/vm/goldfish_tty.cpp 2026/04/29 17:06:00 1.1.1.6 @@ -40,7 +40,6 @@ #include "goldfish_pic.h" #include "hostcom.h" #include "mainbus.h" -#include "mpu.h" #include "scheduler.h" #include "syncer.h" @@ -54,7 +53,7 @@ GFTTYDevice::GFTTYDevice() GFTTYDevice::~GFTTYDevice() { if ((bool)hostcom) { - hostcom->SetRxCallback(NULL); + hostcom->ResetRxCallback(); } } @@ -63,13 +62,13 @@ GFTTYDevice::Create() { // 対応するホストドライバを作成 try { - hostcom.reset(new HostCOMDevice(this, "HostCOM")); + hostcom.reset(new HostCOMDevice(this, 0, "GoldfishTTY")); } catch (...) { } if ((bool)hostcom == false) { warnx("Failed to initialize HostCOMDevice at %s", __method__); return false; } - hostcom->SetRxCallback(ToDeviceCallback(&GFTTYDevice::HostRxCallback)); + hostcom->SetRxCallback(ToDeviceCallback(&GFTTYDevice::HostRxCallback), 0); return true; } @@ -93,7 +92,7 @@ GFTTYDevice::Init() gfpic = GetGFPICDevice(1); gfpic->RegistIRQ(32, "GFTTY", this); - scheduler->ConnectMessage(MessageID::HOSTCOM_RX, this, + scheduler->ConnectMessage(MessageID::HOSTCOM0_RX, this, ToMessageCallback(&GFTTYDevice::RxMessage)); return true; } @@ -125,7 +124,7 @@ GFTTYDevice::ReadPort(uint32 offset) break; default: - putlog(1, "Read $%08x.L", mpu->GetPaddr()); + putlog(1, "Read $%08x.L", mainbus->GetPaddr()); data.SetBusErr(); break; } @@ -160,7 +159,7 @@ GFTTYDevice::WritePort(uint32 offset, ui break; default: - putlog(1, "Write $%08x.L", mpu->GetPaddr()); + putlog(1, "Write $%08x.L", mainbus->GetPaddr()); r.SetBusErr(); break; } @@ -251,7 +250,7 @@ GFTTYDevice::Command(uint32 cmd) void GFTTYDevice::Tx(uint32 data) { - // パフォーマンス測定用のギミック。 + // --perf によるパフォーマンス測定用のギミック。 // GFTTY に特定の文字列を書き込むと、 // VM 電源オン時から現在までの実時間をログに出力する。NetBSD の // マルチユーザブートがあらかた終わってログインプロンプトが出る手前の @@ -291,9 +290,9 @@ GFTTYDevice::ChangeInterrupt() // ホストスレッドからの受信通知 // (HostCOM スレッドで呼ばれる) void -GFTTYDevice::HostRxCallback() +GFTTYDevice::HostRxCallback(uint32 dummy) { - scheduler->SendMessage(MessageID::HOSTCOM_RX); + scheduler->SendMessage(MessageID::HOSTCOM0_RX); } // ホストシリアルからの1バイト(以上)受信メッセージ