kernel: msg: implement asynchronous event messages

This commit is contained in:
2026-03-24 18:32:33 +00:00
parent 110f625f04
commit 89d02c72ee
7 changed files with 178 additions and 56 deletions

22
kernel/msg.c Normal file
View File

@@ -0,0 +1,22 @@
#include <kernel/msg.h>
#include <kernel/vm.h>
static struct vm_cache msg_cache = {
.c_name = "msg",
.c_obj_size = sizeof(struct msg),
};
void msg_init(void)
{
vm_cache_init(&msg_cache);
}
struct msg *msg_alloc(void)
{
return vm_cache_alloc(&msg_cache, VM_NORMAL);
}
void msg_free(struct msg *msg)
{
vm_cache_free(&msg_cache, msg);
}