Module Name: src
Committed By: simonb
Date: Sun Jul 19 08:53:24 UTC 2020
Modified Files:
src/sys/arch/evbmips/cavium: machdep.c
Log Message:
Reserve space for all CPU cores (incorrect logic).
Reserve a full page for each core, not incorrect 4096 (from skrll@).
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbmips/cavium/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/evbmips/cavium/machdep.c
diff -u src/sys/arch/evbmips/cavium/machdep.c:1.19 src/sys/arch/evbmips/cavium/machdep.c:1.20
--- src/sys/arch/evbmips/cavium/machdep.c:1.19 Sun Jul 19 06:31:13 2020
+++ src/sys/arch/evbmips/cavium/machdep.c Sun Jul 19 08:53:24 2020
@@ -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 @@ mach_init_memory(void)
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
/*