summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2001-10-06 09:31:43 +0000
committermarcel <marcel@FreeBSD.org>2001-10-06 09:31:43 +0000
commit1cf975d017d0174d0860a50550b1d135af2b04bb (patch)
tree16b4bb5c03549f1b00939388fd7d2fbb587483ee
parent452ebcd6f6f3a8dc0bf977b254be33be497cf1be (diff)
downloadFreeBSD-src-1cf975d017d0174d0860a50550b1d135af2b04bb.zip
FreeBSD-src-1cf975d017d0174d0860a50550b1d135af2b04bb.tar.gz
o Change ia64_memory_address to explicitly take a u_int64_t
o Add memcpy_fromio, memcpy_io, memcpy_toio, memset_io, memsetw and memsetw_io. I'm not sure this is the right place for it, though.
-rw-r--r--sys/ia64/include/cpufunc.h52
1 files changed, 50 insertions, 2 deletions
diff --git a/sys/ia64/include/cpufunc.h b/sys/ia64/include/cpufunc.h
index be5624a..45390e9 100644
--- a/sys/ia64/include/cpufunc.h
+++ b/sys/ia64/include/cpufunc.h
@@ -55,9 +55,9 @@ ia64_port_address(u_int port)
}
static __inline volatile void *
-ia64_memory_address(u_int addr)
+ia64_memory_address(u_int64_t addr)
{
- return (volatile void *) IA64_PHYS_TO_RR6(addr);;
+ return (volatile void *) IA64_PHYS_TO_RR6(addr);
}
static __inline u_int8_t
@@ -223,6 +223,54 @@ writel(u_int addr, u_int32_t data)
}
static __inline void
+memcpy_fromio(u_int8_t *addr, size_t ofs, size_t count)
+{
+ volatile u_int8_t *p = ia64_memory_address(ofs);
+ while (count--)
+ *addr++ = *p++;
+}
+
+static __inline void
+memcpy_io(size_t dst, size_t src, size_t count)
+{
+ volatile u_int8_t *dp = ia64_memory_address(dst);
+ volatile u_int8_t *sp = ia64_memory_address(src);
+ while (count--)
+ *dp++ = *sp++;
+}
+
+static __inline void
+memcpy_toio(size_t ofs, u_int8_t *addr, size_t count)
+{
+ volatile u_int8_t *p = ia64_memory_address(ofs);
+ while (count--)
+ *p++ = *addr++;
+}
+
+static __inline void
+memset_io(size_t ofs, u_int8_t value, size_t count)
+{
+ volatile u_int8_t *p = ia64_memory_address(ofs);
+ while (count--)
+ *p++ = value;
+}
+
+static __inline void
+memsetw(u_int16_t *addr, int val, size_t size)
+{
+ while (size--)
+ *addr++ = val;
+}
+
+static __inline void
+memsetw_io(size_t ofs, u_int16_t value, size_t count)
+{
+ volatile u_int16_t *p = ia64_memory_address(ofs);
+ while (count--)
+ *p++ = value;
+}
+
+static __inline void
disable_intr(void)
{
__asm __volatile ("rsm psr.i;;");
OpenPOWER on IntegriCloud