diff options
author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2024-01-09 21:22:14 +0100 |
---|---|---|
committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2024-01-09 21:26:23 +0100 |
commit | c6e1454fbb872aed5d445d458958943556271529 (patch) | |
tree | 4951f6a95e4ddead170a355940822f8c86b6ed63 /stage3/interrupts.c | |
parent | 59f22bc7ce5bbadf62722f3db5c93b45e86e4cca (diff) | |
download | cuddles-c6e1454fbb872aed5d445d458958943556271529.tar.xz |
rename some functions to not use standard names
this avoids confusion when some of those functions differ subtly from their standard versions.
free -> kfree
realloc -> krealloc
malloc -> kmalloc
rationale: kmalloc() behaves different from malloc() in that it will never return NULL. it will panic on OOM. try_kmalloc behaves like the usual malloc.
memcpy -> lmemcpy
memcpy_r -> rmemcpy
rationale: by design, lmemcpy() and rmemcpy() allow memory areas to overlap. the 'l' and 'r' indicate the direction of the copy operation.
Diffstat (limited to 'stage3/interrupts.c')
-rw-r--r-- | stage3/interrupts.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stage3/interrupts.c b/stage3/interrupts.c index 2bb64f1..9c7bcc8 100644 --- a/stage3/interrupts.c +++ b/stage3/interrupts.c @@ -27,9 +27,9 @@ void interrupt_handler(interrupt_frame *frame) if (queue_write.len == queue_write.cap) { panic(S("queue exceeded\n")); /* - // TODO: malloc would cause a race condition + // TODO: kmalloc would cause a race condition queue_write.cap = queue_write.cap == 0 ? 1 : queue_write.cap * 2; - queue_write.data = realloc(queue_write.data, queue_write.cap); + queue_write.data = krealloc(queue_write.data, queue_write.cap); */ } @@ -64,7 +64,7 @@ void interrupts_init() u32 zero; } __attribute__((packed)) interrupt_descriptor; - interrupt_descriptor *idt = malloc(256 * sizeof *idt); + interrupt_descriptor *idt = kmalloc(256 * sizeof *idt); for (int i = 0; i < 255; i++) { union { |