From owner-svn-src-all@FreeBSD.ORG Sat Jan 21 17:22:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32791106566B; Sat, 21 Jan 2012 17:22:51 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 025CF8FC08; Sat, 21 Jan 2012 17:22:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LHMoJ4001553; Sat, 21 Jan 2012 17:22:50 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LHMoVs001551; Sat, 21 Jan 2012 17:22:50 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201201211722.q0LHMoVs001551@svn.freebsd.org> From: Robert Millan Date: Sat, 21 Jan 2012 17:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230425 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 17:22:51 -0000 Author: rmh Date: Sat Jan 21 17:22:50 2012 New Revision: 230425 URL: http://svn.freebsd.org/changeset/base/230425 Log: MFC r227827 Define __FreeBSD_kernel__ macro in sys/param.h. __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, which by definition is always true on FreeBSD. This macro is also defined 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. Approved by: kib (mentor) Modified: stable/9/sys/sys/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Sat Jan 21 13:31:38 2012 (r230424) +++ stable/9/sys/sys/param.h Sat Jan 21 17:22:50 2012 (r230425) @@ -60,6 +60,22 @@ #undef __FreeBSD_version #define __FreeBSD_version 900502 /* Master, propagated to newvers */ +/* + * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, + * which by definition is always true on FreeBSD. This macro is also defined + * 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