From owner-freebsd-current@FreeBSD.ORG Tue Nov 22 17:53:55 2011 Return-Path: Delivered-To: freebsd-current@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 , Bruce Evans , freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current 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--