aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-sparc/irq.h2
-rw-r--r--include/asm-sparc/smp.h8
-rw-r--r--include/asm-sparc/spinlock.h3
-rw-r--r--include/asm-sparc64/cpudata.h19
-rw-r--r--include/asm-sparc64/hardirq.h2
-rw-r--r--include/asm-sparc64/hw_irq.h2
-rw-r--r--include/asm-sparc64/irq.h96
-rw-r--r--include/asm-sparc64/pil.h7
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
19BTFIXUPDEF_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
148void 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)));
80extern struct trap_per_cpu trap_block[NR_CPUS]; 82extern struct trap_per_cpu trap_block[NR_CPUS];
81extern void init_cur_cpu_trap(struct thread_info *); 83extern 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
15void 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. */ 4extern 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
18struct ino_bucket;
19
20#define MAX_IRQ_DESC_ACTION 4
21
22struct 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 */
38struct 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 */
93extern 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
101static __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
43extern 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)
112extern void disable_irq(unsigned int); 47extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
113#define disable_irq_nosync disable_irq 48extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
114extern void enable_irq(unsigned int);
115extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap);
116extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsigned char flags);
117extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 49extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
118 50
119static __inline__ void set_softint(unsigned long bits) 51static __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
142struct irqaction;
143struct pt_regs;
144int 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 || \