diff options
author | dfr <dfr@FreeBSD.org> | 2000-02-12 14:57:01 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2000-02-12 14:57:01 +0000 |
commit | 69be10ec73f0a4dc04c4b0849b59b6ba11e039ff (patch) | |
tree | dae599462429d9aff38d08dd7d6a13f9b5201e53 /lib/libio | |
parent | 512d99359fec3621b39f3c2fb6f8b8c51b1565ce (diff) | |
download | FreeBSD-src-69be10ec73f0a4dc04c4b0849b59b6ba11e039ff.zip FreeBSD-src-69be10ec73f0a4dc04c4b0849b59b6ba11e039ff.tar.gz |
Add functions which allow i/o memory to be accessed without forcing a
memory barrier (needed for XFree86 4.0).
Approved by: jkh
Diffstat (limited to 'lib/libio')
-rw-r--r-- | lib/libio/bwx.c | 6 | ||||
-rw-r--r-- | lib/libio/io.c | 25 |
2 files changed, 26 insertions, 5 deletions
diff --git a/lib/libio/bwx.c b/lib/libio/bwx.c index bc3bbb3..dede881 100644 --- a/lib/libio/bwx.c +++ b/lib/libio/bwx.c @@ -206,21 +206,21 @@ static void bwx_writeb(void *handle, u_int32_t offset, u_int8_t val) { struct bwx_mem_handle *h = handle; - stb((vm_offset_t)h->virt1 + offset, val); + stb_nb((vm_offset_t)h->virt1 + offset, val); } static void bwx_writew(void *handle, u_int32_t offset, u_int16_t val) { struct bwx_mem_handle *h = handle; - stw((vm_offset_t)h->virt2 + offset, val); + stw_nb((vm_offset_t)h->virt2 + offset, val); } static void bwx_writel(void *handle, u_int32_t offset, u_int32_t val) { struct bwx_mem_handle *h = handle; - stl((vm_offset_t)h->virt4 + offset, val); + stl_nb((vm_offset_t)h->virt4 + offset, val); } struct io_ops bwx_io_ops = { diff --git a/lib/libio/io.c b/lib/libio/io.c index 7abfa36..3ccce2e 100644 --- a/lib/libio/io.c +++ b/lib/libio/io.c @@ -119,18 +119,39 @@ readl(void *handle, u_int32_t offset) void writeb(void *handle, u_int32_t offset, u_int8_t val) { - return ops->writeb(handle, offset, val); + ops->writeb(handle, offset, val); + __asm__ __volatile__ ("mb"); } void writew(void *handle, u_int32_t offset, u_int16_t val) { - return ops->writew(handle, offset, val); + ops->writew(handle, offset, val); + __asm__ __volatile__ ("mb"); } void writel(void *handle, u_int32_t offset, u_int32_t val) { + ops->writel(handle, offset, val); + __asm__ __volatile__ ("mb"); +} + +void +writeb_nb(void *handle, u_int32_t offset, u_int8_t val) +{ + return ops->writeb(handle, offset, val); +} + +void +writew_nb(void *handle, u_int32_t offset, u_int16_t val) +{ + return ops->writew(handle, offset, val); +} + +void +writel_nb(void *handle, u_int32_t offset, u_int32_t val) +{ return ops->writel(handle, offset, val); } |