Initial commit - slab allocator, kmalloc, other re

factors
This commit is contained in:
ssimnb 2026-01-22 08:05:47 +01:00
parent 1dd7b8b07f
commit 4e40a040dd
39 changed files with 863 additions and 412 deletions

View file

@ -4,7 +4,7 @@
#include "timer.h"
#include "ioapic.h"
#include <lock.h>
#include <stdio.h>
#include <kprint.h>
#include <SFB25.h>
#include <cpuid.h> // GCC specific
@ -55,7 +55,7 @@ void apic_sleep(uint64_t ms){
atomic_flag lapic_timer_flag = ATOMIC_FLAG_INIT;
void lapic_timer_init(int us){
acquire_lock(&lapic_timer_flag);
acquire_spinlock(&lapic_timer_flag);
/* Stop the APIC timer */
lapic_write_reg(LAPIC_TIMER_INITIAL_CNT_REG, 0);
@ -80,7 +80,7 @@ void lapic_timer_init(int us){
/* Set the inital count to the calibration */
lapic_write_reg(LAPIC_TIMER_INITIAL_CNT_REG, calibration);
free_lock(&lapic_timer_flag);
free_spinlock(&lapic_timer_flag);
}