]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
Add assert and note about the size of "unsigned long" inside the
authorhselasky <hselasky@FreeBSD.org>
Fri, 13 Nov 2015 09:00:39 +0000 (09:00 +0000)
committerhselasky <hselasky@FreeBSD.org>
Fri, 13 Nov 2015 09:00:39 +0000 (09:00 +0000)
LinuxKPI for the future.

Sponsored by: Mellanox Technologies

sys/compat/linuxkpi/common/src/linux_compat.c

index f51329cd4b71c9a4681d892fa27f9b74661df39c..cc0479b70fb1473e0c381923ad921fb30292528a 100644 (file)
@@ -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));