Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm Add CPU_IS_ARMV6_P() macro
details: https://anonhg.NetBSD.org/src/rev/60a72fe28848
branches: trunk
changeset: 325357:60a72fe28848
user: matt <matt%NetBSD.org@localhost>
date: Fri Dec 20 06:48:09 2013 +0000
description:
Add CPU_IS_ARMV6_P() macro
diffstat:
sys/arch/arm/arm/cpufunc.c | 15 +++++++++++++--
sys/arch/arm/include/locore.h | 9 +++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diffs (69 lines):
diff -r 61ebe3b66f6a -r 60a72fe28848 sys/arch/arm/arm/cpufunc.c
--- a/sys/arch/arm/arm/cpufunc.c Fri Dec 20 01:17:54 2013 +0000
+++ b/sys/arch/arm/arm/cpufunc.c Fri Dec 20 06:48:09 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.c,v 1.131 2013/12/18 12:52:47 skrll Exp $ */
+/* $NetBSD: cpufunc.c,v 1.132 2013/12/20 06:48:09 matt Exp $ */
/*
* arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.131 2013/12/18 12:52:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.132 2013/12/20 06:48:09 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_cpuoptions.h"
@@ -96,6 +96,11 @@
bool cpu_armv7_p;
#endif
+#if defined(CPU_ARMV6) && (defined(CPU_ARMV7) || defined(CPU_PRE_ARMV6))
+bool cpu_armv6_p;
+#endif
+
+
/* PRIMARY CACHE VARIABLES */
#if (ARM_MMU_V6 + ARM_MMU_V7) != 0
u_int arm_cache_prefer_mask;
@@ -1839,6 +1844,9 @@
#if defined(CPU_ARM11MPCORE)
if (cputype == CPU_ID_ARM11MPCORE) {
cpufuncs = arm11mpcore_cpufuncs;
+#if defined(CPU_ARMV7) || defined(CPU_PRE_ARMV6)
+ cpu_armv6_p = true;
+#endif
get_cachetype_cp15();
armv5_dcache_sets_inc = 1U << arm_dcache_log2_linesize;
armv5_dcache_sets_max = (1U << (arm_dcache_log2_linesize +
@@ -1873,6 +1881,9 @@
cpufuncs = arm1176_cpufuncs;
}
#endif
+#if defined(CPU_ARMV7) || defined(CPU_PRE_ARMV6)
+ cpu_armv6_p = true;
+#endif
cpu_do_powersave = 1; /* Enable powersave */
get_cachetype_cp15();
#ifdef ARM11_CACHE_WRITE_THROUGH
diff -r 61ebe3b66f6a -r 60a72fe28848 sys/arch/arm/include/locore.h
--- a/sys/arch/arm/include/locore.h Fri Dec 20 01:17:54 2013 +0000
+++ b/sys/arch/arm/include/locore.h Fri Dec 20 06:48:09 2013 +0000
@@ -160,6 +160,15 @@
#else
#define CPU_IS_ARMV7_P() true
#endif
+#if !defined(CPU_ARMV6)
+#define CPU_IS_ARMV6_P() false
+#elif defined(CPU_ARMV7) || defined(CPU_PRE_ARMV6)
+extern bool cpu_armv6_p;
+#define CPU_IS_ARMV6_P() (cpu_armv6_p)
+#else
+#define CPU_IS_ARMV6_P() true
+#endif
+
/*
* Random cruft
Home |
Main Index |
Thread Index |
Old Index