summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-04-29 07:06:44 +0000
committermarcel <marcel@FreeBSD.org>2003-04-29 07:06:44 +0000
commitdb92d84028d043a57be76ff4d516386f5736053e (patch)
tree5a9725e558d82709106e92660b02134afcf7cdb4 /sys/dev
parent2d9baa1ee84ea269ffe784918c624d028b7cbb51 (diff)
downloadFreeBSD-src-db92d84028d043a57be76ff4d516386f5736053e.zip
FreeBSD-src-db92d84028d043a57be76ff4d516386f5736053e.tar.gz
Keep syscons specific I/O functions internal/specific to syscons on
ia64 by defining them in terms of newbus. Add a static inline for fillw(), which doesn't have anything to do with I/O. It's still ugly, but now the ugliness can be removed from ia64 specific headers.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/fb/fbreg.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h
index c607337..f17e362 100644
--- a/sys/dev/fb/fbreg.h
+++ b/sys/dev/fb/fbreg.h
@@ -43,7 +43,33 @@
#define fillw_io(p, d, c) fillw((p), (void *)(d), (c))
void generic_bcopy(const void *s, void *d, size_t c);
void generic_bzero(void *d, size_t c);
-#else /* !__i386__ */
+#elif __ia64__
+#include <machine/bus.h>
+#define bcopy_fromio(s, d, c) \
+ bus_space_read_region_1(IA64_BUS_SPACE_MEM, s, 0, (void*)(d), c)
+#define bcopy_io(s, d, c) \
+ bus_space_copy_region_1(IA64_BUS_SPACE_MEM, s, 0, d, 0, c)
+#define bcopy_toio(s, d, c) \
+ bus_space_write_region_1(IA64_BUS_SPACE_MEM, d, 0, (void*)(s), c)
+#define bzero_io(d, c) \
+ bus_space_set_region_1(IA64_BUS_SPACE_MEM, d, 0, 0, c)
+#define fill_io(p, d, c) \
+ bus_space_set_region_1(IA64_BUS_SPACE_MEM, d, 0, p, c)
+#define fillw_io(p, d, c) \
+ bus_space_set_region_2(IA64_BUS_SPACE_MEM, d, 0, p, c)
+#define readw(a) \
+ bus_space_read_2(IA64_BUS_SPACE_MEM, a, 0)
+#define writew(a, v) \
+ bus_space_write_2(IA64_BUS_SPACE_MEM, a, 0, v)
+#define writel(a, v) \
+ bus_space_write_4(IA64_BUS_SPACE_MEM, a, 0, v)
+static __inline void
+fillw(int val, uint16_t *buf, size_t size)
+{
+ while (size--)
+ *buf++ = val;
+}
+#else /* !__i386__ && !__ia64__ */
#define bcopy_io(s, d, c) memcpy_io((d), (s), (c))
#define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c))
#define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c))
OpenPOWER on IntegriCloud