Date: Mon, 16 Dec 2013 15:00:06 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259465 - stable/10/sys/kern Message-ID: <201312161500.rBGF0645081600@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Mon Dec 16 15:00:06 2013 New Revision: 259465 URL: http://svnweb.freebsd.org/changeset/base/259465 Log: MFC r258819,258928: Add new sysctl, kern.supported_archs, 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 Modified: stable/10/sys/kern/kern_mib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_mib.c ============================================================================== --- stable/10/sys/kern/kern_mib.c Mon Dec 16 13:52:18 2013 (r259464) +++ stable/10/sys/kern/kern_mib.c Mon Dec 16 15:00:06 2013 (r259465) @@ -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_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, +#ifdef COMPAT_FREEBSD32 + MACHINE_ARCH " " MACHINE_ARCH32, 0, "Supported architectures for binaries"); +#else + MACHINE_ARCH, 0, "Supported architectures for binaries"); +#endif + static int sysctl_hostname(SYSCTL_HANDLER_ARGS) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312161500.rBGF0645081600>