From f9ce4a4a8ed0d5ead686ea3313349489dab6bedd Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Sat, 25 Nov 2023 13:06:14 -0800 Subject: [PATCH] [Zion] Don't ignore DriverManager Register return code. --- zion/interrupt/driver_manager.h | 3 ++- zion/syscall/ipc.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zion/interrupt/driver_manager.h b/zion/interrupt/driver_manager.h index c2ad11b..db205c8 100644 --- a/zion/interrupt/driver_manager.h +++ b/zion/interrupt/driver_manager.h @@ -15,7 +15,8 @@ class DriverManager { void WriteMessage(uint64_t irq_num, IpcMessage&& message); - glcr::ErrorCode RegisterListener(uint64_t irq_num, glcr::RefPtr port); + [[nodiscard]] glcr::ErrorCode RegisterListener(uint64_t irq_num, + glcr::RefPtr port); private: glcr::HashMap> driver_map_; diff --git a/zion/syscall/ipc.cpp b/zion/syscall/ipc.cpp index e18f84a..a49e1ed 100644 --- a/zion/syscall/ipc.cpp +++ b/zion/syscall/ipc.cpp @@ -160,9 +160,9 @@ glcr::ErrorCode IrqRegister(ZIrqRegisterReq* req) { auto& proc = gScheduler->CurrentProcess(); glcr::RefPtr port = glcr::MakeRefCounted(); + *req->port_cap = proc.AddNewCapability(port); - DriverManager::Get().RegisterListener(req->irq_num, port); - return glcr::OK; + return DriverManager::Get().RegisterListener(req->irq_num, port); } glcr::ErrorCode EndpointCreate(ZEndpointCreateReq* req) {