kernel: msg: implement asynchronous event messages
This commit is contained in:
22
kernel/msg.c
Normal file
22
kernel/msg.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user