All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Cernekee <cernekee@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Subject: [PATCH 8/9] MIPS: Add board_* hooks for ebase and NMI
Date: Sat, 05 Nov 2011 14:21:17 -0700	[thread overview]
Message-ID: <338065dfaf54d0ca25497eabf63a54f0@localhost> (raw)
In-Reply-To: <c2c8833593cb8eeef5c102468e105497@localhost>

Certain BMIPS platforms need to move the exception vectors and/or
intercept NMI events.  Add hooks to make this possible.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 arch/mips/include/asm/traps.h |    2 ++
 arch/mips/kernel/traps.c      |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/traps.h b/arch/mips/include/asm/traps.h
index 90ff2f4..2954bd9 100644
--- a/arch/mips/include/asm/traps.h
+++ b/arch/mips/include/asm/traps.h
@@ -22,7 +22,9 @@ extern void (*board_be_init)(void);
 extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
 
 extern void (*board_nmi_handler_setup)(void);
+extern void (*board_nmi_handler)(struct pt_regs *regs);
 extern void (*board_ejtag_handler_setup)(void);
 extern void (*board_bind_eic_interrupt)(int irq, int regset);
+extern void (*board_ebase_setup)(void);
 
 #endif /* _ASM_TRAPS_H */
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index cbea618..f98349c 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -90,8 +90,10 @@ extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
 void (*board_be_init)(void);
 int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
 void (*board_nmi_handler_setup)(void);
+void (*board_nmi_handler)(struct pt_regs *regs);
 void (*board_ejtag_handler_setup)(void);
 void (*board_bind_eic_interrupt)(int irq, int regset);
+void (*board_ebase_setup)(void);
 
 
 static void show_raw_backtrace(unsigned long reg29)
@@ -1343,6 +1345,8 @@ void ejtag_exception_handler(struct pt_regs *regs)
  */
 NORET_TYPE void ATTRIB_NORET nmi_exception_handler(struct pt_regs *regs)
 {
+	if (board_nmi_handler)
+		board_nmi_handler(regs);
 	bust_spinlocks(1);
 	printk("NMI taken!!!!\n");
 	die("NMI", regs);
@@ -1682,6 +1686,8 @@ void __init trap_init(void)
 			ebase += (read_c0_ebase() & 0x3ffff000);
 	}
 
+	if (board_ebase_setup)
+		board_ebase_setup();
 	per_cpu_trap_init();
 
 	/*
-- 
1.7.6.3

  parent reply	other threads:[~2011-11-05 21:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-05 21:21 [PATCH RESEND 1/9] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu Kevin Cernekee
2011-11-05 21:21 ` [PATCH 2/9] MIPS: BMIPS: Fix up Kconfig settings Kevin Cernekee
2011-11-05 21:21 ` [PATCH 3/9] MIPS: BMIPS: Add XKS01 feature flag to Kconfig Kevin Cernekee
2011-11-08 15:49   ` Ralf Baechle
2011-11-05 21:21 ` [PATCH 4/9] MIPS: Clean up whitespace warning in hazards.h Kevin Cernekee
2011-11-05 21:21 ` [PATCH 5/9] MIPS: BMIPS: Add CFLAGS, Makefile entries for BMIPS Kevin Cernekee
2011-11-05 21:21 ` [PATCH 6/9] MIPS: BMIPS: Add set/clear CP0 macros for BMIPS operations Kevin Cernekee
2011-11-05 21:21 ` [PATCH 7/9] MIPS: BMIPS: Introduce bmips.h Kevin Cernekee
2011-11-08 15:03   ` Ralf Baechle
2011-11-05 21:21 ` Kevin Cernekee [this message]
2011-11-08 15:23   ` [PATCH 8/9] MIPS: Add board_* hooks for ebase and NMI Ralf Baechle
2011-11-05 21:21 ` [PATCH 9/9] MIPS: BMIPS: Add SMP support code for BMIPS43xx/BMIPS5000 Kevin Cernekee
2011-11-08 15:56   ` Ralf Baechle
2011-11-08 16:47 ` [PATCH RESEND 1/9] MIPS: Add local_flush_tlb_all_mm to clear all mm contexts on calling cpu Ralf Baechle
2011-11-08 19:40   ` Kevin Cernekee
2011-11-09  5:33   ` Kevin Cernekee
2011-11-09 13:11     ` Ralf Baechle

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=338065dfaf54d0ca25497eabf63a54f0@localhost \
    --to=cernekee@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.