Add assert and note about the size of "unsigned long" inside the

LinuxKPI for the future.

Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2015-11-13 09:00:39 +00:00
parent 9ae8f20c14
commit f727a767e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290744

View 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));