Dynamic IRQ handling

This commit is contained in:
2025-12-10 01:33:51 +01:00
parent 64b14f3878
commit 6feea1444a
18 changed files with 341 additions and 121 deletions

View File

@@ -9,12 +9,15 @@
#include <libk/stdatomic.h>
#include <libk/types.h>
#include <sys/mm.h>
#include <mm/liballoc.h>
#include <mm/pmm.h>
#include <sync/spinlock.h>
#include <config.h>
#if defined(__i386__)
#include <sys/mm.h>
#endif
struct spinlock liballoc_sl = { .flag = ATOMIC_FLAG_INIT, .name = "liballoc" };
uptr_t liballoc_memory_start = KERNEL_HEAP_START;
@@ -43,8 +46,6 @@ void *liballoc_alloc(int pages) {
sl_unlock(&pd->sl);
return (void *)vaddr;
#else
#error "platform unimplemented"
#endif
}
@@ -52,7 +53,7 @@ int liballoc_free(void *ptr1, int pages) {
#if defined(__i386__)
struct page_dir *pd = mm_get_kernel_pd();
uptr_t ptr = ALIGN_DOWN((uptr_t)ptr1, 0x1000);
uptr_t ptr = ALIGN_DOWN((uptr_t)ptr1, PAGE_SIZE);
sl_lock(&pd->sl);
@@ -65,8 +66,6 @@ int liballoc_free(void *ptr1, int pages) {
sl_unlock(&pd->sl);
return 0;
#else
#error "platform unimplemented"
#endif
}