From 0d75fa6d68f98c1e26efa3e11c53e69d8c4c01b6 Mon Sep 17 00:00:00 2001 From: visa Date: Thu, 8 Jun 2017 12:02:52 +0000 Subject: [PATCH] Move loongson/octeon/sgi unmap_startup() under arch/mips64. --- sys/arch/loongson/loongson/autoconf.c | 13 +------------ sys/arch/mips64/include/autoconf.h | 4 +++- sys/arch/mips64/mips64/mips64_machdep.c | 16 +++++++++++++++- sys/arch/octeon/octeon/autoconf.c | 13 +------------ sys/arch/sgi/sgi/autoconf.c | 13 +------------ 5 files changed, 21 insertions(+), 38 deletions(-) diff --git a/sys/arch/loongson/loongson/autoconf.c b/sys/arch/loongson/loongson/autoconf.c index 00755ee5f1d..1a434a81025 100644 --- a/sys/arch/loongson/loongson/autoconf.c +++ b/sys/arch/loongson/loongson/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.7 2017/06/08 11:44:00 visa Exp $ */ +/* $OpenBSD: autoconf.c,v 1.8 2017/06/08 12:02:52 visa Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. * @@ -34,17 +34,6 @@ enum devclass bootdev_class = DV_DULL; extern char pmon_bootp[]; -void -unmap_startup(void) -{ - extern uint32_t kernel_text[], endboot[]; - uint32_t *word = kernel_text; - - /* Cannot unmap kseg0; smash with trap. */ - while (word < endboot) - *word++ = 0x00000034u; /* TEQ zero, zero */ -} - void cpu_configure(void) { diff --git a/sys/arch/mips64/include/autoconf.h b/sys/arch/mips64/include/autoconf.h index 1a1519f9971..3d372b15bd4 100644 --- a/sys/arch/mips64/include/autoconf.h +++ b/sys/arch/mips64/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.1 2010/01/09 20:33:16 miod Exp $ */ +/* $OpenBSD: autoconf.h,v 1.2 2017/06/08 12:02:52 visa Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -32,4 +32,6 @@ struct cpu_attach_args { extern struct cpu_hwinfo bootcpu_hwinfo; +void unmap_startup(void); + #endif /* _MIPS64_AUTOCONF_H_ */ diff --git a/sys/arch/mips64/mips64/mips64_machdep.c b/sys/arch/mips64/mips64/mips64_machdep.c index fb4a055fe09..9e470b7b367 100644 --- a/sys/arch/mips64/mips64/mips64_machdep.c +++ b/sys/arch/mips64/mips64/mips64_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mips64_machdep.c,v 1.22 2017/05/29 11:46:49 visa Exp $ */ +/* $OpenBSD: mips64_machdep.c,v 1.23 2017/06/08 12:02:52 visa Exp $ */ /* * Copyright (c) 2009, 2010, 2012 Miodrag Vallat. @@ -548,3 +548,17 @@ classify_insn(uint32_t insn) return INSNCLASS_NEUTRAL; } + +/* + * Smash the startup code. There is no way to really unmap it + * because the kernel runs in the kseg0 or xkphys space. + */ +void +unmap_startup(void) +{ + extern uint32_t kernel_text[], endboot[]; + uint32_t *word = kernel_text; + + while (word < endboot) + *word++ = 0x00000034u; /* TEQ zero, zero */ +} diff --git a/sys/arch/octeon/octeon/autoconf.c b/sys/arch/octeon/octeon/autoconf.c index 0adad7ea22a..43e4960644a 100644 --- a/sys/arch/octeon/octeon/autoconf.c +++ b/sys/arch/octeon/octeon/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.11 2017/06/06 14:35:53 visa Exp $ */ +/* $OpenBSD: autoconf.c,v 1.12 2017/06/08 12:02:52 visa Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. * @@ -32,17 +32,6 @@ char bootdev[16]; enum devclass bootdev_class = DV_DULL; extern char uboot_rootdev[]; -void -unmap_startup(void) -{ - extern uint32_t kernel_text[], endboot[]; - uint32_t *word = kernel_text; - - /* Cannot unmap KSEG0; smash with trap. */ - while (word < endboot) - *word++ = 0x00000034u; /* TEQ zero, zero */ -} - void cpu_configure(void) { diff --git a/sys/arch/sgi/sgi/autoconf.c b/sys/arch/sgi/sgi/autoconf.c index 4120664448a..928297219b2 100644 --- a/sys/arch/sgi/sgi/autoconf.c +++ b/sys/arch/sgi/sgi/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.41 2017/06/08 11:47:25 visa Exp $ */ +/* $OpenBSD: autoconf.c,v 1.42 2017/06/08 12:02:52 visa Exp $ */ /* * Copyright (c) 2009, 2010 Miodrag Vallat. * @@ -129,17 +129,6 @@ int16_t currentnasid = 0; char osloadpartition[256]; char osloadoptions[129]; -void -unmap_startup(void) -{ - extern uint32_t kernel_text[], endboot[]; - uint32_t *word = kernel_text; - - /* Cannot unmap kseg0 or xkphys; smash with trap. */ - while (word < endboot) - *word++ = 0x00000034u; /* TEQ zero, zero */ -} - /* * Configure all devices found that we know about. * This is done at boot time. -- 2.20.1