Support mmap with customized attr.

This commit is contained in:
TXuian
2024-10-31 21:00:09 +08:00
parent 78cba2564e
commit ce727442de
10 changed files with 163 additions and 9 deletions

View File

@@ -54,8 +54,13 @@ int sys_spawn(char* img_start, char* name, char** argv)
// alloc a new pcb
struct Thread* new_task_cb = xizi_task_manager.new_task_cb(pmemspace);
if (UNLIKELY(!new_task_cb)) {
ERROR("Unable to new task control block.\n");
free_memspace(pmemspace);
ERROR("Unable to new task control block %x.\n");
// error task allocation may free memspace before hand
// @todo use task ref map to handle this scene
if (NULL != pmemspace->tag.meta) {
free_memspace(pmemspace);
}
return -1;
}
assert(!IS_DOUBLE_LIST_EMPTY(&pmemspace->thread_list_guard));