From 09d292fd09a9599214367dd86bfb8ee8acf7ec40 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 5 Mar 2026 21:04:02 +0000 Subject: [PATCH] kernel: msg: include details about who sent a message --- kernel/channel.c | 2 ++ libmango/include/mango/types.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/kernel/channel.c b/kernel/channel.c index 5a4b217..a8a022c 100644 --- a/kernel/channel.c +++ b/kernel/channel.c @@ -202,6 +202,8 @@ extern kern_status_t channel_recv_msg( } out_msg->msg_id = msg->msg_id; + out_msg->msg_sender = msg->msg_sender_thread->tr_parent->t_id; + out_msg->msg_endpoint = msg->msg_sender_port->p_base.ob_id; spin_unlock_irqrestore(&msg->msg_lock, msg_lock_flags); diff --git a/libmango/include/mango/types.h b/libmango/include/mango/types.h index e713bd0..56fa411 100644 --- a/libmango/include/mango/types.h +++ b/libmango/include/mango/types.h @@ -61,9 +61,19 @@ typedef struct { } kern_msg_handle_t; typedef struct { + /* transaction id. identifies a particular request/response exchange. + * used when replying to a particular message. */ msgid_t msg_id; + /* the id of the task that sent a particular message. */ + tid_t msg_sender; + /* the id of the port or channel used to send a particular message. */ + koid_t msg_endpoint; + /* a list of iovecs that point to the buffers that make up the main + * message data. */ kern_iovec_t *msg_data; size_t msg_data_count; + /* a list of handle entries that contain the kernel handles included + * in a message. */ kern_msg_handle_t *msg_handles; size_t msg_handles_count; } kern_msg_t;