Almost finished scheduler, switched to circular linked list

This commit is contained in:
ssimnb 2026-02-09 06:33:12 +01:00
parent edfbfdad14
commit 4c7ecb4012
10 changed files with 124 additions and 89 deletions

View file

@ -14,7 +14,7 @@ struct ma_bufctl {
};
// ADD COLORING
struct ma_slab {
struct ma_kcache *cache;
struct ma_cache *cache;
struct ma_slab *next;
struct ma_slab *prev;
@ -32,12 +32,12 @@ struct ma_objref {
struct ma_objref *prev;
void *addr; // Addr of the object
struct ma_slab *slab; // The slab which the obj belongs to
struct ma_kcache *kcache; // The cache which the obj belongs to
struct ma_cache *kcache; // The cache which the obj belongs to
};
struct ma_kcache {
struct ma_kcache *next;
struct ma_kcache *prev;
struct ma_cache {
struct ma_cache *next;
struct ma_cache *prev;
uint32_t objsize; // Size of the object which the cache stores
uint16_t flags; // Not useful yet
@ -53,7 +53,8 @@ struct ma_kcache {
char name[KCACHE_NAME_LEN];
};
void *ma_cache_alloc(struct ma_kcache *kcache, uint32_t flags);
void *ma_cache_alloc(struct ma_cache *kcache, uint32_t flags);
kstatus ma_cache_dealloc(void *object);
struct ma_kcache *ma_cache_create(char *name, size_t size, uint32_t flags, void (*constructor)(void *, size_t), void (*destructor)(void *, size_t));
void cache_info(struct ma_kcache *cache);
struct ma_cache *ma_cache_create(char *name, size_t size, uint32_t flags, void (*constructor)(void *, size_t), void (*destructor)(void *, size_t));
void cache_info(struct ma_cache *cache);
void create_base_caches();