Linked list interface change
This commit is contained in:
parent
93cd12690c
commit
6088802c06
|
@ -65,7 +65,7 @@ linked_list_node_t *_KERNEL_ABI linked_list_node_insert(linked_list_node_t * hea
|
|||
}
|
||||
}
|
||||
|
||||
void _KERNEL_ABI linked_list_node_add(linked_list_node_t * head, linked_list_node_t * node)
|
||||
void _KERNEL_ABI linked_list_node_push_back(linked_list_node_t *head, linked_list_node_t *node)
|
||||
{
|
||||
if(head == NULL || node == NULL)
|
||||
return;
|
||||
|
@ -112,7 +112,7 @@ void _KERNEL_ABI linked_list_init(linked_list_t * list)
|
|||
return;
|
||||
}
|
||||
|
||||
void _KERNEL_ABI linked_list_add(linked_list_t * list, linked_list_node_t * node)
|
||||
void _KERNEL_ABI linked_list_push_back(linked_list_t *list, linked_list_node_t *node)
|
||||
{
|
||||
if(list != NULL && node != NULL)
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ void _KERNEL_ABI linked_list_add(linked_list_t * list, linked_list_node_t * node
|
|||
list->head = node;
|
||||
}
|
||||
else
|
||||
linked_list_node_add(list->head, node);
|
||||
linked_list_node_push_back(list->head, node);
|
||||
list->size++;
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -15,7 +15,7 @@ typedef struct
|
|||
|
||||
void _KERNEL_ABI linked_list_init(linked_list_t * list);
|
||||
|
||||
void _KERNEL_ABI linked_list_add(linked_list_t * list, linked_list_node_t * node);
|
||||
void _KERNEL_ABI linked_list_push_back(linked_list_t *list, linked_list_node_t *node);
|
||||
|
||||
void _KERNEL_ABI linked_list_insert(linked_list_t * list, int index, linked_list_node_t * node);
|
||||
|
||||
|
@ -23,16 +23,5 @@ linked_list_node_t *_KERNEL_ABI linked_list_get(linked_list_t * list, int index)
|
|||
|
||||
void _KERNEL_ABI linked_list_remove(linked_list_t *list, int index);
|
||||
|
||||
int _KERNEL_ABI linked_list_node_size(linked_list_node_t * head);
|
||||
|
||||
void _KERNEL_ABI linked_list_node_init(linked_list_node_t * node);
|
||||
|
||||
void _KERNEL_ABI linked_list_node_add(linked_list_node_t * head, linked_list_node_t * node);
|
||||
|
||||
linked_list_node_t *_KERNEL_ABI linked_list_node_insert(linked_list_node_t * head, int index, linked_list_node_t * node);
|
||||
|
||||
linked_list_node_t *_KERNEL_ABI linked_list_node_get(linked_list_node_t * head, int index);
|
||||
|
||||
linked_list_node_t *_KERNEL_ABI linked_list_node_remove(linked_list_node_t *head, int index);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -115,7 +115,7 @@ boot_info_t *_KERNEL_ABI hal_init(multiboot_info_t *m_info)
|
|||
hal_assert(each_desc != NULL, "Unable to allocate memory for memory_descriptor.");
|
||||
each_desc->page_count = page_count;
|
||||
each_desc->base_addr = aligned_base_addr;
|
||||
linked_list_add(boot_info->mem_info->free_page_list, &each_desc->list_node);
|
||||
linked_list_push_back(boot_info->mem_info->free_page_list, &each_desc->list_node);
|
||||
boot_info->mem_info->mem_available += aligned_end_addr - aligned_base_addr;
|
||||
}
|
||||
boot_info->mem_info->mem_installed += (mem_map + i)->len;
|
||||
|
@ -150,7 +150,7 @@ boot_info_t *_KERNEL_ABI hal_init(multiboot_info_t *m_info)
|
|||
hal_assert(each_module->name != NULL, "Unable to allocate memory for module name string.");
|
||||
mem_copy((void *) (mods_list + i)->cmdline, each_module->name,
|
||||
str_len((char *) (mods_list + i)->cmdline) + 1);
|
||||
linked_list_add(boot_info->module_info->module_list, &each_module->list_node);
|
||||
linked_list_push_back(boot_info->module_info->module_list, &each_module->list_node);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue