From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] MIPS: traps.c: separate registers print stuff to show_regs()
Date: Tue, 10 Nov 2015 10:27:13 +0300 [thread overview]
Message-ID: <1447140436-29099-2-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1447140436-29099-1-git-send-email-antonynpavlov@gmail.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/lib/traps.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/arch/mips/lib/traps.c b/arch/mips/lib/traps.c
index 0a5914e..d69697d 100644
--- a/arch/mips/lib/traps.c
+++ b/arch/mips/lib/traps.c
@@ -96,13 +96,10 @@ static char *get_exc_name(u32 cause)
return "unknown exception";
}
-void barebox_exc_handler(const struct pt_regs *regs)
+static void show_regs(const struct pt_regs *regs)
{
- const int field = 2 * sizeof(unsigned long);
- unsigned int cause = regs->cp0_cause;
int i;
-
- printf("\nOoops, %s!\n\n", get_exc_name(cause));
+ const int field = 2 * sizeof(unsigned long);
/*
* Saved main processor registers
@@ -131,9 +128,17 @@ void barebox_exc_handler(const struct pt_regs *regs)
printf("epc : %0*lx\n", field, regs->cp0_epc);
printf("ra : %0*lx\n", field, regs->regs[31]);
- printf("Status: %08x\n", (uint32_t) regs->cp0_status);
- printf("Cause : %08x\n", cause);
+ printf("Status: %08x\n", (uint32_t)regs->cp0_status);
+ printf("Cause : %08x\n", (uint32_t)regs->cp0_cause);
printf("Config: %08x\n\n", read_c0_config());
+}
+
+void barebox_exc_handler(const struct pt_regs *regs)
+{
+ unsigned int cause = regs->cp0_cause;
+
+ printf("\nOoops, %s!\n\n", get_exc_name(cause));
+ show_regs(regs);
hang();
}
--
2.6.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-11-10 7:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 7:27 [PATCH 0/4] MIPS: support return from exception; allow user to pass incorrect address to md command Antony Pavlov
2015-11-10 7:27 ` Antony Pavlov [this message]
2015-11-10 7:27 ` [PATCH 2/4] MIPS: avoid excessive exception Antony Pavlov
2015-11-10 7:27 ` [PATCH 3/4] MIPS: import exception registers restoring macros from linux kernel Antony Pavlov
2015-11-10 7:27 ` [PATCH 4/4] MIPS: allow user to pass incorrect address to md command Antony Pavlov
2015-11-11 7:40 ` [PATCH 0/4] MIPS: support return from exception; " Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447140436-29099-2-git-send-email-antonynpavlov@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox