patch-2.3.14 linux/include/asm-alpha/core_lca.h

Next file: linux/include/asm-alpha/core_mcpcia.h
Previous file: linux/include/asm-alpha/core_cia.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.13/linux/include/asm-alpha/core_lca.h linux/include/asm-alpha/core_lca.h
@@ -305,6 +305,15 @@
 {
 	unsigned long result, msb;
 
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	addr -= LCA_DENSE_MEM;
 	if (addr >= (1UL << 24)) {
 		msb = addr & 0xf8000000;
 		addr -= msb;
@@ -318,6 +327,15 @@
 {
 	unsigned long result, msb;
 
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	addr -= LCA_DENSE_MEM;
 	if (addr >= (1UL << 24)) {
 		msb = addr & 0xf8000000;
 		addr -= msb;
@@ -329,12 +347,28 @@
 
 __EXTERN_INLINE unsigned long lca_readl(unsigned long addr)
 {
-	return *(vuip) (addr + LCA_DENSE_MEM);
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	return *(vuip)addr;
 }
 
 __EXTERN_INLINE unsigned long lca_readq(unsigned long addr)
 {
-	return *(vulp) (addr + LCA_DENSE_MEM);
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	return *(vulp)addr;
 }
 
 __EXTERN_INLINE void lca_writeb(unsigned char b, unsigned long addr)
@@ -342,6 +376,15 @@
 	unsigned long msb;
 	unsigned long w;
 
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	addr -= LCA_DENSE_MEM;
 	if (addr >= (1UL << 24)) {
 		msb = addr & 0xf8000000;
 		addr -= msb;
@@ -356,6 +399,15 @@
 	unsigned long msb;
 	unsigned long w;
 
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	addr -= LCA_DENSE_MEM;
 	if (addr >= (1UL << 24)) {
 		msb = addr & 0xf8000000;
 		addr -= msb;
@@ -367,19 +419,38 @@
 
 __EXTERN_INLINE void lca_writel(unsigned int b, unsigned long addr)
 {
-	*(vuip) (addr + LCA_DENSE_MEM) = b;
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	*(vuip)addr = b;
 }
 
 __EXTERN_INLINE void lca_writeq(unsigned long b, unsigned long addr)
 {
-	*(vulp) (addr + LCA_DENSE_MEM) = b;
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "lca: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += LCA_DENSE_MEM;
+	}
+#endif
+
+	*(vulp)addr = b;
 }
 
-/* Find the DENSE memory area for a given bus address.  */
+__EXTERN_INLINE unsigned long lca_ioremap(unsigned long addr)
+{
+	return LCA_DENSE_MEM + addr;
+}
 
-__EXTERN_INLINE unsigned long lca_dense_mem(unsigned long addr)
+__EXTERN_INLINE int lca_is_ioaddr(unsigned long addr)
 {
-	return LCA_DENSE_MEM;
+	return addr >= IDENT_ADDR + 0x100000000UL;
 }
 
 #undef vip
@@ -404,7 +475,8 @@
 #define __readq		lca_readq
 #define __writel	lca_writel
 #define __writeq	lca_writeq
-#define dense_mem	lca_dense_mem
+#define __ioremap	lca_ioremap
+#define __is_ioaddr	lca_is_ioaddr
 
 #define inb(port) \
 (__builtin_constant_p((port))?__inb(port):_inb(port))
@@ -412,10 +484,12 @@
 #define outb(x, port) \
 (__builtin_constant_p((port))?__outb((x),(port)):_outb((x),(port)))
 
-#define readl(a)	__readl((unsigned long)(a))
-#define readq(a)	__readq((unsigned long)(a))
-#define writel(v,a)	__writel((v),(unsigned long)(a))
-#define writeq(v,a)	__writeq((v),(unsigned long)(a))
+#if !__DEBUG_IOREMAP
+#define __raw_readl(a)		__readl((unsigned long)(a))
+#define __raw_readq(a)		__readq((unsigned long)(a))
+#define __raw_writel(v,a)	__writel((v),(unsigned long)(a))
+#define __raw_writeq(v,a)	__writeq((v),(unsigned long)(a))
+#endif
 
 #endif /* __WANT_IO_DEF */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)