pushed the slab init a bit deeper. added a object cache based allocator, including a bootstrap mechanism to have it init during bootup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20896 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -16,14 +16,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* create_object_cache_etc flags */
|
||||
enum {
|
||||
/* create_object_cache_etc flags */
|
||||
CACHE_NO_DEPOT = 1 << 0,
|
||||
};
|
||||
|
||||
/* object_cache_alloc flags */
|
||||
enum {
|
||||
CACHE_DONT_SLEEP = 1 << 0,
|
||||
/* object_cache_alloc flags */
|
||||
CACHE_DONT_SLEEP = 1 << 8,
|
||||
|
||||
/* internal */
|
||||
CACHE_DURING_BOOT = 1 << 31
|
||||
};
|
||||
|
||||
typedef struct object_cache object_cache;
|
||||
|
||||
@@ -26,7 +26,7 @@ typedef struct object_depot {
|
||||
} object_depot;
|
||||
|
||||
|
||||
status_t object_depot_init(object_depot *depot,
|
||||
status_t object_depot_init(object_depot *depot, uint32 flags,
|
||||
void (*return_object)(object_depot *, void *));
|
||||
void object_depot_destroy(object_depot *depot);
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ extern "C" {
|
||||
|
||||
// startup only
|
||||
status_t vm_init(kernel_args *args);
|
||||
status_t slab_init();
|
||||
status_t vm_init_post_sem(struct kernel_args *args);
|
||||
status_t vm_init_post_thread(struct kernel_args *args);
|
||||
status_t vm_init_post_modules(struct kernel_args *args);
|
||||
@@ -32,6 +31,10 @@ void vm_free_unused_boot_loader_range(addr_t start, addr_t end);
|
||||
addr_t vm_allocate_early(kernel_args *args, size_t virtualSize,
|
||||
size_t physicalSize, uint32 attributes);
|
||||
|
||||
|
||||
void slab_init(addr_t initialBase, size_t initialSize);
|
||||
void slab_init_post_sem();
|
||||
|
||||
// to protect code regions with interrupts turned on
|
||||
void permit_page_faults(void);
|
||||
void forbid_page_faults(void);
|
||||
|
||||
Reference in New Issue
Block a user