kernel/inc/modules/loader.h

33 lines
983 B
C

// This file is part of noxos and licensed under the MIT open source license
#ifndef NOXOS_MODULES_LOADER_H
#define NOXOS_MODULES_LOADER_H
#include <modules/module.h>
#include <utils/bitmap.h>
#define MODULE_MANAGER_CHUNK_SIZE 16
typedef struct module_manager_chunk_T module_manager_chunk_T;
struct module_manager_chunk_T {
module_T* modules [MODULE_MANAGER_CHUNK_SIZE];
bitmap_T modules_bitmap;
uint32_t num_modules;
module_manager_chunk_T* prev;
module_manager_chunk_T* next;
};
typedef struct {
module_manager_chunk_T* chunks;
} module_manager_T;
void module_manager_init ();
module_manager_chunk_T* module_manager_chunk_alloc (module_manager_chunk_T* prev);
module_T* module_load (string_t name, string_t path);
void module_unload (module_T* module);
#endif //NOXOS_MODULES_LOADER_H