From owner-svn-src-head@freebsd.org Fri Nov 13 09:00:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1BEAA2BE43; Fri, 13 Nov 2015 09:00:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD611C63; Fri, 13 Nov 2015 09:00:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD90d8L000686; Fri, 13 Nov 2015 09:00:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD90dlW000685; Fri, 13 Nov 2015 09:00:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511130900.tAD90dlW000685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 Nov 2015 09:00:39 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:00:41 -0000 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));