Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Russell King | 4baa992 | 2008-08-02 10:55:55 +0100 | [diff] [blame] | 2 | * arch/arm/include/asm/mach/irq.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 1995-2000 Russell King. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | #ifndef __ASM_ARM_MACH_IRQ_H |
| 11 | #define __ASM_ARM_MACH_IRQ_H |
| 12 | |
Thomas Gleixner | 4a2581a | 2006-07-01 22:30:09 +0100 | [diff] [blame] | 13 | #include <linux/irq.h> |
| 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | struct seq_file; |
| 16 | |
Russell King | 664399e | 2005-09-04 19:45:00 +0100 | [diff] [blame] | 17 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | * This is internal. Do not use it. |
| 19 | */ |
Shawn Guo | bc89663 | 2012-06-28 14:42:08 +0800 | [diff] [blame] | 20 | extern void init_FIQ(int); |
Russell King | f13cd41 | 2010-11-15 14:33:51 +0000 | [diff] [blame] | 21 | extern int show_fiq_list(struct seq_file *, int); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
| 23 | /* |
Thomas Gleixner | 4a2581a | 2006-07-01 22:30:09 +0100 | [diff] [blame] | 24 | * This is for easy migration, but should be changed in the source |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | */ |
Linus Torvalds | 0cd61b6 | 2006-10-06 10:53:39 -0700 | [diff] [blame] | 26 | #define do_bad_IRQ(irq,desc) \ |
Thomas Gleixner | 4a2581a | 2006-07-01 22:30:09 +0100 | [diff] [blame] | 27 | do { \ |
Thomas Gleixner | 239007b | 2009-11-17 16:46:45 +0100 | [diff] [blame] | 28 | raw_spin_lock(&desc->lock); \ |
Linus Torvalds | 0cd61b6 | 2006-10-06 10:53:39 -0700 | [diff] [blame] | 29 | handle_bad_irq(irq, desc); \ |
Thomas Gleixner | 239007b | 2009-11-17 16:46:45 +0100 | [diff] [blame] | 30 | raw_spin_unlock(&desc->lock); \ |
Thomas Gleixner | 4a2581a | 2006-07-01 22:30:09 +0100 | [diff] [blame] | 31 | } while(0) |
| 32 | |
Will Deacon | 10a8c38 | 2011-03-14 14:00:30 +0100 | [diff] [blame] | 33 | #ifndef __ASSEMBLY__ |
| 34 | /* |
| 35 | * Entry/exit functions for chained handlers where the primary IRQ chip |
| 36 | * may implement either fasteoi or level-trigger flow control. |
| 37 | */ |
| 38 | static inline void chained_irq_enter(struct irq_chip *chip, |
| 39 | struct irq_desc *desc) |
| 40 | { |
| 41 | /* FastEOI controllers require no action on entry. */ |
| 42 | if (chip->irq_eoi) |
| 43 | return; |
| 44 | |
| 45 | if (chip->irq_mask_ack) { |
| 46 | chip->irq_mask_ack(&desc->irq_data); |
| 47 | } else { |
| 48 | chip->irq_mask(&desc->irq_data); |
| 49 | if (chip->irq_ack) |
| 50 | chip->irq_ack(&desc->irq_data); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | static inline void chained_irq_exit(struct irq_chip *chip, |
| 55 | struct irq_desc *desc) |
| 56 | { |
| 57 | if (chip->irq_eoi) |
| 58 | chip->irq_eoi(&desc->irq_data); |
| 59 | else |
| 60 | chip->irq_unmask(&desc->irq_data); |
| 61 | } |
| 62 | #endif |
| 63 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | #endif |