1
0
Fork 0

subkernel: use negative ID for argument passing

This commit is contained in:
mwojcik 2024-01-31 17:10:30 +08:00
parent facc98058c
commit 52e64fb2f9
2 changed files with 3 additions and 3 deletions

View File

@ -103,7 +103,7 @@ pub enum Message {
SubkernelMsgSent, SubkernelMsgSent,
#[cfg(has_drtio)] #[cfg(has_drtio)]
SubkernelMsgRecvRequest { SubkernelMsgRecvRequest {
id: u32, id: i32,
timeout: i64, timeout: i64,
tags: Vec<u8>, tags: Vec<u8>,
}, },

View File

@ -471,7 +471,7 @@ async fn handle_run_kernel(
} }
#[cfg(has_drtio)] #[cfg(has_drtio)]
kernel::Message::SubkernelMsgRecvRequest { id, timeout, tags } => { 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 { let (status, count) = match message_received {
Ok(ref message) => (kernel::SubkernelStatus::NoError, message.count), Ok(ref message) => (kernel::SubkernelStatus::NoError, message.count),
Err(SubkernelError::Timeout) => (kernel::SubkernelStatus::Timeout, 0), Err(SubkernelError::Timeout) => (kernel::SubkernelStatus::Timeout, 0),
@ -480,7 +480,7 @@ async fn handle_run_kernel(
Err(SubkernelError::SubkernelException) => { Err(SubkernelError::SubkernelException) => {
error!("Exception in subkernel"); error!("Exception in subkernel");
// just retrieve the exception // 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 .await
.unwrap(); .unwrap();
match stream { match stream {