Date: Sat, 9 Jan 2016 15:19:43 +0000 (UTC) From: Dmitry Chagin <dchagin@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: r293496 - stable/10/sys/compat/linux Message-ID: <201601091519.u09FJhMt015306@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sat Jan 9 15:19:43 2016 New Revision: 293496 URL: https://svnweb.freebsd.org/changeset/base/293496 Log: MFC r283386: Introduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use instead of harcoded pr_osrelease, pr_osrel values. This will be used later in the VDSO. Modified: stable/10/sys/compat/linux/linux_mib.c stable/10/sys/compat/linux/linux_mib.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_mib.c ============================================================================== --- stable/10/sys/compat/linux/linux_mib.c Sat Jan 9 15:18:36 2016 (r293495) +++ stable/10/sys/compat/linux/linux_mib.c Sat Jan 9 15:19:43 2016 (r293496) @@ -130,9 +130,9 @@ struct linux_prison { static struct linux_prison lprison0 = { .pr_osname = "Linux", - .pr_osrelease = "2.6.18", + .pr_osrelease = LINUX_VERSION_STR, .pr_oss_version = 0x030600, - .pr_osrel = 2006018 + .pr_osrel = LINUX_VERSION_CODE }; static unsigned linux_osd_jail_slot; Modified: stable/10/sys/compat/linux/linux_mib.h ============================================================================== --- stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 15:18:36 2016 (r293495) +++ stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 15:19:43 2016 (r293496) @@ -42,8 +42,19 @@ int linux_get_oss_version(struct thread int linux_kernver(struct thread *td); -#define LINUX_KERNVER_2004000 2004000 -#define LINUX_KERNVER_2006000 2006000 +#define LINUX_KVERSION 2 +#define LINUX_KPATCHLEVEL 6 +#define LINUX_KSUBLEVEL 18 + +#define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \ + LINUX_KPATCHLEVEL, LINUX_KSUBLEVEL) +#define LINUX_KERNVERSTR(x) #x +#define LINUX_XKERNVERSTR(x) LINUX_KERNVERSTR(x) +#define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL) + +#define LINUX_KERNVER_2004000 LINUX_KERNVER(2,4,0) +#define LINUX_KERNVER_2006000 LINUX_KERNVER(2,6,0) #define linux_use26(t) (linux_kernver(t) >= LINUX_KERNVER_2006000)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091519.u09FJhMt015306>