Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153870
b: refs/heads/master
c: 6f10fda
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger committed Jun 23, 2009
1 parent 3aab3c2 commit 5a645a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 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: 46f288a0f983401ebadb918751d342cbf819cde5
refs/heads/master: 6f10fdabdce356aac3c948e659f39b6f1e2f7382
32 changes: 17 additions & 15 deletions trunk/arch/blackfin/kernel/irqchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ int show_interrupts(struct seq_file *p, void *v)
}
#endif

#ifdef CONFIG_DEBUG_STACKOVERFLOW
static void check_stack_overflow(int irq)
{
/* Debugging check for stack overflow: is there less than STACK_WARN free? */
long sp = __get_SP() & (THREAD_SIZE - 1);

if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
dump_stack();
pr_emerg("irq%i: possible stack overflow only %ld bytes free\n",
irq, sp - sizeof(struct thread_info));
}
}
#else
static inline void check_stack_overflow(int irq) { }
#endif

/*
* do_IRQ handles all hardware IRQs. Decoded IRQs should not
* come via this function. Instead, they should provide their
Expand All @@ -105,21 +121,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)

irq_enter();

#ifdef CONFIG_DEBUG_STACKOVERFLOW
/* Debugging check for stack overflow: is there less than STACK_WARN free? */
{
long sp;

sp = __get_SP() & (THREAD_SIZE-1);

if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
dump_stack();
printk(KERN_EMERG "%s: possible stack overflow while handling irq %i "
" only %ld bytes free\n",
__func__, irq, sp - sizeof(struct thread_info));
}
}
#endif
check_stack_overflow(irq);

/*
* Some hardware gives randomly wrong interrupts. Rather
Expand Down

0 comments on commit 5a645a3

Please sign in to comment.