diff options
author | Marcelo Tosatti <marcelo.tosatti@cyclades.com> | 2005-10-28 20:46:10 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-28 23:55:27 -0400 |
commit | e37b0c9670fed2264661ade1beb5c228dec29c96 (patch) | |
tree | 4f23bc5ea578db11de39222aa046804ed9286782 /arch/ppc/syslib/ppc8xx_pic.c | |
parent | 9e3699ea7b8d63eabde7fefa9892e3a258c9c27d (diff) |
[PATCH] ppc32 8xx: use io accessor macros instead of direct memory reference
Convert core 8xx drivers to use in_xxxbe/in_xxx macros instead of direct
memory references.
Other than making IO accesses explicit (which is a plus for readability), a
common set of macros provides a unified place for the volatile flag to
constraint compiler code reordering.
There are several unlucky places at the moment which lack the volatile
flag.
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc/syslib/ppc8xx_pic.c')
-rw-r--r-- | arch/ppc/syslib/ppc8xx_pic.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/ppc/syslib/ppc8xx_pic.c b/arch/ppc/syslib/ppc8xx_pic.c index d3b01c6c97de..3e6f51a61d46 100644 --- a/arch/ppc/syslib/ppc8xx_pic.c +++ b/arch/ppc/syslib/ppc8xx_pic.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/signal.h> | 6 | #include <linux/signal.h> |
7 | #include <linux/interrupt.h> | 7 | #include <linux/interrupt.h> |
8 | #include <asm/irq.h> | 8 | #include <asm/irq.h> |
9 | #include <asm/io.h> | ||
9 | #include <asm/8xx_immap.h> | 10 | #include <asm/8xx_immap.h> |
10 | #include <asm/mpc8xx.h> | 11 | #include <asm/mpc8xx.h> |
11 | #include "ppc8xx_pic.h" | 12 | #include "ppc8xx_pic.h" |
@@ -29,8 +30,7 @@ static void m8xx_mask_irq(unsigned int irq_nr) | |||
29 | word = irq_nr >> 5; | 30 | word = irq_nr >> 5; |
30 | 31 | ||
31 | ppc_cached_irq_mask[word] &= ~(1 << (31-bit)); | 32 | ppc_cached_irq_mask[word] &= ~(1 << (31-bit)); |
32 | ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = | 33 | out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]); |
33 | ppc_cached_irq_mask[word]; | ||
34 | } | 34 | } |
35 | 35 | ||
36 | static void m8xx_unmask_irq(unsigned int irq_nr) | 36 | static void m8xx_unmask_irq(unsigned int irq_nr) |
@@ -41,8 +41,7 @@ static void m8xx_unmask_irq(unsigned int irq_nr) | |||
41 | word = irq_nr >> 5; | 41 | word = irq_nr >> 5; |
42 | 42 | ||
43 | ppc_cached_irq_mask[word] |= (1 << (31-bit)); | 43 | ppc_cached_irq_mask[word] |= (1 << (31-bit)); |
44 | ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = | 44 | out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]); |
45 | ppc_cached_irq_mask[word]; | ||
46 | } | 45 | } |
47 | 46 | ||
48 | static void m8xx_end_irq(unsigned int irq_nr) | 47 | static void m8xx_end_irq(unsigned int irq_nr) |
@@ -55,8 +54,7 @@ static void m8xx_end_irq(unsigned int irq_nr) | |||
55 | word = irq_nr >> 5; | 54 | word = irq_nr >> 5; |
56 | 55 | ||
57 | ppc_cached_irq_mask[word] |= (1 << (31-bit)); | 56 | ppc_cached_irq_mask[word] |= (1 << (31-bit)); |
58 | ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = | 57 | out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]); |
59 | ppc_cached_irq_mask[word]; | ||
60 | } | 58 | } |
61 | } | 59 | } |
62 | 60 | ||
@@ -69,9 +67,8 @@ static void m8xx_mask_and_ack(unsigned int irq_nr) | |||
69 | word = irq_nr >> 5; | 67 | word = irq_nr >> 5; |
70 | 68 | ||
71 | ppc_cached_irq_mask[word] &= ~(1 << (31-bit)); | 69 | ppc_cached_irq_mask[word] &= ~(1 << (31-bit)); |
72 | ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = | 70 | out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]); |
73 | ppc_cached_irq_mask[word]; | 71 | out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sipend, 1 << (31-bit)); |
74 | ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sipend = 1 << (31-bit); | ||
75 | } | 72 | } |
76 | 73 | ||
77 | struct hw_interrupt_type ppc8xx_pic = { | 74 | struct hw_interrupt_type ppc8xx_pic = { |
@@ -93,7 +90,7 @@ m8xx_get_irq(struct pt_regs *regs) | |||
93 | /* For MPC8xx, read the SIVEC register and shift the bits down | 90 | /* For MPC8xx, read the SIVEC register and shift the bits down |
94 | * to get the irq number. | 91 | * to get the irq number. |
95 | */ | 92 | */ |
96 | irq = ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec >> 26; | 93 | irq = in_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec) >> 26; |
97 | 94 | ||
98 | /* | 95 | /* |
99 | * When we read the sivec without an interrupt to process, we will | 96 | * When we read the sivec without an interrupt to process, we will |