riscv: Implement pmap_mapdev_attr
This is needed for LinuxKPI's _ioremap_attr. This reuses the generic implementation introduced for aarch64, and itself requires implementing pmap_kenter, which is trivial to do given riscv currently treats all mapping attributes the same due to the Svpbmt extension not yet being ratified and in hardware. Reviewed by: markj, mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32445
This commit is contained in:
parent
0f559a9f09
commit
682c00a6ce
@ -290,7 +290,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t size)
|
||||
return ((void *)(va + offset));
|
||||
}
|
||||
|
||||
#if defined(__aarch64__)
|
||||
#if defined(__aarch64__) || defined(__riscv)
|
||||
void *
|
||||
pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma)
|
||||
{
|
||||
|
@ -145,10 +145,12 @@ void pmap_activate_boot(pmap_t);
|
||||
void pmap_activate_sw(struct thread *);
|
||||
void pmap_bootstrap(vm_offset_t, vm_paddr_t, vm_size_t);
|
||||
int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode);
|
||||
void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode);
|
||||
void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
|
||||
vm_paddr_t pmap_kextract(vm_offset_t va);
|
||||
void pmap_kremove(vm_offset_t);
|
||||
void pmap_kremove_device(vm_offset_t, vm_size_t);
|
||||
void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma);
|
||||
bool pmap_page_is_mapped(vm_page_t m);
|
||||
bool pmap_ps_enabled(pmap_t);
|
||||
|
||||
|
@ -916,7 +916,7 @@ pmap_kextract(vm_offset_t va)
|
||||
***************************************************/
|
||||
|
||||
void
|
||||
pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa)
|
||||
pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode __unused)
|
||||
{
|
||||
pt_entry_t entry;
|
||||
pt_entry_t *l3;
|
||||
@ -947,6 +947,12 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa)
|
||||
pmap_invalidate_range(kernel_pmap, sva, va);
|
||||
}
|
||||
|
||||
void
|
||||
pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa)
|
||||
{
|
||||
pmap_kenter(sva, size, pa, VM_MEMATTR_DEVICE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove a page from the kernel pagetables.
|
||||
* Note: not SMP coherent.
|
||||
|
Loading…
Reference in New Issue
Block a user