Redesign linked list
All checks were successful
Build documentation / build-and-deploy (push) Successful in 49s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 49s
This commit is contained in:
@@ -49,7 +49,7 @@ void proc_map (struct proc* proc, uintptr_t start_paddr, uintptr_t start_vaddr,
|
||||
|
||||
spin_lock (&proc->pd.lock);
|
||||
|
||||
linklist_append (struct proc_mapping*, proc->mappings, mapping);
|
||||
list_append (proc->mappings, &mapping->proc_mappings_link);
|
||||
|
||||
for (uintptr_t vpage = start_vaddr, ppage = start_paddr; vpage < start_vaddr + pages * PAGE_SIZE;
|
||||
vpage += PAGE_SIZE, ppage += PAGE_SIZE) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <aux/compiler.h>
|
||||
#include <aux/elf.h>
|
||||
#include <libk/list.h>
|
||||
#include <libk/rbtree.h>
|
||||
#include <libk/std.h>
|
||||
#include <sync/spin_lock.h>
|
||||
@@ -21,20 +22,19 @@
|
||||
struct cpu;
|
||||
|
||||
struct proc_mapping {
|
||||
struct proc_mapping* next;
|
||||
struct list_node_link proc_mappings_link;
|
||||
|
||||
uintptr_t paddr;
|
||||
uintptr_t vaddr;
|
||||
size_t size;
|
||||
} PACKED;
|
||||
|
||||
struct procw;
|
||||
};
|
||||
|
||||
struct proc {
|
||||
int pid;
|
||||
struct rb_node_link proc_tree_link;
|
||||
struct rb_node_link cpu_run_q_link;
|
||||
|
||||
struct proc_mapping* mappings; /* pd.lock implicitly protects this field */
|
||||
struct list_node_link* mappings; /* pd.lock implicitly protects this field */
|
||||
struct proc_platformdata pdata;
|
||||
struct pd pd;
|
||||
spin_lock_t lock;
|
||||
|
||||
Reference in New Issue
Block a user