Module Name:    src
Committed By:   uwe
Date:           Sat Dec 17 01:32:22 UTC 2016

Modified Files:
        src/sys/arch/landisk/landisk: machdep.c

Log Message:
PR 51724 - landisk fails to reboot.

machine_reset() - instead of trying to cause an invalid data access
that gcc will optimize away, just use "trapa" instruction.

G/c assignment to EXPEVT, it will be set by the actual reset.  That
assignment has been probably cargo-culted from cpu_reset() that
manually jumps to 0xa0000000 (the reset address) instead of triggering
a reset.

TODO: This code should be SuperH generic cpu_reset().


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/landisk/landisk/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/landisk/landisk/machdep.c
diff -u src/sys/arch/landisk/landisk/machdep.c:1.19 src/sys/arch/landisk/landisk/machdep.c:1.20
--- src/sys/arch/landisk/landisk/machdep.c:1.19	Sat Dec 17 01:10:38 2016
+++ src/sys/arch/landisk/landisk/machdep.c	Sat Dec 17 01:32:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.19 2016/12/17 01:10:38 uwe Exp $	*/
+/*	$NetBSD: machdep.c,v 1.20 2016/12/17 01:32:22 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2016/12/17 01:10:38 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.20 2016/12/17 01:32:22 uwe Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -375,8 +375,7 @@ machine_reset(void)
 {
 
 	_cpu_exception_suspend();
-	_reg_write_4(SH_(EXPEVT), EXPEVT_RESET_MANUAL);
-	(void)*(volatile uint32_t *)0x80000001;	/* CPU shutdown */
+	asm("trapa #0");
 
 	/*NOTREACHED*/
 	for (;;) {

Reply via email to