Commit b3df3468 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Add sparc64die_chain as on x86{,_64}

parent 59e6ca0b
......@@ -36,10 +36,24 @@
#include <asm/psrcompat.h>
#include <asm/processor.h>
#include <asm/timer.h>
#include <asm/kdebug.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
struct notifier_block *sparc64die_chain;
static spinlock_t die_notifier_lock = SPIN_LOCK_UNLOCKED;
int register_die_notifier(struct notifier_block *nb)
{
int err = 0;
unsigned long flags;
spin_lock_irqsave(&die_notifier_lock, flags);
err = notifier_chain_register(&sparc64die_chain, nb);
spin_unlock_irqrestore(&die_notifier_lock, flags);
return err;
}
/* When an irrecoverable trap occurs at tl > 0, the trap entry
* code logs the trap state registers at every level in the trap
* stack. It is found at (pt_regs + sizeof(pt_regs)) and the layout
......
#ifndef _SPARC64_KDEBUG_H
#define _SPARC64_KDEBUG_H
/*
* No kernel debugger on sparc64. Kept here because drivers/sbus/char/
* includes it for sparc32 sake.
/* Nearly identical to x86_64/i386 code. */
#include <linux/notifier.h>
struct pt_regs;
struct die_args {
struct pt_regs *regs;
const char *str;
long err;
int trapnr;
int signr;
};
/* Note - you should never unregister because that can race with NMIs.
* If you really want to do it first unregister - then synchronize_kernel
* - then free.
*/
int register_die_notifier(struct notifier_block *nb);
extern struct notifier_block *sparc64die_chain;
/* Grossly misnamed. */
enum die_val {
DIE_OOPS = 1,
DIE_DEBUG,
DIE_PANIC,
DIE_NMI,
DIE_DIE,
DIE_KERNELDEBUG,
DIE_TRAP,
DIE_GPF,
DIE_CALL,
DIE_PAGE_FAULT,
};
static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs,
long err, int trap, int sig)
{
struct die_args args = { .regs = regs,
.str = str,
.err = err,
.trapnr = trap,
.signr = sig };
return notifier_call_chain(&sparc64die_chain, val, &args);
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment