diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-20 20:39:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-20 20:39:28 -0400 |
commit | be883da7594b0a2a02074e683673ae0e522566a4 (patch) | |
tree | b62f2a8a069fb4d389935c0b2de9bc78798f50c2 /include | |
parent | 077e98945db7e54a9865b5f29a1f02f531eca414 (diff) | |
parent | 4c5eb38af2131d867842cdd09fa83a3ed77bfd26 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Update defconfig.
[SPARC64]: Don't double-export synchronize_irq.
[SPARC64]: Move over to GENERIC_HARDIRQS.
[SPARC64]: Virtualize IRQ numbers.
[SPARC64]: Kill ino_bucket->pil
[SPARC]: Kill __irq_itoa().
[SPARC64]: bp->pil can never be zero
[SPARC64]: Send all device interrupts via one PIL.
[SPARC]: Fix iommu_flush_iotlb end address
[SPARC]: Mark smp init functions as cpuinit
[SPARC]: Add missing rw can_lock macros
[SPARC]: Setup cpu_possible_map
[SPARC]: Add topology_init()
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc/irq.h | 2 | ||||
-rw-r--r-- | include/asm-sparc/smp.h | 8 | ||||
-rw-r--r-- | include/asm-sparc/spinlock.h | 3 | ||||
-rw-r--r-- | include/asm-sparc64/cpudata.h | 19 | ||||
-rw-r--r-- | include/asm-sparc64/hardirq.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/hw_irq.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/irq.h | 96 | ||||
-rw-r--r-- | include/asm-sparc64/pil.h | 7 |
8 files changed, 39 insertions, 100 deletions
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h index dbc687403208..f2d64537e29d 100644 --- a/include/asm-sparc/irq.h +++ b/include/asm-sparc/irq.h | |||
@@ -16,8 +16,6 @@ | |||
16 | 16 | ||
17 | #define __irq_ino(irq) irq | 17 | #define __irq_ino(irq) irq |
18 | #define __irq_pil(irq) irq | 18 | #define __irq_pil(irq) irq |
19 | BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int) | ||
20 | #define __irq_itoa(irq) BTFIXUP_CALL(__irq_itoa)(irq) | ||
21 | 19 | ||
22 | #define NR_IRQS 16 | 20 | #define NR_IRQS 16 |
23 | 21 | ||
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index 5a1b7e4e7cc9..b9da9a600e35 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h | |||
@@ -145,6 +145,8 @@ static inline int hard_smp_processor_id(void) | |||
145 | #define prof_multiplier(__cpu) cpu_data(__cpu).multiplier | 145 | #define prof_multiplier(__cpu) cpu_data(__cpu).multiplier |
146 | #define prof_counter(__cpu) cpu_data(__cpu).counter | 146 | #define prof_counter(__cpu) cpu_data(__cpu).counter |
147 | 147 | ||
148 | void smp_setup_cpu_possible_map(void); | ||
149 | |||
148 | #endif /* !(__ASSEMBLY__) */ | 150 | #endif /* !(__ASSEMBLY__) */ |
149 | 151 | ||
150 | /* Sparc specific messages. */ | 152 | /* Sparc specific messages. */ |
@@ -161,7 +163,11 @@ static inline int hard_smp_processor_id(void) | |||
161 | #define MBOX_IDLECPU2 0xFD | 163 | #define MBOX_IDLECPU2 0xFD |
162 | #define MBOX_STOPCPU2 0xFE | 164 | #define MBOX_STOPCPU2 0xFE |
163 | 165 | ||
164 | #endif /* SMP */ | 166 | #else /* SMP */ |
167 | |||
168 | #define smp_setup_cpu_possible_map() do { } while (0) | ||
169 | |||
170 | #endif /* !(SMP) */ | ||
165 | 171 | ||
166 | #define NO_PROC_ID 0xFF | 172 | #define NO_PROC_ID 0xFF |
167 | 173 | ||
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h index 3350c90c7869..1c75474ba1df 100644 --- a/include/asm-sparc/spinlock.h +++ b/include/asm-sparc/spinlock.h | |||
@@ -154,6 +154,9 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
154 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 154 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
155 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) | 155 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) |
156 | 156 | ||
157 | #define __raw_read_can_lock(rw) (!((rw)->lock & 0xff)) | ||
158 | #define __raw_write_can_lock(rw) (!(rw)->lock) | ||
159 | |||
157 | #endif /* !(__ASSEMBLY__) */ | 160 | #endif /* !(__ASSEMBLY__) */ |
158 | 161 | ||
159 | #endif /* __SPARC_SPINLOCK_H */ | 162 | #endif /* __SPARC_SPINLOCK_H */ |
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h index 9d6a6dbaf126..f2cc9411b4c7 100644 --- a/include/asm-sparc64/cpudata.h +++ b/include/asm-sparc64/cpudata.h | |||
@@ -74,8 +74,10 @@ struct trap_per_cpu { | |||
74 | unsigned long tsb_huge; | 74 | unsigned long tsb_huge; |
75 | unsigned long tsb_huge_temp; | 75 | unsigned long tsb_huge_temp; |
76 | 76 | ||
77 | /* Dcache line 8: Unused, needed to keep trap_block a power-of-2 in size. */ | 77 | /* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */ |
78 | unsigned long __pad2[4]; | 78 | unsigned int irq_worklist; |
79 | unsigned int __pad1; | ||
80 | unsigned long __pad2[3]; | ||
79 | } __attribute__((aligned(64))); | 81 | } __attribute__((aligned(64))); |
80 | extern struct trap_per_cpu trap_block[NR_CPUS]; | 82 | extern struct trap_per_cpu trap_block[NR_CPUS]; |
81 | extern void init_cur_cpu_trap(struct thread_info *); | 83 | extern void init_cur_cpu_trap(struct thread_info *); |
@@ -119,6 +121,7 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch, | |||
119 | #define TRAP_PER_CPU_CPU_LIST_PA 0xc8 | 121 | #define TRAP_PER_CPU_CPU_LIST_PA 0xc8 |
120 | #define TRAP_PER_CPU_TSB_HUGE 0xd0 | 122 | #define TRAP_PER_CPU_TSB_HUGE 0xd0 |
121 | #define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 | 123 | #define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 |
124 | #define TRAP_PER_CPU_IRQ_WORKLIST 0xe0 | ||
122 | 125 | ||
123 | #define TRAP_BLOCK_SZ_SHIFT 8 | 126 | #define TRAP_BLOCK_SZ_SHIFT 8 |
124 | 127 | ||
@@ -171,11 +174,8 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch, | |||
171 | 174 | ||
172 | /* Clobbers TMP, loads local processor's IRQ work area into DEST. */ | 175 | /* Clobbers TMP, loads local processor's IRQ work area into DEST. */ |
173 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ | 176 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ |
174 | __GET_CPUID(TMP) \ | 177 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
175 | sethi %hi(__irq_work), DEST; \ | 178 | add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST; |
176 | sllx TMP, 6, TMP; \ | ||
177 | or DEST, %lo(__irq_work), DEST; \ | ||
178 | add DEST, TMP, DEST; | ||
179 | 179 | ||
180 | /* Clobbers TMP, loads DEST with current thread info pointer. */ | 180 | /* Clobbers TMP, loads DEST with current thread info pointer. */ |
181 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ | 181 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ |
@@ -211,9 +211,10 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch, | |||
211 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ | 211 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
212 | ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; | 212 | ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; |
213 | 213 | ||
214 | /* Clobbers TMP, loads local processor's IRQ work area into DEST. */ | ||
214 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ | 215 | #define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ |
215 | sethi %hi(__irq_work), DEST; \ | 216 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
216 | or DEST, %lo(__irq_work), DEST; | 217 | add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST; |
217 | 218 | ||
218 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ | 219 | #define TRAP_LOAD_THREAD_REG(DEST, TMP) \ |
219 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ | 220 | TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ |
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h index f0cf71376ec5..7c29fd1a87aa 100644 --- a/include/asm-sparc64/hardirq.h +++ b/include/asm-sparc64/hardirq.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #define local_softirq_pending() \ | 12 | #define local_softirq_pending() \ |
13 | (local_cpu_data().__softirq_pending) | 13 | (local_cpu_data().__softirq_pending) |
14 | 14 | ||
15 | void ack_bad_irq(unsigned int irq); | ||
16 | |||
15 | #define HARDIRQ_BITS 8 | 17 | #define HARDIRQ_BITS 8 |
16 | 18 | ||
17 | #endif /* !(__SPARC64_HARDIRQ_H) */ | 19 | #endif /* !(__SPARC64_HARDIRQ_H) */ |
diff --git a/include/asm-sparc64/hw_irq.h b/include/asm-sparc64/hw_irq.h index 153cae2ddaee..599b3b073450 100644 --- a/include/asm-sparc64/hw_irq.h +++ b/include/asm-sparc64/hw_irq.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifndef __ASM_SPARC64_HW_IRQ_H | 1 | #ifndef __ASM_SPARC64_HW_IRQ_H |
2 | #define __ASM_SPARC64_HW_IRQ_H | 2 | #define __ASM_SPARC64_HW_IRQ_H |
3 | 3 | ||
4 | /* Dummy include. */ | 4 | extern void hw_resend_irq(struct hw_interrupt_type *handler, unsigned int virt_irq); |
5 | 5 | ||
6 | #endif | 6 | #endif |
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h index fa164d37ee3f..905e59b4a737 100644 --- a/include/asm-sparc64/irq.h +++ b/include/asm-sparc64/irq.h | |||
@@ -15,58 +15,6 @@ | |||
15 | #include <asm/pil.h> | 15 | #include <asm/pil.h> |
16 | #include <asm/ptrace.h> | 16 | #include <asm/ptrace.h> |
17 | 17 | ||
18 | struct ino_bucket; | ||
19 | |||
20 | #define MAX_IRQ_DESC_ACTION 4 | ||
21 | |||
22 | struct irq_desc { | ||
23 | void (*pre_handler)(struct ino_bucket *, void *, void *); | ||
24 | void *pre_handler_arg1; | ||
25 | void *pre_handler_arg2; | ||
26 | u32 action_active_mask; | ||
27 | struct irqaction action[MAX_IRQ_DESC_ACTION]; | ||
28 | }; | ||
29 | |||
30 | /* You should not mess with this directly. That's the job of irq.c. | ||
31 | * | ||
32 | * If you make changes here, please update hand coded assembler of | ||
33 | * the vectored interrupt trap handler in entry.S -DaveM | ||
34 | * | ||
35 | * This is currently one DCACHE line, two buckets per L2 cache | ||
36 | * line. Keep this in mind please. | ||
37 | */ | ||
38 | struct ino_bucket { | ||
39 | /* Next handler in per-CPU PIL worklist. We know that | ||
40 | * bucket pointers have the high 32-bits clear, so to | ||
41 | * save space we only store the bits we need. | ||
42 | */ | ||
43 | /*0x00*/unsigned int irq_chain; | ||
44 | |||
45 | /* PIL to schedule this IVEC at. */ | ||
46 | /*0x04*/unsigned char pil; | ||
47 | |||
48 | /* If an IVEC arrives while irq_info is NULL, we | ||
49 | * set this to notify request_irq() about the event. | ||
50 | */ | ||
51 | /*0x05*/unsigned char pending; | ||
52 | |||
53 | /* Miscellaneous flags. */ | ||
54 | /*0x06*/unsigned char flags; | ||
55 | |||
56 | /* Currently unused. */ | ||
57 | /*0x07*/unsigned char __pad; | ||
58 | |||
59 | /* Reference to IRQ descriptor for this bucket. */ | ||
60 | /*0x08*/struct irq_desc *irq_info; | ||
61 | |||
62 | /* Sun5 Interrupt Clear Register. */ | ||
63 | /*0x10*/unsigned long iclr; | ||
64 | |||
65 | /* Sun5 Interrupt Mapping Register. */ | ||
66 | /*0x18*/unsigned long imap; | ||
67 | |||
68 | }; | ||
69 | |||
70 | /* IMAP/ICLR register defines */ | 18 | /* IMAP/ICLR register defines */ |
71 | #define IMAP_VALID 0x80000000 /* IRQ Enabled */ | 19 | #define IMAP_VALID 0x80000000 /* IRQ Enabled */ |
72 | #define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ | 20 | #define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ |
@@ -84,36 +32,20 @@ struct ino_bucket { | |||
84 | #define ICLR_TRANSMIT 0x00000001 /* Transmit state */ | 32 | #define ICLR_TRANSMIT 0x00000001 /* Transmit state */ |
85 | #define ICLR_PENDING 0x00000003 /* Pending state */ | 33 | #define ICLR_PENDING 0x00000003 /* Pending state */ |
86 | 34 | ||
87 | /* Only 8-bits are available, be careful. -DaveM */ | 35 | /* The largest number of unique interrupt sources we support. |
88 | #define IBF_PCI 0x02 /* PSYCHO/SABRE/SCHIZO PCI interrupt. */ | 36 | * If this needs to ever be larger than 255, you need to change |
89 | #define IBF_ACTIVE 0x04 /* Interrupt is active and has a handler.*/ | 37 | * the type of ino_bucket->virt_irq as appropriate. |
90 | #define IBF_INPROGRESS 0x10 /* IRQ is being serviced. */ | 38 | * |
91 | 39 | * ino_bucket->virt_irq allocation is made during {sun4v_,}build_irq(). | |
92 | #define NUM_IVECS (IMAP_INR + 1) | 40 | */ |
93 | extern struct ino_bucket ivector_table[NUM_IVECS]; | 41 | #define NR_IRQS 255 |
94 | |||
95 | #define __irq_ino(irq) \ | ||
96 | (((struct ino_bucket *)(unsigned long)(irq)) - &ivector_table[0]) | ||
97 | #define __irq_pil(irq) ((struct ino_bucket *)(unsigned long)(irq))->pil | ||
98 | #define __bucket(irq) ((struct ino_bucket *)(unsigned long)(irq)) | ||
99 | #define __irq(bucket) ((unsigned int)(unsigned long)(bucket)) | ||
100 | |||
101 | static __inline__ char *__irq_itoa(unsigned int irq) | ||
102 | { | ||
103 | static char buff[16]; | ||
104 | |||
105 | sprintf(buff, "%d,%x", __irq_pil(irq), (unsigned int)__irq_ino(irq)); | ||
106 | return buff; | ||
107 | } | ||
108 | |||
109 | #define NR_IRQS 16 | ||
110 | 42 | ||
43 | extern void irq_install_pre_handler(int virt_irq, | ||
44 | void (*func)(unsigned int, void *, void *), | ||
45 | void *arg1, void *arg2); | ||
111 | #define irq_canonicalize(irq) (irq) | 46 | #define irq_canonicalize(irq) (irq) |
112 | extern void disable_irq(unsigned int); | 47 | extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); |
113 | #define disable_irq_nosync disable_irq | 48 | extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); |
114 | extern void enable_irq(unsigned int); | ||
115 | extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap); | ||
116 | extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsigned char flags); | ||
117 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); | 49 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); |
118 | 50 | ||
119 | static __inline__ void set_softint(unsigned long bits) | 51 | static __inline__ void set_softint(unsigned long bits) |
@@ -139,8 +71,4 @@ static __inline__ unsigned long get_softint(void) | |||
139 | return retval; | 71 | return retval; |
140 | } | 72 | } |
141 | 73 | ||
142 | struct irqaction; | ||
143 | struct pt_regs; | ||
144 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
145 | |||
146 | #endif | 74 | #endif |
diff --git a/include/asm-sparc64/pil.h b/include/asm-sparc64/pil.h index 79f827eb3f5d..72927749aebf 100644 --- a/include/asm-sparc64/pil.h +++ b/include/asm-sparc64/pil.h | |||
@@ -5,9 +5,9 @@ | |||
5 | /* To avoid some locking problems, we hard allocate certain PILs | 5 | /* To avoid some locking problems, we hard allocate certain PILs |
6 | * for SMP cross call messages that must do a etrap/rtrap. | 6 | * for SMP cross call messages that must do a etrap/rtrap. |
7 | * | 7 | * |
8 | * A cli() does not block the cross call delivery, so when SMP | 8 | * A local_irq_disable() does not block the cross call delivery, so |
9 | * locking is an issue we reschedule the event into a PIL interrupt | 9 | * when SMP locking is an issue we reschedule the event into a PIL |
10 | * which is blocked by cli(). | 10 | * interrupt which is blocked by local_irq_disable(). |
11 | * | 11 | * |
12 | * In fact any XCALL which has to etrap/rtrap has a problem because | 12 | * In fact any XCALL which has to etrap/rtrap has a problem because |
13 | * it is difficult to prevent rtrap from running BH's, and that would | 13 | * it is difficult to prevent rtrap from running BH's, and that would |
@@ -17,6 +17,7 @@ | |||
17 | #define PIL_SMP_RECEIVE_SIGNAL 2 | 17 | #define PIL_SMP_RECEIVE_SIGNAL 2 |
18 | #define PIL_SMP_CAPTURE 3 | 18 | #define PIL_SMP_CAPTURE 3 |
19 | #define PIL_SMP_CTX_NEW_VERSION 4 | 19 | #define PIL_SMP_CTX_NEW_VERSION 4 |
20 | #define PIL_DEVICE_IRQ 5 | ||
20 | 21 | ||
21 | #ifndef __ASSEMBLY__ | 22 | #ifndef __ASSEMBLY__ |
22 | #define PIL_RESERVED(PIL) ((PIL) == PIL_SMP_CALL_FUNC || \ | 23 | #define PIL_RESERVED(PIL) ((PIL) == PIL_SMP_CALL_FUNC || \ |