Redesign linked list
All checks were successful
Build documentation / build-and-deploy (push) Successful in 49s

This commit is contained in:
2026-01-06 16:38:42 +01:00
parent d09e4d97ad
commit e50f8940a9
6 changed files with 51 additions and 141 deletions

View File

@@ -63,12 +63,15 @@ struct proc* proc_from_elf (uint8_t* elf_contents) {
void proc_cleanup (struct proc* proc) {
struct limine_hhdm_response* hhdm = limine_hhdm_request.response;
struct proc_mapping *mapping, *mapping_tmp;
struct list_node_link *mapping_link, *mapping_link_tmp;
spin_lock (&proc->pd.lock);
linklist_foreach (proc->mappings, mapping, mapping_tmp) {
list_foreach (proc->mappings, mapping_link, mapping_link_tmp) {
struct proc_mapping* mapping =
list_entry (mapping_link, struct proc_mapping, proc_mappings_link);
pmm_free (mapping->paddr, mapping->size / PAGE_SIZE);
linklist_remove (struct proc_mapping*, proc->mappings, mapping);
list_remove (proc->mappings, mapping_link);
free (mapping);
}