| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #ifndef __ASM_ARM_IRQ_H
 | 
					
						
							|  |  |  | #define __ASM_ARM_IRQ_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-03 15:17:23 -06:00
										 |  |  | #define NR_IRQS_LEGACY	16
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef CONFIG_SPARSE_IRQ
 | 
					
						
							| 
									
										
										
										
											2008-08-05 16:14:15 +01:00
										 |  |  | #include <mach/irqs.h>
 | 
					
						
							| 
									
										
										
										
											2012-01-03 15:17:23 -06:00
										 |  |  | #else
 | 
					
						
							|  |  |  | #define NR_IRQS NR_IRQS_LEGACY
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifndef irq_canonicalize
 | 
					
						
							|  |  |  | #define irq_canonicalize(i)	(i)
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Use this value to indicate lack of interrupt | 
					
						
							|  |  |  |  * capability | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #ifndef NO_IRQ
 | 
					
						
							|  |  |  | #define NO_IRQ	((unsigned int)(-1))
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-12-27 22:56:44 +01:00
										 |  |  | #ifndef __ASSEMBLY__
 | 
					
						
							|  |  |  | struct irqaction; | 
					
						
							| 
									
										
										
										
											2010-03-29 05:29:57 +01:00
										 |  |  | struct pt_regs; | 
					
						
							| 
									
										
										
										
											2005-11-02 22:24:33 +00:00
										 |  |  | extern void migrate_irqs(void); | 
					
						
							| 
									
										
										
										
											2008-09-06 10:56:27 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | extern void asm_do_IRQ(unsigned int, struct pt_regs *); | 
					
						
							| 
									
										
											  
											
												ARM: introduce handle_IRQ() not to dump exception stack
On Mon, Jul 11, 2011 at 3:52 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
...
> The __exception annotation on a function causes this to happen:
>
> [<c002406c>] (asm_do_IRQ+0x6c/0x8c) from [<c0024b84>]
> (__irq_svc+0x44/0xcc)
> Exception stack(0xc3897c78 to 0xc3897cc0)
> 7c60:                                                       4022d320 4022e000
> 7c80: 08000075 00001000 c32273c0 c03ce1c0 c2b49b78 4022d000 c2b420b4 00000001
> 7ca0: 00000000 c3897cfc 00000000 c3897cc0 c00afc54 c002edd8 00000013 ffffffff
>
> Where that stack dump represents the pt_regs for the exception which
> happened.  Any function found in while unwinding will cause this to
> be printed.
>
> If you insert a C function between the IRQ assembly and asm_do_IRQ,
> the
> dump you get from asm_do_IRQ will be the stack for your function,
> not
> the pt_regs.  That makes the feature useless.
>
When __irq_svc - or any of the other exception handling assembly code -
calls the C code, the stack pointer will be pointing at the pt_regs
structure.
All the entry points into C code from the exception handling code are
marked with __exception or __exception_irq_enter to indicate that they
are one of the functions which has pt_regs above them.
Normally, when you've entered asm_do_IRQ() you will have this stack
layout (higher address towards top):
       pt_regs
       asm_do_IRQ frame
If you insert a C function between the exception assembly code and
asm_do_IRQ, you end up with this stack layout instead:
       pt_regs
       your function frame
       asm_do_IRQ frame
This means when we unwind, we'll get to asm_do_IRQ, and rather than
dumping out the pt_regs, we'll dump out your functions stack frame
instead, because that's what is above the asm_do_IRQ stack frame
rather than the expected pt_regs structure.
The fix is to introduce handle_IRQ() for no exception stack dump, so
it can be called with MULTI_IRQ_HANDLER is selected and a C function
is between the assembly code and the actual IRQ handling code.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
											
										 
											2011-07-11 22:25:43 +01:00
										 |  |  | void handle_IRQ(unsigned int, struct pt_regs *); | 
					
						
							| 
									
										
										
										
											2008-09-06 10:56:27 +01:00
										 |  |  | void init_IRQ(void); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-12-27 22:56:44 +01:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 |