svn commit: r319656 - in head/sys/compat/linuxkpi/common: include/asm include/linux src

Justin Hibbits jhibbits at FreeBSD.org
Wed Jun 7 18:08:13 UTC 2017


Author: jhibbits
Date: Wed Jun  7 18:08:11 2017
New Revision: 319656
URL: https://svnweb.freebsd.org/changeset/base/319656

Log:
  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

Modified:
  head/sys/compat/linuxkpi/common/include/asm/atomic.h
  head/sys/compat/linuxkpi/common/include/asm/atomic64.h
  head/sys/compat/linuxkpi/common/include/linux/io.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/asm/atomic.h	Wed Jun  7 16:04:34 2017	(r319655)
+++ head/sys/compat/linuxkpi/common/include/asm/atomic.h	Wed Jun  7 18:08:11 2017	(r319656)
@@ -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;

Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/asm/atomic64.h	Wed Jun  7 16:04:34 2017	(r319655)
+++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h	Wed Jun  7 18:08:11 2017	(r319656)
@@ -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;

Modified: head/sys/compat/linuxkpi/common/include/linux/io.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/io.h	Wed Jun  7 16:04:34 2017	(r319655)
+++ head/sys/compat/linuxkpi/common/include/linux/io.h	Wed Jun  7 18:08:11 2017	(r319656)
@@ -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

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_compat.c	Wed Jun  7 16:04:34 2017	(r319655)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Wed Jun  7 18:08:11 2017	(r319656)
@@ -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);


More information about the svn-src-head mailing list