patch-1.3.2 linux/include/asm-alpha/io.h
Next file: linux/include/asm-alpha/lca.h
Previous file: linux/include/asm-alpha/fcntl.h
Back to the patch index
Back to the overall index
- Lines: 58
- Date:
Fri Jun 16 20:03:02 1995
- Orig file:
v1.3.1/linux/include/asm-alpha/io.h
- Orig date:
Fri Jun 2 13:51:16 1995
diff -u --recursive --new-file v1.3.1/linux/include/asm-alpha/io.h linux/include/asm-alpha/io.h
@@ -19,6 +19,13 @@
} hae;
/*
+ * Virtual -> physical identity mapping starts at this offset
+ */
+#define IDENT_ADDR (0xfffffc0000000000UL)
+
+#ifdef __KERNEL__
+
+/*
* We try to avoid hae updates (thus the cache), but when we
* do need to update the hae, we need to do it atomically, so
* that any interrupts wouldn't get confused with the hae
@@ -35,11 +42,6 @@
}
/*
- * Virtual -> physical identity mapping starts at this offset
- */
-#define IDENT_ADDR (0xfffffc0000000000UL)
-
-/*
* Change virtual addresses to physical addresses and vv.
*/
extern inline unsigned long virt_to_phys(void * address)
@@ -51,6 +53,31 @@
{
return (void *) (address + IDENT_ADDR);
}
+
+#else /* !__KERNEL__ */
+
+/*
+ * Define actual functions in private name-space so it's easier to
+ * accomodate things like XFree or svgalib that like to define their
+ * own versions of inb etc.
+ */
+extern unsigned int _inb (unsigned long port);
+extern unsigned int _inw (unsigned long port);
+extern unsigned int _inl (unsigned long port);
+extern void _outb (unsigned char b,unsigned long port);
+extern void _outw (unsigned short w,unsigned long port);
+extern void _outl (unsigned int l,unsigned long port);
+
+#ifndef inb
+# define inb(p) _inb((p))
+# define inw(p) _inw((p))
+# define inl(p) _inl((p))
+# define outb(b,p) _outb((b),(p))
+# define outw(w,p) _outw((w),(p))
+# define outl(l,p) _outl((l),(p))
+#endif
+
+#endif /* __KERNEL__ */
/*
* There are different version of the alpha motherboards: the
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this