slab: rewrite slab allocator

This commit is contained in:
Matheus
2025-09-04 22:40:10 -03:00
parent 8cba07f65c
commit 2fa040096c
11 changed files with 500 additions and 261 deletions
+7 -1
View File
@@ -25,7 +25,7 @@ typedef struct cpu_t {
vmmcontext_t *vmmctx; // expected to be here by other code
long hardware_id; // expected to be here by other code
long internal_id;
long internal_id; // expected to be here by other code
timekeeper_source_t *timekeeper_source;
timekeeper_source_info_t *timekeeper_source_info;
@@ -125,6 +125,12 @@ static inline void set_current_vmm_context(vmmcontext_t *context) {
asm volatile ("mov %%rax, %%gs:16" : : "a"(context) : "memory");
}
static inline long current_cpu_internal_id(void) {
long id;
asm volatile ("mov %%gs:32, %%rax" : "=a"(id) : : "memory");
return id;
}
static inline long current_cpu_id(void) {
long id;
asm volatile ("mov %%gs:24, %%rax" : "=a"(id) : : "memory");