重写rust核心库,构建中断处理框架 #6

Merged
pointer-to-bios merged 18 commits from pointer-to-bios/metaverse-dev:main into main 2024-05-03 05:45:43 +08:00
1 changed files with 0 additions and 5 deletions
Showing only changes of commit ad8cb92e78 - Show all commits

View File

@ -37,7 +37,6 @@ allocator_t *memm_allocator_new(void *start, usize length, usize type, usize pid
allocator_t *allocator = start; allocator_t *allocator = start;
allocator->magic = MEMM_ALLOCATOR_MAGIC; allocator->magic = MEMM_ALLOCATOR_MAGIC;
allocator->full = false; allocator->full = false;
allocator->pid = 0;
allocator->size = length; allocator->size = length;
allocator->type = type; allocator->type = type;
switch (type) switch (type)
@ -71,10 +70,6 @@ void memm_free(void *mem)
allocator_t *allocator = memory_manager.kernel_base_allocator; allocator_t *allocator = memory_manager.kernel_base_allocator;
if (allocator->magic != MEMM_ALLOCATOR_MAGIC) if (allocator->magic != MEMM_ALLOCATOR_MAGIC)
return; return;
if (is_user_address((u64)mem))
{
mem = mem - allocator->userspace + (void *)allocator;
}
allocator->free(allocator->allocator_instance, mem); allocator->free(allocator->allocator_instance, mem);
if (allocator->full) if (allocator->full)
allocator->full = false; allocator->full = false;