Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Nov 2015 09:00:39 +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: r290744 - head/sys/compat/linuxkpi/common/src
Message-ID:  <201511130900.tAD90dlW000685@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Nov 13 09:00:39 2015
New Revision: 290744
URL: https://svnweb.freebsd.org/changeset/base/290744

Log:
  Add assert and note about the size of "unsigned long" inside the
  LinuxKPI for the future.
  
  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	Fri Nov 13 06:20:27 2015	(r290743)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Fri Nov 13 09:00:39 2015	(r290744)
@@ -950,3 +950,11 @@ linux_compat_uninit(void *arg)
 	kobject_kfree_name(&miscclass.kobj);
 }
 SYSUNINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_uninit, NULL);
+
+/*
+ * NOTE: Linux frequently uses "unsigned long" for pointer to integer
+ * conversion and vice versa, where in FreeBSD "uintptr_t" would be
+ * used. Assert these types have the same size, else some parts of the
+ * LinuxKPI may not work like expected:
+ */
+CTASSERT(sizeof(unsigned long) == sizeof(uintptr_t));



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