aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2014-12-24 03:02:12 +0000
committerIan Lepore <ian@FreeBSD.org>2014-12-24 03:02:12 +0000
commit6783238b2deea7acaf2f83745b864263f701536c (patch)
treeac8e459afcd1f77fb3d920a7393f7d4322bb0689
parent84cc2bcd19aba5bb0bbb8732b8bb96673748ca50 (diff)
downloadsrc-6783238b2deea7acaf2f83745b864263f701536c.tar.gz
src-6783238b2deea7acaf2f83745b864263f701536c.zip
Define the old-school arm arch constants we still use internally based on
the somewhat newer constants predefined by the compiler. This will allow userland apps to use various machine/foo.h headers without CPUTYPE defined.
Notes
Notes: svn path=/head/; revision=276165
-rw-r--r--sys/arm/include/cpuconf.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/arm/include/cpuconf.h b/sys/arm/include/cpuconf.h
index da35e576bbe3..bc57d5967a75 100644
--- a/sys/arm/include/cpuconf.h
+++ b/sys/arm/include/cpuconf.h
@@ -85,20 +85,43 @@
#endif
#if !defined(ARM_ARCH_6)
-#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B)
#define ARM_ARCH_6 1
#else
#define ARM_ARCH_6 0
#endif
#endif
-#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) || defined(CPU_MV_PJ4B)
+#if defined(CPU_CORTEXA) || defined(CPU_KRAIT)
#define ARM_ARCH_7A 1
#else
#define ARM_ARCH_7A 0
#endif
#define ARM_NARCH (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6 | ARM_ARCH_7A)
+
+/*
+ * Compatibility for userland builds that have no CPUTYPE defined. Use the ARCH
+ * constants predefined by the compiler to define our old-school arch constants.
+ * This is a stopgap measure to tide us over until the conversion of all code
+ * to the newer ACLE constants defined by ARM (see acle-compat.h).
+ */
+#if ARM_NARCH == 0
+#if defined(__ARM_ARCH_4T__)
+#undef ARM_ARCH_4
+#undef ARM_NARCH
+#define ARM_ARCH_4 1
+#define ARM_NARCH 1
+#define CPU_ARM9 1
+#elif defined(__ARM_ARCH_6ZK__)
+#undef ARM_ARCH_6
+#undef ARM_NARCH
+#define ARM_ARCH_6 1
+#define ARM_NARCH 1
+#define CPU_ARM1176 1
+#endif
+#endif
+
#if ARM_NARCH == 0 && !defined(KLD_MODULE) && defined(_KERNEL)
#error ARM_NARCH is 0
#endif