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