Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbmips/cavium Reserve space for all CPU cores (inc...



details:   https://anonhg.NetBSD.org/src/rev/2111863384e5
branches:  trunk
changeset: 936100:2111863384e5
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sun Jul 19 08:53:24 2020 +0000

description:
Reserve space for all CPU cores (incorrect logic).
Reserve a full page for each core, not incorrect 4096 (from skrll@).

diffstat:

 sys/arch/evbmips/cavium/machdep.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r c7d88cf69a7c -r 2111863384e5 sys/arch/evbmips/cavium/machdep.c
--- a/sys/arch/evbmips/cavium/machdep.c Sun Jul 19 07:35:08 2020 +0000
+++ b/sys/arch/evbmips/cavium/machdep.c Sun Jul 19 08:53:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.19 2020/07/19 06:31:13 simonb Exp $      */
+/*     $NetBSD: machdep.c,v 1.20 2020/07/19 08:53:24 simonb Exp $      */
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -114,7 +114,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2020/07/19 06:31:13 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.20 2020/07/19 08:53:24 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -371,8 +371,10 @@
        physmem = btoc(octeon_btinfo.obt_dram_size * 1024 * 1024);
 
 #ifdef MULTIPROCESSOR
-       const u_int cores = mipsNN_cp0_ebase_read() & MIPS_EBASE_CPUNUM;
-       mem_clusters[0].start = cores * 4096;
+       const uint64_t fuse = octeon_xkphys_read_8(CIU_FUSE);
+       const int cores = popcount64(fuse);
+       mem_clusters[0].start += cores * PAGE_SIZE;
+       mem_clusters[0].size  -= cores * PAGE_SIZE;
 #endif
 
        /*



Home | Main Index | Thread Index | Old Index