From 31a6b2aa80b13e814595d6207a5adb9cfcb4ea97 Mon Sep 17 00:00:00 2001 From: scw Date: Sat, 17 May 2003 09:31:33 +0000 Subject: [PATCH] Mask off the lowest two bits of the disassembly start address. This avoids misaligned references caused by the SHmedia bit. --- sys/arch/sh5/sh5/db_disasm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/arch/sh5/sh5/db_disasm.c b/sys/arch/sh5/sh5/db_disasm.c index 2c8bad5f7634..efdafc51d622 100644 --- a/sys/arch/sh5/sh5/db_disasm.c +++ b/sys/arch/sh5/sh5/db_disasm.c @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.11 2002/12/06 10:12:13 scw Exp $ */ +/* $NetBSD: db_disasm.c,v 1.12 2003/05/17 09:31:33 scw Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -1091,6 +1091,11 @@ db_disasm(db_addr_t loc, boolean_t dummy) opcode_t op; const char *mnemonic, *comma = ""; + /* + * Ditch the SHmedia bit + */ + loc &= ~3; + if (loc < SH5_KSEG0_BASE) { op = fuword((void *)loc); if (op == 0xffffffff) {