]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-alpha/core_t2.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6-omap-h63xx.git] / include / asm-alpha / core_t2.h
index 457c34b6eb09337bc87421aeb0edfe0b35edd2e7..46bfff58f67093877e4815a30c6c165d9be192d3 100644 (file)
@@ -356,13 +356,13 @@ struct el_t2_frame_corrected {
 #define vip    volatile int *
 #define vuip   volatile unsigned int *
 
-static inline u8 t2_inb(unsigned long addr)
+extern inline u8 t2_inb(unsigned long addr)
 {
        long result = *(vip) ((addr << 5) + T2_IO + 0x00);
        return __kernel_extbl(result, addr & 3);
 }
 
-static inline void t2_outb(u8 b, unsigned long addr)
+extern inline void t2_outb(u8 b, unsigned long addr)
 {
        unsigned long w;
 
@@ -371,13 +371,13 @@ static inline void t2_outb(u8 b, unsigned long addr)
        mb();
 }
 
-static inline u16 t2_inw(unsigned long addr)
+extern inline u16 t2_inw(unsigned long addr)
 {
        long result = *(vip) ((addr << 5) + T2_IO + 0x08);
        return __kernel_extwl(result, addr & 3);
 }
 
-static inline void t2_outw(u16 b, unsigned long addr)
+extern inline void t2_outw(u16 b, unsigned long addr)
 {
        unsigned long w;
 
@@ -386,12 +386,12 @@ static inline void t2_outw(u16 b, unsigned long addr)
        mb();
 }
 
-static inline u32 t2_inl(unsigned long addr)
+extern inline u32 t2_inl(unsigned long addr)
 {
        return *(vuip) ((addr << 5) + T2_IO + 0x18);
 }
 
-static inline void t2_outl(u32 b, unsigned long addr)
+extern inline void t2_outl(u32 b, unsigned long addr)
 {
        *(vuip) ((addr << 5) + T2_IO + 0x18) = b;
        mb();
@@ -435,11 +435,17 @@ static inline void t2_outl(u32 b, unsigned long addr)
        set_hae(msb); \
 }
 
-static DEFINE_SPINLOCK(t2_hae_lock);
+extern spinlock_t t2_hae_lock;
+
+/*
+ * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
+ *       they may be called directly, rather than through the
+ *       ioreadNN/iowriteNN routines.
+ */
 
 __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long result, msb;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -453,7 +459,7 @@ __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
 
 __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long result, msb;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -471,7 +477,7 @@ __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
  */
 __EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long result, msb;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -485,7 +491,7 @@ __EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr)
 
 __EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long r0, r1, work, msb;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -501,7 +507,7 @@ __EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr)
 
 __EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long msb, w;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -515,7 +521,7 @@ __EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr)
 
 __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long msb, w;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -533,7 +539,7 @@ __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
  */
 __EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long msb;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -546,7 +552,7 @@ __EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr)
 
 __EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr)
 {
-       unsigned long addr = (unsigned long) xaddr;
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
        unsigned long msb, work;
        unsigned long flags;
        spin_lock_irqsave(&t2_hae_lock, flags);
@@ -587,14 +593,14 @@ __EXTERN_INLINE int t2_is_mmio(const volatile void __iomem *addr)
 __EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr)                \
 {                                                                      \
        if (t2_is_mmio(xaddr))                                          \
-               return t2_read##OS(xaddr - T2_DENSE_MEM);               \
+               return t2_read##OS(xaddr);                              \
        else                                                            \
                return t2_in##OS((unsigned long)xaddr - T2_IO);         \
 }                                                                      \
 __EXTERN_INLINE void t2_iowrite##NS(u##NS b, void __iomem *xaddr)      \
 {                                                                      \
        if (t2_is_mmio(xaddr))                                          \
-               t2_write##OS(b, xaddr - T2_DENSE_MEM);                  \
+               t2_write##OS(b, xaddr);                                 \
        else                                                            \
                t2_out##OS(b, (unsigned long)xaddr - T2_IO);            \
 }