Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2017 20:39:31 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315422 - head/sys/compat/linuxkpi/common/src
Message-ID:  <201703162039.v2GKdV3F028942@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Mar 16 20:39:31 2017
New Revision: 315422
URL: https://svnweb.freebsd.org/changeset/base/315422

Log:
  Use __LP64__ to detect presence of suword64() to fix linking and
  loading of the LinuxKPI on 32-bit platforms.
  
  Reported by:		lwhsu @
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_compat.c	Thu Mar 16 17:49:37 2017	(r315421)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Thu Mar 16 20:39:31 2017	(r315422)
@@ -524,8 +524,15 @@ linux_clear_user(void *_uaddr, size_t _l
 
 	/* zero 8 bytes at a time */
 	while (len > 7) {
+#ifdef __LP64__
 		if (suword64(uaddr, 0))
 			return (_len);
+#else
+		if (suword32(uaddr, 0))
+			return (_len);
+		if (suword32(uaddr + 4, 0))
+			return (_len);
+#endif
 		uaddr += 8;
 		len -= 8;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703162039.v2GKdV3F028942>