--- nono/vm/mpu.cpp 2026/04/29 17:05:41 1.1.1.16 +++ nono/vm/mpu.cpp 2026/04/29 17:05:54 1.1.1.18 @@ -25,6 +25,7 @@ #include "mpu.h" #include "config.h" #include "debugger.h" +#include "event.h" #include "mainbus.h" #include "scheduler.h" #include "syncer.h" @@ -50,8 +51,8 @@ MPUDevice::Init() { debugger = GetDebugger(); - // パラメータは継承側でセットしている。 - scheduler->RegistEvent(exec_event); + auto evman = GetEventManager(); + exec_event = evman->Regist(this, NULL, "MPU Execute"); return true; } @@ -112,8 +113,6 @@ MainMPUDevice::Init() scheduler->ConnectMessage(MessageID::MPU_TRACE_MAIN, this, ToMessageCallback(&MainMPUDevice::TraceMessage)); - exec_event.SetName("MPU Execute"); - return true; } @@ -134,7 +133,7 @@ void MainMPUDevice::ChangeState(uint32 new_state) { // new_mode (CPU_STATE_*) と - // RequestCPUMode() の引数 Syncer::SYNCMODE_CPU_* は + // NotifyCPUMode() の引数 Syncer::SYNCMODE_CPU_* は // 実は同じ値なのでそのまま渡してよいことにする。 static_assert(CPU_STATE_NORMAL == Syncer::SYNCMODE_CPU_NORMAL, ""); static_assert(CPU_STATE_STOP == Syncer::SYNCMODE_CPU_STOP, ""); @@ -143,7 +142,7 @@ MainMPUDevice::ChangeState(uint32 new_st if (cpu_state != new_state) { cpu_state = new_state; // スケジューラに通知 - syncer->RequestCPUMode(cpu_state); + syncer->NotifyCPUMode(cpu_state); } }