-/* $OpenBSD: autoconf.c,v 1.10 2017/04/22 12:34:44 visa Exp $ */
+/* $OpenBSD: autoconf.c,v 1.11 2017/06/06 14:35:53 visa Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
*
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)
{
softintr_init();
(void)config_rootfound("mainbus", NULL);
+ unmap_startup();
+
splinit();
cold = 0;
}
-/* $OpenBSD: locore.S,v 1.13 2017/06/05 15:23:11 visa Exp $ */
+/* $OpenBSD: locore.S,v 1.14 2017/06/06 14:35:53 visa Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
blt t0, t1, 1b
sd v0, -8(t0) # store to randomdata
- /*
- * Smash the very early boot code by overwriting it.
- */
- li v0, 0x00000034 # TEQ zero, zero
- LA t0, start
- LA t1, endboot
-1:
- daddu t0, t0, 4
- blt t0, t1, 1b
- sw v0, -4(t0)
-
/*
* Initialize stack and call machine startup.
*/