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().
This commit is contained in:
parent
677cac1588
commit
1c4039c864
@ -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 (;;) {
|
||||
|
Loading…
Reference in New Issue
Block a user