[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree
zrouter-src-freebsd at zrouter.org
zrouter-src-freebsd at zrouter.org
Tue Apr 24 17:11:48 UTC 2012
details: http://zrouter.org/hg/FreeBSD/head//rev/906760806c39
changeset: 471:906760806c39
user: Aleksandr Rybalko <ray at ddteam.net>
date: Tue Apr 24 20:12:26 2012 +0300
description:
New sysctl values to know on which board we run
diffstat:
head/sys/conf/options | 8 ++++++
head/sys/mips/atheros/ar71xx_machdep.c | 40 ++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 0 deletions(-)
diffs (75 lines):
diff -r a3d29eff2697 -r 906760806c39 head/sys/conf/options
--- a/head/sys/conf/options Tue Apr 24 20:05:58 2012 +0300
+++ b/head/sys/conf/options Tue Apr 24 20:12:26 2012 +0300
@@ -321,6 +321,14 @@
CHANGER_MIN_BUSY_SECONDS opt_cd.h
CHANGER_MAX_BUSY_SECONDS opt_cd.h
+# Allow to define cpu/board names
+SOC_VENDOR opt_global.h
+SOC_MODEL opt_global.h
+SOC_REV opt_global.h
+DEVICE_VENDOR opt_global.h
+DEVICE_MODEL opt_global.h
+DEVICE_REV opt_global.h
+
# Options used only in cam/scsi/scsi_sa.c.
SA_IO_TIMEOUT opt_sa.h
SA_SPACE_TIMEOUT opt_sa.h
diff -r a3d29eff2697 -r 906760806c39 head/sys/mips/atheros/ar71xx_machdep.c
--- a/head/sys/mips/atheros/ar71xx_machdep.c Tue Apr 24 20:05:58 2012 +0300
+++ b/head/sys/mips/atheros/ar71xx_machdep.c Tue Apr 24 20:12:26 2012 +0300
@@ -38,6 +38,7 @@
#include <sys/cons.h>
#include <sys/kdb.h>
#include <sys/reboot.h>
+#include <sys/sysctl.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
@@ -140,6 +141,45 @@
}
}
+#if defined(SOC_VENDOR) || defined(SOC_MODEL) || defined(SOC_REV)
+static SYSCTL_NODE(_hw, OID_AUTO, soc, CTLFLAG_RD, 0,
+ "System on Chip information");
+#endif
+#if defined(SOC_VENDOR)
+static char hw_soc_vendor[] = SOC_VENDOR;
+SYSCTL_STRING(_hw_soc, OID_AUTO, vendor, CTLFLAG_RD, hw_soc_vendor, 0,
+ "SoC vendor");
+#endif
+#if defined(SOC_MODEL)
+static char hw_soc_model[] = SOC_MODEL;
+SYSCTL_STRING(_hw_soc, OID_AUTO, model, CTLFLAG_RD, hw_soc_model, 0,
+ "SoC model");
+#endif
+#if defined(SOC_REV)
+static char hw_soc_revision[] = SOC_REV;
+SYSCTL_STRING(_hw_soc, OID_AUTO, revision, CTLFLAG_RD, hw_soc_revision, 0,
+ "SoC revision");
+#endif
+
+#if defined(DEVICE_VENDOR) || defined(DEVICE_MODEL) || defined(DEVICE_REV)
+static SYSCTL_NODE(_hw, OID_AUTO, device, CTLFLAG_RD, 0, "Board information");
+#endif
+#if defined(DEVICE_VENDOR)
+static char hw_device_vendor[] = DEVICE_VENDOR;
+SYSCTL_STRING(_hw_device, OID_AUTO, vendor, CTLFLAG_RD, hw_device_vendor, 0,
+ "Board vendor");
+#endif
+#if defined(DEVICE_MODEL)
+static char hw_device_model[] = DEVICE_MODEL;
+SYSCTL_STRING(_hw_device, OID_AUTO, model, CTLFLAG_RD, hw_device_model, 0,
+ "Board model");
+#endif
+#if defined(DEVICE_REV)
+static char hw_device_revision[] = DEVICE_REV;
+SYSCTL_STRING(_hw_device, OID_AUTO, revision, CTLFLAG_RD, hw_device_revision, 0,
+ "Board revision");
+#endif
+
void
platform_start(__register_t a0 __unused, __register_t a1 __unused,
__register_t a2 __unused, __register_t a3 __unused)
More information about the Zrouter-src-freebsd
mailing list