Sat Jul 16 01:49:42 2016 UTC ()
apply some #if (ARM_MMU_V6 + ARM_MMU_V7) != 0.
now this builds on pre v6-only.


(mrg)
diff -r1.111 -r1.112 src/sys/arch/arm/arm32/arm32_machdep.c
diff -r1.76 -r1.77 src/sys/arch/arm/include/cpufunc.h

cvs diff -r1.111 -r1.112 src/sys/arch/arm/arm32/arm32_machdep.c (expand / switch to unified diff)

--- src/sys/arch/arm/arm32/arm32_machdep.c 2016/07/15 05:59:46 1.111
+++ src/sys/arch/arm/arm32/arm32_machdep.c 2016/07/16 01:49:42 1.112
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: arm32_machdep.c,v 1.111 2016/07/15 05:59:46 skrll Exp $ */ 1/* $NetBSD: arm32_machdep.c,v 1.112 2016/07/16 01:49:42 mrg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994-1998 Mark Brinicombe. 4 * Copyright (c) 1994-1998 Mark Brinicombe.
5 * Copyright (c) 1994 Brini. 5 * Copyright (c) 1994 Brini.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software written for Brini by Mark Brinicombe 8 * This code is derived from software written for Brini by Mark Brinicombe
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -32,27 +32,27 @@ @@ -32,27 +32,27 @@
32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE. 36 * SUCH DAMAGE.
37 * 37 *
38 * Machine dependent functions for kernel setup 38 * Machine dependent functions for kernel setup
39 * 39 *
40 * Created : 17/09/94 40 * Created : 17/09/94
41 * Updated : 18/04/01 updated for new wscons 41 * Updated : 18/04/01 updated for new wscons
42 */ 42 */
43 43
44#include <sys/cdefs.h> 44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.111 2016/07/15 05:59:46 skrll Exp $"); 45__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.112 2016/07/16 01:49:42 mrg Exp $");
46 46
47#include "opt_modular.h" 47#include "opt_modular.h"
48#include "opt_md.h" 48#include "opt_md.h"
49#include "opt_pmap_debug.h" 49#include "opt_pmap_debug.h"
50#include "opt_multiprocessor.h" 50#include "opt_multiprocessor.h"
51 51
52#include <sys/param.h> 52#include <sys/param.h>
53#include <sys/systm.h> 53#include <sys/systm.h>
54#include <sys/reboot.h> 54#include <sys/reboot.h>
55#include <sys/proc.h> 55#include <sys/proc.h>
56#include <sys/kauth.h> 56#include <sys/kauth.h>
57#include <sys/kernel.h> 57#include <sys/kernel.h>
58#include <sys/mbuf.h> 58#include <sys/mbuf.h>
@@ -740,17 +740,23 @@ mm_md_direct_mapped_phys(paddr_t pa, vad @@ -740,17 +740,23 @@ mm_md_direct_mapped_phys(paddr_t pa, vad
740{ 740{
741 bool rv; 741 bool rv;
742 vaddr_t va = pmap_direct_mapped_phys(pa, &rv, 0); 742 vaddr_t va = pmap_direct_mapped_phys(pa, &rv, 0);
743 if (rv) { 743 if (rv) {
744 *vap = va; 744 *vap = va;
745 } 745 }
746 return rv; 746 return rv;
747} 747}
748#endif 748#endif
749 749
750bool 750bool
751mm_md_page_color(paddr_t pa, int *colorp) 751mm_md_page_color(paddr_t pa, int *colorp)
752{ 752{
 753#if (ARM_MMU_V6 + ARM_MMU_V7) != 0
753 *colorp = atop(pa & arm_cache_prefer_mask); 754 *colorp = atop(pa & arm_cache_prefer_mask);
754 755
755 return arm_cache_prefer_mask ? false : true; 756 return arm_cache_prefer_mask ? false : true;
 757#else
 758 *colorp = 0;
 759
 760 return true;
 761#endif
756} 762}

cvs diff -r1.76 -r1.77 src/sys/arch/arm/include/cpufunc.h (expand / switch to unified diff)

--- src/sys/arch/arm/include/cpufunc.h 2016/01/23 21:39:18 1.76
+++ src/sys/arch/arm/include/cpufunc.h 2016/07/16 01:49:42 1.77
@@ -409,27 +409,29 @@ struct arm_cache_info { @@ -409,27 +409,29 @@ struct arm_cache_info {
409 409
410 u_int dcache_size; 410 u_int dcache_size;
411 u_int dcache_line_size; 411 u_int dcache_line_size;
412 u_int dcache_ways; 412 u_int dcache_ways;
413 u_int dcache_way_size; 413 u_int dcache_way_size;
414 u_int dcache_sets; 414 u_int dcache_sets;
415 415
416 uint8_t cache_type; 416 uint8_t cache_type;
417 bool cache_unified; 417 bool cache_unified;
418 uint8_t icache_type; 418 uint8_t icache_type;
419 uint8_t dcache_type; 419 uint8_t dcache_type;
420}; 420};
421 421
 422#if (ARM_MMU_V6 + ARM_MMU_V7) != 0
422extern u_int arm_cache_prefer_mask; 423extern u_int arm_cache_prefer_mask;
 424#endif
423extern u_int arm_dcache_align; 425extern u_int arm_dcache_align;
424extern u_int arm_dcache_align_mask; 426extern u_int arm_dcache_align_mask;
425 427
426extern struct arm_cache_info arm_pcache; 428extern struct arm_cache_info arm_pcache;
427extern struct arm_cache_info arm_scache; 429extern struct arm_cache_info arm_scache;
428#endif /* _KERNEL */ 430#endif /* _KERNEL */
429 431
430#if defined(_KERNEL) || defined(_KMEMUSER) 432#if defined(_KERNEL) || defined(_KMEMUSER)
431/* 433/*
432 * Miscellany 434 * Miscellany
433 */ 435 */
434 436
435int get_pc_str_offset (void); 437int get_pc_str_offset (void);