Add more #ifdef arch checks to the linuxkpi

arm, mips, and powerpc all implement pmap_mapdev_attr() and pmap_unmapdev(),
so add those archs to the checks.  powerpc also includes the atomic_swap_*()
functions, so add that to the supported list as well.  Not tested except by
compiling powerpc.

Reviewed by:	markj
This commit is contained in:
Justin Hibbits 2017-06-07 18:08:11 +00:00
parent d90bf7d850
commit 287e7a861a
4 changed files with 10 additions and 5 deletions

View File

@ -131,7 +131,8 @@ static inline int
atomic_xchg(atomic_t *v, int i)
{
#if defined(__i386__) || defined(__amd64__) || \
defined(__arm__) || defined(__aarch64__)
defined(__arm__) || defined(__aarch64__) || \
defined(__powerpc__)
return (atomic_swap_int(&v->counter, i));
#else
int ret;

View File

@ -108,7 +108,8 @@ static inline int64_t
atomic64_xchg(atomic64_t *v, int64_t i)
{
#if defined(__i386__) || defined(__amd64__) || \
defined(__arm__) || defined(__aarch64__)
defined(__arm__) || defined(__aarch64__) || \
defined(__powerpc64__)
return (atomic_swap_64(&v->counter, i));
#else
int64_t ret;

View File

@ -180,7 +180,8 @@ _outb(u_char data, u_int port)
}
#endif
#if defined(__i386__) || defined(__amd64__)
#if defined(__i386__) || defined(__amd64__) || \
defined(__arm__) || defined(__mips__) || defined(__powerpc__)
void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
#else
#define _ioremap_attr(...) NULL

View File

@ -1415,7 +1415,8 @@ vmmap_remove(void *addr)
return (vmmap);
}
#if defined(__i386__) || defined(__amd64__)
#if defined(__i386__) || defined(__amd64__) || \
defined(__arm__) || defined(__mips__) || defined(__powerpc__)
void *
_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr)
{
@ -1438,7 +1439,8 @@ iounmap(void *addr)
vmmap = vmmap_remove(addr);
if (vmmap == NULL)
return;
#if defined(__i386__) || defined(__amd64__)
#if defined(__i386__) || defined(__amd64__) || \
defined(__arm__) || defined(__mips__) || defined(__powerpc__)
pmap_unmapdev((vm_offset_t)addr, vmmap->vm_size);
#endif
kfree(vmmap);