mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Add (wip) futex syscalls
Add the syscalls j6_futex_wait and j6_futex_wake. Currently marking this as WIP as they need more testing. Added to support futexes: - vm_area and vm_space support for looking up physical address for a virtual address - libj6 mutex implementation using futex system calls
This commit is contained in:
@@ -367,3 +367,17 @@ vm_space::copy(vm_space &source, vm_space &dest, const void *from, void *to, siz
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
uintptr_t
|
||||
vm_space::find_physical(uintptr_t virt)
|
||||
{
|
||||
uintptr_t base = 0;
|
||||
obj::vm_area *area = get(virt, &base);
|
||||
if (!area)
|
||||
return 0;
|
||||
|
||||
uintptr_t phys = 0;
|
||||
area->get_page(virt - base, phys, false);
|
||||
return phys;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user