[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:
Justin C. Miller
2023-02-26 11:32:30 -08:00
parent 0c777bc62f
commit ed95574c24
10 changed files with 222 additions and 14 deletions

View File

@@ -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;
}