Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204956
b: refs/heads/master
c: 62a0309
h: refs/heads/master
v: v3
  • Loading branch information
Jason Wessel committed Aug 5, 2010
1 parent 4eb3a43 commit d0c9bbe
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d855b1d83c980c1283d98d2d63a2bd3a87e21b7
refs/heads/master: 62a0309c4c99274052e4829ed6a8fe579dd2c767
34 changes: 34 additions & 0 deletions trunk/arch/arm/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Deepak Saxena <dsaxena@plexity.net>
*/
#include <linux/irq.h>
#include <linux/kdebug.h>
#include <linux/kgdb.h>
#include <asm/traps.h>

Expand Down Expand Up @@ -180,6 +181,33 @@ void kgdb_roundup_cpus(unsigned long flags)
local_irq_disable();
}

static int __kgdb_notify(struct die_args *args, unsigned long cmd)
{
struct pt_regs *regs = args->regs;

if (kgdb_handle_exception(1, args->signr, cmd, regs))
return NOTIFY_DONE;
return NOTIFY_STOP;
}
static int
kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
{
unsigned long flags;
int ret;

local_irq_save(flags);
ret = __kgdb_notify(ptr, cmd);
local_irq_restore(flags);

return ret;
}

static struct notifier_block kgdb_notifier = {
.notifier_call = kgdb_notify,
.priority = -INT_MAX,
};


/**
* kgdb_arch_init - Perform any architecture specific initalization.
*
Expand All @@ -188,6 +216,11 @@ void kgdb_roundup_cpus(unsigned long flags)
*/
int kgdb_arch_init(void)
{
int ret = register_die_notifier(&kgdb_notifier);

if (ret != 0)
return ret;

register_undef_hook(&kgdb_brkpt_hook);
register_undef_hook(&kgdb_compiled_brkpt_hook);

Expand All @@ -204,6 +237,7 @@ void kgdb_arch_exit(void)
{
unregister_undef_hook(&kgdb_brkpt_hook);
unregister_undef_hook(&kgdb_compiled_brkpt_hook);
unregister_die_notifier(&kgdb_notifier);
}

/*
Expand Down

0 comments on commit d0c9bbe

Please sign in to comment.