Skip to content

Commit

Permalink
LinuxKPI: Implement _ioremap_attr for riscv
Browse files Browse the repository at this point in the history
Now that riscv implements pmap_mapdev_attr we can enable the non-stub
implementation for riscv, which is needed for drm-kmod to not fail at
run time for drivers that need to map I/O regions.

Reviewed by:	hselasky, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32446

(cherry picked from commit 60d962e)
  • Loading branch information
jrtc27 committed Oct 24, 2021
1 parent af81861 commit feb3031
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sys/compat/linuxkpi/common/include/linux/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ _outb(u_char data, u_int port)
}
#endif

#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__)
#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv)
void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
#else
#define _ioremap_attr(...) NULL
Expand Down
4 changes: 2 additions & 2 deletions sys/compat/linuxkpi/common/src/linux_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ vmmap_remove(void *addr)
return (vmmap);
}

#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__)
#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv)
void *
_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr)
{
Expand All @@ -1845,7 +1845,7 @@ iounmap(void *addr)
vmmap = vmmap_remove(addr);
if (vmmap == NULL)
return;
#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__)
#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv)
pmap_unmapdev((vm_offset_t)addr, vmmap->vm_size);
#endif
kfree(vmmap);
Expand Down

0 comments on commit feb3031

Please sign in to comment.