From owner-svn-src-head@FreeBSD.ORG Mon Dec 2 00:44:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD6F872E; Mon, 2 Dec 2013 00:44:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C95EF1255; Mon, 2 Dec 2013 00:44:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB20iamj074727; Mon, 2 Dec 2013 00:44:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rB20iaOB074726; Mon, 2 Dec 2013 00:44:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312020044.rB20iaOB074726@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 2 Dec 2013 00:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258819 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Dec 2013 00:44:36 -0000 Author: nwhitehorn Date: Mon Dec 2 00:44:36 2013 New Revision: 258819 URL: http://svnweb.freebsd.org/changeset/base/258819 Log: Add new sysctl, kern.supported_abis, containing the list of FreeBSD MACHINE_ARCH values whose binaries this kernel can run. This patch provides a feature requested for implementing pkgng ABI identifiers in a robust way. The list is designed to indicate whether, say, an i386 package can be run on the current system. If kern.supported_abis contains "i386", then the answer is yes. Otherwise, the answer is no. At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we gain support for more interesting combinations, this needs to become more flexible, possibily through the sysent framework, along with the hw.machine_arch emulation immediately preceding this code in kern_mib.c. Reviewed by: imp MFC after: 3 days Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sun Dec 1 22:43:14 2013 (r258818) +++ head/sys/kern/kern_mib.c Mon Dec 2 00:44:36 2013 (r258819) @@ -261,6 +261,13 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_STRING(_kern, OID_AUTO, supported_abis, CTLFLAG_RD | CTLFLAG_MPSAFE, +#ifdef COMPAT_FREEBSD32 + MACHINE_ARCH " " MACHINE_ARCH32, 0, "List of supported ABIs"); +#else + MACHINE_ARCH, 0, "List of supported ABIs"); +#endif + static int sysctl_hostname(SYSCTL_HANDLER_ARGS) {