[init] Move PCIe probing to srv.init

This was kept in the kernel as a way to keep exercising the code, but it
doesn't belong there. This moves it to init, which doesn't do anything
but probe for devices currently - but at least it's executing the code
in userspace now.
This commit is contained in:
Justin C. Miller
2023-02-20 11:23:49 -08:00
parent 15e2f8abf3
commit 3a7a18011c
16 changed files with 294 additions and 235 deletions

View File

@@ -19,17 +19,14 @@ constexpr size_t stack_size = 0x10000;
constexpr uintptr_t stack_top = 0x80000000000;
j6_handle_t
map_phys(j6_handle_t sys, uintptr_t phys, size_t len, uintptr_t addr)
map_phys(j6_handle_t sys, uintptr_t phys, size_t len, j6_vm_flags flags)
{
j6_handle_t vma = j6_handle_invalid;
j6_status_t res = j6_system_map_phys(sys, &vma, phys, len, 0);
j6_status_t res = j6_system_map_phys(sys, &vma, phys, len, flags);
if (res != j6_status_ok)
return j6_handle_invalid;
if (!addr)
addr = phys;
res = j6_vma_map(vma, 0, addr);
res = j6_vma_map(vma, 0, phys);
if (res != j6_status_ok)
return j6_handle_invalid;