From owner-freebsd-arch@FreeBSD.ORG Sun Nov 20 11:40:49 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A6EE106566B; Sun, 20 Nov 2011 11:40:49 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 4BFEF8FC0A; Sun, 20 Nov 2011 11:40:47 +0000 (UTC) Received: by wwg14 with SMTP id 14so7934503wwg.31 for ; Sun, 20 Nov 2011 03:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=C4aW2lOCoRiybYjlCwU5KOcWW1a9JN0btpBchS8XgwE=; b=GAV6oVHn7/i+QRRbtinBzxQTl75MULTM9/YnFsS3Et2ZcY+D5Czap31KLW718ZEQdV YyzPNOJ4og7O8VftpTXOJkxtBIu2Pc7V+sm2C1bKaM1tS06QiFyyrEbROTZ9px8TWXyI DYXuBP9NRAKRiu9KMgUNuLQED16928ihbCTng= Received: by 10.216.30.206 with SMTP id k56mr1350964wea.98.1321789247206; Sun, 20 Nov 2011 03:40:47 -0800 (PST) Received: from thorin (52.Red-95-122-67.staticIP.rima-tde.net. [95.122.67.52]) by mx.google.com with ESMTPS id m25sm8430800wbp.6.2011.11.20.03.40.44 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 20 Nov 2011 03:40:46 -0800 (PST) Sender: Robert Millan Received: from rmh by thorin with local (Exim 4.72) (envelope-from ) id 1RS5lL-0000L0-0a; Sun, 20 Nov 2011 12:40:43 +0100 Date: Sun, 20 Nov 2011 12:40:42 +0100 From: Robert Millan To: Kostik Belousov Message-ID: <20111120114042.GA1256@thorin> References: <201111170959.56767.jhb@freebsd.org> <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uZ3hkaAS1mZxFaxD" Content-Disposition: inline In-Reply-To: <20111119175620.GV50300@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 11:40:49 -0000 --uZ3hkaAS1mZxFaxD Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 19, 2011 at 07:56:20PM +0200, Kostik Belousov wrote: > I fully agree with an idea that compiler is not an authorative source > of the knowledge of the FreeBSD version. Even more, I argue that we shall > not rely on compiler for this at all. Ideally, we should be able to > build FreeBSD using the stock compilers without local modifications. > Thus relying on the symbols defined by compiler, and not the source > is the thing to avoid and consistently remove. >=20 > We must do this to be able to use third-party tooldchain for FreeBSD buil= ds. >=20 > That said, why not define __FreeBSD_kernel as equal to __FreeBSD_version ? > And then make more strong wording about other systems that use the macro, > e.g. remove 'may' from the kFreeBSD example. > Also, please remove the smile from comment. Ok. New patch attached. --=20 Robert Millan --45Z9DzgjV8m4Oswq Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="freebsd_kernel.diff" Content-Transfer-Encoding: quoted-printable Index: sys/sys/param.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/param.h (revision 227580) +++ sys/sys/param.h (working copy) @@ -60,6 +60,22 @@ #undef __FreeBSD_version #define __FreeBSD_version 1000001 /* Master, propagated to newvers */ =20 +/* + * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBS= D, + * which by definition is always true on FreeBSD. This macro is also defin= ed + * on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD + * + * It is tempting to use this macro in userland code when we want to enable + * kernel-specific routines, and in fact it's fine to do this in code that + * is part of FreeBSD itself. However, be aware that as presence of this + * macro is still not widespread (e.g. older FreeBSD versions, 3rd party + * compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in + * external applications without also checking for __FreeBSD__ as an + * alternative. + */ +#undef __FreeBSD_kernel__ +#define __FreeBSD_kernel__ __FreeBSD_version + #ifdef _KERNEL #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 --45Z9DzgjV8m4Oswq-- --uZ3hkaAS1mZxFaxD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/kFreeBSD) iQIcBAEBCAAGBQJOyOc6AAoJELd1onhloKnOtqcP/i5iauSTUFGr+KKByL67pChM AnQyq223iEfPn21v9kKuD8wIBqoetQCYMUPfd4QyNI5SEDi/4kSr4LWG4h81wKCQ 6WjEesPb5lCG+/7+mp4SpLgVHQAwXarNLTP5KKCYKyROrj3DC1tTPjkBuknfcA89 Qp2on7e2vNzd9D+CFO0ol+q3Y5Oy/NkiN5GFLfDo01B2fELTn7b91VxkbkNGki4b Mz35uaiLMLOdzVt9iskbpRA2aCndRgIzMeSs04XHZvVpykj/wi50TXtpkfI8FeKG U+AyFTjY99ltJlpwcaU8iPnkLTiUdORtHp44pdNccSKBHcfR9ru55RRQm9aZ63ud XqaSC+WZaMLa3gMFf7+6NF4KB8h/HvnjGqe9g7bSLD6SgsmTa1QRx3m9h483gQ4J rwzy+jPj7BgL4SvQT0ZM4VUNwxCa13z3+Q5sCyVOxfgCI2SS+7w4kgRGXSN0rByF y5xlE+eF3N8X7NnmnEpRubEQIrU+Yeiby5QMR/kqbDb/MBUTVGkUisFNPKpvfkcJ UsbEpOVnnadrslmylYvb+0UDoy5g35IdpQVq6hSLNGObgPHl3A6g+JCGU4Dev49X xTtuOxJKXwWM/uJh1R9CpI/AihlFMrvaJhp4OXmH4nQO/KPOy2MwLP87PiqJ3nn4 uTF3AW2xq69KGB4qSere =GLmz -----END PGP SIGNATURE----- --uZ3hkaAS1mZxFaxD-- From owner-freebsd-arch@FreeBSD.ORG Sun Nov 20 17:48:17 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E48B71065670; Sun, 20 Nov 2011 17:48:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 57F908FC08; Sun, 20 Nov 2011 17:48:17 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAKHm71M046366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Nov 2011 19:48:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAKHm7MI031145; Sun, 20 Nov 2011 19:48:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAKHm7nr031144; Sun, 20 Nov 2011 19:48:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 20 Nov 2011 19:48:07 +0200 From: Kostik Belousov To: Robert Millan Message-ID: <20111120174807.GY50300@deviant.kiev.zoral.com.ua> References: <201111170959.56767.jhb@freebsd.org> <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wf9W8POIGIHIPm/L" Content-Disposition: inline In-Reply-To: <20111120114042.GA1256@thorin> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 17:48:18 -0000 --Wf9W8POIGIHIPm/L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 20, 2011 at 12:40:42PM +0100, Robert Millan wrote: > On Sat, Nov 19, 2011 at 07:56:20PM +0200, Kostik Belousov wrote: > > I fully agree with an idea that compiler is not an authorative source > > of the knowledge of the FreeBSD version. Even more, I argue that we sha= ll > > not rely on compiler for this at all. Ideally, we should be able to > > build FreeBSD using the stock compilers without local modifications. > > Thus relying on the symbols defined by compiler, and not the source > > is the thing to avoid and consistently remove. > >=20 > > We must do this to be able to use third-party tooldchain for FreeBSD bu= ilds. > >=20 > > That said, why not define __FreeBSD_kernel as equal to __FreeBSD_versio= n ? > > And then make more strong wording about other systems that use the macr= o, > > e.g. remove 'may' from the kFreeBSD example. > > Also, please remove the smile from comment. >=20 > Ok. New patch attached. And the last, question, why not do #ifndef __FreeBSD_kernel__ #define __FreeBSD_kernel__ __FreeBSD_version #endif ? #undef is too big tools tool apply there, IMO. --Wf9W8POIGIHIPm/L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7JPVYACgkQC3+MBN1Mb4gSRgCdGTjCg5VHRaGSDqLIZEzpDHy6 THEAoOu96w8IHK1UsmOqzZS/S/sIDFdj =LGeQ -----END PGP SIGNATURE----- --Wf9W8POIGIHIPm/L-- From owner-freebsd-arch@FreeBSD.ORG Mon Nov 21 02:45:34 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 096C21065670; Mon, 21 Nov 2011 02:45:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 943BF8FC19; Mon, 21 Nov 2011 02:45:33 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAL2jTje008191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Nov 2011 13:45:30 +1100 Date: Mon, 21 Nov 2011 13:45:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20111120174807.GY50300@deviant.kiev.zoral.com.ua> Message-ID: <20111121133954.A1108@besplex.bde.org> References: <201111170959.56767.jhb@freebsd.org> <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org, Adrian Chadd , freebsd-current@freebsd.org, Robert Millan Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 02:45:34 -0000 On Sun, 20 Nov 2011, Kostik Belousov wrote: > On Sun, Nov 20, 2011 at 12:40:42PM +0100, Robert Millan wrote: >> On Sat, Nov 19, 2011 at 07:56:20PM +0200, Kostik Belousov wrote: >>> I fully agree with an idea that compiler is not an authorative source >>> of the knowledge of the FreeBSD version. Even more, I argue that we shall >>> not rely on compiler for this at all. Ideally, we should be able to >>> build FreeBSD using the stock compilers without local modifications. >>> Thus relying on the symbols defined by compiler, and not the source >>> is the thing to avoid and consistently remove. >>> >>> We must do this to be able to use third-party tooldchain for FreeBSD builds. >>> >>> That said, why not define __FreeBSD_kernel as equal to __FreeBSD_version ? >>> And then make more strong wording about other systems that use the macro, >>> e.g. remove 'may' from the kFreeBSD example. >>> Also, please remove the smile from comment. >> >> Ok. New patch attached. > > And the last, question, why not do > #ifndef __FreeBSD_kernel__ > #define __FreeBSD_kernel__ __FreeBSD_version > #endif > ? > > #undef is too big tools tool apply there, IMO. #ifndef is too big to apply here, IMO :-). __FreeBSD_kernel__ is in the implementation namespace, so any previous definition of it is a bug. The #ifndef breaks the warning for this bug. And why not use FreeBSD style? In KNF, the fields are separated by tabs, not spaces. In FreeBSD style, trailing underscores are not used for names in the implementation namespace, since they have no effect on namespaces. The name __FreeBSD_version is an example of this. Does existing practice require using the name with the trailing underscores? Bruce From owner-freebsd-arch@FreeBSD.ORG Mon Nov 21 09:27:56 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEDD5106566B; Mon, 21 Nov 2011 09:27:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8AD8FC08; Mon, 21 Nov 2011 09:27:54 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAL9Roh9010373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Nov 2011 11:27:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAL9RoxD033780; Mon, 21 Nov 2011 11:27:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAL9Robu033779; Mon, 21 Nov 2011 11:27:50 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 21 Nov 2011 11:27:49 +0200 From: Kostik Belousov To: Bruce Evans Message-ID: <20111121092749.GD50300@deviant.kiev.zoral.com.ua> References: <201111170959.56767.jhb@freebsd.org> <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> <20111121133954.A1108@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MsQ2Tn89rTjvu/Ra" Content-Disposition: inline In-Reply-To: <20111121133954.A1108@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-arch@freebsd.org, Adrian Chadd , freebsd-current@freebsd.org, Robert Millan Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 09:27:56 -0000 --MsQ2Tn89rTjvu/Ra Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 21, 2011 at 01:45:29PM +1100, Bruce Evans wrote: > On Sun, 20 Nov 2011, Kostik Belousov wrote: >=20 > >On Sun, Nov 20, 2011 at 12:40:42PM +0100, Robert Millan wrote: > >>On Sat, Nov 19, 2011 at 07:56:20PM +0200, Kostik Belousov wrote: > >>>I fully agree with an idea that compiler is not an authorative source > >>>of the knowledge of the FreeBSD version. Even more, I argue that we sh= all > >>>not rely on compiler for this at all. Ideally, we should be able to > >>>build FreeBSD using the stock compilers without local modifications. > >>>Thus relying on the symbols defined by compiler, and not the source > >>>is the thing to avoid and consistently remove. > >>> > >>>We must do this to be able to use third-party tooldchain for FreeBSD= =20 > >>>builds. > >>> > >>>That said, why not define __FreeBSD_kernel as equal to __FreeBSD_versi= on=20 > >>>? > >>>And then make more strong wording about other systems that use the mac= ro, > >>>e.g. remove 'may' from the kFreeBSD example. > >>>Also, please remove the smile from comment. > >> > >>Ok. New patch attached. > > > >And the last, question, why not do > >#ifndef __FreeBSD_kernel__ > >#define __FreeBSD_kernel__ __FreeBSD_version > >#endif > >? > > > >#undef is too big tools tool apply there, IMO. >=20 > #ifndef is too big to apply here, IMO :-). __FreeBSD_kernel__ is in the > implementation namespace, so any previous definition of it is a bug. The > #ifndef breaks the warning for this bug. FreeBSD does not need it at all. There are some implementations that use FreeBSD kernel, and which could potentially benefit from providing its own value for __FreeBSD_kernel. I was only tried to be nice for the out-of-tree implementations, it boils down to kFreeBSD project preferences. >=20 > And why not use FreeBSD style? In KNF, the fields are separated by > tabs, not spaces. In FreeBSD style, trailing underscores are not used > for names in the implementation namespace, since they have no effect > on namespaces. The name __FreeBSD_version is an example of this. Does > existing practice require using the name with the trailing underscores? --MsQ2Tn89rTjvu/Ra Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7KGZUACgkQC3+MBN1Mb4hnkQCeIbVEc2t+iid/4Az+A/ujTt7g ZkIAoOKQNSWGsnqSPDR635aoifSLKuVJ =XKUs -----END PGP SIGNATURE----- --MsQ2Tn89rTjvu/Ra-- From owner-freebsd-arch@FreeBSD.ORG Mon Nov 21 17:39:28 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 039A4106564A; Mon, 21 Nov 2011 17:39:28 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 884908FC1F; Mon, 21 Nov 2011 17:39:27 +0000 (UTC) Received: by yenq9 with SMTP id q9so743345yen.13 for ; Mon, 21 Nov 2011 09:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=SlONRK9gfgMCKC1nlR+fu8w2+2BF2hmUNA3VRAVDuJg=; b=pSDZmHQwGxZhoxLxVs9YKVQwRj2Z2rxMkLkBylqtTHvw0gecjJ7Iezldn5ndB5IkbR CaHhb18jHcvcfbM7hcEML7LpFF/LxrA/SzD1KpcIANv/b3/OFlEh1Eg8f8tSfbXrl/KP mdo/EQnGXMjfczKEr3OuK1u/2EUwsYaESsZEw= MIME-Version: 1.0 Received: by 10.50.169.1 with SMTP id aa1mr15646765igc.9.1321897166684; Mon, 21 Nov 2011 09:39:26 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.200 with HTTP; Mon, 21 Nov 2011 09:39:26 -0800 (PST) In-Reply-To: <20111121092749.GD50300@deviant.kiev.zoral.com.ua> References: <201111170959.56767.jhb@freebsd.org> <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> <20111121133954.A1108@besplex.bde.org> <20111121092749.GD50300@deviant.kiev.zoral.com.ua> Date: Mon, 21 Nov 2011 18:39:26 +0100 X-Google-Sender-Auth: sYqpNhocR9rVYUbN1EgOH6hCixc Message-ID: From: Robert Millan To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Cc: Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 17:39:28 -0000 (replying with Debian hat this time) 2011/11/21 Kostik Belousov : > There are some implementations that > use FreeBSD kernel, and which could potentially benefit from providing > its own value for __FreeBSD_kernel. Actually, we wouldn't be able to provide a different value for the macro (whatever its name). Our compiler simply doesn't know which version of the kernel it is building for. Only the headers do, but if we define it in the headers we'd just use the FreeBSD definitions. Our compiler defines __FreeBSD_kernel__ as an empty macro, I don't expect this will change because unlike with FreeBSD, on Debian there are strong technical limitations to making it a number. If __FreeBSD_kernel__ is to be defined in FreeBSD land, may I suggest that it is defined as an empty macro as well? This covers the vast majority of cases (e.g. like the ones in my initial patch which started this discussion), and it doesn't preclude the possibility that this macro becomes a number without breaking backward compatibility. OTOH once you define it as a number, it becomes relevant whether you did it with #ifndef or with #undef, and so you have to commit to it. Just to make it clear: It's no problem to me if it's defined as a number, but it doesn't help much either. At least from Debian POV it's not worth making a big argument about. It could be a good idea from FreeBSD POV, but please only do this if it's useful to FreeBSD. -- Robert Millan From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 09:35:24 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9253E1065670; Tue, 22 Nov 2011 09:35:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2785F8FC15; Tue, 22 Nov 2011 09:35:23 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAM9ZGxc009372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Nov 2011 11:35:16 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAM9ZG9E038036; Tue, 22 Nov 2011 11:35:16 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAM9ZF43038035; Tue, 22 Nov 2011 11:35:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 22 Nov 2011 11:35:15 +0200 From: Kostik Belousov To: Robert Millan Message-ID: <20111122093515.GK50300@deviant.kiev.zoral.com.ua> References: <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> <20111121133954.A1108@besplex.bde.org> <20111121092749.GD50300@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="313G32quqWeq5lpS" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 09:35:24 -0000 --313G32quqWeq5lpS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 21, 2011 at 06:39:26PM +0100, Robert Millan wrote: > (replying with Debian hat this time) >=20 > 2011/11/21 Kostik Belousov : > > There are some implementations that > > use FreeBSD kernel, and which could potentially benefit from providing > > its own value for __FreeBSD_kernel. >=20 > Actually, we wouldn't be able to provide a different value for the > macro (whatever its name). Our compiler simply doesn't know which > version of the kernel it is building for. Only the headers do, but if > we define it in the headers we'd just use the FreeBSD definitions. >=20 > Our compiler defines __FreeBSD_kernel__ as an empty macro, I don't > expect this will change because unlike with FreeBSD, on Debian there > are strong technical limitations to making it a number. >=20 > If __FreeBSD_kernel__ is to be defined in FreeBSD land, may I suggest > that it is defined as an empty macro as well? This covers the vast > majority of cases (e.g. like the ones in my initial patch which > started this discussion), and it doesn't preclude the possibility that > this macro becomes a number without breaking backward compatibility. >=20 > OTOH once you define it as a number, it becomes relevant whether you > did it with #ifndef or with #undef, and so you have to commit to it. >=20 > Just to make it clear: It's no problem to me if it's defined as a > number, but it doesn't help much either. At least from Debian POV it's > not worth making a big argument about. It could be a good idea from > FreeBSD POV, but please only do this if it's useful to FreeBSD. >=20 I am fine with __FreeBSD_kernel being empty, please submit the patch. --313G32quqWeq5lpS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7LbNMACgkQC3+MBN1Mb4gXaQCfdYpkCc+hivE5dTAUIUj7IvKa 7owAn1Myrkr9h2XERuYtrgXTEMgMATlb =uxi0 -----END PGP SIGNATURE----- --313G32quqWeq5lpS-- From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 12:44:16 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E2931065675; Tue, 22 Nov 2011 12:44:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF898FC08; Tue, 22 Nov 2011 12:44:15 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAMCiA2r031304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Nov 2011 14:44:11 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAMCiAUn038971; Tue, 22 Nov 2011 14:44:10 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAMCiA5R038970; Tue, 22 Nov 2011 14:44:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 22 Nov 2011 14:44:10 +0200 From: Kostik Belousov To: arch@freebsd.org Message-ID: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0GVCiSrLHbw8OoqI" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: is@nginx.org, current@freebsd.org Subject: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 12:44:16 -0000 --0GVCiSrLHbw8OoqI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I was reminded about the patch I wrote for Igor Sysoev some time ago. The issue the patch tries to handle is that jemalloc uses mmap() instead of sbrk() for pages allocation, and thus RLIMIT_DATA limit is no longer effective to put the bounds on the process heap. Since reverting to sbrk for such purpose is worse then the issue itself, I proposed a solution of 'self-restricting malloc'. The patch adds a flag MAP_DATALIMIT to the flags argument of mmap(2), which instructs the system to account the mapping in the RLIMIT_DATA resource count. The malloc(3) also gets new option 'L' to enable passing MAP_DATALIMIT to mmap() when allocating pages. By default, the 'L' option is not activated. Now, if user wants to ensure that process heap is restricted by the ulimit -d and still use mmap() for jemalloc, he supplies the option using any mechanism. The behaviour is voluntaristic, to prevent the trashing use RLIMIT_SWAP. Do people consider the facility useful ? Any comments for the patch itself ? http://people.freebsd.org/~kib/misc/map_datalimit.1.patch --0GVCiSrLHbw8OoqI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7LmRoACgkQC3+MBN1Mb4gr7gCeM4pLMS2vJRO9MN2TLcsBEpjK BbAAn26eANd2C7HD4MnpBNthTjnvfhbx =FksP -----END PGP SIGNATURE----- --0GVCiSrLHbw8OoqI-- From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 13:30:07 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 296CF1065670; Tue, 22 Nov 2011 13:30:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E995D8FC1C; Tue, 22 Nov 2011 13:30:06 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 9C5EF46B23; Tue, 22 Nov 2011 08:30:06 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 17571B947; Tue, 22 Nov 2011 08:30:06 -0500 (EST) From: John Baldwin To: freebsd-arch@freebsd.org Date: Tue, 22 Nov 2011 08:24:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <20111121092749.GD50300@deviant.kiev.zoral.com.ua> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201111220824.07823.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Nov 2011 08:30:06 -0500 (EST) Cc: Kostik Belousov , Robert Millan , freebsd-current@freebsd.org, Adrian Chadd Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 13:30:07 -0000 On Monday, November 21, 2011 12:39:26 pm Robert Millan wrote: > (replying with Debian hat this time) > > 2011/11/21 Kostik Belousov : > > There are some implementations that > > use FreeBSD kernel, and which could potentially benefit from providing > > its own value for __FreeBSD_kernel. > > Actually, we wouldn't be able to provide a different value for the > macro (whatever its name). Our compiler simply doesn't know which > version of the kernel it is building for. Only the headers do, but if > we define it in the headers we'd just use the FreeBSD definitions. > > Our compiler defines __FreeBSD_kernel__ as an empty macro, I don't > expect this will change because unlike with FreeBSD, on Debian there > are strong technical limitations to making it a number. > > If __FreeBSD_kernel__ is to be defined in FreeBSD land, may I suggest > that it is defined as an empty macro as well? This covers the vast > majority of cases (e.g. like the ones in my initial patch which > started this discussion), and it doesn't preclude the possibility that > this macro becomes a number without breaking backward compatibility. > > OTOH once you define it as a number, it becomes relevant whether you > did it with #ifndef or with #undef, and so you have to commit to it. > > Just to make it clear: It's no problem to me if it's defined as a > number, but it doesn't help much either. At least from Debian POV it's > not worth making a big argument about. It could be a good idea from > FreeBSD POV, but please only do this if it's useful to FreeBSD. Is __FreeBSD_version defined if __FreeBSD_kernel__ is defined on kFreeBSD? Most things that want to check versions that I've seen do something like this: #ifdef __FreeBSD__ #include #if __FreeBSD_version > XXXXXXX /* use new feature */ #endif #endif If __FreeBSD_version is defined when __FreeBSD_kernel__ is defined, then I think having it be empty would be ok as it would allow usage as above. Also, in that case I think __FreeBSD_kernel__ is much closer in meaning to __FreeBSD__ than to __FreeBSD_version. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 15:49:44 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D5E3106564A; Tue, 22 Nov 2011 15:49:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B97758FC13; Tue, 22 Nov 2011 15:49:43 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAMFnZLb053047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Nov 2011 17:49:35 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAMFnZnF040186; Tue, 22 Nov 2011 17:49:35 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAMFnZas040185; Tue, 22 Nov 2011 17:49:35 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 22 Nov 2011 17:49:35 +0200 From: Kostik Belousov To: Maxim Dounin Message-ID: <20111122154935.GR50300@deviant.kiev.zoral.com.ua> References: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> <20111122154357.GI95664@mdounin.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ej7tn9G4wHTwOygb" Content-Disposition: inline In-Reply-To: <20111122154357.GI95664@mdounin.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: is@nginx.org, arch@freebsd.org, current@freebsd.org Subject: Re: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 15:49:44 -0000 --ej7tn9G4wHTwOygb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 22, 2011 at 07:43:57PM +0400, Maxim Dounin wrote: > Hello! >=20 > On Tue, Nov 22, 2011 at 02:44:10PM +0200, Kostik Belousov wrote: >=20 > > I was reminded about the patch I wrote for Igor Sysoev some time ago. > > The issue the patch tries to handle is that jemalloc uses mmap() instead > > of sbrk() for pages allocation, and thus RLIMIT_DATA limit is no longer > > effective to put the bounds on the process heap. Since reverting to sbrk > > for such purpose is worse then the issue itself, I proposed a solution > > of 'self-restricting malloc'. >=20 > Just a little clarification for others: currently, there is no way=20 > to *safely* limit memory usage of a process while using jemalloc=20 > with mmap(). >=20 > The only thing available is RLIMIT_VMEM, but it's not safe as it=20 > may be reached on stack grow (leaving no possibility for an=20 > application to handle this). >=20 > > The patch adds a flag MAP_DATALIMIT to the flags argument of mmap(2), > > which instructs the system to account the mapping in the RLIMIT_DATA > > resource count. The malloc(3) also gets new option 'L' to enable > > passing MAP_DATALIMIT to mmap() when allocating pages. By default, > > the 'L' option is not activated. > >=20 > > Now, if user wants to ensure that process heap is restricted by the > > ulimit -d and still use mmap() for jemalloc, he supplies the option > > using any mechanism. The behaviour is voluntaristic, to prevent the > > trashing use RLIMIT_SWAP. > >=20 > > Do people consider the facility useful ? >=20 > Yes, at least some way to safely limit process memory usage is=20 > certainly needed. >=20 > It's a bit sad this isn't enabled by default, but it's probably=20 > too late for this. RLIMIT_DATA was (almost) a noop for too long=20 > and making it work again to limit all memory allocations will=20 > break POLA. >=20 > > Any comments for the patch itself ? > >=20 > > http://people.freebsd.org/~kib/misc/map_datalimit.1.patch >=20 > Patch looks ok for me (though I'm not a VM expert). >=20 > Another possible aproach would be to introduce separate anonymous=20 > (private?) mmap limit, this will allow to do essentially the same=20 > thing in a bit more consistent (IMHO) manner. This is already done in some form as the per-user swap limit. Converting swap limit to the per-process limit raises the architectural questions, due to shadow chains of the backing vm objects. In particular, we have to account the anonymous memory used for backing the changed pages from the writeable private mapping of the files. Similar issues appear due to fork(). Anyway, the patch needs testers before I will push it forward. --ej7tn9G4wHTwOygb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7LxI4ACgkQC3+MBN1Mb4iMIACeKyzYhqGotSkEe2TGFxRtc3f7 Nk8An0DfqopmYU75H0PmQ4ssc4eL42m4 =GU0S -----END PGP SIGNATURE----- --ej7tn9G4wHTwOygb-- From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 15:59:04 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7C94106564A; Tue, 22 Nov 2011 15:59:04 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id 92D118FC0C; Tue, 22 Nov 2011 15:59:04 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 4437F17024; Tue, 22 Nov 2011 19:43:57 +0400 (MSK) Date: Tue, 22 Nov 2011 19:43:57 +0400 From: Maxim Dounin To: Kostik Belousov Message-ID: <20111122154357.GI95664@mdounin.ru> References: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: is@nginx.org, arch@freebsd.org, current@freebsd.org Subject: Re: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 15:59:04 -0000 Hello! On Tue, Nov 22, 2011 at 02:44:10PM +0200, Kostik Belousov wrote: > I was reminded about the patch I wrote for Igor Sysoev some time ago. > The issue the patch tries to handle is that jemalloc uses mmap() instead > of sbrk() for pages allocation, and thus RLIMIT_DATA limit is no longer > effective to put the bounds on the process heap. Since reverting to sbrk > for such purpose is worse then the issue itself, I proposed a solution > of 'self-restricting malloc'. Just a little clarification for others: currently, there is no way to *safely* limit memory usage of a process while using jemalloc with mmap(). The only thing available is RLIMIT_VMEM, but it's not safe as it may be reached on stack grow (leaving no possibility for an application to handle this). > The patch adds a flag MAP_DATALIMIT to the flags argument of mmap(2), > which instructs the system to account the mapping in the RLIMIT_DATA > resource count. The malloc(3) also gets new option 'L' to enable > passing MAP_DATALIMIT to mmap() when allocating pages. By default, > the 'L' option is not activated. > > Now, if user wants to ensure that process heap is restricted by the > ulimit -d and still use mmap() for jemalloc, he supplies the option > using any mechanism. The behaviour is voluntaristic, to prevent the > trashing use RLIMIT_SWAP. > > Do people consider the facility useful ? Yes, at least some way to safely limit process memory usage is certainly needed. It's a bit sad this isn't enabled by default, but it's probably too late for this. RLIMIT_DATA was (almost) a noop for too long and making it work again to limit all memory allocations will break POLA. > Any comments for the patch itself ? > > http://people.freebsd.org/~kib/misc/map_datalimit.1.patch Patch looks ok for me (though I'm not a VM expert). Another possible aproach would be to introduce separate anonymous (private?) mmap limit, this will allow to do essentially the same thing in a bit more consistent (IMHO) manner. Maxim Dounin From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 17:53:55 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60731106564A; Tue, 22 Nov 2011 17:53:55 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7EEF28FC13; Tue, 22 Nov 2011 17:53:54 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so685096bkb.13 for ; Tue, 22 Nov 2011 09:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=c1Ejf3Xq3gD1rPEA9QYLniOvCrRHavz5BomSugShYhY=; b=BFedfFAjI9YQ+ggyLtLm3gxelNdFaEZP2IKmkJi1gq0NIMIsOUkMpdlBzdBmo3inD7 YZV6npoBbUoqDnG+j8hcGD+D9B61Mazkmvzy9vjuS5d+C/4+crtiZVN4z41x2roez+SR ol9oU7WvVSePMRs+wAOD5PzVUY8IR8ppgohV8= Received: by 10.204.152.4 with SMTP id e4mr19850076bkw.56.1321984433465; Tue, 22 Nov 2011 09:53:53 -0800 (PST) Received: from thorin (52.Red-95-122-67.staticIP.rima-tde.net. [95.122.67.52]) by mx.google.com with ESMTPS id cc2sm10734870bkb.8.2011.11.22.09.53.48 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Nov 2011 09:53:52 -0800 (PST) Sender: Robert Millan Received: from rmh by thorin with local (Exim 4.72) (envelope-from ) id 1RSuXM-000BYA-MR; Tue, 22 Nov 2011 18:53:40 +0100 Date: Tue, 22 Nov 2011 18:53:40 +0100 From: Robert Millan To: Kostik Belousov Message-ID: <20111122175340.GA44367@thorin> References: <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> <20111121133954.A1108@besplex.bde.org> <20111121092749.GD50300@deviant.kiev.zoral.com.ua> <20111122093515.GK50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6sX45UoQRIJXqkqR" Content-Disposition: inline In-Reply-To: <20111122093515.GK50300@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Robert Millan , freebsd-current@freebsd.org, Adrian Chadd , freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 17:53:55 -0000 --6sX45UoQRIJXqkqR Content-Type: multipart/mixed; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 22, 2011 at 11:35:15AM +0200, Kostik Belousov wrote: > I am fine with __FreeBSD_kernel being empty, please submit the patch. Here. --=20 Robert Millan --lrZ03NoBR/3+SXJZ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="freebsd_kernel.diff" Content-Transfer-Encoding: quoted-printable Index: sys/sys/param.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/param.h (revision 227580) +++ sys/sys/param.h (working copy) @@ -60,6 +60,22 @@ #undef __FreeBSD_version #define __FreeBSD_version 1000001 /* Master, propagated to newvers */ =20 +/* + * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBS= D, + * which by definition is always true on FreeBSD. This macro is also defin= ed + * on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD + * + * It is tempting to use this macro in userland code when we want to enable + * kernel-specific routines, and in fact it's fine to do this in code that + * is part of FreeBSD itself. However, be aware that as presence of this + * macro is still not widespread (e.g. older FreeBSD versions, 3rd party + * compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in + * external applications without also checking for __FreeBSD__ as an + * alternative. + */ +#undef __FreeBSD_kernel__ +#define __FreeBSD_kernel__ + #ifdef _KERNEL #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 --lrZ03NoBR/3+SXJZ-- --6sX45UoQRIJXqkqR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/kFreeBSD) iQIcBAEBCAAGBQJOy+GjAAoJELd1onhloKnOUDgP+QFg4UkD/RNaWH1SPxcfaudV U8V24pPqgTYnftLGc+R9IFK+pXcr+lIOL7em8whIa0QYbl4L0s4a9cStcKySJALa BPLtHHv2b64WELfa8RVzPeXYZ87oCSYrhYroEU7l7yd2ezaHbZf6yq7ugrIzBtM8 uJNDUKwz2plFT2Mq2uf8s42o++cWZUXP2ifVlEiQNqvcsNTrfYaLA2iXDhs26tTV eX1Y/aiD83PVIPRIpbiFPu7Wv4EkeF0aW/ejlH6fcEyaNjAo+mFDPaFL7Ci6OCfS 3V8gFERM3TZy3HAKcX6yuP1OuIfVAPt/LxMhF6bzADSh9rVjKDvDbbsRojp0z3w8 zHqZDQFcZYItee2HeCmUKcb8OGRNwP3Twqh78Tfy9AVmLaYFgdq3qVQ4HIO8UCJr pTqZRnthZlIxA6EtTZqxQ4Gv59YD5Z7FKwjc83oMRdnxhIFcc1pQtKWIZBoPjgkE N1iJhu9opqFUPH97lqoTFxFZnVVS/YsT5VaoPJcuADv+pc4GmlABZm1nid5tzEIx v97pJSEfY0UweNUAAoVZFt63jgShvWYPJ4sZ9Fb4TVu5sJeztFJiFAKNp6+3CDXh 5HBrfmEJTS7vioAyaF4PpU1sYLSADV8jpRLbYwTrFvW73UrcQONTHRtRkAfAEclp 2Gvjex6xv0XjhsB6trrW =mtIo -----END PGP SIGNATURE----- --6sX45UoQRIJXqkqR-- From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 17:59:20 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCD38106566C; Tue, 22 Nov 2011 17:59:20 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7EEB18FC08; Tue, 22 Nov 2011 17:59:20 +0000 (UTC) Received: by iakl21 with SMTP id l21so758172iak.13 for ; Tue, 22 Nov 2011 09:59:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=CqYJlEeVevEYv63b2oOGDu6p9ZBFvCC7qR3FjCJ9Rx4=; b=EpyR822OnRfFVI6wAveTRYDOEF1Stfjfv1psmsj17isDTTWgFA/cQeS4oWau9SQSib V8PyIXvsPPnriQPfGhKPC95Ou8wM6GMvJlRJKV+mNcZEvGjvhfHyLY6QW/7lVooOAA9J lyjvRh8DgjQMi3wm/7OXs8OfdLN22dgsh2SYo= MIME-Version: 1.0 Received: by 10.50.149.165 with SMTP id ub5mr23104261igb.23.1321984759696; Tue, 22 Nov 2011 09:59:19 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.200 with HTTP; Tue, 22 Nov 2011 09:59:19 -0800 (PST) In-Reply-To: <201111220824.07823.jhb@freebsd.org> References: <20111121092749.GD50300@deviant.kiev.zoral.com.ua> <201111220824.07823.jhb@freebsd.org> Date: Tue, 22 Nov 2011 18:59:19 +0100 X-Google-Sender-Auth: bd6J299HIomwO-QgrENhS4BJyUk Message-ID: From: Robert Millan To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 17:59:21 -0000 2011/11/22 John Baldwin : > Is __FreeBSD_version defined if __FreeBSD_kernel__ is defined on kFreeBSD? Not currently (except for kernel-space code), but if all the checks that use __FreeBSD_version are like the one you describe, I think it'd make sense. But we need to make sure that defining it wouldn't suddenly enable code that is intended for FreeBSD userland, like it happens with __FreeBSD__. It'd also have to be discussed on Debian mailing list. My first impression is that defining it could be useful in some situations. We just don't run into this kind of situation so often, so this possibility AFAIK has never been discussed. I had it in my TODO to bring it up. -- Robert Millan From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 18:53:01 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E78EE106564A; Tue, 22 Nov 2011 18:53:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 80E578FC08; Tue, 22 Nov 2011 18:53:01 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 6BA732A28CC8; Tue, 22 Nov 2011 19:53:00 +0100 (CET) Date: Tue, 22 Nov 2011 19:53:00 +0100 From: Ed Schouten To: Robert Millan Message-ID: <20111122185300.GC1979@hoeg.nl> References: <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> <20111121133954.A1108@besplex.bde.org> <20111121092749.GD50300@deviant.kiev.zoral.com.ua> <20111122093515.GK50300@deviant.kiev.zoral.com.ua> <20111122175340.GA44367@thorin> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oTHb8nViIGeoXxdp" Content-Disposition: inline In-Reply-To: <20111122175340.GA44367@thorin> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Kostik Belousov , Robert Millan , freebsd-current@freebsd.org, Adrian Chadd , freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 18:53:02 -0000 --oTHb8nViIGeoXxdp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Robert, * Robert Millan , 20111122 18:53: > +#undef __FreeBSD_kernel__ > +#define __FreeBSD_kernel__ So why not remove the #undef and not let the compiler define it at all? --=20 Ed Schouten WWW: http://80386.nl/ --oTHb8nViIGeoXxdp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOy++MAAoJEG5e2P40kaK73E0P/RopaqICYgBUUlIJZxENyIVk IOBmYxj+z/cKP8zfAnJDKz2K6ahhaHwVLSNM9hi+Ie7v3JFrn8olZSC2HQvm0+RH iszJVme4Bs6UP9ugNSq+2YeSJme0MieaBtWNzyZE6dOj+7iW0mj6TrQnVSeiVSdm yM6eEIpX8jYLjjtTlIHxNW8zeukZUDWXtaEf0LenjF4jSqw/4EU3pMhxtJ/J6PfV smf8nTNW993ZwFYc512H7k5w7Af7w2MRMIGO7LZgUXEXql/OsxxLapf3h8lYR2WD uxsptHBmnDmWVcGkgkrHxw/JsX/DUJHizZ+V0r0hYqxGsa6UUVrczNq3kCDH9hLM Uom7dZ6+UvYEMEZtRZKqEdg2P9XRk52vScDFe/HJdK9RQu+5gs4WmZ4aAlLARLaF Yuh6dFSUZalAc7n0SmuSDrHv+d201D6LeN8ZoPVzQTkI/BEZrUlWGIm6VAEuKHF6 3MOcADrhHfnYd4hlr3NLoCZMeUC57/8hDd0pYE/Z4nG5J2hcAlI20a4daIpEZGrs PUXk96UXX0wsps5WK0BZsNI73EQLtFRwKyMGYl98YGJJDX+XOerP1mDESr7McTXv 0AXRt+O7CE3zBVtrwQUOCtFQT0X9nKV6QcsEl6aaf25NpRfgqEOMnT4SXP72y2ZF 0RggeUNmvPbrNk8E7r2Q =4Ux/ -----END PGP SIGNATURE----- --oTHb8nViIGeoXxdp-- From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 19:14:51 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF6F0106564A; Tue, 22 Nov 2011 19:14:51 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9B7788FC08; Tue, 22 Nov 2011 19:14:51 +0000 (UTC) Received: by iakl21 with SMTP id l21so900530iak.13 for ; Tue, 22 Nov 2011 11:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=M17aGCBWLZN3WOgt09ff64Dq7K1toKW/SAXpJ1u6YZo=; b=hgxG3zRqlKSIkVW2gAziUYKAjPgC6TfO5ORg5JP9n+RjYzg8h09l/7CE9shFv4Z+57 VMPdOvvxkWVm05ngHywZS+jeQWyA4OMW4NWjwAVT+/m5kVEKYVDovgojDtVDG+LhWxtG /HV3TeQLMZ2oZJNEgPNphwGQ/uZWgfTptqSas= MIME-Version: 1.0 Received: by 10.50.149.165 with SMTP id ub5mr23634748igb.23.1321989290944; Tue, 22 Nov 2011 11:14:50 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.200 with HTTP; Tue, 22 Nov 2011 11:14:50 -0800 (PST) In-Reply-To: <20111122185300.GC1979@hoeg.nl> References: <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> <20111121133954.A1108@besplex.bde.org> <20111121092749.GD50300@deviant.kiev.zoral.com.ua> <20111122093515.GK50300@deviant.kiev.zoral.com.ua> <20111122175340.GA44367@thorin> <20111122185300.GC1979@hoeg.nl> Date: Tue, 22 Nov 2011 20:14:50 +0100 X-Google-Sender-Auth: 2Xb0MP5xOIceOmfUw2vLCENP3bg Message-ID: From: Robert Millan To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 19:14:52 -0000 Hi Ed, 2011/11/22 Ed Schouten : >> +#undef __FreeBSD_kernel__ >> +#define __FreeBSD_kernel__ > > So why not remove the #undef and not let the compiler define it at all? Well I have no objection if the #undef is removed. I don't understand why you consider it a problem though. It's not terribly useful but if compilers can opt in and define it (usually as an empty macro), this doesn't hurt either AFAICT. The problem I described before was about compilers being forced to provide a number. Anyhow, I don't think it makes a big difference. From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 19:24:33 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9081065677; Tue, 22 Nov 2011 19:24:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 411508FC1C; Tue, 22 Nov 2011 19:24:33 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id E977E46B3C; Tue, 22 Nov 2011 14:24:32 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5AF3CB93F; Tue, 22 Nov 2011 14:24:32 -0500 (EST) From: John Baldwin To: Robert Millan Date: Tue, 22 Nov 2011 14:21:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111220824.07823.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201111221421.53395.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Nov 2011 14:24:32 -0500 (EST) Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 19:24:33 -0000 On Tuesday, November 22, 2011 12:59:19 pm Robert Millan wrote: > 2011/11/22 John Baldwin : > > Is __FreeBSD_version defined if __FreeBSD_kernel__ is defined on kFreeBSD? > > Not currently (except for kernel-space code), but if all the checks > that use __FreeBSD_version are like the one you describe, I think it'd > make sense. I can think of cases where you might want it exposed (e.g. in the parts of net-snmp that grovel around in kernel data structures and use __FreeBSD_version to figure out what the right thing to do is, possibly the same with lsof). > But we need to make sure that defining it wouldn't suddenly enable > code that is intended for FreeBSD userland, like it happens with > __FreeBSD__. Correct. I don't believe that is the case since normally one has to check for __FreeBSD__ before using __FreeBSD_version. -- John Baldwin From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 19:28:07 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A910C106564A; Tue, 22 Nov 2011 19:28:07 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4820C8FC14; Tue, 22 Nov 2011 19:28:07 +0000 (UTC) Received: by iakl21 with SMTP id l21so922343iak.13 for ; Tue, 22 Nov 2011 11:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=QBsDQYqLYmgyUXvhJLgNvEtBvEmeDXZr3MJJ8Qn46uY=; b=dGaOP8Y1fK5OqSo/hXbcQ57nT/aJR9qtWCgcs7dGxg2sh5Ky7jjkb788SRNbMnfvWB NcmffiZ3ERO7czy1DHAl1ZepHQWt0tXCEkTDQxkIUf0rMyzwa5JpteSCjPx9iwNsqgPR PeySwGKu0BPPHfO3bD5mWQfVG97XwfYRagiE8= MIME-Version: 1.0 Received: by 10.50.17.197 with SMTP id q5mr23787362igd.2.1321990086678; Tue, 22 Nov 2011 11:28:06 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.200 with HTTP; Tue, 22 Nov 2011 11:28:06 -0800 (PST) In-Reply-To: <201111221421.53395.jhb@freebsd.org> References: <201111220824.07823.jhb@freebsd.org> <201111221421.53395.jhb@freebsd.org> Date: Tue, 22 Nov 2011 20:28:06 +0100 X-Google-Sender-Auth: tUGdXGVOAG2mB71Vf2MLM3-L6qM Message-ID: From: Robert Millan To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 19:28:07 -0000 2011/11/22 John Baldwin : >> Not currently (except for kernel-space code), but if all the checks >> that use __FreeBSD_version are like the one you describe, I think it'd >> make sense. > > I can think of cases where you might want it exposed (e.g. in the parts > of net-snmp that grovel around in kernel data structures and use > __FreeBSD_version to figure out what the right thing to do is, possibly > the same with lsof). > >> But we need to make sure that defining it wouldn't suddenly enable >> code that is intended for FreeBSD userland, like it happens with >> __FreeBSD__. > > Correct. =C2=A0I don't believe that is the case since normally one has to > check for __FreeBSD__ before using __FreeBSD_version. Makes sense. I'll bring this up in debian-bsd mailing list. Thanks for the tip --=20 Robert Millan From owner-freebsd-arch@FreeBSD.ORG Tue Nov 22 22:47:00 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98F9A106566B; Tue, 22 Nov 2011 22:47:00 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (lrosenman-1-pt.tunnel.tserv8.dal1.ipv6.he.net [IPv6:2001:470:1f0e:3ad::2]) by mx1.freebsd.org (Postfix) with ESMTP id 590FD8FC0C; Tue, 22 Nov 2011 22:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=KD+lKiL2Gv7+cDw+ESGc7XvhSMZGHrSOZjgNVlE1swg=; b=klW2WeTCl3DKdqV7tdE/pcIkAk3CFOwIXSqZb0/NJtb/IDDnkAheRgdLx28CpyWXyrX/dkkCzBvinbEBqHsRKg6H/ZuSt49qoOmK2RlUC9s33vSTV1E5P86x2nLaNe7JbEdNq5p3RyKbJsJQsJXWv+FtFCyp2Dv1nxIeHcFv1Vc=; Received: from [32.97.110.60] (port=24422 helo=[9.41.58.142]) by thebighonker.lerctr.org with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1RSz7B-000H9j-Ec; Tue, 22 Nov 2011 16:46:59 -0600 Message-ID: <4ECC2651.6020307@lerctr.org> Date: Tue, 22 Nov 2011 16:46:41 -0600 From: Larry Rosenman Organization: LERCTR Consulting User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: John Baldwin References: <201111220824.07823.jhb@freebsd.org> <201111221421.53395.jhb@freebsd.org> In-Reply-To: <201111221421.53395.jhb@freebsd.org> X-Enigmail-Version: 1.3.3 OpenPGP: id=2F035CE6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-LERCTR-Spam-Score: 0.5 (/) X-Spam-Report: SpamScore (0.5/5.0) ALL_TRUSTED=-1, BAYES_00=-1.9, FM_MULTI_ODD2=1.1, FM_MULTI_ODD3=0.7, FM_MULTI_ODD4=0.7, FM_MULTI_ODD5=0.9 X-LERCTR-Spam-Report: SpamScore (0.5/5.0) ALL_TRUSTED=-1, BAYES_00=-1.9, FM_MULTI_ODD2=1.1, FM_MULTI_ODD3=0.7, FM_MULTI_ODD4=0.7, FM_MULTI_ODD5=0.9 Cc: Kostik Belousov , Robert Millan , freebsd-current@freebsd.org, Adrian Chadd , freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 22:47:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/22/2011 1:21 PM, John Baldwin wrote: > On Tuesday, November 22, 2011 12:59:19 pm Robert Millan wrote: >> 2011/11/22 John Baldwin : >>> Is __FreeBSD_version defined if __FreeBSD_kernel__ is defined >>> on kFreeBSD? >> >> Not currently (except for kernel-space code), but if all the >> checks that use __FreeBSD_version are like the one you describe, >> I think it'd make sense. > > I can think of cases where you might want it exposed (e.g. in the > parts of net-snmp that grovel around in kernel data structures and > use __FreeBSD_version to figure out what the right thing to do is, > possibly the same with lsof). > >> But we need to make sure that defining it wouldn't suddenly >> enable code that is intended for FreeBSD userland, like it >> happens with __FreeBSD__. > > Correct. I don't believe that is the case since normally one has > to check for __FreeBSD__ before using __FreeBSD_version. > Let me know if I can help on the lsof front. I'm the maintainer of the FreeBSD lsof port, and have access to the developer. - -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOzCZQAAoJENC8dtAvA1zmuLoIAItbMRQhoF1OcW9DVI9A1qNj UHCUCIlqYqS16m+/xoagjrPdjNK/nrP1aU791KIyvtaVZQ4HCsrzsePHv7iyGBAQ L1APl7FXkAl7If3C+Nl2tJ+kiRrM8bp336KSoVnipm5zbCX7Zhp7ZFFNpcNGQ0V4 7LJdtqIwyWtPzTIdri/qARVnOcBEaG8OYj+N55JTVjPL6cqeSiu2uQSAw9tgGY68 SMQ22N04HGOrFPcGUaHA9A4RbM/b/au2oqFN+2ggcC84qpweJMMLn3/lNksM0vj+ N+RkpafGdkmUAomUYoGP7BqHx0RMnEC7Kkc2y6Ti3HeIwcbehQR+RN6953ELGwk= =Rpp5 -----END PGP SIGNATURE----- From owner-freebsd-arch@FreeBSD.ORG Wed Nov 23 07:00:44 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B2D8106566B; Wed, 23 Nov 2011 07:00:44 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 786408FC19; Wed, 23 Nov 2011 07:00:42 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so1599112bkb.13 for ; Tue, 22 Nov 2011 23:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=96fW9g4IfohqUriHyyHywNi7Vd9+UxudIqVff3kidyw=; b=XT1qGfyIoWBlj7iM9qpURuQWv00ZGm/B913FFa9aBpXMKhHgbA99eFvuGONlnYSdsA XWinLTlRAs61gon80GzYDG+jmsWfQdt32dO5RTYxf2RbnZTkzKJ6qzQGBwJtAlx+tHY0 e5rMVhaDczc8pBPsduunuhEnjZES2DSwll4m8= Received: by 10.204.149.216 with SMTP id u24mr22118757bkv.73.1322031642070; Tue, 22 Nov 2011 23:00:42 -0800 (PST) Received: from thorin (52.Red-95-122-67.staticIP.rima-tde.net. [95.122.67.52]) by mx.google.com with ESMTPS id jf4sm6373023bkc.5.2011.11.22.23.00.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Nov 2011 23:00:40 -0800 (PST) Sender: Robert Millan Received: from rmh by thorin with local (Exim 4.72) (envelope-from ) id 1RT6ou-0007nN-Oe; Wed, 23 Nov 2011 08:00:36 +0100 Date: Wed, 23 Nov 2011 08:00:36 +0100 From: Robert Millan To: freebsd-current@freebsd.org, freebsd-arch@freebsd.org Message-ID: <20111123070036.GA29952@thorin> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Kostik Belousov , Adrian Chadd Subject: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 07:00:44 -0000 --8GpibOaaTibBMecb Content-Type: multipart/mixed; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Here we go again :-) Out of the kernel headers that are installed in /usr/include/ hierracy, the= re are some which include support multiple operating systems (usually FreeBSD = and other *BSD flavours). This patch adds support to detect GNU/kFreeBSD as well. In all cases, we match the same declarations as FreeBSD does (which is to be expected in ker= nel headers, since both systems share the same kernel). --=20 Robert Millan --nFreZHaLTZJo0R7j Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gnu-kfreebsd_headers.diff" Content-Transfer-Encoding: quoted-printable Index: sys/cam/scsi/scsi_low.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/scsi/scsi_low.h (revision 227831) +++ sys/cam/scsi/scsi_low.h (working copy) @@ -44,6 +44,8 @@ #ifndef _SCSI_LOW_H_ #define _SCSI_LOW_H_ =20 +#include + /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D * Scsi low OSDEP=20 * (All os depend structures should be here!) @@ -53,10 +55,10 @@ #define SCSI_LOW_INTERFACE_XS #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #define SCSI_LOW_INTERFACE_CAM #define CAM -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 /******** includes *******************************/ #ifdef __NetBSD__ @@ -64,7 +66,7 @@ #include #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #include #include #include @@ -75,7 +77,7 @@ =20 #include #include -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 /******** functions macro ************************/ #ifdef __NetBSD__ @@ -85,13 +87,13 @@ #define SCSI_LOW_BZERO(pt, size) memset((pt), 0, (size)) #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #undef MSG_IDENTIFY #define SCSI_LOW_DEBUGGER(dev) kdb_enter(KDB_WHY_CAM, dev) #define SCSI_LOW_DELAY(mu) DELAY((mu)) #define SCSI_LOW_SPLSCSI splcam #define SCSI_LOW_BZERO(pt, size) bzero((pt), (size)) -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 /******** os depend interface structures **********/ #ifdef __NetBSD__ @@ -111,7 +113,7 @@ }; #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ typedef struct scsi_sense_data scsi_low_osdep_sense_data_t; =20 struct scsi_low_osdep_interface { @@ -134,7 +136,7 @@ =20 struct scsi_low_osdep_lun_interface { }; -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 /******** os depend interface functions *************/ struct slccb; Index: sys/cam/scsi/scsi_low_pisa.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/scsi/scsi_low_pisa.h (revision 227831) +++ sys/cam/scsi/scsi_low_pisa.h (working copy) @@ -34,14 +34,16 @@ #ifndef _SCSI_LOW_PISA_H_ #define _SCSI_LOW_PISA_H_ =20 +#include + #ifdef __NetBSD__ int scsi_low_activate_pisa(pisa_device_handle_t); int scsi_low_deactivate_pisa(pisa_device_handle_t); int scsi_low_notify_pisa(pisa_device_handle_t, pisa_event_t); #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ int scsi_low_activate_pisa(struct scsi_low_softc *, int); int scsi_low_deactivate_pisa(struct scsi_low_softc *); -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ #endif /* !_SCSI_LOW_PISA_H_ */ Index: sys/contrib/altq/altq/altq_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/altq/altq/altq_var.h (revision 227831) +++ sys/contrib/altq/altq/altq_var.h (working copy) @@ -201,7 +201,7 @@ #define CALLOUT_STOP(c) untimeout((c)->c_func,(c)->c_arg) #define CALLOUT_INITIALIZER { NULL, NULL } #endif -#if !defined(__FreeBSD__) +#if !defined(__FreeBSD_kernel__) typedef void (timeout_t)(void *); #endif =20 Index: sys/contrib/altq/altq/if_altq.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/altq/altq/if_altq.h (revision 227831) +++ sys/contrib/altq/altq/if_altq.h (working copy) @@ -29,7 +29,9 @@ #ifndef _ALTQ_IF_ALTQ_H_ #define _ALTQ_IF_ALTQ_H_ =20 -#ifdef __FreeBSD__ +#include + +#ifdef __FreeBSD_kernel__ #include /* XXX */ #include /* XXX */ #include /* XXX */ @@ -51,7 +53,7 @@ int ifq_len; int ifq_maxlen; int ifq_drops; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct mtx ifq_mtx; #endif =20 Index: sys/contrib/pf/net/if_pflog.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/if_pflog.h (revision 227831) +++ sys/contrib/pf/net/if_pflog.h (working copy) @@ -27,10 +27,12 @@ #ifndef _NET_IF_PFLOG_H_ #define _NET_IF_PFLOG_H_ =20 +#include + #define PFLOGIFS_MAX 16 =20 struct pflog_softc { -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct ifnet *sc_ifp; /* the interface pointer */ #else struct ifnet sc_if; /* the interface */ @@ -74,7 +76,7 @@ #define OLD_PFLOG_HDRLEN sizeof(struct old_pfloghdr) =20 #ifdef _KERNEL -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct pf_rule; struct pf_ruleset; struct pfi_kif; @@ -90,7 +92,7 @@ if (pflog_packet_ptr !=3D NULL) \ pflog_packet_ptr(i,a,b,c,d,e,f,g,h); \ } while (0) -#else /* ! __FreeBSD__ */ +#else /* ! __FreeBSD_kernel__ */ #if NPFLOG > 0 #define PFLOG_PACKET(i,x,a,b,c,d,e,f,g,h) pflog_packet(i,a,b,c,d,e,f,g,h) #else Index: sys/contrib/pf/net/if_pflow.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/if_pflow.h (revision 227831) +++ sys/contrib/pf/net/if_pflow.h (working copy) @@ -22,6 +22,8 @@ #ifndef _NET_IF_PFLOW_H_ #define _NET_IF_PFLOW_H_ =20 +#include + #define PFLOW_ID_LEN sizeof(u_int64_t) =20 #define PFLOW_MAXFLOWS 30 @@ -66,7 +68,7 @@ unsigned int sc_maxcount; u_int64_t sc_gcounter; struct ip_moptions sc_imo; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct callout sc_tmo; #else struct timeout sc_tmo; Index: sys/contrib/pf/net/if_pfsync.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/if_pfsync.h (revision 227831) +++ sys/contrib/pf/net/if_pfsync.h (working copy) @@ -45,6 +45,8 @@ #ifndef _NET_IF_PFSYNC_H_ #define _NET_IF_PFSYNC_H_ =20 +#include + #define PFSYNC_VERSION 5 #define PFSYNC_DFLTTL 255 =20 @@ -268,7 +270,7 @@ int pfsyncr_authlevel; }; =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #define SIOCSETPFSYNC _IOW('i', 247, struct ifreq) #define SIOCGETPFSYNC _IOWR('i', 248, struct ifreq) #endif @@ -288,7 +290,7 @@ #define PFSYNC_S_DEFER 0xfe #define PFSYNC_S_NONE 0xff =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ void pfsync_input(struct mbuf *, __unused int); #else void pfsync_input(struct mbuf *, ...); @@ -300,7 +302,7 @@ #define PFSYNC_SI_CKSUM 0x02 #define PFSYNC_SI_ACK 0x04 int pfsync_state_import(struct pfsync_state *, u_int8_t); -#ifndef __FreeBSD__ +#ifndef __FreeBSD_kernel__ void pfsync_state_export(struct pfsync_state *, struct pf_state *); #endif Index: sys/contrib/pf/net/pfvar.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/pfvar.h (revision 227831) +++ sys/contrib/pf/net/pfvar.h (working copy) @@ -37,7 +37,7 @@ #include #include #include -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #include #include #else @@ -46,7 +46,7 @@ =20 #include #include -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #include #include #include @@ -54,7 +54,7 @@ #include #endif =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #include #endif =20 @@ -62,7 +62,7 @@ =20 struct ip; struct ip6_hdr; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct inpcb; #endif =20 @@ -173,7 +173,7 @@ } a; char ifname[IFNAMSIZ]; char tblname[PF_TABLE_NAME_SIZE]; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #define RTLABEL_LEN 32 #endif char rtlabelname[RTLABEL_LEN]; @@ -211,7 +211,7 @@ * Address manipulation macros */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #define splsoftnet() splnet() =20 #define HTONL(x) (x) =3D htonl((__uint32_t)(x)) @@ -236,7 +236,7 @@ if (var) \ uma_zdestroy(var) =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ extern struct mtx pf_task_mtx; =20 #define PF_LOCK_ASSERT() mtx_assert(&pf_task_mtx, MA_OWNED) @@ -255,7 +255,7 @@ #define PF_UNLOCK_ASSERT() #define PF_LOCK() #define PF_UNLOCK() -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 #define PF_COPYIN(uaddr, kaddr, len, r) do { \ PF_UNLOCK(); \ @@ -279,7 +279,7 @@ #define PFSYNC_MINVER 1 #define PFSYNC_PREFVER PFSYNC_MODVER #define PFSYNC_MAXVER 1 -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ #ifdef INET #ifndef INET6 #define PF_INET_ONLY @@ -833,7 +833,7 @@ u_int64_t id; u_int32_t creatorid; u_int8_t direction; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ u_int8_t pad[2]; u_int8_t local_flags; #define PFSTATE_EXPIRING 0x01 @@ -923,7 +923,7 @@ sa_family_t af; u_int8_t proto; u_int8_t direction; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ u_int8_t local_flags; #define PFSTATE_EXPIRING 0x01 u_int8_t pad; @@ -935,7 +935,7 @@ u_int8_t updates; } __packed; =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #ifdef _KERNEL /* pfsync */ typedef int pfsync_state_import_t(struct pfsync_state *, u_int8_t); @@ -1215,7 +1215,7 @@ RB_HEAD(pfi_ifhead, pfi_kif); =20 /* state tables */ -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #ifdef _KERNEL VNET_DECLARE(struct pf_state_tree, pf_statetbl); #define V_pf_statetbl VNET(pf_statetbl) @@ -1277,7 +1277,7 @@ struct pf_addr *dst; /* dst address */ u_int16_t *sport; u_int16_t *dport; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct pf_mtag *pf_mtag; #endif =20 @@ -1403,7 +1403,7 @@ *(a) =3D (x); \ } while (0) =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #define REASON_SET(a, x) \ do { \ if ((a) !=3D NULL) \ @@ -1488,7 +1488,7 @@ u_int32_t parent_qid; /* parent queue id */ u_int32_t bandwidth; /* queue bandwidth */ u_int8_t priority; /* priority */ -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ u_int8_t local_flags; /* dynamic interface */ #define PFALTQ_FLAG_IF_REMOVED 0x01 #endif @@ -1768,7 +1768,7 @@ #define DIOCSETIFFLAG _IOWR('D', 89, struct pfioc_iface) #define DIOCCLRIFFLAG _IOWR('D', 90, struct pfioc_iface) #define DIOCKILLSRCNODES _IOWR('D', 91, struct pfioc_src_node_kill) -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct pf_ifspeed { char ifname[IFNAMSIZ]; u_int32_t baudrate; @@ -1779,7 +1779,7 @@ #ifdef _KERNEL RB_HEAD(pf_src_tree, pf_src_node); RB_PROTOTYPE(pf_src_tree, pf_src_node, entry, pf_src_compare); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct pf_src_tree, tree_src_tracking); #define V_tree_src_tracking VNET(tree_src_tracking) #else @@ -1789,7 +1789,7 @@ RB_HEAD(pf_state_tree_id, pf_state); RB_PROTOTYPE(pf_state_tree_id, pf_state, entry_id, pf_state_compare_id); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct pf_state_tree_id, tree_id); #define V_tree_id VNET(tree_id) VNET_DECLARE(struct pf_state_queue, state_list); @@ -1800,14 +1800,14 @@ #endif =20 TAILQ_HEAD(pf_poolqueue, pf_pool); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct pf_poolqueue, pf_pools[2]); #define V_pf_pools VNET(pf_pools) #else extern struct pf_poolqueue pf_pools[2]; #endif TAILQ_HEAD(pf_altqqueue, pf_altq); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct pf_altqqueue, pf_altqs[2]); #define V_pf_altqs VNET(pf_altqs) VNET_DECLARE(struct pf_palist, pf_pabuf); @@ -1817,7 +1817,7 @@ extern struct pf_palist pf_pabuf; #endif =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(u_int32_t, ticket_altqs_active); #define V_ticket_altqs_active VNET(ticket_altqs_active) VNET_DECLARE(u_int32_t, ticket_altqs_inactive); @@ -1849,7 +1849,7 @@ extern void pf_tbladdr_remove(struct pf_addr_wrap *); extern void pf_tbladdr_copyout(struct pf_addr_wrap *); extern void pf_calc_skip_steps(struct pf_rulequeue *); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #ifdef ALTQ extern void pf_altq_ifnet_event(struct ifnet *, int); #endif @@ -1886,7 +1886,7 @@ extern struct pool pf_state_scrub_pl; #endif extern void pf_purge_thread(void *); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ extern int pf_purge_expired_src_nodes(int); extern int pf_purge_expired_states(u_int32_t , int); #else @@ -1911,7 +1911,7 @@ extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, u_int8_t); =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct ifnet *, sync_ifp); #define V_sync_ifp VNET(sync_ifp); VNET_DECLARE(struct pf_rule, pf_default_rule); @@ -1924,12 +1924,12 @@ u_int8_t); void pf_rm_rule(struct pf_rulequeue *, struct pf_rule *); -#ifndef __FreeBSD__ +#ifndef __FreeBSD_kernel__ struct pf_divert *pf_find_divert(struct mbuf *); #endif =20 #ifdef INET -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ int pf_test(int, struct ifnet *, struct mbuf **, struct ether_header *, struct inpcb *); #else @@ -1938,7 +1938,7 @@ #endif /* INET */ =20 #ifdef INET6 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ int pf_test6(int, struct ifnet *, struct mbuf **, struct ether_header *, struct inpcb *); #else @@ -1949,7 +1949,7 @@ void pf_addr_inc(struct pf_addr *, sa_family_t); #endif /* INET6 */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ u_int32_t pf_new_isn(struct pf_state *); #endif void *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *, @@ -1986,7 +1986,7 @@ void pf_purge_expired_fragments(void); int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *); int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ int pf_socket_lookup(int, struct pf_pdesc *, struct inpcb *); #else int pf_socket_lookup(int, struct pf_pdesc *); @@ -2031,7 +2031,7 @@ int pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *, int *, u_int32_t, int); =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct pfi_kif *, pfi_all); #define V_pfi_all VNET(pfi_all) #else @@ -2039,7 +2039,7 @@ #endif =20 void pfi_initialize(void); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ void pfi_cleanup(void); #endif struct pfi_kif *pfi_kif_get(const char *); @@ -2061,7 +2061,7 @@ int pfi_set_flags(const char *, int); int pfi_clear_flags(const char *, int); =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ int pf_match_tag(struct mbuf *, struct pf_rule *, int *, struct pf_mtag *); #else @@ -2071,7 +2071,7 @@ void pf_tag2tagname(u_int16_t, char *); void pf_tag_ref(u_int16_t); void pf_tag_unref(u_int16_t); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ int pf_tag_packet(struct mbuf *, int, int, struct pf_mtag *); #else int pf_tag_packet(struct mbuf *, int, int); @@ -2080,14 +2080,14 @@ void pf_qid2qname(u_int32_t, char *); void pf_qid_unref(u_int32_t); =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct pf_status, pf_status); #define V_pf_status VNET(pf_status) #else extern struct pf_status pf_status; #endif =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(uma_zone_t, pf_frent_pl); #define V_pf_frent_pl VNET(pf_frent_pl) VNET_DECLARE(uma_zone_t, pf_frag_pl); @@ -2103,14 +2103,14 @@ void *pp; unsigned limit; }; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ VNET_DECLARE(struct pf_pool_limit, pf_pool_limits[PF_LIMIT_MAX]); #define V_pf_pool_limits VNET(pf_pool_limits) #else extern struct pf_pool_limit pf_pool_limits[PF_LIMIT_MAX]; #endif =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct pf_frent { LIST_ENTRY(pf_frent) fr_next; struct ip *fr_ip; @@ -2140,11 +2140,11 @@ LIST_HEAD(pf_cacheq, pf_frcache) fru_cache; /* non-buf */ } fr_u; }; -#endif /* (__FreeBSD__) */ +#endif /* (__FreeBSD_kernel__) */ =20 #endif /* _KERNEL */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #ifdef _KERNEL VNET_DECLARE(struct pf_anchor_global, pf_anchors); #define V_pf_anchors VNET(pf_anchors) @@ -2172,7 +2172,7 @@ struct pf_ruleset *pf_find_or_create_ruleset(const char *); void pf_rs_initialize(void); =20 -#ifndef __FreeBSD__ +#ifndef __FreeBSD_kernel__ #ifdef _KERNEL int pf_anchor_copyout(const struct pf_ruleset *, const struct pf_rule *, struct pfioc_rule *); @@ -2193,7 +2193,7 @@ const struct tcphdr *); void pf_osfp_flush(void); int pf_osfp_get(struct pf_osfp_ioctl *); -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ int pf_osfp_initialize(void); void pf_osfp_cleanup(void); #else Index: sys/dev/firewire/firewirereg.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/firewire/firewirereg.h (revision 227831) +++ sys/dev/firewire/firewirereg.h (working copy) @@ -35,6 +35,8 @@ * */ =20 +#include + #ifdef __DragonFly__ typedef d_thread_t fw_proc; #include @@ -75,7 +77,7 @@ }; =20 struct firewire_softc { -#if defined(__FreeBSD__) && __FreeBSD_version >=3D 500000 +#if defined(__FreeBSD_kernel__) && __FreeBSD_version >=3D 500000 struct cdev *dev; #endif struct firewire_comm *fc; Index: sys/dev/lmc/if_lmc.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/lmc/if_lmc.h (revision 227831) +++ sys/dev/lmc/if_lmc.h (working copy) @@ -47,6 +47,8 @@ #ifndef IF_LMC_H #define IF_LMC_H =20 +#include + #define DEVICE_NAME "lmc" =20 /* Linux RPM-style version information */ @@ -984,7 +986,7 @@ #endif u_int32_t address1; /* buffer1 bus address */ u_int32_t address2; /* buffer2 bus address */ -#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) +#if (defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenB= SD__)) bus_dmamap_t map; /* bus dmamap for this descriptor */ # define TLP_BUS_DSL_VAL (sizeof(bus_dmamap_t) & TLP_BUS_DSL) #else @@ -1035,7 +1037,7 @@ #elif BSD struct mbuf *head; /* tail-queue of mbufs */ struct mbuf *tail; -# if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) +# if (defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__Open= BSD__)) bus_dma_tag_t tag; /* bus_dma tag for desc array */ bus_dmamap_t map; /* bus_dma map for desc array */ bus_dma_segment_t segs[2]; /* bus_dmamap_load() or bus_dmamem_alloc() */ @@ -1068,7 +1070,7 @@ */ #define IOREF_CSR 1 /* access Tulip CSRs with IO cycles if 1 */ =20 -#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) +#if (defined(__FreeBSD_kernel__) && defined(DEVICE_POLLING)) # define DEV_POLL 1 #else # define DEV_POLL 0 @@ -1151,7 +1153,7 @@ # endif #endif =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ struct callout callout; /* watchdog needs this */ struct device *dev; /* base device pointer */ bus_space_tag_t csr_tag; /* bus_space needs this */ @@ -1173,7 +1175,7 @@ int top_spl; /* lock card->watchdog vs core_ioctl */ int bottom_spl; /* lock for buf queues & descriptor rings */ # endif -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 #ifdef __linux__ struct pci_dev *pci_dev; /* READ/WRITE_PCI_CFG macros need this */ @@ -1210,7 +1212,7 @@ =20 /* Hide the minor differences between OS versions */ =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ typedef void intr_return_t; # define READ_PCI_CFG(sc, addr) pci_read_config ((sc)->dev, addr, 4) # define WRITE_PCI_CFG(sc, addr, data) pci_write_config((sc)->dev, addr, d= ata, 4) @@ -1264,7 +1266,7 @@ # if (__FreeBSD_version >=3D 600000) # define IFF_RUNNING IFF_DRV_RUNNING # endif -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 #ifdef __NetBSD__ typedef int intr_return_t; @@ -1428,7 +1430,7 @@ #endif =20 #if (defined(__bsdi__) || /* unconditionally */ \ - (defined(__FreeBSD__) && (__FreeBSD_version < 503000)) || \ + (defined(__FreeBSD_kernel__) && (__FreeBSD_version < 503000)) || \ (defined(__NetBSD__) && (__NetBSD_Version__ < 106000000)) || \ (defined(__OpenBSD__) && ( OpenBSD < 200111))) # define IFQ_ENQUEUE(ifq, m, pa, err) \ @@ -1531,7 +1533,7 @@ static int t1_ioctl(softc_t *, struct ioctl *); =20 #if IFNET -# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\ +# if ((defined(__FreeBSD_kernel__) && (__FreeBSD_version < 500000)) ||\ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)) static void netisr_dispatch(int, struct mbuf *); # endif @@ -1541,7 +1543,7 @@ #if BSD static void mbuf_enqueue(struct desc_ring *, struct mbuf *); static struct mbuf* mbuf_dequeue(struct desc_ring *); -# ifdef __FreeBSD__ +# ifdef __FreeBSD_kernel__ static void fbsd_dmamap_load(void *, bus_dma_segment_t *, int, int); # endif static int create_ring(softc_t *, struct desc_ring *, int); @@ -1570,7 +1572,7 @@ static void core_interrupt(void *, int); static void user_interrupt(softc_t *, int); #if BSD -# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) +# if (defined(__FreeBSD_kernel__) && defined(DEVICE_POLLING)) static int fbsd_poll(struct ifnet *, enum poll_cmd, int); # endif static intr_return_t bsd_interrupt(void *); @@ -1638,12 +1640,12 @@ static int attach_card(softc_t *, const char *); static void detach_card(softc_t *); =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ static int fbsd_probe(device_t); static int fbsd_detach(device_t); static int fbsd_shutdown(device_t); static int fbsd_attach(device_t); -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 #ifdef __NetBSD__ static int nbsd_match(struct device *t, struct cfdata *, void *); Index: sys/dev/mpt/mpilib/mpi_type.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/mpt/mpilib/mpi_type.h (revision 227831) +++ sys/dev/mpt/mpilib/mpi_type.h (working copy) @@ -55,7 +55,9 @@ #ifndef MPI_TYPE_H #define MPI_TYPE_H =20 +#include =20 + /*************************************************************************= ****** * Define MPI_POINTER if it hasn't already been defined. By default MPI_PO= INTER * is defined to be a near pointer. MPI_POINTER can be defined as a far po= inter @@ -77,7 +79,7 @@ typedef signed short S16; typedef unsigned short U16; =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ =20 typedef int32_t S32; typedef uint32_t U32; Index: sys/dev/wi/if_wireg.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/wi/if_wireg.h (revision 227831) +++ sys/dev/wi/if_wireg.h (working copy) @@ -32,6 +32,8 @@ * $FreeBSD$ */ =20 +#include + #define WI_DELAY 5 #define WI_TIMEOUT (500000/WI_DELAY) /* 500 ms */ =20 @@ -84,7 +86,7 @@ #ifdef __NetBSD__ #define OS_STRING_NAME "NetBSD" #endif -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ #define OS_STRING_NAME "FreeBSD" #endif #ifdef __OpenBSD__ Index: sys/fs/nfs/nfs_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/fs/nfs/nfs_var.h (revision 227831) +++ sys/fs/nfs/nfs_var.h (working copy) @@ -32,6 +32,8 @@ * $FreeBSD$ */ =20 +#include + /* * XXX needs and because of typedefs */ @@ -76,7 +78,7 @@ struct nfsvattr; struct nfs_vattr; struct NFSSVCARGS; -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ NFS_ACCESS_ARGS; NFS_OPEN_ARGS; NFS_GETATTR_ARGS; Index: sys/net/if_atm.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net/if_atm.h (revision 227831) +++ sys/net/if_atm.h (working copy) @@ -37,6 +37,8 @@ * net/if_atm.h */ =20 +#include + /* * Classification of ATM cards. */ @@ -202,7 +204,7 @@ =20 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) #define RTALLOC1(A,B) rtalloc1((A),(B)) -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD_kernel__) #define RTALLOC1(A,B) rtalloc1((A),(B),0UL) #endif =20 Index: sys/net/zlib.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net/zlib.h (revision 227831) +++ sys/net/zlib.h (working copy) @@ -50,6 +50,8 @@ #ifndef _ZLIB_H #define _ZLIB_H =20 +#include + #ifdef __cplusplus extern "C" { #endif @@ -510,7 +512,7 @@ done by inflate(). */ =20 -#if defined(__FreeBSD__) && defined(_KERNEL) +#if defined(__FreeBSD_kernel__) && defined(_KERNEL) #define inflate inflate_ppp /* FreeBSD already has an inflate :-= ( */ #endif =20 Index: sys/net80211/ieee80211_ioctl.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net80211/ieee80211_ioctl.h (revision 227831) +++ sys/net80211/ieee80211_ioctl.h (working copy) @@ -28,6 +28,8 @@ #ifndef _NET80211_IEEE80211_IOCTL_H_ #define _NET80211_IEEE80211_IOCTL_H_ =20 +#include + /* * IEEE 802.11 ioctls. */ @@ -569,7 +571,7 @@ uint16_t sv_vlan; }; =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ /* * FreeBSD-style ioctls. */ @@ -849,6 +851,6 @@ #define IEEE80211_CLONE_WDSLEGACY 0x0004 /* legacy WDS processing */ #define IEEE80211_CLONE_MACADDR 0x0008 /* use specified mac addr */ #define IEEE80211_CLONE_TDMA 0x0010 /* operate in TDMA mode */ -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 #endif /* _NET80211_IEEE80211_IOCTL_H_ */ Index: sys/net80211/ieee80211_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net80211/ieee80211_var.h (revision 227831) +++ sys/net80211/ieee80211_var.h (working copy) @@ -28,13 +28,15 @@ #ifndef _NET80211_IEEE80211_VAR_H_ #define _NET80211_IEEE80211_VAR_H_ =20 +#include + /* * Definitions for IEEE 802.11 drivers. */ /* NB: portability glue must go first */ #if defined(__NetBSD__) #include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD_kernel__) #include #elif defined(__linux__) #include Index: sys/netinet/sctp_constants.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/sctp_constants.h (revision 227831) +++ sys/netinet/sctp_constants.h (working copy) @@ -38,6 +38,8 @@ #ifndef __sctp_constants_h__ #define __sctp_constants_h__ =20 +#include + /* IANA assigned port number for SCTP over UDP encapsulation */ /* For freebsd we cannot bind the port at * startup. Otherwise what will happen is @@ -1020,7 +1022,7 @@ #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) #define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) #endif -/*#if defined(__FreeBSD__) || defined(__APPLE__)*/ +/*#if defined(__FreeBSD_kernel__) || defined(__APPLE__)*/ /*#define SCTP_GETTIME_TIMEVAL(x) { \*/ /* (x)->tv_sec =3D ticks / 1000; \*/ /* (x)->tv_usec =3D (ticks % 1000) * 1000; \*/ @@ -1028,7 +1030,7 @@ =20 /*#else*/ /*#define SCTP_GETTIME_TIMEVAL(x) (microtime(x))*/ -/*#endif __FreeBSD__ */ +/*#endif __FreeBSD_kernel__ */ =20 #if defined(_KERNEL) || defined(__Userspace__) #define sctp_sowwakeup(inp, so) \ Index: sys/netinet/sctp_pcb.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/sctp_pcb.h (revision 227831) +++ sys/netinet/sctp_pcb.h (working copy) @@ -37,6 +37,8 @@ #ifndef __sctp_pcb_h__ #define __sctp_pcb_h__ =20 +#include + #include #include #include @@ -240,7 +242,7 @@ * All static structures that anchor the system must be here. */ struct sctp_epinfo sctppcbinfo; -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) +#if defined(__FreeBSD_kernel__) && defined(SMP) && defined(SCTP_USE_PERCPU= _STAT) struct sctpstat *sctpstat; #else struct sctpstat sctpstat; @@ -633,7 +635,7 @@ struct sctp_inpcb *, uint8_t co_off); =20 -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +#if defined(__FreeBSD_kernel__) && defined(SCTP_MCORE_INPUT) && defined(SM= P) void sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use); =20 Index: sys/netinet/sctp_structs.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/sctp_structs.h (revision 227831) +++ sys/netinet/sctp_structs.h (working copy) @@ -38,6 +38,8 @@ #ifndef __sctp_structs_h__ #define __sctp_structs_h__ =20 +#include + #include #include #include @@ -108,7 +110,7 @@ typedef int (*inp_func) (struct sctp_inpcb *, void *ptr, uint32_t val); typedef void (*end_func) (void *ptr, uint32_t val); =20 -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +#if defined(__FreeBSD_kernel__) && defined(SCTP_MCORE_INPUT) && defined(SM= P) /* whats on the mcore control struct */ struct sctp_mcore_queue { TAILQ_ENTRY(sctp_mcore_queue) next; Index: sys/netinet/sctp_uio.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/sctp_uio.h (revision 227831) +++ sys/netinet/sctp_uio.h (working copy) @@ -37,6 +37,7 @@ #ifndef __sctp_uio_h__ #define __sctp_uio_h__ =20 +#include =20 #if ! defined(_KERNEL) #include @@ -1062,7 +1063,7 @@ =20 #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1) #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1) -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) +#if defined(__FreeBSD_kernel__) && defined(SMP) && defined(SCTP_USE_PERCPU= _STAT) #define SCTP_STAT_INCR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x +=3D= _d) #define SCTP_STAT_DECR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x -=3D= _d) #else Index: sys/sys/device_port.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/device_port.h (revision 227831) +++ sys/sys/device_port.h (working copy) @@ -27,9 +27,11 @@ * $FreeBSD$ */ =20 +#include + #if defined(__NetBSD__) # include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD_kernel__) # include # include #endif @@ -43,7 +45,7 @@ # define DEVPORT_DEVNAME(dev) (dev).dv_xname # define DEVPORT_DEVUNIT(dev) (dev).dv_unit =20 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD_kernel__) /* * FreeBSD (compatibility for struct device) */ @@ -67,4 +69,4 @@ #define DEVPORT_PDEVALLOC_SOFTC(pdev) device_get_softc(pdev) #define DEVPORT_PDEVGET_SOFTC(pdev) device_get_softc(pdev) =20 -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ Index: sys/sys/timex.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/timex.h (revision 227831) +++ sys/sys/timex.h (working copy) @@ -95,6 +95,9 @@ */ #ifndef _SYS_TIMEX_H_ #define _SYS_TIMEX_H_ 1 + +#include + #define NTP_API 4 /* NTP API version */ =20 #ifndef MSDOS /* Microsoft specific */ @@ -218,7 +221,7 @@ long stbcnt; /* stability limit exceeded (ro) */ }; =20 -#ifdef __FreeBSD__ +#ifdef __FreeBSD_kernel__ =20 #ifdef _KERNEL void ntp_update_second(int64_t *adjustment, time_t *newsec); @@ -231,6 +234,6 @@ __END_DECLS #endif /* _KERNEL */ =20 -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD_kernel__ */ =20 #endif /* !_SYS_TIMEX_H_ */ --nFreZHaLTZJo0R7j-- --8GpibOaaTibBMecb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/kFreeBSD) iQIcBAEBCAAGBQJOzJoSAAoJELd1onhloKnOSSoP/14VCu82RmybijW2Jb2aWLjK z1XZVo5oPa6RM/rFGMIphfwRJv73ep4iieRDlbaxJm/Mky8VEY18VIMWVLlVeSFk W1RlzDaQEQVFx3mdhtVY22zEKRIDi+TAx8c5Fh/aOMacP2krrrbKFKNIjUCb1mGZ 5NNp42gnRCQkkdciZ0iDGP3jL2sG04vmNrzpC/2nVOyulzH+JLSvRAFbKg23XUe/ Xm4vaojiCPDRJk7FT7lznLW4g1i284ojYwGbxOm4GZl9T0XeUgw3ZCFpXHQ4zzjw RkesuQudqWbn3rJ5KD6xbhMF8NK3cxBVl33RRvXIVAD44abw97sAMshcW+JC50Pk dJ+F3lHxPi/RdGSZRpU0OYxnaTGc0ZByGyZrbo5589FcQx9UA2fhrhh0DQLCfSd1 bIHfZBrZnRf9DLlidnWn2FuQ2961gcMY/ehpqUXXTgY9CU8FvRRSdat8RJadlYI3 4epiiXzR9RZXlFxhhcN/s4uvKGuIZNbLSxBUZ98Nn3kaLpYQ9Ex+fGxO4ErWITEH 3mkj0a0hYUF9TSegXW6aIf//cyqT+P6FvY+o9ft4WUAXW+oyC7hpT7eExwmcBFTW RYs2MlbnVtuzwaXpkx0Vwv1JWII1+XRZRxrGywY/seXS8i+IvdbLS/P3iiiu4A57 cT9klxq+J6ViBv8ZFvF8 =qRMr -----END PGP SIGNATURE----- --8GpibOaaTibBMecb-- From owner-freebsd-arch@FreeBSD.ORG Wed Nov 23 07:22:15 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8C4B106564A; Wed, 23 Nov 2011 07:22:15 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 3594D8FC08; Wed, 23 Nov 2011 07:22:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id pAN7MDhj022144; Wed, 23 Nov 2011 11:22:13 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Wed, 23 Nov 2011 11:22:13 +0400 (MSK) From: Maxim Konovalov To: Kostik Belousov In-Reply-To: <20111122154935.GR50300@deviant.kiev.zoral.com.ua> Message-ID: References: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> <20111122154357.GI95664@mdounin.ru> <20111122154935.GR50300@deviant.kiev.zoral.com.ua> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: arch@freebsd.org, current@freebsd.org, igor@sysoev.ru, Maxim Dounin Subject: Re: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 07:22:15 -0000 [...] > Anyway, the patch needs testers before I will push it forward. > [igor's email was corrected] We will test it in out environment and let you know. Thanks for the patch! -- Maxim Konovalov From owner-freebsd-arch@FreeBSD.ORG Thu Nov 24 03:25:55 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B09F1065673; Thu, 24 Nov 2011 03:25:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id B28668FC0A; Thu, 24 Nov 2011 03:25:54 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAO3PpxX020118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Nov 2011 14:25:52 +1100 Date: Thu, 24 Nov 2011 14:25:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Robert Millan In-Reply-To: <20111123070036.GA29952@thorin> Message-ID: <20111124141821.O932@besplex.bde.org> References: <20111123070036.GA29952@thorin> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 03:25:55 -0000 On Wed, 23 Nov 2011, Robert Millan wrote: > Here we go again :-) > > Out of the kernel headers that are installed in /usr/include/ hierracy, there > are some which include support multiple operating systems (usually FreeBSD and > other *BSD flavours). > > This patch adds support to detect GNU/kFreeBSD as well. In all cases, we > match the same declarations as FreeBSD does (which is to be expected in kernel > headers, since both systems share the same kernel). Now it adds lots of namespace pollution (all of , including all of its namespace pollution), just to get 1 new symbol defined. % Index: sys/cam/scsi/scsi_low.h % =================================================================== % --- sys/cam/scsi/scsi_low.h (revision 227831) % +++ sys/cam/scsi/scsi_low.h (working copy) % @@ -44,6 +44,8 @@ % #ifndef _SCSI_LOW_H_ % #define _SCSI_LOW_H_ % % +#include % + % /*================================================ % * Scsi low OSDEP % * (All os depend structures should be here!) % % [... 22 more headers polluted] All the affected headers are poorly implemented ones. Mostly kernel headers which escaped to userland. Bruce From owner-freebsd-arch@FreeBSD.ORG Thu Nov 24 17:38:22 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 303111065673; Thu, 24 Nov 2011 17:38:22 +0000 (UTC) (envelope-from maxim@freebsd.org) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 7730C8FC08; Thu, 24 Nov 2011 17:38:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id pAOHcJcJ018757; Thu, 24 Nov 2011 21:38:19 +0400 (MSK) (envelope-from maxim@freebsd.org) Date: Thu, 24 Nov 2011 21:38:19 +0400 (MSK) From: Maxim Konovalov To: Kostik Belousov In-Reply-To: Message-ID: References: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> <20111122154357.GI95664@mdounin.ru> <20111122154935.GR50300@deviant.kiev.zoral.com.ua> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: arch@freebsd.org, current@freebsd.org, igor@sysoev.ru, Maxim Dounin Subject: Re: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 17:38:22 -0000 Hi Kostik, On Wed, 23 Nov 2011, 11:22+0400, Maxim Konovalov wrote: > [...] > > Anyway, the patch needs testers before I will push it forward. > > > [igor's email was corrected] > > We will test it in out environment and let you know. > It seems I don't understand how it works. Here is a test program: http://maxim.int.ru/stuff/malloc_test.c.txt It allocates successfully 64x1MB chunks by malloc(), reallocf() and realloc() with the following command line: MALLOC_OPTIONS=JM limits -d 10m ./malloc_test When we add L flag to the MALLOC_OPTIONS it starts to work strange: It allocates 64MB via malloc() but fails to allocate more than 3MB by realloc() and reallocf(). More funny, the result varies from time to time: $ MALLOC_OPTIONS=JML limits -d 10m ./malloc_test | head RLIMIT_DATA: rlim_cur is 10485760, rlim_max is 10485760 1th allocation failed 2th allocation failed 3th allocation failed 4th allocation failed 5th allocation failed 6th allocation failed 7th allocation failed 8th allocation failed 9th allocation failed $ MALLOC_OPTIONS=JML limits -d 10m ./malloc_test | head RLIMIT_DATA: rlim_cur is 10485760, rlim_max is 10485760 1048576 bytes successfuly allocated 2097152 bytes successfuly allocated 3145728 bytes successfuly allocated 4194304 bytes successfuly allocated 5242880 bytes successfuly allocated 6291456 bytes successfuly allocated 7340032 bytes successfuly allocated 8388608 bytes successfuly allocated 9437184 bytes successfuly allocated $ MALLOC_OPTIONS=JML limits -d 10m ./malloc_test | head RLIMIT_DATA: rlim_cur is 10485760, rlim_max is 10485760 1th allocation failed 2th allocation failed 3th allocation failed 4th allocation failed 5th allocation failed 6th allocation failed 7th allocation failed 8th allocation failed 9th allocation failed It's today -current with your patch. -- Maxim Konovalov From owner-freebsd-arch@FreeBSD.ORG Thu Nov 24 18:58:12 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB9BF106567C; Thu, 24 Nov 2011 18:58:12 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 689F48FC1D; Thu, 24 Nov 2011 18:58:12 +0000 (UTC) Received: by iakl21 with SMTP id l21so5147462iak.13 for ; Thu, 24 Nov 2011 10:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=EUFsV2qANwyavbxlhH3qYD3VRcboyFKKrumONJd2fuI=; b=Ahh8KIdwc14Qf2elMh8A8vrtxE2tieb3q+6QtKwIB8iqTFEfAovFMSobrgksJHWuIb WIPX8jkBfHfUT4txNoDprEV4Qf0yPeLuKLaMqLBeRjHRLV551ohwc6vOl1anXzpupTrF /ot54usLrhr1YsT112Gx/4AvmmnTJ32PECi5w= MIME-Version: 1.0 Received: by 10.43.45.137 with SMTP id uk9mr8680604icb.52.1322161091957; Thu, 24 Nov 2011 10:58:11 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.200 with HTTP; Thu, 24 Nov 2011 10:58:11 -0800 (PST) In-Reply-To: <20111124141821.O932@besplex.bde.org> References: <20111123070036.GA29952@thorin> <20111124141821.O932@besplex.bde.org> Date: Thu, 24 Nov 2011 19:58:11 +0100 X-Google-Sender-Auth: texmV3vH3fcaWgk38rk-x6_K4jE Message-ID: From: Robert Millan To: Bruce Evans Content-Type: multipart/mixed; boundary=bcaec5299f5938d4f804b27f9e42 Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 18:58:12 -0000 --bcaec5299f5938d4f804b27f9e42 Content-Type: text/plain; charset=UTF-8 Hi Bruce, 2011/11/24 Bruce Evans : > Now it adds lots of namespace pollution (all of , including > all of its namespace pollution), just to get 1 new symbol defined. Well, my initial patch (see mail with same subject modulo "v2") didn't have this problem. Now that __FreeBSD_kernel__ is defined, many #ifdefs can be simplified, but maybe it's not desireable for all of them. At least not until we can rely on the compiler to define this macro. So in this particular case maybe it's better to use the other approach? See attachment. --bcaec5299f5938d4f804b27f9e42 Content-Type: text/x-diff; charset=US-ASCII; name="gnu-kfreebsd_headers.diff" Content-Disposition: attachment; filename="gnu-kfreebsd_head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fRnJl ZUJTRF9fKSB8fCBkZWZpbmVkKF9fRnJlZUJTRF9rZXJuZWxfXykKIC8qCiAgKiBGcmVlQlNEIChj b21wYXRpYmlsaXR5IGZvciBzdHJ1Y3QgZGV2aWNlKQogICovCmRpZmYgLXVyIHN5cy5vbGQvc3lz L3RpbWV4Lmggc3lzL3N5cy90aW1leC5oCi0tLSBzeXMub2xkL3N5cy90aW1leC5oCTIwMDUtMDEt MDcgMDM6Mjk6MjcuMDAwMDAwMDAwICswMTAwCisrKyBzeXMvc3lzL3RpbWV4LmgJMjAxMS0xMS0x MyAxNDoxMjo0MS4xNTU5MDc1ODcgKzAxMDAKQEAgLTIxOCw3ICsyMTgsNyBAQAogCWxvbmcJc3Ri Y250OwkJLyogc3RhYmlsaXR5IGxpbWl0IGV4Y2VlZGVkIChybykgKi8KIH07CiAKLSNpZmRlZiBf X0ZyZWVCU0RfXworI2lmIGRlZmluZWQoX19GcmVlQlNEX18pIHx8IGRlZmluZWQoX19GcmVlQlNE X2tlcm5lbF9fKQogCiAjaWZkZWYgX0tFUk5FTAogdm9pZAludHBfdXBkYXRlX3NlY29uZChpbnQ2 NF90ICphZGp1c3RtZW50LCB0aW1lX3QgKm5ld3NlYyk7Cg== --bcaec5299f5938d4f804b27f9e42-- From owner-freebsd-arch@FreeBSD.ORG Thu Nov 24 20:29:50 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C74C0106564A; Thu, 24 Nov 2011 20:29:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 632B48FC14; Thu, 24 Nov 2011 20:29:49 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAOKTjuu077996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Nov 2011 22:29:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAOKTjd3049933; Thu, 24 Nov 2011 22:29:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAOKTjpX049932; Thu, 24 Nov 2011 22:29:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Nov 2011 22:29:45 +0200 From: Kostik Belousov To: Maxim Konovalov Message-ID: <20111124202945.GR50300@deviant.kiev.zoral.com.ua> References: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> <20111122154357.GI95664@mdounin.ru> <20111122154935.GR50300@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="865IE93Xpm46K7pT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: arch@freebsd.org, current@freebsd.org, igor@sysoev.ru, Maxim Dounin Subject: Re: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 20:29:51 -0000 --865IE93Xpm46K7pT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 24, 2011 at 09:38:19PM +0400, Maxim Konovalov wrote: > Hi Kostik, >=20 > On Wed, 23 Nov 2011, 11:22+0400, Maxim Konovalov wrote: >=20 > > [...] > > > Anyway, the patch needs testers before I will push it forward. > > > > > [igor's email was corrected] > > > > We will test it in out environment and let you know. > > > It seems I don't understand how it works. >=20 > Here is a test program: http://maxim.int.ru/stuff/malloc_test.c.txt >=20 > It allocates successfully 64x1MB chunks by malloc(), reallocf() and > realloc() with the following command line: >=20 > MALLOC_OPTIONS=3DJM limits -d 10m ./malloc_test >=20 > When we add L flag to the MALLOC_OPTIONS it starts to work strange: >=20 > It allocates 64MB via malloc() but fails to allocate more than 3MB by > realloc() and reallocf(). The non-failing 64MB allocation is easily explained by a bug. I forgot to account for the case when existing map entry was expanded, instead of new entry created due to mmap(2). The other part, in particular, the failure after 3MB, is in fact the correct behaviour. Jemalloc() caches allocation of the pages, and it allocates more then asked in the request. ktrace(1) shows the whole history. Malloc() first allocated 4MB for the needs of libc etc. Then, it allocated 4MB chunk which was used for satisfying the requests of 1-3MB. When the 4MB request came in, the allocation for 8MB was attempted, and failed, since 4MB (libc etc) + 8MB =3D 12MB > data limit. >=20 > More funny, the result varies from time to time: I have no explanation for this, and cannot reproduce the issue. Look at the ktrace. Overall, the test is quite curious but absolutely unrealistic. Fixed patch is available at http://people.freebsd.org/~kib/misc/map_datalimit.2.patch --865IE93Xpm46K7pT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7OqTkACgkQC3+MBN1Mb4hVFACginFQ/syGlHkbuL2ZtY20QdAX mqgAoKgirRQKnX1phG9DhOMUwQHm/B+C =5PsP -----END PGP SIGNATURE----- --865IE93Xpm46K7pT-- From owner-freebsd-arch@FreeBSD.ORG Fri Nov 25 05:37:44 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C03F106564A; Fri, 25 Nov 2011 05:37:44 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 0248C8FC18; Fri, 25 Nov 2011 05:37:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id pAP5bgcX058797; Fri, 25 Nov 2011 09:37:42 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Fri, 25 Nov 2011 09:37:42 +0400 (MSK) From: Maxim Konovalov To: Kostik Belousov In-Reply-To: <20111124202945.GR50300@deviant.kiev.zoral.com.ua> Message-ID: References: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> <20111122154357.GI95664@mdounin.ru> <20111122154935.GR50300@deviant.kiev.zoral.com.ua> <20111124202945.GR50300@deviant.kiev.zoral.com.ua> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: arch@freebsd.org, Maxim Dounin , current@freebsd.org, igor@sysoev.ru Subject: Re: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2011 05:37:44 -0000 [...] > Overall, the test is quite curious but absolutely unrealistic. If there is a realistic one I'm open to use it :-) > Fixed patch is available at > http://people.freebsd.org/~kib/misc/map_datalimit.2.patch > OK, will test and report the results shortly. -- Maxim Konovalov From owner-freebsd-arch@FreeBSD.ORG Fri Nov 25 05:55:01 2011 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0AFA106566C; Fri, 25 Nov 2011 05:55:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id E3D2E8FC08; Fri, 25 Nov 2011 05:55:00 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAP5ssdn010859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Nov 2011 16:54:57 +1100 Date: Fri, 25 Nov 2011 16:54:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Robert Millan In-Reply-To: Message-ID: <20111125150324.G1018@besplex.bde.org> References: <20111123070036.GA29952@thorin> <20111124141821.O932@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , Adrian Chadd , freebsd-current@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2011 05:55:01 -0000 On Thu, 24 Nov 2011, Robert Millan wrote: > 2011/11/24 Bruce Evans : >> Now it adds lots of namespace pollution (all of , including >> all of its namespace pollution), just to get 1 new symbol defined. > > Well, my initial patch (see mail with same subject modulo "v2") didn't > have this problem. Now that __FreeBSD_kernel__ is defined, many > #ifdefs can be simplified, but maybe it's not desireable for all of > them. At least not until we can rely on the compiler to define this > macro. > > So in this particular case maybe it's better to use the other approach? > > See attachment. That is clean enough, except for some style bugs. (I thought of worse ways like duplicating the logic of , or directing to only declare version macros, or putting version macros in a little separate param header and including that. The latter would be cleanest, but gives even more includes, and not worth it for this, but it would have been better for __FreeBSD_version. I don't like having to recompile half the universe according to dependencies on because only __FreeBSD_version__ in it changed. Basic headers rarely change apart from that. BTW, a recent discussion in the POSIX mailing list says that standardized generation of depenedencies should not generate dependencies on system headers. This would break the effect of putting mistakes like __FreeBSD_version__ in any system header :-).) % diff -ur sys.old/cam/scsi/scsi_low.h sys/cam/scsi/scsi_low.h % --- sys.old/cam/scsi/scsi_low.h 2007-12-25 18:52:02.000000000 +0100 % +++ sys/cam/scsi/scsi_low.h 2011-11-13 14:12:41.121908380 +0100 % @@ -53,7 +53,7 @@ % #define SCSI_LOW_INTERFACE_XS % #endif /* __NetBSD__ */ % % -#ifdef __FreeBSD__ % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) % #define SCSI_LOW_INTERFACE_CAM % #define CAM % #endif /* __FreeBSD__ */ This also fixes some style bugs (tab instead of space after `#ifdef'). But it doesn't fix others (tab instead of space after `#ifdef', and comment on a short ifdef). And it introduces a new one (the comment on the ifdef now doesn't even match the code). cam has a highly non-KNF style, so it may require all of these style bugs except the comment not matching the code. This makes it hard for non-cam programmers to maintain. According to grep, it prefers a tab to a space after `#ifdef' by a ratio of 89:38 in a version checked out a year or two ago. But in 9.0-BETA1, the counts have blown out and the ratio has reduced to 254:221. The counts are more than doubled because the first version is a cvs checkout and the second version is a svn checkout, and it is too hard to filter out the svn duplicates. I guess the ratio changed because the new ata subsystem is not bug for bug compatible with cam style. Anywyay, there never was a consistent cam style to match. % @@ -64,7 +64,7 @@ % #include % #endif /* __NetBSD__ */ % % -#ifdef __FreeBSD__ % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) % #include % #include % #include Same problems, but now the ifdef is larger (but not large enough to need a comment on its endif), so the inconsistent comment is not visible in the patch. % [... similarly throught cam] % diff -ur sys.old/contrib/altq/altq/if_altq.h sys/contrib/altq/altq/if_altq.h % --- sys.old/contrib/altq/altq/if_altq.h 2011-03-10 19:49:15.000000000 +0100 % +++ sys/contrib/altq/altq/if_altq.h 2011-11-13 14:12:41.119907128 +0100 % @@ -29,7 +29,7 @@ % #ifndef _ALTQ_IF_ALTQ_H_ % #define _ALTQ_IF_ALTQ_H_ % % -#ifdef __FreeBSD__ % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) % #include /* XXX */ % #include /* XXX */ % #include /* XXX */ % @@ -51,7 +51,7 @@ % int ifq_len; % int ifq_maxlen; % int ifq_drops; % -#ifdef __FreeBSD__ % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) % struct mtx ifq_mtx; % #endif % No new problems, but I wonder how this even compiles when the ifdefs are not satisfed. Here we are exporting mounds of kernel data structures to userland. There is a similar mess in . There it has no ifdefs at all for the lock, mutex and event headers there, and you didn't touch it. is unfortunately actually needed in userland. The mutexes in its data structures cannot simply be left out, since then the data structures become incompatible with the actual ones. I don't see how the above can work with the mutex left out. By "not even compiles", I meant the header itself, but there should be no problems there because the second ifdef should kill the only use of all the headers. And userland should compile since it shouldn't use the ifdefed out (kernel) parts of the data struct. But leaving out the data substructures changes the ABI, so how could any application that actually uses the full structure work? And if nothing uses it, it shouldn't be exported. Exporting the full pollution of sys/lock.h, sys/mutex.h and sys/event.h to userland is probably an implementation bug. This is partially fixed in my version if by including these headers only for the _KERNEL case. sys/_lock.h and sys/_mutex.h are enough for declaring the mutex, and sys/event*.h isn't even used in the userland parts of . But this probably wouldn't help you much, since the underscored mutex headers are just as unavailable as the non-underscored ones on non-FreeBSD systems. I checked that this file doesn't have any comments on the changed ifdefs to get out of sync (it just has a misformatted one for the endif for _KERNEL and a backwards one for the one for the idempotency endif). I didn't check this for other files. % diff -ur sys.old/contrib/pf/net/if_pflog.h sys/contrib/pf/net/if_pflog.h % --- sys.old/contrib/pf/net/if_pflog.h 2011-06-28 13:57:25.000000000 +0200 % +++ sys/contrib/pf/net/if_pflog.h 2011-11-13 14:12:41.130906469 +0100 % @@ -30,7 +30,7 @@ % #define PFLOGIFS_MAX 16 % % struct pflog_softc { % -#ifdef __FreeBSD__ % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) % struct ifnet *sc_ifp; /* the interface pointer */ % #else % struct ifnet sc_if; /* the interface */ Another very fundamental ABI difference in a clearer form. It this only used in the kernel, and if so, why is it exported to userland? Wouldn't a _KERNEL ifdef work better for avoiding the latter than a __FreeBSD_kernel__ ifdef? (It would be with && instead of ||.) [... similarly for all the pf headers] % diff -ur sys.old/dev/firewire/firewirereg.h sys/dev/firewire/firewirereg.h % --- sys.old/dev/firewire/firewirereg.h 2007-07-20 05:42:57.000000000 +0200 % +++ sys/dev/firewire/firewirereg.h 2011-11-13 14:12:41.122907609 +0100 % @@ -75,7 +75,7 @@ % }; % % struct firewire_softc { % -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && __FreeBSD_version >= 500000 % struct cdev *dev; % #endif % struct firewire_comm *fc; The line is now too long. This change seems to be wrong. I think the __FreeBSD__ ifdef is only there because of broken compilers. The correct code is simply `#if __FreeBSD_version >= 500000', where with non-broken compilers __FreeBSD_version is replaced by 0 if it is not defined. But broken compilers warn when undefined identifiers are used in arithmetic cpp expressions. Some users like to break their compilers using -Wundef to give the warnings; -Werror then gives full breakage (C compilers are permitted to give spurious diagnostics but not to fail to compile C code.) This is normally worked around by checking if the identifier is defined before it is used in an arithmetic expression. But here a different identifier is checked for being defined. FreeBSD gcc defines both __FreeBSD__ and __FreeBSD_version__ together, so this works under FreeBSD. I think it only works accidentally under FreeBSD, and it still doesn't work with your changed ifdef under non-FreeBSD. grepping for `FreeBSD.*FreeBSD_version' in $(find /sys -name *.h) shows very few lines, and even fewer lines with this bug. Most matching lines do the unsurprising check that __FreeBSD_version__ is defined before using it. The exceptions are just the above, 2 lines in if_lmc.h and about 5 lines in ipfilter (some on comments on endifs for ipfilter. Even ipfilter does the unsurprising comparison in 4 lines). grepping for `FreeBSD_version' in $(find /sys -name *.h) shows many more lines than the above. It follows that many headers cannot be compiled by broken compilers, and little would be lost, at least in the kernel, by removing all the checks that __FreeBSD_version__ is defined before using it. But since this inconsistency intersects with your changes, perhaps the checks are there mainly for cases that escape to userland, where the broken compilers are more common. % diff -ur sys.old/dev/lmc/if_lmc.h sys/dev/lmc/if_lmc.h % --- sys.old/dev/lmc/if_lmc.h 2009-11-19 19:21:51.000000000 +0100 % +++ sys/dev/lmc/if_lmc.h 2011-11-13 14:12:41.124908302 +0100 % @@ -984,7 +984,7 @@ % #endif % u_int32_t address1; /* buffer1 bus address */ % u_int32_t address2; /* buffer2 bus address */ % -#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)) % bus_dmamap_t map; /* bus dmamap for this descriptor */ % # define TLP_BUS_DSL_VAL (sizeof(bus_dmamap_t) & TLP_BUS_DSL) % #else The line is now too long. ABI differences when __FreeBSD__ etc. is not defined indicated that the declaration probably doesn't actually work without the definitions, so the whole struct probably shouldn't be exported. % @@ -1035,7 +1035,7 @@ % #elif BSD % struct mbuf *head; /* tail-queue of mbufs */ % struct mbuf *tail; % -# if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) % +# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)) % bus_dma_tag_t tag; /* bus_dma tag for desc array */ % bus_dmamap_t map; /* bus_dma map for desc array */ % bus_dma_segment_t segs[2]; /* bus_dmamap_load() or bus_dmamem_alloc() */ As above. % @@ -1068,7 +1068,7 @@ % */ % #define IOREF_CSR 1 /* access Tulip CSRs with IO cycles if 1 */ % % -#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) % +#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(DEVICE_POLLING)) % # define DEV_POLL 1 % #else % # define DEV_POLL 0 As above, plus DEVICE_POLLING is only defined in a kernel options header, so there shouldn't be ifdefs on it in header files, even in the kernel. % @@ -1151,7 +1151,7 @@ % # endif % #endif % % -#ifdef __FreeBSD__ % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) % struct callout callout; /* watchdog needs this */ % struct device *dev; /* base device pointer */ % bus_space_tag_t csr_tag; /* bus_space needs this */ But I may misunderstand how __FreeBSD_kernel__ works. Data structures containing kernel things like the kernel watchdog callout shouldn't be exported. Given that they are, they should be exported with the full kernel mess so that their layout for the non-kernel parts doesn't depend on ifdefs. The __FreeBSD__ ifdef was bogus, but had no effect under FreeBSD since FreeBSD gcc always defines it. A _KERNEL ifdef would have given a wrong ABI in userland. Your __FreeBSD_kernel__ ifdef seems to be equivalent to a _KERNEL ifdef for non-FreeBSD. Thus it gives a changed ABI for non-FreeBSD. I don't see how the changed ABI can work unless it is not used. But if it is not used, then the whold ABI should be ifdefed out. This may be beyond the scope of your changes. % @@ -1428,7 +1428,7 @@ % #endif % % #if (defined(__bsdi__) || /* unconditionally */ \ % - (defined(__FreeBSD__) && (__FreeBSD_version < 503000)) || \ % + ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && (__FreeBSD_version < 503000)) || \ % (defined(__NetBSD__) && (__NetBSD_Version__ < 106000000)) || \ % (defined(__OpenBSD__) && ( OpenBSD < 200111))) % # define IFQ_ENQUEUE(ifq, m, pa, err) \ Another long line. The /* unconditionally */ comment is now even more grossly mismatched with the code. % @@ -1531,7 +1531,7 @@ % static int t1_ioctl(softc_t *, struct ioctl *); % % #if IFNET % -# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\ % +# if (((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && __FreeBSD_version < 500000) ||\ % defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)) % static void netisr_dispatch(int, struct mbuf *); % # endif Another long line. There are many old style bugs in these ifdefs, starting with __bsdi__ being first in the previous ifdef and last in this one. % @@ -1570,7 +1570,7 @@ % static void core_interrupt(void *, int); % static void user_interrupt(softc_t *, int); % #if BSD % -# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) % +# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(DEVICE_POLLING) % static int fbsd_poll(struct ifnet *, enum poll_cmd, int); % # endif % static intr_return_t bsd_interrupt(void *); Another long line. Now the declaration is of a kernel function, so the condition for if is clearly nonsense. Why not just `#ifdef DEVICE_POLLING' or no ifdef at all. The function is static in a .c file, so declaring it as static in a public header is worse than its ifdefs. Better yet, the ifdef for it here didn't match the ifdef for it in the .c file, and is now further from matching (the C file has an ifdef on BSD, __FreeBSD__ and DEVICE_POLLING, while the header file had an ifdef on _KERNEL, KERNEL, __KERNEL__, __FreeBSD__ and DEVICE_POLLING). Fixing mistakes in DEVICE_POLLING is clearly beyond the scope of your changes. % @@ -1638,7 +1638,7 @@ % static int attach_card(softc_t *, const char *); % static void detach_card(softc_t *); % % -#ifdef __FreeBSD__ % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) % static int fbsd_probe(device_t); % static int fbsd_detach(device_t); % static int fbsd_shutdown(device_t); This file is especially bad. % diff -ur sys.old/netinet/sctp_constants.h sys/netinet/sctp_constants.h % --- sys.old/netinet/sctp_constants.h 2011-09-17 10:50:29.000000000 +0200 % +++ sys/netinet/sctp_constants.h 2011-11-13 14:12:41.145908872 +0100 % @@ -1020,7 +1020,7 @@ % #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) % #define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) % #endif % -/*#if defined(__FreeBSD__) || defined(__APPLE__)*/ % +/*#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__)*/ % /*#define SCTP_GETTIME_TIMEVAL(x) { \*/ % /* (x)->tv_sec = ticks / 1000; \*/ % /* (x)->tv_usec = (ticks % 1000) * 1000; \*/ Line too long. % diff -ur sys.old/netinet/sctp_pcb.h sys/netinet/sctp_pcb.h % --- sys.old/netinet/sctp_pcb.h 2011-09-14 10:15:21.000000000 +0200 % +++ sys/netinet/sctp_pcb.h 2011-11-13 14:12:41.148909632 +0100 % @@ -240,7 +240,7 @@ % * All static structures that anchor the system must be here. % */ % struct sctp_epinfo sctppcbinfo; % -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) % struct sctpstat *sctpstat; % #else % struct sctpstat sctpstat; % @@ -632,7 +632,7 @@ % struct sctp_inpcb *, % uint8_t co_off); % % -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(SCTP_MCORE_INPUT) && defined(SMP) % void % sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use); % Lines too long. How would the kernel options be defined for non-FreeBSD? I.e., why have any __FreeBSD* ifdefs at all here? % diff -ur sys.old/netinet/sctp_structs.h sys/netinet/sctp_structs.h % --- sys.old/netinet/sctp_structs.h 2011-10-10 18:31:18.000000000 +0200 % +++ sys/netinet/sctp_structs.h 2011-11-13 14:12:41.150907531 +0100 % @@ -108,7 +108,7 @@ % typedef int (*inp_func) (struct sctp_inpcb *, void *ptr, uint32_t val); % typedef void (*end_func) (void *ptr, uint32_t val); % % -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(SCTP_MCORE_INPUT) && defined(SMP) % /* whats on the mcore control struct */ % struct sctp_mcore_queue { % TAILQ_ENTRY(sctp_mcore_queue) next; Line too long. % diff -ur sys.old/netinet/sctp_uio.h sys/netinet/sctp_uio.h % --- sys.old/netinet/sctp_uio.h 2011-08-14 22:55:32.000000000 +0200 % +++ sys/netinet/sctp_uio.h 2011-11-13 14:12:41.152905989 +0100 % @@ -1056,7 +1056,7 @@ % % #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1) % #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1) % -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) % #define SCTP_STAT_INCR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x += _d) % #define SCTP_STAT_DECR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x -= _d) % #else As usual. Bruce From owner-freebsd-arch@FreeBSD.ORG Fri Nov 25 18:22:01 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F82106566C; Fri, 25 Nov 2011 18:22:01 +0000 (UTC) (envelope-from maxim@freebsd.org) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0C18FC08; Fri, 25 Nov 2011 18:22:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id pAPILx9a042975; Fri, 25 Nov 2011 22:21:59 +0400 (MSK) (envelope-from maxim@freebsd.org) Date: Fri, 25 Nov 2011 22:21:59 +0400 (MSK) From: Maxim Konovalov To: Kostik Belousov In-Reply-To: <20111124202945.GR50300@deviant.kiev.zoral.com.ua> Message-ID: References: <20111122124410.GP50300@deviant.kiev.zoral.com.ua> <20111122154357.GI95664@mdounin.ru> <20111122154935.GR50300@deviant.kiev.zoral.com.ua> <20111124202945.GR50300@deviant.kiev.zoral.com.ua> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: arch@freebsd.org, Maxim Dounin , current@freebsd.org, igor@sysoev.ru Subject: Re: RLIMIT_DATA and malloc(3) use of mmap(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2011 18:22:01 -0000 [...] > Fixed patch is available at > http://people.freebsd.org/~kib/misc/map_datalimit.2.patch > Works as expected without any glitches. -- Maxim Konovalov From owner-freebsd-arch@FreeBSD.ORG Fri Nov 25 18:25:27 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4939106564A; Fri, 25 Nov 2011 18:25:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 243398FC15; Fri, 25 Nov 2011 18:25:27 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pAPIGFxU012506 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 25 Nov 2011 11:16:16 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20111125150324.G1018@besplex.bde.org> Date: Fri, 25 Nov 2011 11:16:15 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20111123070036.GA29952@thorin> <20111124141821.O932@besplex.bde.org> <20111125150324.G1018@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 25 Nov 2011 11:16:16 -0700 (MST) Cc: Kostik Belousov , freebsd-arch@freebsd.org, Adrian Chadd , freebsd-current@freebsd.org, Robert Millan Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2011 18:25:27 -0000 Hey Bruce, These sound like good suggestions, but I'd hoped to actually go through = all these files with a fine-toothed comb to see which ones were still = relevant. You've found a bunch of good areas to clean up, but I'd like = to humbly suggest they be done in a follow-on commit. Warner On Nov 24, 2011, at 10:54 PM, Bruce Evans wrote: > On Thu, 24 Nov 2011, Robert Millan wrote: >=20 >> 2011/11/24 Bruce Evans : >>> Now it adds lots of namespace pollution (all of , = including >>> all of its namespace pollution), just to get 1 new symbol defined. >>=20 >> Well, my initial patch (see mail with same subject modulo "v2") = didn't >> have this problem. Now that __FreeBSD_kernel__ is defined, many >> #ifdefs can be simplified, but maybe it's not desireable for all of >> them. At least not until we can rely on the compiler to define this >> macro. >>=20 >> So in this particular case maybe it's better to use the other = approach? >>=20 >> See attachment. >=20 > That is clean enough, except for some style bugs. (I thought of worse > ways like duplicating the logic of , or directing > to only declare version macros, or putting version = macros > in a little separate param header and including that. The latter = would > be cleanest, but gives even more includes, and not worth it for this, > but it would have been better for __FreeBSD_version. I don't like > having to recompile half the universe according to dependencies on > because only __FreeBSD_version__ in it changed. Basic > headers rarely change apart from that. BTW, a recent discussion in > the POSIX mailing list says that standardized generation of = depenedencies > should not generate dependencies on system headers. This would break > the effect of putting mistakes like __FreeBSD_version__ in any system > header :-).) >=20 > % diff -ur sys.old/cam/scsi/scsi_low.h sys/cam/scsi/scsi_low.h > % --- sys.old/cam/scsi/scsi_low.h 2007-12-25 18:52:02.000000000 = +0100 > % +++ sys/cam/scsi/scsi_low.h 2011-11-13 14:12:41.121908380 +0100 > % @@ -53,7 +53,7 @@ > % #define SCSI_LOW_INTERFACE_XS > % #endif /* __NetBSD__ */ > % % -#ifdef __FreeBSD__ > % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) > % #define SCSI_LOW_INTERFACE_CAM > % #define CAM > % #endif /* __FreeBSD__ */ >=20 > This also fixes some style bugs (tab instead of space after `#ifdef'). > But it doesn't fix others (tab instead of space after `#ifdef', and > comment on a short ifdef). And it introduces a new one (the comment > on the ifdef now doesn't even match the code). >=20 > cam has a highly non-KNF style, so it may require all of these style > bugs except the comment not matching the code. This makes it hard > for non-cam programmers to maintain. According to grep, it prefers > a tab to a space after `#ifdef' by a ratio of 89:38 in a version > checked out a year or two ago. But in 9.0-BETA1, the counts have > blown out and the ratio has reduced to 254:221. The counts are > more than doubled because the first version is a cvs checkout and > the second version is a svn checkout, and it is too hard to filter > out the svn duplicates. I guess the ratio changed because the new > ata subsystem is not bug for bug compatible with cam style. Anywyay, > there never was a consistent cam style to match. >=20 > % @@ -64,7 +64,7 @@ > % #include > % #endif /* __NetBSD__ */ > % % -#ifdef __FreeBSD__ > % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) > % #include > % #include > % #include >=20 > Same problems, but now the ifdef is larger (but not large enough to > need a comment on its endif), so the inconsistent comment is not > visible in the patch. >=20 > % [... similarly throught cam] >=20 > % diff -ur sys.old/contrib/altq/altq/if_altq.h = sys/contrib/altq/altq/if_altq.h > % --- sys.old/contrib/altq/altq/if_altq.h 2011-03-10 = 19:49:15.000000000 +0100 > % +++ sys/contrib/altq/altq/if_altq.h 2011-11-13 14:12:41.119907128 = +0100 > % @@ -29,7 +29,7 @@ > % #ifndef _ALTQ_IF_ALTQ_H_ > % #define _ALTQ_IF_ALTQ_H_ > % % -#ifdef __FreeBSD__ > % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) > % #include /* XXX */ > % #include /* XXX */ > % #include /* XXX */ > % @@ -51,7 +51,7 @@ > % int ifq_len; > % int ifq_maxlen; > % int ifq_drops; > % -#ifdef __FreeBSD__ > % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) > % struct mtx ifq_mtx; > % #endif > % >=20 > No new problems, but I wonder how this even compiles when the ifdefs > are not satisfed. Here we are exporting mounds of kernel data = structures > to userland. There is a similar mess in . There it has > no ifdefs at all for the lock, mutex and event headers there, and you > didn't touch it. is unfortunately actually needed in > userland. The mutexes in its data structures cannot simply be left > out, since then the data structures become incompatible with the = actual > ones. I don't see how the above can work with the mutex left out. >=20 > By "not even compiles", I meant the header itself, but there should be > no problems there because the second ifdef should kill the only use of > all the headers. And userland should compile since it shouldn't use > the ifdefed out (kernel) parts of the data struct. But leaving out > the data substructures changes the ABI, so how could any application = that > actually uses the full structure work? And if nothing uses it, it > shouldn't be exported. >=20 > Exporting the full pollution of sys/lock.h, sys/mutex.h and = sys/event.h > to userland is probably an implementation bug. This is partially = fixed > in my version if by including these headers only for > the _KERNEL case. sys/_lock.h and sys/_mutex.h are enough for = declaring > the mutex, and sys/event*.h isn't even used in the userland parts of > . But this probably wouldn't help you much, since the > underscored mutex headers are just as unavailable as the = non-underscored > ones on non-FreeBSD systems. >=20 > I checked that this file doesn't have any comments on the changed = ifdefs > to get out of sync (it just has a misformatted one for the endif for > _KERNEL and a backwards one for the one for the idempotency endif). > I didn't check this for other files. >=20 > % diff -ur sys.old/contrib/pf/net/if_pflog.h = sys/contrib/pf/net/if_pflog.h > % --- sys.old/contrib/pf/net/if_pflog.h 2011-06-28 = 13:57:25.000000000 +0200 > % +++ sys/contrib/pf/net/if_pflog.h 2011-11-13 14:12:41.130906469 = +0100 > % @@ -30,7 +30,7 @@ > % #define PFLOGIFS_MAX 16 > % % struct pflog_softc { > % -#ifdef __FreeBSD__ > % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) > % struct ifnet *sc_ifp; /* the interface pointer = */ > % #else > % struct ifnet sc_if; /* the interface */ >=20 > Another very fundamental ABI difference in a clearer form. It this = only > used in the kernel, and if so, why is it exported to userland? = Wouldn't > a _KERNEL ifdef work better for avoiding the latter than a > __FreeBSD_kernel__ ifdef? (It would be with && instead of ||.) >=20 > [... similarly for all the pf headers] >=20 > % diff -ur sys.old/dev/firewire/firewirereg.h = sys/dev/firewire/firewirereg.h > % --- sys.old/dev/firewire/firewirereg.h 2007-07-20 = 05:42:57.000000000 +0200 > % +++ sys/dev/firewire/firewirereg.h 2011-11-13 14:12:41.122907609 = +0100 > % @@ -75,7 +75,7 @@ > % }; > % % struct firewire_softc { > % -#if defined(__FreeBSD__) && __FreeBSD_version >=3D 500000 > % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = __FreeBSD_version >=3D 500000 > % struct cdev *dev; > % #endif > % struct firewire_comm *fc; >=20 > The line is now too long. >=20 > This change seems to be wrong. I think the __FreeBSD__ ifdef is only > there because of broken compilers. The correct code is simply `#if > __FreeBSD_version >=3D 500000', where with non-broken compilers > __FreeBSD_version is replaced by 0 if it is not defined. But broken > compilers warn when undefined identifiers are used in arithmetic cpp > expressions. Some users like to break their compilers using -Wundef > to give the warnings; -Werror then gives full breakage (C compilers > are permitted to give spurious diagnostics but not to fail to compile > C code.) This is normally worked around by checking if the identifier > is defined before it is used in an arithmetic expression. But here a > different identifier is checked for being defined. FreeBSD gcc = defines > both __FreeBSD__ and __FreeBSD_version__ together, so this works under > FreeBSD. I think it only works accidentally under FreeBSD, and it > still doesn't work with your changed ifdef under non-FreeBSD. >=20 > grepping for `FreeBSD.*FreeBSD_version' in $(find /sys -name *.h) = shows > very few lines, and even fewer lines with this bug. Most matching > lines do the unsurprising check that __FreeBSD_version__ is defined > before using it. The exceptions are just the above, 2 lines in > if_lmc.h and about 5 lines in ipfilter (some on comments on endifs > for ipfilter. Even ipfilter does the unsurprising comparison in > 4 lines). >=20 > grepping for `FreeBSD_version' in $(find /sys -name *.h) shows many = more > lines than the above. It follows that many headers cannot be compiled > by broken compilers, and little would be lost, at least in the kernel, > by removing all the checks that __FreeBSD_version__ is defined before > using it. But since this inconsistency intersects with your changes, > perhaps the checks are there mainly for cases that escape to userland, > where the broken compilers are more common. >=20 > % diff -ur sys.old/dev/lmc/if_lmc.h sys/dev/lmc/if_lmc.h > % --- sys.old/dev/lmc/if_lmc.h 2009-11-19 19:21:51.000000000 = +0100 > % +++ sys/dev/lmc/if_lmc.h 2011-11-13 14:12:41.124908302 +0100 > % @@ -984,7 +984,7 @@ > % #endif > % u_int32_t address1; /* buffer1 bus address */ > % u_int32_t address2; /* buffer2 bus address */ > % -#if (defined(__FreeBSD__) || defined(__NetBSD__) || = defined(__OpenBSD__)) > % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || = defined(__NetBSD__) || defined(__OpenBSD__)) > % bus_dmamap_t map; /* bus dmamap for this = descriptor */ > % # define TLP_BUS_DSL_VAL (sizeof(bus_dmamap_t) & TLP_BUS_DSL) > % #else >=20 > The line is now too long. ABI differences when __FreeBSD__ etc. is = not > defined indicated that the declaration probably doesn't actually work > without the definitions, so the whole struct probably shouldn't be > exported. >=20 > % @@ -1035,7 +1035,7 @@ > % #elif BSD > % struct mbuf *head; /* tail-queue of mbufs */ > % struct mbuf *tail; > % -# if (defined(__FreeBSD__) || defined(__NetBSD__) || = defined(__OpenBSD__)) > % +# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || = defined(__NetBSD__) || defined(__OpenBSD__)) > % bus_dma_tag_t tag; /* bus_dma tag for desc array */ > % bus_dmamap_t map; /* bus_dma map for desc array */ > % bus_dma_segment_t segs[2]; /* bus_dmamap_load() or = bus_dmamem_alloc() */ >=20 > As above. >=20 > % @@ -1068,7 +1068,7 @@ > % */ > % #define IOREF_CSR 1 /* access Tulip CSRs with IO cycles if 1 */ > % % -#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) > % +#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = defined(DEVICE_POLLING)) > % # define DEV_POLL 1 > % #else > % # define DEV_POLL 0 >=20 > As above, plus DEVICE_POLLING is only defined in a kernel options = header, > so there shouldn't be ifdefs on it in header files, even in the = kernel. >=20 > % @@ -1151,7 +1151,7 @@ > % # endif > % #endif > % % -#ifdef __FreeBSD__ > % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) > % struct callout callout; /* watchdog needs this = */ > % struct device *dev; /* base device pointer = */ > % bus_space_tag_t csr_tag; /* bus_space needs this = */ >=20 > But I may misunderstand how __FreeBSD_kernel__ works. Data structures > containing kernel things like the kernel watchdog callout shouldn't be > exported. Given that they are, they should be exported with the full > kernel mess so that their layout for the non-kernel parts doesn't > depend on ifdefs. The __FreeBSD__ ifdef was bogus, but had no effect > under FreeBSD since FreeBSD gcc always defines it. A _KERNEL ifdef > would have given a wrong ABI in userland. Your __FreeBSD_kernel__ > ifdef seems to be equivalent to a _KERNEL ifdef for non-FreeBSD. Thus > it gives a changed ABI for non-FreeBSD. I don't see how the changed > ABI can work unless it is not used. But if it is not used, then the > whold ABI should be ifdefed out. This may be beyond the scope of > your changes. >=20 > % @@ -1428,7 +1428,7 @@ > % #endif > % % #if (defined(__bsdi__) || /* unconditionally */ \ > % - (defined(__FreeBSD__) && (__FreeBSD_version < 503000)) || \ > % + ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = (__FreeBSD_version < 503000)) || \ > % (defined(__NetBSD__) && (__NetBSD_Version__ < 106000000)) || \ > % (defined(__OpenBSD__) && ( OpenBSD < 200111))) > % # define IFQ_ENQUEUE(ifq, m, pa, err) \ >=20 > Another long line. The /* unconditionally */ comment is now even more > grossly mismatched with the code. >=20 > % @@ -1531,7 +1531,7 @@ > % static int t1_ioctl(softc_t *, struct ioctl *); > % % #if IFNET > % -# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\ > % +# if (((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = __FreeBSD_version < 500000) ||\ > % defined(__NetBSD__) || defined(__OpenBSD__) || = defined(__bsdi__)) > % static void netisr_dispatch(int, struct mbuf *); > % # endif >=20 > Another long line. There are many old style bugs in these ifdefs, = starting > with __bsdi__ being first in the previous ifdef and last in this one. >=20 > % @@ -1570,7 +1570,7 @@ > % static void core_interrupt(void *, int); > % static void user_interrupt(softc_t *, int); > % #if BSD > % -# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) > % +# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = defined(DEVICE_POLLING) > % static int fbsd_poll(struct ifnet *, enum poll_cmd, int); > % # endif > % static intr_return_t bsd_interrupt(void *); >=20 > Another long line. Now the declaration is of a kernel function, so = the > condition for if is clearly nonsense. Why not just `#ifdef = DEVICE_POLLING' > or no ifdef at all. The function is static in a .c file, so declaring = it > as static in a public header is worse than its ifdefs. Better yet, = the > ifdef for it here didn't match the ifdef for it in the .c file, and is > now further from matching (the C file has an ifdef on BSD, __FreeBSD__ > and DEVICE_POLLING, while the header file had an ifdef on _KERNEL, > KERNEL, __KERNEL__, __FreeBSD__ and DEVICE_POLLING). Fixing mistakes = in > DEVICE_POLLING is clearly beyond the scope of your changes. >=20 > % @@ -1638,7 +1638,7 @@ > % static int attach_card(softc_t *, const char *); > % static void detach_card(softc_t *); > % % -#ifdef __FreeBSD__ > % +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) > % static int fbsd_probe(device_t); > % static int fbsd_detach(device_t); > % static int fbsd_shutdown(device_t); >=20 > This file is especially bad. >=20 > % diff -ur sys.old/netinet/sctp_constants.h = sys/netinet/sctp_constants.h > % --- sys.old/netinet/sctp_constants.h 2011-09-17 = 10:50:29.000000000 +0200 > % +++ sys/netinet/sctp_constants.h 2011-11-13 14:12:41.145908872 = +0100 > % @@ -1020,7 +1020,7 @@ > % #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) > % #define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) > % #endif > % -/*#if defined(__FreeBSD__) || defined(__APPLE__)*/ > % +/*#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || = defined(__APPLE__)*/ > % /*#define SCTP_GETTIME_TIMEVAL(x) { \*/ > % /* (x)->tv_sec =3D ticks / 1000; \*/ > % /* (x)->tv_usec =3D (ticks % 1000) * 1000; \*/ >=20 > Line too long. >=20 > % diff -ur sys.old/netinet/sctp_pcb.h sys/netinet/sctp_pcb.h > % --- sys.old/netinet/sctp_pcb.h 2011-09-14 10:15:21.000000000 = +0200 > % +++ sys/netinet/sctp_pcb.h 2011-11-13 14:12:41.148909632 +0100 > % @@ -240,7 +240,7 @@ > % * All static structures that anchor the system must be here. > % */ > % struct sctp_epinfo sctppcbinfo; > % -#if defined(__FreeBSD__) && defined(SMP) && = defined(SCTP_USE_PERCPU_STAT) > % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = defined(SMP) && defined(SCTP_USE_PERCPU_STAT) > % struct sctpstat *sctpstat; > % #else > % struct sctpstat sctpstat; > % @@ -632,7 +632,7 @@ > % struct sctp_inpcb *, > % uint8_t co_off); > % % -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && = defined(SMP) > % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = defined(SCTP_MCORE_INPUT) && defined(SMP) > % void > % sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use); > % >=20 > Lines too long. How would the kernel options be defined for = non-FreeBSD? > I.e., why have any __FreeBSD* ifdefs at all here? >=20 >=20 > % diff -ur sys.old/netinet/sctp_structs.h sys/netinet/sctp_structs.h > % --- sys.old/netinet/sctp_structs.h 2011-10-10 18:31:18.000000000 = +0200 > % +++ sys/netinet/sctp_structs.h 2011-11-13 14:12:41.150907531 = +0100 > % @@ -108,7 +108,7 @@ > % typedef int (*inp_func) (struct sctp_inpcb *, void *ptr, uint32_t = val); > % typedef void (*end_func) (void *ptr, uint32_t val); > % % -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && = defined(SMP) > % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = defined(SCTP_MCORE_INPUT) && defined(SMP) > % /* whats on the mcore control struct */ > % struct sctp_mcore_queue { > % TAILQ_ENTRY(sctp_mcore_queue) next; >=20 > Line too long. >=20 > % diff -ur sys.old/netinet/sctp_uio.h sys/netinet/sctp_uio.h > % --- sys.old/netinet/sctp_uio.h 2011-08-14 22:55:32.000000000 = +0200 > % +++ sys/netinet/sctp_uio.h 2011-11-13 14:12:41.152905989 +0100 > % @@ -1056,7 +1056,7 @@ > % % #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1) > % #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1) > % -#if defined(__FreeBSD__) && defined(SMP) && = defined(SCTP_USE_PERCPU_STAT) > % +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && = defined(SMP) && defined(SCTP_USE_PERCPU_STAT) > % #define SCTP_STAT_INCR_BY(_x,_d) = (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x +=3D _d) > % #define SCTP_STAT_DECR_BY(_x,_d) = (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x -=3D _d) > % #else >=20 > As usual. >=20 > Bruce > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to = "freebsd-arch-unsubscribe@freebsd.org" >=20 >=20 From owner-freebsd-arch@FreeBSD.ORG Sat Nov 26 20:07:58 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A2CD106564A; Sat, 26 Nov 2011 20:07:58 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 92BBA8FC0A; Sat, 26 Nov 2011 20:07:57 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so7710106bkb.13 for ; Sat, 26 Nov 2011 12:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Asd4KVFRy6/3XNavyJt8lP/MnUi91CTJ67ZTI4Lbs48=; b=V+V/BwPCkcvxzGTIDMIQM59NMkQhJQPTpts0gGQFuRWV7btgPvYXgxRRuSfVbnwWTG gNPm4TO7UB5efajZQaZlCypOPpiZ+HpAsYmoaWAhjS3c29ZzNpeNEb0EKCtDRk0JhLTG wezFVds3j0qrqZlQUUuEOOmuSPmjvm1/UhKv4= Received: by 10.205.83.73 with SMTP id af9mr39395692bkc.24.1322338076463; Sat, 26 Nov 2011 12:07:56 -0800 (PST) Received: from thorin (52.Red-95-122-67.staticIP.rima-tde.net. [95.122.67.52]) by mx.google.com with ESMTPS id h7sm22597384bkw.12.2011.11.26.12.07.51 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Nov 2011 12:07:55 -0800 (PST) Sender: Robert Millan Received: from rmh by thorin with local (Exim 4.72) (envelope-from ) id 1RUOXN-000IkR-9b; Sat, 26 Nov 2011 21:07:49 +0100 Date: Sat, 26 Nov 2011 21:07:49 +0100 From: Robert Millan To: Warner Losh Message-ID: <20111126200749.GA72056@thorin> References: <20111123070036.GA29952@thorin> <20111124141821.O932@besplex.bde.org> <20111125150324.G1018@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JP+T4n/bALQSJXh8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 20:07:58 -0000 --JP+T4n/bALQSJXh8 Content-Type: multipart/mixed; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 25, 2011 at 11:16:15AM -0700, Warner Losh wrote: > Hey Bruce, >=20 > These sound like good suggestions, but I'd hoped to actually go through a= ll these files with a fine-toothed comb to see which ones were still releva= nt. You've found a bunch of good areas to clean up, but I'd like to humbly= suggest they be done in a follow-on commit. Hi, I'm sending a new patch. Thanks Bruce for your input. TTBOMK this corrects all the problems you spotted that were introduced by my patch. It doesn't fix pre-existing problems in the files however, except in cases where I had to modify that line anyway. I think it's a good compromise between my initial patch and an exhaustive cleanup of those headers (which I'm probably not the most indicate for). --=20 Robert Millan --0OAP2g/MAC+5xKAE Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gnu-kfreebsd_headers.diff" Content-Transfer-Encoding: quoted-printable Index: sys/cam/scsi/scsi_low.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/scsi/scsi_low.h (revision 227956) +++ sys/cam/scsi/scsi_low.h (working copy) @@ -53,10 +53,10 @@ #define SCSI_LOW_INTERFACE_XS #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define SCSI_LOW_INTERFACE_CAM #define CAM -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 /******** includes *******************************/ #ifdef __NetBSD__ @@ -64,7 +64,7 @@ #include #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #include #include @@ -75,7 +75,7 @@ =20 #include #include -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 /******** functions macro ************************/ #ifdef __NetBSD__ @@ -85,13 +85,13 @@ #define SCSI_LOW_BZERO(pt, size) memset((pt), 0, (size)) #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #undef MSG_IDENTIFY #define SCSI_LOW_DEBUGGER(dev) kdb_enter(KDB_WHY_CAM, dev) #define SCSI_LOW_DELAY(mu) DELAY((mu)) #define SCSI_LOW_SPLSCSI splcam #define SCSI_LOW_BZERO(pt, size) bzero((pt), (size)) -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 /******** os depend interface structures **********/ #ifdef __NetBSD__ @@ -111,7 +111,7 @@ }; #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) typedef struct scsi_sense_data scsi_low_osdep_sense_data_t; =20 struct scsi_low_osdep_interface { @@ -134,7 +134,7 @@ =20 struct scsi_low_osdep_lun_interface { }; -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 /******** os depend interface functions *************/ struct slccb; Index: sys/cam/scsi/scsi_low_pisa.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/cam/scsi/scsi_low_pisa.h (revision 227956) +++ sys/cam/scsi/scsi_low_pisa.h (working copy) @@ -40,8 +40,8 @@ int scsi_low_notify_pisa(pisa_device_handle_t, pisa_event_t); #endif /* __NetBSD__ */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int scsi_low_activate_pisa(struct scsi_low_softc *, int); int scsi_low_deactivate_pisa(struct scsi_low_softc *); -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ #endif /* !_SCSI_LOW_PISA_H_ */ Index: sys/contrib/altq/altq/altq_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/altq/altq/altq_var.h (revision 227956) +++ sys/contrib/altq/altq/altq_var.h (working copy) @@ -201,7 +201,7 @@ #define CALLOUT_STOP(c) untimeout((c)->c_func,(c)->c_arg) #define CALLOUT_INITIALIZER { NULL, NULL } #endif -#if !defined(__FreeBSD__) +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) typedef void (timeout_t)(void *); #endif =20 Index: sys/contrib/altq/altq/if_altq.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/altq/altq/if_altq.h (revision 227956) +++ sys/contrib/altq/altq/if_altq.h (working copy) @@ -29,7 +29,7 @@ #ifndef _ALTQ_IF_ALTQ_H_ #define _ALTQ_IF_ALTQ_H_ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include /* XXX */ #include /* XXX */ #include /* XXX */ @@ -51,7 +51,7 @@ int ifq_len; int ifq_maxlen; int ifq_drops; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct mtx ifq_mtx; #endif =20 Index: sys/contrib/pf/net/if_pflog.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/if_pflog.h (revision 227956) +++ sys/contrib/pf/net/if_pflog.h (working copy) @@ -30,7 +30,7 @@ #define PFLOGIFS_MAX 16 =20 struct pflog_softc { -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct ifnet *sc_ifp; /* the interface pointer */ #else struct ifnet sc_if; /* the interface */ @@ -74,7 +74,7 @@ #define OLD_PFLOG_HDRLEN sizeof(struct old_pfloghdr) =20 #ifdef _KERNEL -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct pf_rule; struct pf_ruleset; struct pfi_kif; Index: sys/contrib/pf/net/if_pflow.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/if_pflow.h (revision 227956) +++ sys/contrib/pf/net/if_pflow.h (working copy) @@ -66,7 +66,7 @@ unsigned int sc_maxcount; u_int64_t sc_gcounter; struct ip_moptions sc_imo; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct callout sc_tmo; #else struct timeout sc_tmo; Index: sys/contrib/pf/net/if_pfsync.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/if_pfsync.h (revision 227956) +++ sys/contrib/pf/net/if_pfsync.h (working copy) @@ -268,7 +268,7 @@ int pfsyncr_authlevel; }; =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define SIOCSETPFSYNC _IOW('i', 247, struct ifreq) #define SIOCGETPFSYNC _IOWR('i', 248, struct ifreq) #endif @@ -288,7 +288,7 @@ #define PFSYNC_S_DEFER 0xfe #define PFSYNC_S_NONE 0xff =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) void pfsync_input(struct mbuf *, __unused int); #else void pfsync_input(struct mbuf *, ...); @@ -300,7 +300,7 @@ #define PFSYNC_SI_CKSUM 0x02 #define PFSYNC_SI_ACK 0x04 int pfsync_state_import(struct pfsync_state *, u_int8_t); -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) void pfsync_state_export(struct pfsync_state *, struct pf_state *); #endif Index: sys/contrib/pf/net/pfvar.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/contrib/pf/net/pfvar.h (revision 227956) +++ sys/contrib/pf/net/pfvar.h (working copy) @@ -37,7 +37,7 @@ #include #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #include #else @@ -46,7 +46,7 @@ =20 #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #include #include @@ -54,7 +54,7 @@ #include #endif =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #endif =20 @@ -62,7 +62,7 @@ =20 struct ip; struct ip6_hdr; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct inpcb; #endif =20 @@ -173,7 +173,7 @@ } a; char ifname[IFNAMSIZ]; char tblname[PF_TABLE_NAME_SIZE]; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define RTLABEL_LEN 32 #endif char rtlabelname[RTLABEL_LEN]; @@ -211,7 +211,7 @@ * Address manipulation macros */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define splsoftnet() splnet() =20 #define HTONL(x) (x) =3D htonl((__uint32_t)(x)) @@ -236,7 +236,7 @@ if (var) \ uma_zdestroy(var) =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) extern struct mtx pf_task_mtx; =20 #define PF_LOCK_ASSERT() mtx_assert(&pf_task_mtx, MA_OWNED) @@ -255,7 +255,7 @@ #define PF_UNLOCK_ASSERT() #define PF_LOCK() #define PF_UNLOCK() -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 #define PF_COPYIN(uaddr, kaddr, len, r) do { \ PF_UNLOCK(); \ @@ -279,7 +279,7 @@ #define PFSYNC_MINVER 1 #define PFSYNC_PREFVER PFSYNC_MODVER #define PFSYNC_MAXVER 1 -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ #ifdef INET #ifndef INET6 #define PF_INET_ONLY @@ -833,7 +833,7 @@ u_int64_t id; u_int32_t creatorid; u_int8_t direction; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) u_int8_t pad[2]; u_int8_t local_flags; #define PFSTATE_EXPIRING 0x01 @@ -923,7 +923,7 @@ sa_family_t af; u_int8_t proto; u_int8_t direction; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) u_int8_t local_flags; #define PFSTATE_EXPIRING 0x01 u_int8_t pad; @@ -935,7 +935,7 @@ u_int8_t updates; } __packed; =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #ifdef _KERNEL /* pfsync */ typedef int pfsync_state_import_t(struct pfsync_state *, u_int8_t); @@ -1215,7 +1215,7 @@ RB_HEAD(pfi_ifhead, pfi_kif); =20 /* state tables */ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #ifdef _KERNEL VNET_DECLARE(struct pf_state_tree, pf_statetbl); #define V_pf_statetbl VNET(pf_statetbl) @@ -1277,7 +1277,7 @@ struct pf_addr *dst; /* dst address */ u_int16_t *sport; u_int16_t *dport; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct pf_mtag *pf_mtag; #endif =20 @@ -1403,7 +1403,7 @@ *(a) =3D (x); \ } while (0) =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define REASON_SET(a, x) \ do { \ if ((a) !=3D NULL) \ @@ -1488,7 +1488,7 @@ u_int32_t parent_qid; /* parent queue id */ u_int32_t bandwidth; /* queue bandwidth */ u_int8_t priority; /* priority */ -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) u_int8_t local_flags; /* dynamic interface */ #define PFALTQ_FLAG_IF_REMOVED 0x01 #endif @@ -1768,7 +1768,7 @@ #define DIOCSETIFFLAG _IOWR('D', 89, struct pfioc_iface) #define DIOCCLRIFFLAG _IOWR('D', 90, struct pfioc_iface) #define DIOCKILLSRCNODES _IOWR('D', 91, struct pfioc_src_node_kill) -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct pf_ifspeed { char ifname[IFNAMSIZ]; u_int32_t baudrate; @@ -1779,7 +1779,7 @@ #ifdef _KERNEL RB_HEAD(pf_src_tree, pf_src_node); RB_PROTOTYPE(pf_src_tree, pf_src_node, entry, pf_src_compare); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct pf_src_tree, tree_src_tracking); #define V_tree_src_tracking VNET(tree_src_tracking) #else @@ -1789,7 +1789,7 @@ RB_HEAD(pf_state_tree_id, pf_state); RB_PROTOTYPE(pf_state_tree_id, pf_state, entry_id, pf_state_compare_id); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct pf_state_tree_id, tree_id); #define V_tree_id VNET(tree_id) VNET_DECLARE(struct pf_state_queue, state_list); @@ -1800,14 +1800,14 @@ #endif =20 TAILQ_HEAD(pf_poolqueue, pf_pool); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct pf_poolqueue, pf_pools[2]); #define V_pf_pools VNET(pf_pools) #else extern struct pf_poolqueue pf_pools[2]; #endif TAILQ_HEAD(pf_altqqueue, pf_altq); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct pf_altqqueue, pf_altqs[2]); #define V_pf_altqs VNET(pf_altqs) VNET_DECLARE(struct pf_palist, pf_pabuf); @@ -1817,7 +1817,7 @@ extern struct pf_palist pf_pabuf; #endif =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(u_int32_t, ticket_altqs_active); #define V_ticket_altqs_active VNET(ticket_altqs_active) VNET_DECLARE(u_int32_t, ticket_altqs_inactive); @@ -1849,7 +1849,7 @@ extern void pf_tbladdr_remove(struct pf_addr_wrap *); extern void pf_tbladdr_copyout(struct pf_addr_wrap *); extern void pf_calc_skip_steps(struct pf_rulequeue *); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #ifdef ALTQ extern void pf_altq_ifnet_event(struct ifnet *, int); #endif @@ -1886,7 +1886,7 @@ extern struct pool pf_state_scrub_pl; #endif extern void pf_purge_thread(void *); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) extern int pf_purge_expired_src_nodes(int); extern int pf_purge_expired_states(u_int32_t , int); #else @@ -1911,7 +1911,7 @@ extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, u_int8_t); =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct ifnet *, sync_ifp); #define V_sync_ifp VNET(sync_ifp); VNET_DECLARE(struct pf_rule, pf_default_rule); @@ -1924,12 +1924,12 @@ u_int8_t); void pf_rm_rule(struct pf_rulequeue *, struct pf_rule *); -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) struct pf_divert *pf_find_divert(struct mbuf *); #endif =20 #ifdef INET -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int pf_test(int, struct ifnet *, struct mbuf **, struct ether_header *, struct inpcb *); #else @@ -1938,7 +1938,7 @@ #endif /* INET */ =20 #ifdef INET6 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int pf_test6(int, struct ifnet *, struct mbuf **, struct ether_header *, struct inpcb *); #else @@ -1949,7 +1949,7 @@ void pf_addr_inc(struct pf_addr *, sa_family_t); #endif /* INET6 */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) u_int32_t pf_new_isn(struct pf_state *); #endif void *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *, @@ -1986,7 +1986,7 @@ void pf_purge_expired_fragments(void); int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *); int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int pf_socket_lookup(int, struct pf_pdesc *, struct inpcb *); #else int pf_socket_lookup(int, struct pf_pdesc *); @@ -2031,7 +2031,7 @@ int pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *, int *, u_int32_t, int); =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct pfi_kif *, pfi_all); #define V_pfi_all VNET(pfi_all) #else @@ -2039,7 +2039,7 @@ #endif =20 void pfi_initialize(void); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) void pfi_cleanup(void); #endif struct pfi_kif *pfi_kif_get(const char *); @@ -2061,7 +2061,7 @@ int pfi_set_flags(const char *, int); int pfi_clear_flags(const char *, int); =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int pf_match_tag(struct mbuf *, struct pf_rule *, int *, struct pf_mtag *); #else @@ -2071,7 +2071,7 @@ void pf_tag2tagname(u_int16_t, char *); void pf_tag_ref(u_int16_t); void pf_tag_unref(u_int16_t); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int pf_tag_packet(struct mbuf *, int, int, struct pf_mtag *); #else int pf_tag_packet(struct mbuf *, int, int); @@ -2080,14 +2080,14 @@ void pf_qid2qname(u_int32_t, char *); void pf_qid_unref(u_int32_t); =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct pf_status, pf_status); #define V_pf_status VNET(pf_status) #else extern struct pf_status pf_status; #endif =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(uma_zone_t, pf_frent_pl); #define V_pf_frent_pl VNET(pf_frent_pl) VNET_DECLARE(uma_zone_t, pf_frag_pl); @@ -2103,14 +2103,14 @@ void *pp; unsigned limit; }; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) VNET_DECLARE(struct pf_pool_limit, pf_pool_limits[PF_LIMIT_MAX]); #define V_pf_pool_limits VNET(pf_pool_limits) #else extern struct pf_pool_limit pf_pool_limits[PF_LIMIT_MAX]; #endif =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct pf_frent { LIST_ENTRY(pf_frent) fr_next; struct ip *fr_ip; @@ -2140,11 +2140,11 @@ LIST_HEAD(pf_cacheq, pf_frcache) fru_cache; /* non-buf */ } fr_u; }; -#endif /* (__FreeBSD__) */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 #endif /* _KERNEL */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #ifdef _KERNEL VNET_DECLARE(struct pf_anchor_global, pf_anchors); #define V_pf_anchors VNET(pf_anchors) @@ -2172,7 +2172,7 @@ struct pf_ruleset *pf_find_or_create_ruleset(const char *); void pf_rs_initialize(void); =20 -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) #ifdef _KERNEL int pf_anchor_copyout(const struct pf_ruleset *, const struct pf_rule *, struct pfioc_rule *); @@ -2193,7 +2193,7 @@ const struct tcphdr *); void pf_osfp_flush(void); int pf_osfp_get(struct pf_osfp_ioctl *); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int pf_osfp_initialize(void); void pf_osfp_cleanup(void); #else Index: sys/dev/firewire/firewirereg.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/firewire/firewirereg.h (revision 227956) +++ sys/dev/firewire/firewirereg.h (working copy) @@ -75,7 +75,8 @@ }; =20 struct firewire_softc { -#if defined(__FreeBSD__) && __FreeBSD_version >=3D 500000 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + __FreeBSD_version >=3D 500000 struct cdev *dev; #endif struct firewire_comm *fc; Index: sys/dev/lmc/if_lmc.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/lmc/if_lmc.h (revision 227956) +++ sys/dev/lmc/if_lmc.h (working copy) @@ -984,7 +984,8 @@ #endif u_int32_t address1; /* buffer1 bus address */ u_int32_t address2; /* buffer2 bus address */ -#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ + defined(__NetBSD__) || defined(__OpenBSD__)) bus_dmamap_t map; /* bus dmamap for this descriptor */ # define TLP_BUS_DSL_VAL (sizeof(bus_dmamap_t) & TLP_BUS_DSL) #else @@ -1035,7 +1036,8 @@ #elif BSD struct mbuf *head; /* tail-queue of mbufs */ struct mbuf *tail; -# if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) +# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ + defined(__NetBSD__) || defined(__OpenBSD__)) bus_dma_tag_t tag; /* bus_dma tag for desc array */ bus_dmamap_t map; /* bus_dma map for desc array */ bus_dma_segment_t segs[2]; /* bus_dmamap_load() or bus_dmamem_alloc() */ @@ -1068,7 +1070,8 @@ */ #define IOREF_CSR 1 /* access Tulip CSRs with IO cycles if 1 */ =20 -#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) +#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + defined(DEVICE_POLLING)) # define DEV_POLL 1 #else # define DEV_POLL 0 @@ -1151,7 +1154,7 @@ # endif #endif =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct callout callout; /* watchdog needs this */ struct device *dev; /* base device pointer */ bus_space_tag_t csr_tag; /* bus_space needs this */ @@ -1173,7 +1176,7 @@ int top_spl; /* lock card->watchdog vs core_ioctl */ int bottom_spl; /* lock for buf queues & descriptor rings */ # endif -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 #ifdef __linux__ struct pci_dev *pci_dev; /* READ/WRITE_PCI_CFG macros need this */ @@ -1210,7 +1213,7 @@ =20 /* Hide the minor differences between OS versions */ =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) typedef void intr_return_t; # define READ_PCI_CFG(sc, addr) pci_read_config ((sc)->dev, addr, 4) # define WRITE_PCI_CFG(sc, addr, data) pci_write_config((sc)->dev, addr, d= ata, 4) @@ -1264,7 +1267,7 @@ # if (__FreeBSD_version >=3D 600000) # define IFF_RUNNING IFF_DRV_RUNNING # endif -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 #ifdef __NetBSD__ typedef int intr_return_t; @@ -1531,7 +1534,7 @@ static int t1_ioctl(softc_t *, struct ioctl *); =20 #if IFNET -# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\ +# if ((defined(__FreeBSD__) && __FreeBSD_version < 500000) ||\ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)) static void netisr_dispatch(int, struct mbuf *); # endif @@ -1541,7 +1544,7 @@ #if BSD static void mbuf_enqueue(struct desc_ring *, struct mbuf *); static struct mbuf* mbuf_dequeue(struct desc_ring *); -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) static void fbsd_dmamap_load(void *, bus_dma_segment_t *, int, int); # endif static int create_ring(softc_t *, struct desc_ring *, int); @@ -1570,7 +1573,8 @@ static void core_interrupt(void *, int); static void user_interrupt(softc_t *, int); #if BSD -# if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) +# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + defined(DEVICE_POLLING) static int fbsd_poll(struct ifnet *, enum poll_cmd, int); # endif static intr_return_t bsd_interrupt(void *); @@ -1638,12 +1642,12 @@ static int attach_card(softc_t *, const char *); static void detach_card(softc_t *); =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) static int fbsd_probe(device_t); static int fbsd_detach(device_t); static int fbsd_shutdown(device_t); static int fbsd_attach(device_t); -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 #ifdef __NetBSD__ static int nbsd_match(struct device *t, struct cfdata *, void *); Index: sys/dev/mpt/mpilib/mpi_type.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/mpt/mpilib/mpi_type.h (revision 227956) +++ sys/dev/mpt/mpilib/mpi_type.h (working copy) @@ -77,7 +77,7 @@ typedef signed short S16; typedef unsigned short U16; =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) =20 typedef int32_t S32; typedef uint32_t U32; Index: sys/dev/wi/if_wireg.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/wi/if_wireg.h (revision 227956) +++ sys/dev/wi/if_wireg.h (working copy) @@ -84,7 +84,7 @@ #ifdef __NetBSD__ #define OS_STRING_NAME "NetBSD" #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define OS_STRING_NAME "FreeBSD" #endif #ifdef __OpenBSD__ Index: sys/fs/nfs/nfs_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/fs/nfs/nfs_var.h (revision 227956) +++ sys/fs/nfs/nfs_var.h (working copy) @@ -76,7 +76,7 @@ struct nfsvattr; struct nfs_vattr; struct NFSSVCARGS; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) NFS_ACCESS_ARGS; NFS_OPEN_ARGS; NFS_GETATTR_ARGS; Index: sys/net/if_atm.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net/if_atm.h (revision 227956) +++ sys/net/if_atm.h (working copy) @@ -202,7 +202,7 @@ =20 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) #define RTALLOC1(A,B) rtalloc1((A),(B)) -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define RTALLOC1(A,B) rtalloc1((A),(B),0UL) #endif =20 Index: sys/net/zlib.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net/zlib.h (revision 227956) +++ sys/net/zlib.h (working copy) @@ -510,7 +510,7 @@ done by inflate(). */ =20 -#if defined(__FreeBSD__) && defined(_KERNEL) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(_KERN= EL) #define inflate inflate_ppp /* FreeBSD already has an inflate :-= ( */ #endif =20 Index: sys/net80211/ieee80211_ioctl.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net80211/ieee80211_ioctl.h (revision 227956) +++ sys/net80211/ieee80211_ioctl.h (working copy) @@ -569,7 +569,7 @@ uint16_t sv_vlan; }; =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* * FreeBSD-style ioctls. */ @@ -849,6 +849,6 @@ #define IEEE80211_CLONE_WDSLEGACY 0x0004 /* legacy WDS processing */ #define IEEE80211_CLONE_MACADDR 0x0008 /* use specified mac addr */ #define IEEE80211_CLONE_TDMA 0x0010 /* operate in TDMA mode */ -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 #endif /* _NET80211_IEEE80211_IOCTL_H_ */ Index: sys/net80211/ieee80211_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/net80211/ieee80211_var.h (revision 227956) +++ sys/net80211/ieee80211_var.h (working copy) @@ -34,7 +34,7 @@ /* NB: portability glue must go first */ #if defined(__NetBSD__) #include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #elif defined(__linux__) #include Index: sys/netinet/sctp_pcb.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/sctp_pcb.h (revision 227956) +++ sys/netinet/sctp_pcb.h (working copy) @@ -240,7 +240,8 @@ * All static structures that anchor the system must be here. */ struct sctp_epinfo sctppcbinfo; -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + defined(SMP) && defined(SCTP_USE_PERCPU_STAT) struct sctpstat *sctpstat; #else struct sctpstat sctpstat; @@ -633,7 +634,8 @@ struct sctp_inpcb *, uint8_t co_off); =20 -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + defined(SCTP_MCORE_INPUT) && defined(SMP) void sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use); =20 Index: sys/netinet/sctp_structs.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/sctp_structs.h (revision 227956) +++ sys/netinet/sctp_structs.h (working copy) @@ -108,7 +108,8 @@ typedef int (*inp_func) (struct sctp_inpcb *, void *ptr, uint32_t val); typedef void (*end_func) (void *ptr, uint32_t val); =20 -#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + defined(SCTP_MCORE_INPUT) && defined(SMP) /* whats on the mcore control struct */ struct sctp_mcore_queue { TAILQ_ENTRY(sctp_mcore_queue) next; Index: sys/netinet/sctp_uio.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/sctp_uio.h (revision 227956) +++ sys/netinet/sctp_uio.h (working copy) @@ -1062,7 +1062,8 @@ =20 #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1) #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1) -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && \ + defined(SMP) && defined(SCTP_USE_PERCPU_STAT) #define SCTP_STAT_INCR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x +=3D= _d) #define SCTP_STAT_DECR_BY(_x,_d) (SCTP_BASE_STATS[PCPU_GET(cpuid)]._x -=3D= _d) #else Index: sys/sys/device_port.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/device_port.h (revision 227956) +++ sys/sys/device_port.h (working copy) @@ -29,7 +29,7 @@ =20 #if defined(__NetBSD__) # include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include # include #endif @@ -43,7 +43,7 @@ # define DEVPORT_DEVNAME(dev) (dev).dv_xname # define DEVPORT_DEVUNIT(dev) (dev).dv_unit =20 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* * FreeBSD (compatibility for struct device) */ @@ -67,4 +67,4 @@ #define DEVPORT_PDEVALLOC_SOFTC(pdev) device_get_softc(pdev) #define DEVPORT_PDEVGET_SOFTC(pdev) device_get_softc(pdev) =20 -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ Index: sys/sys/timex.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/timex.h (revision 227956) +++ sys/sys/timex.h (working copy) @@ -218,7 +218,7 @@ long stbcnt; /* stability limit exceeded (ro) */ }; =20 -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) =20 #ifdef _KERNEL void ntp_update_second(int64_t *adjustment, time_t *newsec); @@ -231,6 +231,6 @@ __END_DECLS #endif /* _KERNEL */ =20 -#endif /* __FreeBSD__ */ +#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ =20 #endif /* !_SYS_TIMEX_H_ */ --0OAP2g/MAC+5xKAE-- --JP+T4n/bALQSJXh8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/kFreeBSD) iQIcBAEBCAAGBQJO0UcUAAoJELd1onhloKnOaKYP/1aZ0B8BEpO31dTN0jxpmRql 8YsoSbsMVtc+fTDo9IpMPigcy12dDL2j+7NEGhEYZlWC+GkQTeT3gaKQZLp87WAD h8i1pee4BuHmF/0CWsqEexs7eE9vIXi4tsiPpmAtKQnN7bIFlYjQSSIDFhQYSKKD LLRjPl2f/5yNA6aMokMUGS64MThoFgp7HU5yvTj3a4yOZb+399k7jJ1oN0CXZeSW vm75rEz/hmS9c0wkcxbyq/KO24gPU3cfx60TGWtHIso1ue8Bymaa9mtML/M5ksAF NwtE0Guic8AtyEfcvV8umM4Vj4AbxSgR/CkAfvTa6tqjmEjme88GyYnPDwkPgEfU FoKv45U7t8j+caOeEjNl6UEqHb7Rju8OZ4e65Vt2kc0ahQyhKPt58hvUy2062x6w 2tQBfrLjYRAbt0/Ch1thBHmY4vLpQhCP91x+lpBEkADDqLlykuKG3pCkE4Zd9eyU y29iQESed4+kc5QQ8SRPqW4qQXPWG8wpUYKvHG3ZCIIqPychjVz9uuUIaVGpzI2A wOGgPLts+cL0kMrKVc3zITxMJ6jsR5bMtvDa87vs2u/Vf6Nzy/Q6pAHuRJgmFpnh xCvv6WTtcEkwxhqWhehQkKtaQTjRPp8wqSTtqpe9R+EAPWwYnPA2X1/9mJIIF6er BV6uVOJXJkA+oD1OTTy0 =uPGO -----END PGP SIGNATURE----- --JP+T4n/bALQSJXh8-- From owner-freebsd-arch@FreeBSD.ORG Sat Nov 26 23:30:40 2011 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C071D1065783; Sat, 26 Nov 2011 23:30:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2A88FC0C; Sat, 26 Nov 2011 23:30:40 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pAQNOTsZ027433 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sat, 26 Nov 2011 16:24:29 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: <20111126200749.GA72056@thorin> Date: Sat, 26 Nov 2011 16:24:29 -0700 Message-Id: <7FCA9875-4828-4AAD-8426-8D2530A4BFCA@bsdimp.com> References: <20111123070036.GA29952@thorin> <20111124141821.O932@besplex.bde.org> <20111125150324.G1018@besplex.bde.org> <20111126200749.GA72056@thorin> To: Robert Millan X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sat, 26 Nov 2011 16:24:30 -0700 (MST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Kostik Belousov , Adrian Chadd , freebsd-current@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers (v2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:30:40 -0000 This looks fine to me. Warner On Nov 26, 2011, at 1:07 PM, Robert Millan wrote: >