11 #include <linux/kernel.h>
12 #include <linux/types.h>
14 #include <linux/sched.h>
15 #include <linux/pci.h>
18 #include <asm/ptrace.h>
21 #include <asm/mmu_context.h>
23 #include <asm/pgtable.h>
25 #include <asm/tlbflush.h>
40 static unsigned int hose_irq_masks[4] = {
41 0xff0000, 0xfe0000, 0xff0000, 0xff0000
43 static unsigned int cached_irq_masks[4];
47 rawhide_update_irq_hw(
int hose,
int mask)
54 #define hose_exists(h) \
55 (((h) < MCPCIA_MAX_HOSES) && (cached_irq_masks[(h)] != 0))
60 unsigned int mask, hose;
71 spin_lock(&rawhide_irq_lock);
72 mask |= cached_irq_masks[hose];
73 cached_irq_masks[hose] =
mask;
74 rawhide_update_irq_hw(hose, mask);
75 spin_unlock(&rawhide_irq_lock);
81 unsigned int mask, hose;
90 mask = ~(1 << irq) | hose_irq_masks[hose];
92 spin_lock(&rawhide_irq_lock);
93 mask &= cached_irq_masks[hose];
94 cached_irq_masks[hose] =
mask;
95 rawhide_update_irq_hw(hose, mask);
96 spin_unlock(&rawhide_irq_lock);
100 rawhide_mask_and_ack_irq(
struct irq_data *d)
102 unsigned int mask, mask1, hose;
103 unsigned int irq = d->
irq;
112 mask = ~mask1 | hose_irq_masks[hose];
114 spin_lock(&rawhide_irq_lock);
116 mask &= cached_irq_masks[hose];
117 cached_irq_masks[hose] =
mask;
118 rawhide_update_irq_hw(hose, mask);
123 spin_unlock(&rawhide_irq_lock);
126 static struct irq_chip rawhide_irq_type = {
128 .irq_unmask = rawhide_enable_irq,
129 .irq_mask = rawhide_disable_irq,
130 .irq_mask_ack = rawhide_mask_and_ack_irq,
134 rawhide_srm_device_interrupt(
unsigned long vector)
138 irq = (vector - 0x800) >> 4;
156 irq -= ((irq + 16) >> 2) & 0x38;
162 rawhide_init_irq(
void)
172 for (hose =
hose_head; hose; hose = hose->next) {
173 unsigned int h = hose->
index;
174 unsigned int mask = hose_irq_masks[
h];
176 cached_irq_masks[
h] =
mask;
181 for (i = 16; i < 128; ++
i) {
182 irq_set_chip_and_handler(i, &rawhide_irq_type,
229 { 16+16, 16+16, 16+16, 16+16, 16+16},
230 { 16+ 0, 16+ 0, 16+ 1, 16+ 2, 16+ 3},
231 { 16+ 4, 16+ 4, 16+ 5, 16+ 6, 16+ 7},
232 { 16+ 8, 16+ 8, 16+ 9, 16+10, 16+11},
233 { 16+12, 16+12, 16+13, 16+14, 16+15}
235 const long min_idsel = 1, max_idsel = 5, irqs_per_slot = 5;
240 irq += 24 * hose->
index;
249 struct alpha_machine_vector rawhide_mv
__initmv = {
250 .vector_name =
"Rawhide",
261 .device_interrupt = rawhide_srm_device_interrupt,
264 .init_irq = rawhide_init_irq,
268 .pci_map_irq = rawhide_map_irq,