Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325791
b: refs/heads/master
c: 5a14fea
h: refs/heads/master
i:
  325789: d4c3c70
  325787: 31a5d7e
  325783: 4ad1f52
  325775: a4a5121
  325759: 8d713cd
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent 4379460 commit 3270a82
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 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: c5dd553b9fd069892c9e2de734f4f604e280fa7a
refs/heads/master: 5a14fead07bcf4e0acc877a8d9e1d1f40a441153
3 changes: 3 additions & 0 deletions trunk/include/linux/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ extern void kgdb_arch_late(void);
* hardware breakpoints.
* @correct_hw_break: Allow an architecture to specify how to correct the
* hardware debug registers.
* @enable_nmi: Manage NMI-triggered entry to KGDB
*/
struct kgdb_arch {
unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE];
Expand All @@ -252,6 +253,8 @@ struct kgdb_arch {
void (*disable_hw_break)(struct pt_regs *regs);
void (*remove_all_hw_break)(void);
void (*correct_hw_break)(void);

void (*enable_nmi)(bool on);
};

/**
Expand Down
14 changes: 11 additions & 3 deletions trunk/kernel/debug/debug_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs)
{
struct kgdb_state kgdb_var;
struct kgdb_state *ks = &kgdb_var;
int ret = 0;

if (arch_kgdb_ops.enable_nmi)
arch_kgdb_ops.enable_nmi(0);

ks->cpu = raw_smp_processor_id();
ks->ex_vector = evector;
Expand All @@ -681,11 +685,15 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs)
ks->linux_regs = regs;

if (kgdb_reenter_check(ks))
return 0; /* Ouch, double exception ! */
goto out; /* Ouch, double exception ! */
if (kgdb_info[ks->cpu].enter_kgdb != 0)
return 0;
goto out;

return kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
ret = kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
out:
if (arch_kgdb_ops.enable_nmi)
arch_kgdb_ops.enable_nmi(1);
return ret;
}

int kgdb_nmicallback(int cpu, void *regs)
Expand Down

0 comments on commit 3270a82

Please sign in to comment.