From 52e64fb2f984cc87e210ced4f863293edb0881d5 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Wed, 31 Jan 2024 17:10:30 +0800 Subject: [PATCH] subkernel: use negative ID for argument passing --- src/libksupport/src/kernel/mod.rs | 2 +- src/runtime/src/comms.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libksupport/src/kernel/mod.rs b/src/libksupport/src/kernel/mod.rs index 89dacb38..b235cdd4 100644 --- a/src/libksupport/src/kernel/mod.rs +++ b/src/libksupport/src/kernel/mod.rs @@ -103,7 +103,7 @@ pub enum Message { SubkernelMsgSent, #[cfg(has_drtio)] SubkernelMsgRecvRequest { - id: u32, + id: i32, timeout: i64, tags: Vec, }, diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index 163793b6..d5960ec7 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -471,7 +471,7 @@ async fn handle_run_kernel( } #[cfg(has_drtio)] kernel::Message::SubkernelMsgRecvRequest { id, timeout, tags } => { - let message_received = subkernel::message_await(id, timeout, timer).await; + let message_received = subkernel::message_await(id as u32, timeout, timer).await; let (status, count) = match message_received { Ok(ref message) => (kernel::SubkernelStatus::NoError, message.count), Err(SubkernelError::Timeout) => (kernel::SubkernelStatus::Timeout, 0), @@ -480,7 +480,7 @@ async fn handle_run_kernel( Err(SubkernelError::SubkernelException) => { error!("Exception in subkernel"); // just retrieve the exception - let status = subkernel::await_finish(aux_mutex, routing_table, timer, id, timeout) + let status = subkernel::await_finish(aux_mutex, routing_table, timer, id as u32, timeout) .await .unwrap(); match stream {