Add support for RISC-V.

This commit is contained in:
Ruslan Bukin 2016-04-26 12:29:47 +00:00
parent fc0424631d
commit 3a32292401

View File

@ -56,7 +56,7 @@ static struct devmap_entry akva_devmap_entries[AKVA_DEVMAP_MAX_ENTRIES];
static u_int akva_devmap_idx;
static vm_offset_t akva_devmap_vaddr = DEVMAP_MAX_VADDR;
#ifdef __aarch64__
#if defined(__aarch64__) || defined(__riscv__)
extern int early_boot;
#endif
@ -200,7 +200,7 @@ devmap_bootstrap(vm_offset_t l1pt, const struct devmap_entry *table)
pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size,
VM_PROT_READ | VM_PROT_WRITE, PTE_DEVICE);
#endif
#elif defined(__aarch64__)
#elif defined(__aarch64__) || defined(__riscv__)
pmap_kenter_device(pd->pd_va, pd->pd_size, pd->pd_pa);
#endif
}
@ -273,7 +273,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t size)
pa = trunc_page(pa);
size = round_page(size + offset);
#ifdef __aarch64__
#if defined(__aarch64__) || defined(__riscv__)
if (early_boot) {
akva_devmap_vaddr = trunc_page(akva_devmap_vaddr - size);
va = akva_devmap_vaddr;