Thomas Gleixner | e6bea9c | 2011-02-09 13:16:52 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Internal header to deal with irq_desc->status which will be renamed |
| 3 | * to irq_desc->settings. |
| 4 | */ |
| 5 | enum { |
| 6 | _IRQ_DEFAULT_INIT_FLAGS = IRQ_DEFAULT_INIT_FLAGS, |
Thomas Gleixner | a005677 | 2011-02-08 17:11:03 +0100 | [diff] [blame] | 7 | _IRQ_PER_CPU = IRQ_PER_CPU, |
Thomas Gleixner | 876dbd4 | 2011-02-08 17:28:12 +0100 | [diff] [blame] | 8 | _IRQ_LEVEL = IRQ_LEVEL, |
Thomas Gleixner | 1ccb4e6 | 2011-02-09 14:44:17 +0100 | [diff] [blame^] | 9 | _IRQ_NOPROBE = IRQ_NOPROBE, |
| 10 | _IRQ_NOREQUEST = IRQ_NOREQUEST, |
| 11 | _IRQ_NOAUTOEN = IRQ_NOAUTOEN, |
| 12 | _IRQ_MOVE_PCNTXT = IRQ_MOVE_PCNTXT, |
Thomas Gleixner | a005677 | 2011-02-08 17:11:03 +0100 | [diff] [blame] | 13 | _IRQ_NO_BALANCING = IRQ_NO_BALANCING, |
Thomas Gleixner | 1ccb4e6 | 2011-02-09 14:44:17 +0100 | [diff] [blame^] | 14 | _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD, |
Thomas Gleixner | a005677 | 2011-02-08 17:11:03 +0100 | [diff] [blame] | 15 | _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK, |
Thomas Gleixner | e6bea9c | 2011-02-09 13:16:52 +0100 | [diff] [blame] | 16 | }; |
Thomas Gleixner | 009b4c3 | 2011-02-07 21:48:49 +0100 | [diff] [blame] | 17 | |
| 18 | #undef IRQ_INPROGRESS |
| 19 | #define IRQ_INPROGRESS GOT_YOU_MORON |
Thomas Gleixner | 163ef30 | 2011-02-08 11:39:15 +0100 | [diff] [blame] | 20 | #undef IRQ_REPLAY |
| 21 | #define IRQ_REPLAY GOT_YOU_MORON |
| 22 | #undef IRQ_WAITING |
| 23 | #define IRQ_WAITING GOT_YOU_MORON |
Thomas Gleixner | c1594b7 | 2011-02-07 22:11:30 +0100 | [diff] [blame] | 24 | #undef IRQ_DISABLED |
| 25 | #define IRQ_DISABLED GOT_YOU_MORON |
Thomas Gleixner | 2a0d6fb | 2011-02-08 12:17:57 +0100 | [diff] [blame] | 26 | #undef IRQ_PENDING |
| 27 | #define IRQ_PENDING GOT_YOU_MORON |
Thomas Gleixner | 6e40262 | 2011-02-08 12:36:06 +0100 | [diff] [blame] | 28 | #undef IRQ_MASKED |
| 29 | #define IRQ_MASKED GOT_YOU_MORON |
Thomas Gleixner | 6d2cd17 | 2011-02-08 14:34:18 +0100 | [diff] [blame] | 30 | #undef IRQ_WAKEUP |
| 31 | #define IRQ_WAKEUP GOT_YOU_MORON |
Thomas Gleixner | f230b6d | 2011-02-05 15:20:04 +0100 | [diff] [blame] | 32 | #undef IRQ_MOVE_PENDING |
| 33 | #define IRQ_MOVE_PENDING GOT_YOU_MORON |
Thomas Gleixner | a005677 | 2011-02-08 17:11:03 +0100 | [diff] [blame] | 34 | #undef IRQ_PER_CPU |
| 35 | #define IRQ_PER_CPU GOT_YOU_MORON |
| 36 | #undef IRQ_NO_BALANCING |
| 37 | #define IRQ_NO_BALANCING GOT_YOU_MORON |
Thomas Gleixner | 2bdd105 | 2011-02-08 17:22:00 +0100 | [diff] [blame] | 38 | #undef IRQ_AFFINITY_SET |
| 39 | #define IRQ_AFFINITY_SET GOT_YOU_MORON |
Thomas Gleixner | 876dbd4 | 2011-02-08 17:28:12 +0100 | [diff] [blame] | 40 | #undef IRQ_LEVEL |
| 41 | #define IRQ_LEVEL GOT_YOU_MORON |
Thomas Gleixner | 1ccb4e6 | 2011-02-09 14:44:17 +0100 | [diff] [blame^] | 42 | #undef IRQ_NOPROBE |
| 43 | #define IRQ_NOPROBE GOT_YOU_MORON |
| 44 | #undef IRQ_NOREQUEST |
| 45 | #define IRQ_NOREQUEST GOT_YOU_MORON |
| 46 | #undef IRQ_NOAUTOEN |
| 47 | #define IRQ_NOAUTOEN GOT_YOU_MORON |
| 48 | #undef IRQ_NESTED_THREAD |
| 49 | #define IRQ_NESTED_THREAD GOT_YOU_MORON |
Thomas Gleixner | a005677 | 2011-02-08 17:11:03 +0100 | [diff] [blame] | 50 | #undef IRQF_MODIFY_MASK |
| 51 | #define IRQF_MODIFY_MASK GOT_YOU_MORON |
| 52 | |
| 53 | static inline void |
| 54 | irq_settings_clr_and_set(struct irq_desc *desc, u32 clr, u32 set) |
| 55 | { |
| 56 | desc->status &= ~(clr & _IRQF_MODIFY_MASK); |
| 57 | desc->status |= (set & _IRQF_MODIFY_MASK); |
| 58 | } |
| 59 | |
| 60 | static inline bool irq_settings_is_per_cpu(struct irq_desc *desc) |
| 61 | { |
| 62 | return desc->status & _IRQ_PER_CPU; |
| 63 | } |
| 64 | |
| 65 | static inline void irq_settings_set_per_cpu(struct irq_desc *desc) |
| 66 | { |
| 67 | desc->status |= _IRQ_PER_CPU; |
| 68 | } |
| 69 | |
| 70 | static inline void irq_settings_set_no_balancing(struct irq_desc *desc) |
| 71 | { |
| 72 | desc->status |= _IRQ_NO_BALANCING; |
| 73 | } |
| 74 | |
| 75 | static inline bool irq_settings_has_no_balance_set(struct irq_desc *desc) |
| 76 | { |
| 77 | return desc->status & _IRQ_NO_BALANCING; |
| 78 | } |
Thomas Gleixner | 876dbd4 | 2011-02-08 17:28:12 +0100 | [diff] [blame] | 79 | |
| 80 | static inline u32 irq_settings_get_trigger_mask(struct irq_desc *desc) |
| 81 | { |
| 82 | return desc->status & IRQ_TYPE_SENSE_MASK; |
| 83 | } |
| 84 | |
| 85 | static inline void |
| 86 | irq_settings_set_trigger_mask(struct irq_desc *desc, u32 mask) |
| 87 | { |
| 88 | desc->status &= ~IRQ_TYPE_SENSE_MASK; |
| 89 | desc->status |= mask & IRQ_TYPE_SENSE_MASK; |
| 90 | } |
| 91 | |
| 92 | static inline bool irq_settings_is_level(struct irq_desc *desc) |
| 93 | { |
| 94 | return desc->status & _IRQ_LEVEL; |
| 95 | } |
| 96 | |
| 97 | static inline void irq_settings_clr_level(struct irq_desc *desc) |
| 98 | { |
| 99 | desc->status &= ~_IRQ_LEVEL; |
| 100 | } |
| 101 | |
| 102 | static inline void irq_settings_set_level(struct irq_desc *desc) |
| 103 | { |
| 104 | desc->status |= _IRQ_LEVEL; |
| 105 | } |
Thomas Gleixner | 1ccb4e6 | 2011-02-09 14:44:17 +0100 | [diff] [blame^] | 106 | |
| 107 | static inline bool irq_settings_can_request(struct irq_desc *desc) |
| 108 | { |
| 109 | return !(desc->status & _IRQ_NOREQUEST); |
| 110 | } |
| 111 | |
| 112 | static inline void irq_settings_clr_norequest(struct irq_desc *desc) |
| 113 | { |
| 114 | desc->status &= ~_IRQ_NOREQUEST; |
| 115 | } |
| 116 | |
| 117 | static inline void irq_settings_set_norequest(struct irq_desc *desc) |
| 118 | { |
| 119 | desc->status |= _IRQ_NOREQUEST; |
| 120 | } |
| 121 | |
| 122 | static inline bool irq_settings_can_probe(struct irq_desc *desc) |
| 123 | { |
| 124 | return !(desc->status & _IRQ_NOPROBE); |
| 125 | } |
| 126 | |
| 127 | static inline void irq_settings_clr_noprobe(struct irq_desc *desc) |
| 128 | { |
| 129 | desc->status &= ~_IRQ_NOPROBE; |
| 130 | } |
| 131 | |
| 132 | static inline void irq_settings_set_noprobe(struct irq_desc *desc) |
| 133 | { |
| 134 | desc->status |= _IRQ_NOPROBE; |
| 135 | } |
| 136 | |
| 137 | static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc) |
| 138 | { |
| 139 | return desc->status & _IRQ_MOVE_PCNTXT; |
| 140 | } |
| 141 | |
| 142 | static inline bool irq_settings_can_autoenable(struct irq_desc *desc) |
| 143 | { |
| 144 | return !(desc->status & _IRQ_NOAUTOEN); |
| 145 | } |
| 146 | |
| 147 | static inline bool irq_settings_is_nested_thread(struct irq_desc *desc) |
| 148 | { |
| 149 | return desc->status & _IRQ_NESTED_THREAD; |
| 150 | } |