summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-11-13 09:00:39 +0000
committerhselasky <hselasky@FreeBSD.org>2015-11-13 09:00:39 +0000
commit71f160e0193fee45242bebeff7f1282846e83d2c (patch)
treef4b73be856bb0f6f404e8650167bff3f0e6bcd1a /sys/compat
parentad846c8f474827a0eef9b92d18fb3d6c9251ef72 (diff)
downloadFreeBSD-src-71f160e0193fee45242bebeff7f1282846e83d2c.zip
FreeBSD-src-71f160e0193fee45242bebeff7f1282846e83d2c.tar.gz
Add assert and note about the size of "unsigned long" inside the
LinuxKPI for the future. Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linuxkpi/common/src/linux_compat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
index f51329c..cc0479b 100644
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -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));
OpenPOWER on IntegriCloud