diff options
-rw-r--r-- | arch/sparc/kernel/entry.S | 14 | ||||
-rw-r--r-- | arch/sparc/kernel/irq.c | 27 | ||||
-rw-r--r-- | arch/sparc/kernel/irq.h | 68 | ||||
-rw-r--r-- | arch/sparc/kernel/pcic.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/sparc_ksyms.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4c_irq.c | 15 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4d_irq.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4d_smp.c | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4m_irq.c | 74 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4m_smp.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/tick14.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/time.c | 2 | ||||
-rw-r--r-- | arch/sparc/mm/init.c | 3 | ||||
-rw-r--r-- | arch/sparc/mm/srmmu.c | 2 | ||||
-rw-r--r-- | arch/sparc/mm/sun4c.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/sparc64_ksyms.c | 1 | ||||
-rw-r--r-- | include/asm-sparc/irq.h | 168 | ||||
-rw-r--r-- | include/asm-sparc/pgtable.h | 3 |
19 files changed, 217 insertions, 182 deletions
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index 831f540251f8..eac38388f5fd 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S | |||
@@ -1749,8 +1749,8 @@ fpload: | |||
1749 | __ndelay: | 1749 | __ndelay: |
1750 | save %sp, -STACKFRAME_SZ, %sp | 1750 | save %sp, -STACKFRAME_SZ, %sp |
1751 | mov %i0, %o0 | 1751 | mov %i0, %o0 |
1752 | call .umul | 1752 | call .umul ! round multiplier up so large ns ok |
1753 | mov 0x1ad, %o1 ! 2**32 / (1 000 000 000 / HZ) | 1753 | mov 0x1ae, %o1 ! 2**32 / (1 000 000 000 / HZ) |
1754 | call .umul | 1754 | call .umul |
1755 | mov %i1, %o1 ! udelay_val | 1755 | mov %i1, %o1 ! udelay_val |
1756 | ba delay_continue | 1756 | ba delay_continue |
@@ -1760,11 +1760,17 @@ __ndelay: | |||
1760 | __udelay: | 1760 | __udelay: |
1761 | save %sp, -STACKFRAME_SZ, %sp | 1761 | save %sp, -STACKFRAME_SZ, %sp |
1762 | mov %i0, %o0 | 1762 | mov %i0, %o0 |
1763 | sethi %hi(0x10c6), %o1 | 1763 | sethi %hi(0x10c7), %o1 ! round multiplier up so large us ok |
1764 | call .umul | 1764 | call .umul |
1765 | or %o1, %lo(0x10c6), %o1 ! 2**32 / 1 000 000 | 1765 | or %o1, %lo(0x10c7), %o1 ! 2**32 / 1 000 000 |
1766 | call .umul | 1766 | call .umul |
1767 | mov %i1, %o1 ! udelay_val | 1767 | mov %i1, %o1 ! udelay_val |
1768 | sethi %hi(0x028f4b62), %l0 ! Add in rounding constant * 2**32, | ||
1769 | or %g0, %lo(0x028f4b62), %l0 | ||
1770 | addcc %o0, %l0, %o0 ! 2**32 * 0.009 999 | ||
1771 | bcs,a 3f | ||
1772 | add %o1, 0x01, %o1 | ||
1773 | 3: | ||
1768 | call .umul | 1774 | call .umul |
1769 | mov HZ, %o0 ! >>32 earlier for wider range | 1775 | mov HZ, %o0 ! >>32 earlier for wider range |
1770 | 1776 | ||
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c index f257a67bcf93..75b2240ad0f9 100644 --- a/arch/sparc/kernel/irq.c +++ b/arch/sparc/kernel/irq.c | |||
@@ -47,6 +47,8 @@ | |||
47 | #include <asm/cacheflush.h> | 47 | #include <asm/cacheflush.h> |
48 | #include <asm/irq_regs.h> | 48 | #include <asm/irq_regs.h> |
49 | 49 | ||
50 | #include "irq.h" | ||
51 | |||
50 | #ifdef CONFIG_SMP | 52 | #ifdef CONFIG_SMP |
51 | #define SMP_NOP2 "nop; nop;\n\t" | 53 | #define SMP_NOP2 "nop; nop;\n\t" |
52 | #define SMP_NOP3 "nop; nop; nop;\n\t" | 54 | #define SMP_NOP3 "nop; nop; nop;\n\t" |
@@ -268,7 +270,7 @@ void free_irq(unsigned int irq, void *dev_id) | |||
268 | kfree(action); | 270 | kfree(action); |
269 | 271 | ||
270 | if (!sparc_irq[cpu_irq].action) | 272 | if (!sparc_irq[cpu_irq].action) |
271 | disable_irq(irq); | 273 | __disable_irq(irq); |
272 | 274 | ||
273 | out_unlock: | 275 | out_unlock: |
274 | spin_unlock_irqrestore(&irq_action_lock, flags); | 276 | spin_unlock_irqrestore(&irq_action_lock, flags); |
@@ -464,7 +466,7 @@ int request_fast_irq(unsigned int irq, | |||
464 | 466 | ||
465 | sparc_irq[cpu_irq].action = action; | 467 | sparc_irq[cpu_irq].action = action; |
466 | 468 | ||
467 | enable_irq(irq); | 469 | __enable_irq(irq); |
468 | 470 | ||
469 | ret = 0; | 471 | ret = 0; |
470 | out_unlock: | 472 | out_unlock: |
@@ -544,7 +546,7 @@ int request_irq(unsigned int irq, | |||
544 | 546 | ||
545 | *actionp = action; | 547 | *actionp = action; |
546 | 548 | ||
547 | enable_irq(irq); | 549 | __enable_irq(irq); |
548 | 550 | ||
549 | ret = 0; | 551 | ret = 0; |
550 | out_unlock: | 552 | out_unlock: |
@@ -555,6 +557,25 @@ out: | |||
555 | 557 | ||
556 | EXPORT_SYMBOL(request_irq); | 558 | EXPORT_SYMBOL(request_irq); |
557 | 559 | ||
560 | void disable_irq_nosync(unsigned int irq) | ||
561 | { | ||
562 | return __disable_irq(irq); | ||
563 | } | ||
564 | EXPORT_SYMBOL(disable_irq_nosync); | ||
565 | |||
566 | void disable_irq(unsigned int irq) | ||
567 | { | ||
568 | return __disable_irq(irq); | ||
569 | } | ||
570 | EXPORT_SYMBOL(disable_irq); | ||
571 | |||
572 | void enable_irq(unsigned int irq) | ||
573 | { | ||
574 | return __enable_irq(irq); | ||
575 | } | ||
576 | |||
577 | EXPORT_SYMBOL(enable_irq); | ||
578 | |||
558 | /* We really don't need these at all on the Sparc. We only have | 579 | /* We really don't need these at all on the Sparc. We only have |
559 | * stubs here because they are exported to modules. | 580 | * stubs here because they are exported to modules. |
560 | */ | 581 | */ |
diff --git a/arch/sparc/kernel/irq.h b/arch/sparc/kernel/irq.h new file mode 100644 index 000000000000..32ef3ebd0a88 --- /dev/null +++ b/arch/sparc/kernel/irq.h | |||
@@ -0,0 +1,68 @@ | |||
1 | #include <asm/btfixup.h> | ||
2 | |||
3 | /* Dave Redman (djhr@tadpole.co.uk) | ||
4 | * changed these to function pointers.. it saves cycles and will allow | ||
5 | * the irq dependencies to be split into different files at a later date | ||
6 | * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size. | ||
7 | * Jakub Jelinek (jj@sunsite.mff.cuni.cz) | ||
8 | * Changed these to btfixup entities... It saves cycles :) | ||
9 | */ | ||
10 | |||
11 | BTFIXUPDEF_CALL(void, disable_irq, unsigned int) | ||
12 | BTFIXUPDEF_CALL(void, enable_irq, unsigned int) | ||
13 | BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) | ||
14 | BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) | ||
15 | BTFIXUPDEF_CALL(void, clear_clock_irq, void) | ||
16 | BTFIXUPDEF_CALL(void, clear_profile_irq, int) | ||
17 | BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) | ||
18 | |||
19 | static inline void __disable_irq(unsigned int irq) | ||
20 | { | ||
21 | BTFIXUP_CALL(disable_irq)(irq); | ||
22 | } | ||
23 | |||
24 | static inline void __enable_irq(unsigned int irq) | ||
25 | { | ||
26 | BTFIXUP_CALL(enable_irq)(irq); | ||
27 | } | ||
28 | |||
29 | static inline void disable_pil_irq(unsigned int irq) | ||
30 | { | ||
31 | BTFIXUP_CALL(disable_pil_irq)(irq); | ||
32 | } | ||
33 | |||
34 | static inline void enable_pil_irq(unsigned int irq) | ||
35 | { | ||
36 | BTFIXUP_CALL(enable_pil_irq)(irq); | ||
37 | } | ||
38 | |||
39 | static inline void clear_clock_irq(void) | ||
40 | { | ||
41 | BTFIXUP_CALL(clear_clock_irq)(); | ||
42 | } | ||
43 | |||
44 | static inline void clear_profile_irq(int irq) | ||
45 | { | ||
46 | BTFIXUP_CALL(clear_profile_irq)(irq); | ||
47 | } | ||
48 | |||
49 | static inline void load_profile_irq(int cpu, int limit) | ||
50 | { | ||
51 | BTFIXUP_CALL(load_profile_irq)(cpu, limit); | ||
52 | } | ||
53 | |||
54 | extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); | ||
55 | |||
56 | extern void claim_ticker14(irq_handler_t irq_handler, | ||
57 | int irq, | ||
58 | unsigned int timeout); | ||
59 | |||
60 | #ifdef CONFIG_SMP | ||
61 | BTFIXUPDEF_CALL(void, set_cpu_int, int, int) | ||
62 | BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) | ||
63 | BTFIXUPDEF_CALL(void, set_irq_udt, int) | ||
64 | |||
65 | #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) | ||
66 | #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) | ||
67 | #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) | ||
68 | #endif | ||
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 791771196905..f2eae457fc9a 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | #include <asm/irq_regs.h> | 37 | #include <asm/irq_regs.h> |
38 | 38 | ||
39 | #include "irq.h" | ||
39 | 40 | ||
40 | /* | 41 | /* |
41 | * I studied different documents and many live PROMs both from 2.30 | 42 | * I studied different documents and many live PROMs both from 2.30 |
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c index 4fea3ac7bff0..6724ab90f82b 100644 --- a/arch/sparc/kernel/smp.c +++ b/arch/sparc/kernel/smp.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include <asm/tlbflush.h> | 33 | #include <asm/tlbflush.h> |
34 | #include <asm/cpudata.h> | 34 | #include <asm/cpudata.h> |
35 | 35 | ||
36 | #include "irq.h" | ||
37 | |||
36 | int smp_num_cpus = 1; | 38 | int smp_num_cpus = 1; |
37 | volatile unsigned long cpu_callin_map[NR_CPUS] __initdata = {0,}; | 39 | volatile unsigned long cpu_callin_map[NR_CPUS] __initdata = {0,}; |
38 | unsigned char boot_cpu_id = 0; | 40 | unsigned char boot_cpu_id = 0; |
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index d8e008a04e2b..55bac516dfe2 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c | |||
@@ -154,8 +154,6 @@ EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); | |||
154 | #else | 154 | #else |
155 | EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id)); | 155 | EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id)); |
156 | #endif | 156 | #endif |
157 | EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq)); | ||
158 | EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq)); | ||
159 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea)); | 157 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea)); |
160 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea)); | 158 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea)); |
161 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl)); | 159 | EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl)); |
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c index 009e891a4329..c6ac9fc52563 100644 --- a/arch/sparc/kernel/sun4c_irq.c +++ b/arch/sparc/kernel/sun4c_irq.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include "irq.h" | ||
21 | 22 | ||
22 | #include <asm/ptrace.h> | 23 | #include <asm/ptrace.h> |
23 | #include <asm/processor.h> | 24 | #include <asm/processor.h> |
@@ -40,6 +41,20 @@ static struct resource sun4c_timer_eb = { "sun4c_timer" }; | |||
40 | static struct resource sun4c_intr_eb = { "sun4c_intr" }; | 41 | static struct resource sun4c_intr_eb = { "sun4c_intr" }; |
41 | #endif | 42 | #endif |
42 | 43 | ||
44 | /* | ||
45 | * Bit field defines for the interrupt registers on various | ||
46 | * Sparc machines. | ||
47 | */ | ||
48 | |||
49 | /* The sun4c interrupt register. */ | ||
50 | #define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */ | ||
51 | #define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */ | ||
52 | #define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */ | ||
53 | #define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */ | ||
54 | #define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */ | ||
55 | #define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */ | ||
56 | #define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */ | ||
57 | |||
43 | /* Pointer to the interrupt enable byte | 58 | /* Pointer to the interrupt enable byte |
44 | * | 59 | * |
45 | * Dave Redman (djhr@tadpole.co.uk) | 60 | * Dave Redman (djhr@tadpole.co.uk) |
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index 396797e20c39..e0efab2a6bef 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #include <asm/cacheflush.h> | 39 | #include <asm/cacheflush.h> |
40 | #include <asm/irq_regs.h> | 40 | #include <asm/irq_regs.h> |
41 | 41 | ||
42 | #include "irq.h" | ||
43 | |||
42 | /* If you trust current SCSI layer to handle different SCSI IRQs, enable this. I don't trust it... -jj */ | 44 | /* If you trust current SCSI layer to handle different SCSI IRQs, enable this. I don't trust it... -jj */ |
43 | /* #define DISTRIBUTE_IRQS */ | 45 | /* #define DISTRIBUTE_IRQS */ |
44 | 46 | ||
@@ -188,7 +190,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) | |||
188 | kfree(action); | 190 | kfree(action); |
189 | 191 | ||
190 | if (!(*actionp)) | 192 | if (!(*actionp)) |
191 | disable_irq(irq); | 193 | __disable_irq(irq); |
192 | 194 | ||
193 | out_unlock: | 195 | out_unlock: |
194 | spin_unlock_irqrestore(&irq_action_lock, flags); | 196 | spin_unlock_irqrestore(&irq_action_lock, flags); |
@@ -346,7 +348,7 @@ int sun4d_request_irq(unsigned int irq, | |||
346 | else | 348 | else |
347 | *actionp = action; | 349 | *actionp = action; |
348 | 350 | ||
349 | enable_irq(irq); | 351 | __enable_irq(irq); |
350 | 352 | ||
351 | ret = 0; | 353 | ret = 0; |
352 | out_unlock: | 354 | out_unlock: |
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index 098c94f1a322..89a6de95070c 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/cacheflush.h> | 36 | #include <asm/cacheflush.h> |
37 | #include <asm/cpudata.h> | 37 | #include <asm/cpudata.h> |
38 | 38 | ||
39 | #include "irq.h" | ||
39 | #define IRQ_CROSS_CALL 15 | 40 | #define IRQ_CROSS_CALL 15 |
40 | 41 | ||
41 | extern ctxd_t *srmmu_ctx_table_phys; | 42 | extern ctxd_t *srmmu_ctx_table_phys; |
diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 91a803ea88be..b92d6d2d5b04 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c | |||
@@ -38,11 +38,85 @@ | |||
38 | #include <asm/sbus.h> | 38 | #include <asm/sbus.h> |
39 | #include <asm/cacheflush.h> | 39 | #include <asm/cacheflush.h> |
40 | 40 | ||
41 | #include "irq.h" | ||
42 | |||
43 | /* On the sun4m, just like the timers, we have both per-cpu and master | ||
44 | * interrupt registers. | ||
45 | */ | ||
46 | |||
47 | /* These registers are used for sending/receiving irqs from/to | ||
48 | * different cpu's. | ||
49 | */ | ||
50 | struct sun4m_intreg_percpu { | ||
51 | unsigned int tbt; /* Interrupts still pending for this cpu. */ | ||
52 | |||
53 | /* These next two registers are WRITE-ONLY and are only | ||
54 | * "on bit" sensitive, "off bits" written have NO affect. | ||
55 | */ | ||
56 | unsigned int clear; /* Clear this cpus irqs here. */ | ||
57 | unsigned int set; /* Set this cpus irqs here. */ | ||
58 | unsigned char space[PAGE_SIZE - 12]; | ||
59 | }; | ||
60 | |||
61 | /* | ||
62 | * djhr | ||
63 | * Actually the clear and set fields in this struct are misleading.. | ||
64 | * according to the SLAVIO manual (and the same applies for the SEC) | ||
65 | * the clear field clears bits in the mask which will ENABLE that IRQ | ||
66 | * the set field sets bits in the mask to DISABLE the IRQ. | ||
67 | * | ||
68 | * Also the undirected_xx address in the SLAVIO is defined as | ||
69 | * RESERVED and write only.. | ||
70 | * | ||
71 | * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor | ||
72 | * sun4m machines, for MP the layout makes more sense. | ||
73 | */ | ||
74 | struct sun4m_intregs { | ||
75 | struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS]; | ||
76 | unsigned int tbt; /* IRQ's that are still pending. */ | ||
77 | unsigned int irqs; /* Master IRQ bits. */ | ||
78 | |||
79 | /* Again, like the above, two these registers are WRITE-ONLY. */ | ||
80 | unsigned int clear; /* Clear master IRQ's by setting bits here. */ | ||
81 | unsigned int set; /* Set master IRQ's by setting bits here. */ | ||
82 | |||
83 | /* This register is both READ and WRITE. */ | ||
84 | unsigned int undirected_target; /* Which cpu gets undirected irqs. */ | ||
85 | }; | ||
86 | |||
41 | static unsigned long dummy; | 87 | static unsigned long dummy; |
42 | 88 | ||
43 | struct sun4m_intregs *sun4m_interrupts; | 89 | struct sun4m_intregs *sun4m_interrupts; |
44 | unsigned long *irq_rcvreg = &dummy; | 90 | unsigned long *irq_rcvreg = &dummy; |
45 | 91 | ||
92 | /* Dave Redman (djhr@tadpole.co.uk) | ||
93 | * The sun4m interrupt registers. | ||
94 | */ | ||
95 | #define SUN4M_INT_ENABLE 0x80000000 | ||
96 | #define SUN4M_INT_E14 0x00000080 | ||
97 | #define SUN4M_INT_E10 0x00080000 | ||
98 | |||
99 | #define SUN4M_HARD_INT(x) (0x000000001 << (x)) | ||
100 | #define SUN4M_SOFT_INT(x) (0x000010000 << (x)) | ||
101 | |||
102 | #define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */ | ||
103 | #define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */ | ||
104 | #define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */ | ||
105 | #define SUN4M_INT_ECC 0x10000000 /* ecc memory error */ | ||
106 | #define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */ | ||
107 | #define SUN4M_INT_MODULE 0x00200000 /* module interrupt */ | ||
108 | #define SUN4M_INT_VIDEO 0x00100000 /* onboard video */ | ||
109 | #define SUN4M_INT_REALTIME 0x00080000 /* system timer */ | ||
110 | #define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */ | ||
111 | #define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */ | ||
112 | #define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */ | ||
113 | #define SUN4M_INT_SERIAL 0x00008000 /* serial ports */ | ||
114 | #define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */ | ||
115 | #define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */ | ||
116 | |||
117 | #define SUN4M_INT_SBUS(x) (1 << (x+7)) | ||
118 | #define SUN4M_INT_VME(x) (1 << (x)) | ||
119 | |||
46 | /* These tables only apply for interrupts greater than 15.. | 120 | /* These tables only apply for interrupts greater than 15.. |
47 | * | 121 | * |
48 | * any intr value below 0x10 is considered to be a soft-int | 122 | * any intr value below 0x10 is considered to be a soft-int |
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 63ed19bfd028..730eb5796f8e 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <asm/oplib.h> | 31 | #include <asm/oplib.h> |
32 | #include <asm/cpudata.h> | 32 | #include <asm/cpudata.h> |
33 | 33 | ||
34 | #include "irq.h" | ||
35 | |||
34 | #define IRQ_RESCHEDULE 13 | 36 | #define IRQ_RESCHEDULE 13 |
35 | #define IRQ_STOP_CPU 14 | 37 | #define IRQ_STOP_CPU 14 |
36 | #define IRQ_CROSS_CALL 15 | 38 | #define IRQ_CROSS_CALL 15 |
diff --git a/arch/sparc/kernel/tick14.c b/arch/sparc/kernel/tick14.c index f1a7bd19e04f..707bfda86570 100644 --- a/arch/sparc/kernel/tick14.c +++ b/arch/sparc/kernel/tick14.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | 27 | ||
28 | #include "irq.h" | ||
29 | |||
28 | extern unsigned long lvl14_save[5]; | 30 | extern unsigned long lvl14_save[5]; |
29 | static unsigned long *linux_lvl14 = NULL; | 31 | static unsigned long *linux_lvl14 = NULL; |
30 | static unsigned long obp_lvl14[4]; | 32 | static unsigned long obp_lvl14[4]; |
@@ -62,7 +64,7 @@ void claim_ticker14(irq_handler_t handler, | |||
62 | 64 | ||
63 | /* first we copy the obp handler instructions | 65 | /* first we copy the obp handler instructions |
64 | */ | 66 | */ |
65 | disable_irq(irq_nr); | 67 | __disable_irq(irq_nr); |
66 | if (!handler) | 68 | if (!handler) |
67 | return; | 69 | return; |
68 | 70 | ||
@@ -79,6 +81,6 @@ void claim_ticker14(irq_handler_t handler, | |||
79 | NULL)) { | 81 | NULL)) { |
80 | install_linux_ticker(); | 82 | install_linux_ticker(); |
81 | load_profile_irq(cpu, timeout); | 83 | load_profile_irq(cpu, timeout); |
82 | enable_irq(irq_nr); | 84 | __enable_irq(irq_nr); |
83 | } | 85 | } |
84 | } | 86 | } |
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index f2fdbb3664d3..6a2513321620 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <asm/of_device.h> | 44 | #include <asm/of_device.h> |
45 | #include <asm/irq_regs.h> | 45 | #include <asm/irq_regs.h> |
46 | 46 | ||
47 | #include "irq.h" | ||
48 | |||
47 | DEFINE_SPINLOCK(rtc_lock); | 49 | DEFINE_SPINLOCK(rtc_lock); |
48 | enum sparc_clock_type sp_clock_typ; | 50 | enum sparc_clock_type sp_clock_typ; |
49 | DEFINE_SPINLOCK(mostek_lock); | 51 | DEFINE_SPINLOCK(mostek_lock); |
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c index a532922e2e35..a1bef07755a9 100644 --- a/arch/sparc/mm/init.c +++ b/arch/sparc/mm/init.c | |||
@@ -308,6 +308,9 @@ extern void sun4c_paging_init(void); | |||
308 | extern void srmmu_paging_init(void); | 308 | extern void srmmu_paging_init(void); |
309 | extern void device_scan(void); | 309 | extern void device_scan(void); |
310 | 310 | ||
311 | pgprot_t PAGE_SHARED __read_mostly; | ||
312 | EXPORT_SYMBOL(PAGE_SHARED); | ||
313 | |||
311 | void __init paging_init(void) | 314 | void __init paging_init(void) |
312 | { | 315 | { |
313 | switch(sparc_cpu_model) { | 316 | switch(sparc_cpu_model) { |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index ca26232da7ab..17b485f2825c 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -2154,7 +2154,7 @@ void __init ld_mmu_srmmu(void) | |||
2154 | BTFIXUPSET_SIMM13(ptrs_per_pgd, SRMMU_PTRS_PER_PGD); | 2154 | BTFIXUPSET_SIMM13(ptrs_per_pgd, SRMMU_PTRS_PER_PGD); |
2155 | 2155 | ||
2156 | BTFIXUPSET_INT(page_none, pgprot_val(SRMMU_PAGE_NONE)); | 2156 | BTFIXUPSET_INT(page_none, pgprot_val(SRMMU_PAGE_NONE)); |
2157 | BTFIXUPSET_INT(page_shared, pgprot_val(SRMMU_PAGE_SHARED)); | 2157 | PAGE_SHARED = pgprot_val(SRMMU_PAGE_SHARED); |
2158 | BTFIXUPSET_INT(page_copy, pgprot_val(SRMMU_PAGE_COPY)); | 2158 | BTFIXUPSET_INT(page_copy, pgprot_val(SRMMU_PAGE_COPY)); |
2159 | BTFIXUPSET_INT(page_readonly, pgprot_val(SRMMU_PAGE_RDONLY)); | 2159 | BTFIXUPSET_INT(page_readonly, pgprot_val(SRMMU_PAGE_RDONLY)); |
2160 | BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL)); | 2160 | BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL)); |
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index bdd835fba02e..a57a366e339a 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c | |||
@@ -2155,7 +2155,7 @@ void __init ld_mmu_sun4c(void) | |||
2155 | BTFIXUPSET_SIMM13(user_ptrs_per_pgd, KERNBASE / SUN4C_PGDIR_SIZE); | 2155 | BTFIXUPSET_SIMM13(user_ptrs_per_pgd, KERNBASE / SUN4C_PGDIR_SIZE); |
2156 | 2156 | ||
2157 | BTFIXUPSET_INT(page_none, pgprot_val(SUN4C_PAGE_NONE)); | 2157 | BTFIXUPSET_INT(page_none, pgprot_val(SUN4C_PAGE_NONE)); |
2158 | BTFIXUPSET_INT(page_shared, pgprot_val(SUN4C_PAGE_SHARED)); | 2158 | PAGE_SHARED = pgprot_val(SUN4C_PAGE_SHARED); |
2159 | BTFIXUPSET_INT(page_copy, pgprot_val(SUN4C_PAGE_COPY)); | 2159 | BTFIXUPSET_INT(page_copy, pgprot_val(SUN4C_PAGE_COPY)); |
2160 | BTFIXUPSET_INT(page_readonly, pgprot_val(SUN4C_PAGE_READONLY)); | 2160 | BTFIXUPSET_INT(page_readonly, pgprot_val(SUN4C_PAGE_READONLY)); |
2161 | BTFIXUPSET_INT(page_kernel, pgprot_val(SUN4C_PAGE_KERNEL)); | 2161 | BTFIXUPSET_INT(page_kernel, pgprot_val(SUN4C_PAGE_KERNEL)); |
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index 7d36531aa5b9..d270c2f0be0f 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c | |||
@@ -280,6 +280,7 @@ EXPORT_SYMBOL(sys_getgid); | |||
280 | EXPORT_SYMBOL(svr4_getcontext); | 280 | EXPORT_SYMBOL(svr4_getcontext); |
281 | EXPORT_SYMBOL(svr4_setcontext); | 281 | EXPORT_SYMBOL(svr4_setcontext); |
282 | EXPORT_SYMBOL(compat_sys_ioctl); | 282 | EXPORT_SYMBOL(compat_sys_ioctl); |
283 | EXPORT_SYMBOL(sys_ioctl); | ||
283 | EXPORT_SYMBOL(sparc32_open); | 284 | EXPORT_SYMBOL(sparc32_open); |
284 | #endif | 285 | #endif |
285 | 286 | ||
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h index ff520ea97473..afb88a5973f0 100644 --- a/include/asm-sparc/irq.h +++ b/include/asm-sparc/irq.h | |||
@@ -7,178 +7,16 @@ | |||
7 | #ifndef _SPARC_IRQ_H | 7 | #ifndef _SPARC_IRQ_H |
8 | #define _SPARC_IRQ_H | 8 | #define _SPARC_IRQ_H |
9 | 9 | ||
10 | #include <linux/linkage.h> | ||
11 | #include <linux/threads.h> /* For NR_CPUS */ | ||
12 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
13 | 11 | ||
14 | #include <asm/system.h> /* For SUN4M_NCPUS */ | ||
15 | #include <asm/btfixup.h> | ||
16 | |||
17 | #define __irq_ino(irq) irq | ||
18 | #define __irq_pil(irq) irq | ||
19 | |||
20 | #define NR_IRQS 16 | 12 | #define NR_IRQS 16 |
21 | 13 | ||
22 | #define irq_canonicalize(irq) (irq) | 14 | #define irq_canonicalize(irq) (irq) |
23 | 15 | ||
24 | /* Dave Redman (djhr@tadpole.co.uk) | 16 | extern void disable_irq_nosync(unsigned int irq); |
25 | * changed these to function pointers.. it saves cycles and will allow | 17 | extern void disable_irq(unsigned int irq); |
26 | * the irq dependencies to be split into different files at a later date | 18 | extern void enable_irq(unsigned int irq); |
27 | * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size. | ||
28 | * Jakub Jelinek (jj@sunsite.mff.cuni.cz) | ||
29 | * Changed these to btfixup entities... It saves cycles :) | ||
30 | */ | ||
31 | BTFIXUPDEF_CALL(void, disable_irq, unsigned int) | ||
32 | BTFIXUPDEF_CALL(void, enable_irq, unsigned int) | ||
33 | BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) | ||
34 | BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) | ||
35 | BTFIXUPDEF_CALL(void, clear_clock_irq, void) | ||
36 | BTFIXUPDEF_CALL(void, clear_profile_irq, int) | ||
37 | BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) | ||
38 | |||
39 | static inline void disable_irq_nosync(unsigned int irq) | ||
40 | { | ||
41 | BTFIXUP_CALL(disable_irq)(irq); | ||
42 | } | ||
43 | |||
44 | static inline void disable_irq(unsigned int irq) | ||
45 | { | ||
46 | BTFIXUP_CALL(disable_irq)(irq); | ||
47 | } | ||
48 | |||
49 | static inline void enable_irq(unsigned int irq) | ||
50 | { | ||
51 | BTFIXUP_CALL(enable_irq)(irq); | ||
52 | } | ||
53 | |||
54 | static inline void disable_pil_irq(unsigned int irq) | ||
55 | { | ||
56 | BTFIXUP_CALL(disable_pil_irq)(irq); | ||
57 | } | ||
58 | |||
59 | static inline void enable_pil_irq(unsigned int irq) | ||
60 | { | ||
61 | BTFIXUP_CALL(enable_pil_irq)(irq); | ||
62 | } | ||
63 | |||
64 | static inline void clear_clock_irq(void) | ||
65 | { | ||
66 | BTFIXUP_CALL(clear_clock_irq)(); | ||
67 | } | ||
68 | |||
69 | static inline void clear_profile_irq(int irq) | ||
70 | { | ||
71 | BTFIXUP_CALL(clear_profile_irq)(irq); | ||
72 | } | ||
73 | |||
74 | static inline void load_profile_irq(int cpu, int limit) | ||
75 | { | ||
76 | BTFIXUP_CALL(load_profile_irq)(cpu, limit); | ||
77 | } | ||
78 | |||
79 | extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); | ||
80 | extern void claim_ticker14(irq_handler_t irq_handler, | ||
81 | int irq, | ||
82 | unsigned int timeout); | ||
83 | |||
84 | #ifdef CONFIG_SMP | ||
85 | BTFIXUPDEF_CALL(void, set_cpu_int, int, int) | ||
86 | BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) | ||
87 | BTFIXUPDEF_CALL(void, set_irq_udt, int) | ||
88 | |||
89 | #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) | ||
90 | #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) | ||
91 | #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) | ||
92 | #endif | ||
93 | 19 | ||
94 | extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname); | 20 | extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname); |
95 | 21 | ||
96 | /* On the sun4m, just like the timers, we have both per-cpu and master | ||
97 | * interrupt registers. | ||
98 | */ | ||
99 | |||
100 | /* These registers are used for sending/receiving irqs from/to | ||
101 | * different cpu's. | ||
102 | */ | ||
103 | struct sun4m_intreg_percpu { | ||
104 | unsigned int tbt; /* Interrupts still pending for this cpu. */ | ||
105 | |||
106 | /* These next two registers are WRITE-ONLY and are only | ||
107 | * "on bit" sensitive, "off bits" written have NO affect. | ||
108 | */ | ||
109 | unsigned int clear; /* Clear this cpus irqs here. */ | ||
110 | unsigned int set; /* Set this cpus irqs here. */ | ||
111 | unsigned char space[PAGE_SIZE - 12]; | ||
112 | }; | ||
113 | |||
114 | /* | ||
115 | * djhr | ||
116 | * Actually the clear and set fields in this struct are misleading.. | ||
117 | * according to the SLAVIO manual (and the same applies for the SEC) | ||
118 | * the clear field clears bits in the mask which will ENABLE that IRQ | ||
119 | * the set field sets bits in the mask to DISABLE the IRQ. | ||
120 | * | ||
121 | * Also the undirected_xx address in the SLAVIO is defined as | ||
122 | * RESERVED and write only.. | ||
123 | * | ||
124 | * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor | ||
125 | * sun4m machines, for MP the layout makes more sense. | ||
126 | */ | ||
127 | struct sun4m_intregs { | ||
128 | struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS]; | ||
129 | unsigned int tbt; /* IRQ's that are still pending. */ | ||
130 | unsigned int irqs; /* Master IRQ bits. */ | ||
131 | |||
132 | /* Again, like the above, two these registers are WRITE-ONLY. */ | ||
133 | unsigned int clear; /* Clear master IRQ's by setting bits here. */ | ||
134 | unsigned int set; /* Set master IRQ's by setting bits here. */ | ||
135 | |||
136 | /* This register is both READ and WRITE. */ | ||
137 | unsigned int undirected_target; /* Which cpu gets undirected irqs. */ | ||
138 | }; | ||
139 | |||
140 | extern struct sun4m_intregs *sun4m_interrupts; | ||
141 | |||
142 | /* | ||
143 | * Bit field defines for the interrupt registers on various | ||
144 | * Sparc machines. | ||
145 | */ | ||
146 | |||
147 | /* The sun4c interrupt register. */ | ||
148 | #define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */ | ||
149 | #define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */ | ||
150 | #define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */ | ||
151 | #define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */ | ||
152 | #define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */ | ||
153 | #define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */ | ||
154 | #define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */ | ||
155 | |||
156 | /* Dave Redman (djhr@tadpole.co.uk) | ||
157 | * The sun4m interrupt registers. | ||
158 | */ | ||
159 | #define SUN4M_INT_ENABLE 0x80000000 | ||
160 | #define SUN4M_INT_E14 0x00000080 | ||
161 | #define SUN4M_INT_E10 0x00080000 | ||
162 | |||
163 | #define SUN4M_HARD_INT(x) (0x000000001 << (x)) | ||
164 | #define SUN4M_SOFT_INT(x) (0x000010000 << (x)) | ||
165 | |||
166 | #define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */ | ||
167 | #define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */ | ||
168 | #define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */ | ||
169 | #define SUN4M_INT_ECC 0x10000000 /* ecc memory error */ | ||
170 | #define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */ | ||
171 | #define SUN4M_INT_MODULE 0x00200000 /* module interrupt */ | ||
172 | #define SUN4M_INT_VIDEO 0x00100000 /* onboard video */ | ||
173 | #define SUN4M_INT_REALTIME 0x00080000 /* system timer */ | ||
174 | #define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */ | ||
175 | #define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */ | ||
176 | #define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */ | ||
177 | #define SUN4M_INT_SERIAL 0x00008000 /* serial ports */ | ||
178 | #define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */ | ||
179 | #define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */ | ||
180 | |||
181 | #define SUN4M_INT_SBUS(x) (1 << (x+7)) | ||
182 | #define SUN4M_INT_VME(x) (1 << (x)) | ||
183 | |||
184 | #endif | 22 | #endif |
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index a55f4c3488b0..2cc235b74d94 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h | |||
@@ -46,7 +46,6 @@ BTFIXUPDEF_SIMM13(user_ptrs_per_pgd) | |||
46 | #define pgd_ERROR(e) __builtin_trap() | 46 | #define pgd_ERROR(e) __builtin_trap() |
47 | 47 | ||
48 | BTFIXUPDEF_INT(page_none) | 48 | BTFIXUPDEF_INT(page_none) |
49 | BTFIXUPDEF_INT(page_shared) | ||
50 | BTFIXUPDEF_INT(page_copy) | 49 | BTFIXUPDEF_INT(page_copy) |
51 | BTFIXUPDEF_INT(page_readonly) | 50 | BTFIXUPDEF_INT(page_readonly) |
52 | BTFIXUPDEF_INT(page_kernel) | 51 | BTFIXUPDEF_INT(page_kernel) |
@@ -66,7 +65,7 @@ BTFIXUPDEF_INT(page_kernel) | |||
66 | #define PTE_SIZE (PTRS_PER_PTE*4) | 65 | #define PTE_SIZE (PTRS_PER_PTE*4) |
67 | 66 | ||
68 | #define PAGE_NONE __pgprot(BTFIXUP_INT(page_none)) | 67 | #define PAGE_NONE __pgprot(BTFIXUP_INT(page_none)) |
69 | #define PAGE_SHARED __pgprot(BTFIXUP_INT(page_shared)) | 68 | extern pgprot_t PAGE_SHARED; |
70 | #define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy)) | 69 | #define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy)) |
71 | #define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly)) | 70 | #define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly)) |
72 | 71 | ||