Module Name: src
Committed By: simonb
Date: Thu Jun 4 03:08:59 UTC 2020
Modified Files:
src/sys/arch/evbmips/cavium: machdep.c
Log Message:
Only clear BSS up to "end" symbol, not all the way to mips_round_page(end).
U-Boot puts some data immediately after the BSS section cleared in the ELF
segments, and we don't want to overwrite that.
XXX: Stop using mips_round_page(end) on all MIPS?
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 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.11 src/sys/arch/evbmips/cavium/machdep.c:1.12
--- src/sys/arch/evbmips/cavium/machdep.c:1.11 Sun May 31 14:05:21 2020
+++ src/sys/arch/evbmips/cavium/machdep.c Thu Jun 4 03:08:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.11 2020/05/31 14:05:21 simonb Exp $ */
+/* $NetBSD: machdep.c,v 1.12 2020/06/04 03:08:59 simonb Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -115,7 +115,7 @@
#include "opt_cavium.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.11 2020/05/31 14:05:21 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2020/06/04 03:08:59 simonb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -154,7 +154,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v
#include <evbmips/cavium/octeon_uboot.h>
-static void mach_init_bss(void);
static void mach_init_vector(void);
static void mach_init_bus_space(void);
static void mach_init_console(void);
@@ -191,8 +190,11 @@ mach_init(uint64_t arg0, uint64_t arg1,
uint64_t btinfo_paddr;
u_quad_t memsize;
int corefreq;
+ extern char edata[], end[];
+
+ /* clear the BSS segment */
+ memset(edata, 0, end - edata);
- mach_init_bss();
KASSERT(MIPS_XKPHYS_P(arg3));
btinfo_paddr = mips3_ld(arg3 + OCTEON_BTINFO_PADDR_OFFSET);
@@ -270,17 +272,6 @@ consinit(void)
}
void
-mach_init_bss(void)
-{
- extern char edata[], end[];
-
- /*
- * Clear the BSS segment.
- */
- memset(edata, 0, mips_round_page(end) - (uintptr_t)edata);
-}
-
-void
mach_init_vector(void)
{