Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181067
b: refs/heads/master
c: 2264873
h: refs/heads/master
i:
  181065: 661a16a
  181063: f88048a
v: v3
  • Loading branch information
Paul Mundt committed Dec 22, 2009
1 parent bd0d45a commit 505eff0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b74ab703b1326aafadb5604ff6200da62c61df49
refs/heads/master: 22648735405f73299b717bb5933767e9a9c335ca
1 change: 0 additions & 1 deletion trunk/arch/sh/kernel/debugtraps.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <linux/linkage.h>

#if !defined(CONFIG_KGDB)
#define breakpoint_trap_handler debug_trap_handler
#define singlestep_trap_handler debug_trap_handler
#endif

Expand Down
46 changes: 41 additions & 5 deletions trunk/arch/sh/kernel/kgdb.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SuperH KGDB support
*
* Copyright (C) 2008 Paul Mundt
* Copyright (C) 2008 - 2009 Paul Mundt
*
* Single stepping taken from the old stub by Henry Bell and Jeremy Siegel.
*
Expand Down Expand Up @@ -251,24 +251,60 @@ BUILD_TRAP_HANDLER(singlestep)
local_irq_restore(flags);
}

static int __kgdb_notify(struct die_args *args, unsigned long cmd)
{
int ret;

switch (cmd) {
case DIE_BREAKPOINT:
/*
* This means a user thread is single stepping
* a system call which should be ignored
*/
if (test_thread_flag(TIF_SINGLESTEP))
return NOTIFY_DONE;

ret = kgdb_handle_exception(args->trapnr & 0xff, args->signr,
args->err, args->regs);
if (ret)
return NOTIFY_DONE;

break;
}

BUILD_TRAP_HANDLER(breakpoint)
return NOTIFY_STOP;
}

static int
kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
{
unsigned long flags;
TRAP_HANDLER_DECL;
int ret;

local_irq_save(flags);
kgdb_handle_exception(vec >> 2, SIGTRAP, 0, regs);
ret = __kgdb_notify(ptr, cmd);
local_irq_restore(flags);

return ret;
}

static struct notifier_block kgdb_notifier = {
.notifier_call = kgdb_notify,

/*
* Lowest-prio notifier priority, we want to be notified last:
*/
.priority = -INT_MAX,
};

int kgdb_arch_init(void)
{
return 0;
return register_die_notifier(&kgdb_notifier);
}

void kgdb_arch_exit(void)
{
unregister_die_notifier(&kgdb_notifier);
}

struct kgdb_arch arch_kgdb_ops = {
Expand Down

0 comments on commit 505eff0

Please sign in to comment.