summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrucec <brucec@FreeBSD.org>2010-12-03 07:09:23 +0000
committerbrucec <brucec@FreeBSD.org>2010-12-03 07:09:23 +0000
commit6e3faf1602bf6c6c348e207557a56e715392a112 (patch)
tree8bfc5e3c3a033dbc114da53335064960c35404ff
parentde08b1bcf1ecdb8025e89558c87c0f0e800037cc (diff)
downloadFreeBSD-src-6e3faf1602bf6c6c348e207557a56e715392a112.zip
FreeBSD-src-6e3faf1602bf6c6c348e207557a56e715392a112.tar.gz
Revert r216134. This checkin broke platforms where bus_space are macros:
they need to be a single statement, and do { } while (0) doesn't work in this situation so revert until a solution can be devised.
-rw-r--r--share/man/man9/bus_space.93
-rw-r--r--sys/amd64/include/bus.h30
-rw-r--r--sys/arm/include/bus.h67
-rw-r--r--sys/i386/include/bus.h36
-rw-r--r--sys/ia64/include/bus.h55
-rw-r--r--sys/mips/include/bus.h75
-rw-r--r--sys/pc98/include/bus.h16
-rw-r--r--sys/powerpc/include/bus.h80
-rw-r--r--sys/sparc64/include/bus.h115
-rw-r--r--sys/sun4v/include/bus.h115
10 files changed, 194 insertions, 398 deletions
diff --git a/share/man/man9/bus_space.9 b/share/man/man9/bus_space.9
index 8c832f2..5a18dfb 100644
--- a/share/man/man9/bus_space.9
+++ b/share/man/man9/bus_space.9
@@ -719,9 +719,6 @@ or which return data read from bus space (i.e., functions which
do not obviously return an error code) do not fail.
They could only fail
if given invalid arguments, and in that case their behaviour is undefined.
-Functions which take a count of bytes must not pass in a count of zero;
-doing so will cause a panic if the kernel was compiled with
-.Cd "options INVARIANTS" .
.Sh TYPES
Several types are defined in
.In machine/bus.h
diff --git a/sys/amd64/include/bus.h b/sys/amd64/include/bus.h
index c5a0a69..e25f427 100644
--- a/sys/amd64/include/bus.h
+++ b/sys/amd64/include/bus.h
@@ -104,9 +104,6 @@
#ifndef _AMD64_BUS_H_
#define _AMD64_BUS_H_
-#include <sys/param.h>
-#include <sys/systm.h>
-
#include <machine/_bus.h>
#include <machine/cpufunc.h>
@@ -271,7 +268,7 @@ static __inline void
bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO)
insb(bsh + offset, addr, count);
else {
@@ -292,7 +289,7 @@ static __inline void
bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO)
insw(bsh + offset, addr, count);
else {
@@ -313,7 +310,7 @@ static __inline void
bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO)
insl(bsh + offset, addr, count);
else {
@@ -359,7 +356,7 @@ static __inline void
bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -391,7 +388,7 @@ static __inline void
bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -423,7 +420,7 @@ static __inline void
bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -535,7 +532,7 @@ static __inline void
bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO)
outsb(bsh + offset, addr, count);
else {
@@ -556,7 +553,7 @@ static __inline void
bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO)
outsw(bsh + offset, addr, count);
else {
@@ -577,7 +574,7 @@ static __inline void
bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO)
outsl(bsh + offset, addr, count);
else {
@@ -624,7 +621,7 @@ static __inline void
bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -656,7 +653,7 @@ static __inline void
bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -688,7 +685,7 @@ static __inline void
bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == AMD64_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -880,7 +877,6 @@ bus_space_copy_region_1(bus_space_tag_t tag, bus_space_handle_t bsh1,
bus_space_handle_t addr1 = bsh1 + off1;
bus_space_handle_t addr2 = bsh2 + off2;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == AMD64_BUS_SPACE_IO) {
if (addr1 >= addr2) {
/* src after dest: copy forward */
@@ -916,7 +912,6 @@ bus_space_copy_region_2(bus_space_tag_t tag, bus_space_handle_t bsh1,
bus_space_handle_t addr1 = bsh1 + off1;
bus_space_handle_t addr2 = bsh2 + off2;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == AMD64_BUS_SPACE_IO) {
if (addr1 >= addr2) {
/* src after dest: copy forward */
@@ -952,7 +947,6 @@ bus_space_copy_region_4(bus_space_tag_t tag, bus_space_handle_t bsh1,
bus_space_handle_t addr1 = bsh1 + off1;
bus_space_handle_t addr2 = bsh2 + off2;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == AMD64_BUS_SPACE_IO) {
if (addr1 >= addr2) {
/* src after dest: copy forward */
diff --git a/sys/arm/include/bus.h b/sys/arm/include/bus.h
index 4df6103..cabf1f7 100644
--- a/sys/arm/include/bus.h
+++ b/sys/arm/include/bus.h
@@ -66,9 +66,6 @@
#ifndef _MACHINE_BUS_H_
#define _MACHINE_BUS_H_
-#include <sys/param.h>
-#include <sys/systm.h>
-
#include <machine/_bus.h>
/*
@@ -321,29 +318,21 @@ struct bus_space {
* Bus read multiple operations.
*/
#define bus_space_read_multi_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \
__bs_nonsingle(rm,1,(t),(h),(o),(a),(c))
#define bus_space_read_multi_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_2: count == 0")); \
__bs_nonsingle(rm,2,(t),(h),(o),(a),(c))
#define bus_space_read_multi_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_4: count == 0")); \
__bs_nonsingle(rm,4,(t),(h),(o),(a),(c))
#define bus_space_read_multi_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_8: count == 0")); \
__bs_nonsingle(rm,8,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_1: count == 0")); \
__bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_2: count == 0")); \
__bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_4: count == 0")); \
__bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_8: count == 0")); \
__bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c))
@@ -351,29 +340,21 @@ struct bus_space {
* Bus read region operations.
*/
#define bus_space_read_region_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_1: count == 0")); \
__bs_nonsingle(rr,1,(t),(h),(o),(a),(c))
#define bus_space_read_region_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_2: count == 0")); \
__bs_nonsingle(rr,2,(t),(h),(o),(a),(c))
#define bus_space_read_region_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_4: count == 0")); \
__bs_nonsingle(rr,4,(t),(h),(o),(a),(c))
#define bus_space_read_region_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_8: count == 0")); \
__bs_nonsingle(rr,8,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_stream_1: count == 0"));\
__bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_stream_2: count == 0"));\
__bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_stream_4: count == 0"));\
__bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_stream_8 count == 0")); \
__bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c))
@@ -395,29 +376,21 @@ struct bus_space {
* Bus write multiple operations.
*/
#define bus_space_write_multi_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_1: count == 0")); \
__bs_nonsingle(wm,1,(t),(h),(o),(a),(c))
#define bus_space_write_multi_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_2: count == 0")); \
__bs_nonsingle(wm,2,(t),(h),(o),(a),(c))
#define bus_space_write_multi_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_4: count == 0")); \
__bs_nonsingle(wm,4,(t),(h),(o),(a),(c))
#define bus_space_write_multi_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_8: count == 0")); \
__bs_nonsingle(wm,8,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_stream_1: count == 0"));\
__bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_stream_2: count == 0"));\
__bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_stream_4: count == 0"));\
__bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_stream_8: count == 0"));\
__bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c))
@@ -425,50 +398,34 @@ struct bus_space {
* Bus write region operations.
*/
#define bus_space_write_region_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_1: count == 0")); \
__bs_nonsingle(wr,1,(t),(h),(o),(a),(c))
#define bus_space_write_region_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_2: count == 0")); \
__bs_nonsingle(wr,2,(t),(h),(o),(a),(c))
#define bus_space_write_region_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_4: count == 0")); \
__bs_nonsingle(wr,4,(t),(h),(o),(a),(c))
#define bus_space_write_region_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_8: count == 0")); \
__bs_nonsingle(wr,8,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_1: count == 0")); \
__bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_2: count == 0")); \
__bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_4: count == 0")); \
__bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_8: count == 0")); \
__bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c))
/*
* Set multiple operations.
*/
-#define bus_space_set_multi_1(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_1: count == 0")); \
+#define bus_space_set_multi_1(t, h, o, v, c) \
__bs_set(sm,1,(t),(h),(o),(v),(c))
-#define bus_space_set_multi_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_2: count == 0")); \
+#define bus_space_set_multi_2(t, h, o, v, c) \
__bs_set(sm,2,(t),(h),(o),(v),(c))
-#define bus_space_set_multi_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_4: count == 0")); \
+#define bus_space_set_multi_4(t, h, o, v, c) \
__bs_set(sm,4,(t),(h),(o),(v),(c))
-#define bus_space_set_multi_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_8: count == 0")); \
+#define bus_space_set_multi_8(t, h, o, v, c) \
__bs_set(sm,8,(t),(h),(o),(v),(c))
@@ -476,33 +433,25 @@ struct bus_space {
* Set region operations.
*/
#define bus_space_set_region_1(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_1: count == 0")); \
__bs_set(sr,1,(t),(h),(o),(v),(c))
#define bus_space_set_region_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_2: count == 0")); \
__bs_set(sr,2,(t),(h),(o),(v),(c))
#define bus_space_set_region_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_4: count == 0")); \
__bs_set(sr,4,(t),(h),(o),(v),(c))
#define bus_space_set_region_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_8: count == 0")); \
__bs_set(sr,8,(t),(h),(o),(v),(c))
/*
* Copy operations.
*/
-#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_1: count == 0")); \
+#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
__bs_copy(1, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_2: count == 0")); \
+#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
__bs_copy(2, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_4: count == 0")); \
+#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
__bs_copy(4, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_8: count == 0")); \
+#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
__bs_copy(8, t, h1, o1, h2, o2, c)
/*
diff --git a/sys/i386/include/bus.h b/sys/i386/include/bus.h
index c8a06be..bfbc6a7 100644
--- a/sys/i386/include/bus.h
+++ b/sys/i386/include/bus.h
@@ -104,9 +104,6 @@
#ifndef _I386_BUS_H_
#define _I386_BUS_H_
-#include <sys/param.h>
-#include <sys/systm.h>
-
#include <machine/_bus.h>
#include <machine/cpufunc.h>
@@ -275,7 +272,7 @@ static __inline void
bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO)
insb(bsh + offset, addr, count);
else {
@@ -300,7 +297,7 @@ static __inline void
bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO)
insw(bsh + offset, addr, count);
else {
@@ -325,7 +322,7 @@ static __inline void
bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO)
insl(bsh + offset, addr, count);
else {
@@ -375,7 +372,7 @@ static __inline void
bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -415,7 +412,7 @@ static __inline void
bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -455,7 +452,7 @@ static __inline void
bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -575,7 +572,7 @@ static __inline void
bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO)
outsb(bsh + offset, addr, count);
else {
@@ -600,7 +597,7 @@ static __inline void
bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO)
outsw(bsh + offset, addr, count);
else {
@@ -625,7 +622,7 @@ static __inline void
bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO)
outsl(bsh + offset, addr, count);
else {
@@ -676,7 +673,7 @@ static __inline void
bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int8_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -716,7 +713,7 @@ static __inline void
bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int16_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -756,7 +753,7 @@ static __inline void
bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int32_t *addr, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (tag == I386_BUS_SPACE_IO) {
int _port_ = bsh + offset;
#ifdef __GNUCLIKE_ASM
@@ -821,7 +818,6 @@ bus_space_set_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
{
bus_space_handle_t addr = bsh + offset;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO)
while (count--)
outb(addr, value);
@@ -836,7 +832,6 @@ bus_space_set_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
{
bus_space_handle_t addr = bsh + offset;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO)
while (count--)
outw(addr, value);
@@ -851,7 +846,6 @@ bus_space_set_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
{
bus_space_handle_t addr = bsh + offset;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO)
while (count--)
outl(addr, value);
@@ -888,7 +882,6 @@ bus_space_set_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
{
bus_space_handle_t addr = bsh + offset;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO)
for (; count != 0; count--, addr++)
outb(addr, value);
@@ -903,7 +896,6 @@ bus_space_set_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
{
bus_space_handle_t addr = bsh + offset;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO)
for (; count != 0; count--, addr += 2)
outw(addr, value);
@@ -918,7 +910,6 @@ bus_space_set_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
{
bus_space_handle_t addr = bsh + offset;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO)
for (; count != 0; count--, addr += 4)
outl(addr, value);
@@ -962,7 +953,6 @@ bus_space_copy_region_1(bus_space_tag_t tag, bus_space_handle_t bsh1,
bus_space_handle_t addr1 = bsh1 + off1;
bus_space_handle_t addr2 = bsh2 + off2;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO) {
if (addr1 >= addr2) {
/* src after dest: copy forward */
@@ -998,7 +988,6 @@ bus_space_copy_region_2(bus_space_tag_t tag, bus_space_handle_t bsh1,
bus_space_handle_t addr1 = bsh1 + off1;
bus_space_handle_t addr2 = bsh2 + off2;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO) {
if (addr1 >= addr2) {
/* src after dest: copy forward */
@@ -1034,7 +1023,6 @@ bus_space_copy_region_4(bus_space_tag_t tag, bus_space_handle_t bsh1,
bus_space_handle_t addr1 = bsh1 + off1;
bus_space_handle_t addr2 = bsh2 + off2;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (tag == I386_BUS_SPACE_IO) {
if (addr1 >= addr2) {
/* src after dest: copy forward */
diff --git a/sys/ia64/include/bus.h b/sys/ia64/include/bus.h
index e974a93..966a75d3 100644
--- a/sys/ia64/include/bus.h
+++ b/sys/ia64/include/bus.h
@@ -91,9 +91,6 @@
#ifndef _MACHINE_BUS_H_
#define _MACHINE_BUS_H_
-#include <sys/param.h>
-#include <sys/systm.h>
-
#include <machine/_bus.h>
#include <machine/cpufunc.h>
@@ -301,7 +298,7 @@ static __inline void
bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint8_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_multi_io_1(bsh + ofs, bufp, count);
else {
@@ -314,7 +311,7 @@ static __inline void
bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint16_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_multi_io_2(bsh + ofs, bufp, count);
else {
@@ -327,7 +324,7 @@ static __inline void
bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint32_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_multi_io_4(bsh + ofs, bufp, count);
else {
@@ -340,7 +337,7 @@ static __inline void
bus_space_read_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint64_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_multi_io_8(bsh + ofs, bufp, count);
else {
@@ -364,7 +361,7 @@ static __inline void
bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint8_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_multi_io_1(bsh + ofs, bufp, count);
else {
@@ -377,7 +374,7 @@ static __inline void
bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint16_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_multi_io_2(bsh + ofs, bufp, count);
else {
@@ -390,7 +387,7 @@ static __inline void
bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint32_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_multi_io_4(bsh + ofs, bufp, count);
else {
@@ -403,7 +400,7 @@ static __inline void
bus_space_write_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint64_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_multi_io_8(bsh + ofs, bufp, count);
else {
@@ -428,7 +425,7 @@ static __inline void
bus_space_read_region_1(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint8_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_region_io_1(bsh + ofs, bufp, count);
else {
@@ -442,7 +439,7 @@ static __inline void
bus_space_read_region_2(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint16_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_region_io_2(bsh + ofs, bufp, count);
else {
@@ -456,7 +453,7 @@ static __inline void
bus_space_read_region_4(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint32_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_region_io_4(bsh + ofs, bufp, count);
else {
@@ -470,7 +467,7 @@ static __inline void
bus_space_read_region_8(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint64_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_read_region_io_8(bsh + ofs, bufp, count);
else {
@@ -496,7 +493,7 @@ static __inline void
bus_space_write_region_1(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint8_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_region_io_1(bsh + ofs, bufp, count);
else {
@@ -510,7 +507,7 @@ static __inline void
bus_space_write_region_2(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint16_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_region_io_2(bsh + ofs, bufp, count);
else {
@@ -524,7 +521,7 @@ static __inline void
bus_space_write_region_4(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint32_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_region_io_4(bsh + ofs, bufp, count);
else {
@@ -538,7 +535,7 @@ static __inline void
bus_space_write_region_8(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, const uint64_t *bufp, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_write_region_io_8(bsh + ofs, bufp, count);
else {
@@ -558,7 +555,7 @@ static __inline void
bus_space_set_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint8_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
while (count-- > 0)
bus_space_write_1(bst, bsh, ofs, val);
}
@@ -567,7 +564,7 @@ static __inline void
bus_space_set_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint16_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
while (count-- > 0)
bus_space_write_2(bst, bsh, ofs, val);
}
@@ -576,7 +573,7 @@ static __inline void
bus_space_set_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint32_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
while (count-- > 0)
bus_space_write_4(bst, bsh, ofs, val);
}
@@ -585,7 +582,7 @@ static __inline void
bus_space_set_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint64_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
while (count-- > 0)
bus_space_write_8(bst, bsh, ofs, val);
}
@@ -606,7 +603,7 @@ static __inline void
bus_space_set_region_1(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint8_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_set_region_io_1(bsh + ofs, val, count);
else {
@@ -620,7 +617,7 @@ static __inline void
bus_space_set_region_2(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint16_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_set_region_io_2(bsh + ofs, val, count);
else {
@@ -634,7 +631,7 @@ static __inline void
bus_space_set_region_4(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint32_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_set_region_io_4(bsh + ofs, val, count);
else {
@@ -648,7 +645,7 @@ static __inline void
bus_space_set_region_8(bus_space_tag_t bst, bus_space_handle_t bsh,
bus_size_t ofs, uint64_t val, size_t count)
{
- KASSERT(count != 0, ("%s: count == 0", __func__));
+
if (__predict_false(bst == IA64_BUS_SPACE_IO))
bus_space_set_region_io_4(bsh + ofs, val, count);
else {
@@ -677,7 +674,6 @@ bus_space_copy_region_1(bus_space_tag_t bst, bus_space_handle_t sbsh,
{
uint8_t *dst, *src;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (__predict_false(bst == IA64_BUS_SPACE_IO)) {
bus_space_copy_region_io_1(sbsh + sofs, dbsh + dofs, count);
return;
@@ -702,7 +698,6 @@ bus_space_copy_region_2(bus_space_tag_t bst, bus_space_handle_t sbsh,
{
uint16_t *dst, *src;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (__predict_false(bst == IA64_BUS_SPACE_IO)) {
bus_space_copy_region_io_2(sbsh + sofs, dbsh + dofs, count);
return;
@@ -727,7 +722,6 @@ bus_space_copy_region_4(bus_space_tag_t bst, bus_space_handle_t sbsh,
{
uint32_t *dst, *src;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (__predict_false(bst == IA64_BUS_SPACE_IO)) {
bus_space_copy_region_io_4(sbsh + sofs, dbsh + dofs, count);
return;
@@ -752,7 +746,6 @@ bus_space_copy_region_8(bus_space_tag_t bst, bus_space_handle_t sbsh,
{
uint64_t *dst, *src;
- KASSERT(count != 0, ("%s: count == 0", __func__));
if (__predict_false(bst == IA64_BUS_SPACE_IO)) {
bus_space_copy_region_io_8(sbsh + sofs, dbsh + dofs, count);
return;
diff --git a/sys/mips/include/bus.h b/sys/mips/include/bus.h
index 6e47347..af83d36 100644
--- a/sys/mips/include/bus.h
+++ b/sys/mips/include/bus.h
@@ -73,9 +73,6 @@
#ifndef _MACHINE_BUS_H_
#define _MACHINE_BUS_H_
-#include <sys/param.h>
-#include <sys/systm.h>
-
#include <machine/_bus.h>
struct bus_space {
@@ -317,29 +314,21 @@ struct bus_space {
* Bus read multiple operations.
*/
#define bus_space_read_multi_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \
__bs_nonsingle(rm,1,(t),(h),(o),(a),(c))
#define bus_space_read_multi_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_2: count == 0")); \
__bs_nonsingle(rm,2,(t),(h),(o),(a),(c))
#define bus_space_read_multi_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_4: count == 0")); \
__bs_nonsingle(rm,4,(t),(h),(o),(a),(c))
#define bus_space_read_multi_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_8: count == 0")); \
__bs_nonsingle(rm,8,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_1: count == 0")); \
__bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_2: count == 0")); \
__bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_4: count == 0")); \
__bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_8: count == 0")); \
__bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c))
@@ -347,33 +336,21 @@ struct bus_space {
* Bus read region operations.
*/
#define bus_space_read_region_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_1: count == 0")); \
__bs_nonsingle(rr,1,(t),(h),(o),(a),(c))
#define bus_space_read_region_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_2: count == 0")); \
__bs_nonsingle(rr,2,(t),(h),(o),(a),(c))
#define bus_space_read_region_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_4: count == 0")); \
__bs_nonsingle(rr,4,(t),(h),(o),(a),(c))
#define bus_space_read_region_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_8: count == 0")); \
__bs_nonsingle(rr,8,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_read_region_stream_1: count == 0")); \
__bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_read_region_stream_2: count == 0")); \
__bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_read_region_stream_4: count == 0")); \
__bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_read_region_stream_8: count == 0")); \
__bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c))
@@ -395,33 +372,21 @@ struct bus_space {
* Bus write multiple operations.
*/
#define bus_space_write_multi_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_1: count == 0")); \
__bs_nonsingle(wm,1,(t),(h),(o),(a),(c))
#define bus_space_write_multi_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_2: count == 0")); \
__bs_nonsingle(wm,2,(t),(h),(o),(a),(c))
#define bus_space_write_multi_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_4: count == 0")); \
__bs_nonsingle(wm,4,(t),(h),(o),(a),(c))
#define bus_space_write_multi_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_8: count == 0")); \
__bs_nonsingle(wm,8,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_multi_stream_1: count == 0")); \
__bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_multi_stream_2: count == 0")); \
__bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_multi_stream_4: count == 0")); \
__bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_multi_stream_8: count == 0")); \
__bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c))
@@ -429,50 +394,34 @@ struct bus_space {
* Bus write region operations.
*/
#define bus_space_write_region_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_1: count == 0")); \
__bs_nonsingle(wr,1,(t),(h),(o),(a),(c))
#define bus_space_write_region_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_2: count == 0")); \
__bs_nonsingle(wr,2,(t),(h),(o),(a),(c))
#define bus_space_write_region_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_4: count == 0")); \
__bs_nonsingle(wr,4,(t),(h),(o),(a),(c))
#define bus_space_write_region_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_8: count == 0")); \
__bs_nonsingle(wr,8,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_1(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_1: count == 0")); \
__bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_2: count == 0")); \
__bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_4: count == 0")); \
__bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_8: count == 0")); \
__bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c))
/*
* Set multiple operations.
*/
-#define bus_space_set_multi_1(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_1: count == 0")); \
+#define bus_space_set_multi_1(t, h, o, v, c) \
__bs_set(sm,1,(t),(h),(o),(v),(c))
-#define bus_space_set_multi_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_2: count == 0")); \
+#define bus_space_set_multi_2(t, h, o, v, c) \
__bs_set(sm,2,(t),(h),(o),(v),(c))
-#define bus_space_set_multi_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_4: count == 0")); \
+#define bus_space_set_multi_4(t, h, o, v, c) \
__bs_set(sm,4,(t),(h),(o),(v),(c))
-#define bus_space_set_multi_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_8: count == 0")); \
+#define bus_space_set_multi_8(t, h, o, v, c) \
__bs_set(sm,8,(t),(h),(o),(v),(c))
@@ -480,33 +429,25 @@ struct bus_space {
* Set region operations.
*/
#define bus_space_set_region_1(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_1: count == 0")); \
__bs_set(sr,1,(t),(h),(o),(v),(c))
#define bus_space_set_region_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_2: count == 0")); \
__bs_set(sr,2,(t),(h),(o),(v),(c))
#define bus_space_set_region_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_4: count == 0")); \
__bs_set(sr,4,(t),(h),(o),(v),(c))
#define bus_space_set_region_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_8: count == 0")); \
__bs_set(sr,8,(t),(h),(o),(v),(c))
/*
* Copy operations.
*/
-#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_1: count == 0")); \
+#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
__bs_copy(1, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_2: count == 0")); \
+#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
__bs_copy(2, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_4: count == 0")); \
+#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
__bs_copy(4, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_8: count == 0")); \
+#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
__bs_copy(8, t, h1, o1, h2, o2, c)
/*
diff --git a/sys/pc98/include/bus.h b/sys/pc98/include/bus.h
index a31590e..b12845c 100644
--- a/sys/pc98/include/bus.h
+++ b/sys/pc98/include/bus.h
@@ -78,7 +78,6 @@
#ifndef _PC98_BUS_H_
#define _PC98_BUS_H_
-#include <sys/param.h>
#include <sys/systm.h>
#include <machine/_bus.h>
@@ -379,7 +378,7 @@ bus_space_read_multi_##BWN (tag, bsh, offset, buf, cnt) \
TYPE *buf; \
size_t cnt; \
{ \
- KASSERT(cnt != 0, ("count == 0")); \
+ \
__asm __volatile("call *%3" \
:"=c" (cnt), \
"=d" (offset), \
@@ -408,7 +407,7 @@ bus_space_write_multi_##BWN (tag, bsh, offset, buf, cnt) \
const TYPE *buf; \
size_t cnt; \
{ \
- KASSERT(cnt != 0, ("count == 0")); \
+ \
__asm __volatile("call *%3" \
:"=c" (cnt), \
"=d" (offset), \
@@ -434,10 +433,10 @@ bus_space_read_region_##BWN (tag, bsh, offset, buf, cnt) \
bus_space_tag_t tag; \
bus_space_handle_t bsh; \
bus_size_t offset; \
- TYPE *buf; \
+ TYPE *buf; \
size_t cnt; \
{ \
- KASSERT(cnt != 0, ("count == 0")); \
+ \
__asm __volatile("call *%3" \
:"=c" (cnt), \
"=d" (offset), \
@@ -466,7 +465,7 @@ bus_space_write_region_##BWN (tag, bsh, offset, buf, cnt) \
const TYPE *buf; \
size_t cnt; \
{ \
- KASSERT(cnt != 0, ("count == 0")); \
+ \
__asm __volatile("call *%3" \
:"=c" (cnt), \
"=d" (offset), \
@@ -495,7 +494,7 @@ bus_space_set_multi_##BWN (tag, bsh, offset, val, cnt) \
TYPE val; \
size_t cnt; \
{ \
- KASSERT(cnt != 0, ("count == 0")); \
+ \
__asm __volatile("call *%2" \
:"=c" (cnt), \
"=d" (offset) \
@@ -523,7 +522,7 @@ bus_space_set_region_##BWN (tag, bsh, offset, val, cnt) \
TYPE val; \
size_t cnt; \
{ \
- KASSERT(cnt != 0, ("count == 0")); \
+ \
__asm __volatile("call *%2" \
:"=c" (cnt), \
"=d" (offset) \
@@ -556,7 +555,6 @@ bus_space_copy_region_##BWN (tag, sbsh, src, dbsh, dst, cnt) \
if (dbsh->bsh_bam.bs_copy_region_1 != sbsh->bsh_bam.bs_copy_region_1) \
panic("bus_space_copy_region: funcs mismatch (ENOSUPPORT)");\
\
- KASSERT(cnt != 0, ("count == 0")); \
__asm __volatile("call *%3" \
:"=c" (cnt), \
"=S" (src), \
diff --git a/sys/powerpc/include/bus.h b/sys/powerpc/include/bus.h
index a96e7c8..420d022 100644
--- a/sys/powerpc/include/bus.h
+++ b/sys/powerpc/include/bus.h
@@ -73,9 +73,6 @@
#ifndef _MACHINE_BUS_H_
#define _MACHINE_BUS_H_
-#include <sys/param.h>
-#include <sys/systm.h>
-
#include <machine/_bus.h>
#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
@@ -314,57 +311,40 @@ extern struct bus_space bs_le_tag;
* Bus read multiple operations.
*/
#define bus_space_read_multi_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \
__bs_nonsingle(rm,1,(t),(h),(o),(a),(c))
#define bus_space_read_multi_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_2: count == 0")); \
__bs_nonsingle(rm,2,(t),(h),(o),(a),(c))
#define bus_space_read_multi_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_4: count == 0")); \
__bs_nonsingle(rm,4,(t),(h),(o),(a),(c))
#define bus_space_read_multi_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_8: count == 0")); \
__bs_nonsingle(rm,8,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_1 bus_space_read_multi_1
#define bus_space_read_multi_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_2: count == 0")); \
__bs_nonsingle(rm,s_2,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_4: count == 0")); \
__bs_nonsingle(rm,s_4,(t),(h),(o),(a),(c))
#define bus_space_read_multi_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_multi_stream_8: count == 0")); \
__bs_nonsingle(rm,s_8,(t),(h),(o),(a),(c))
/*
* Bus read region operations.
*/
#define bus_space_read_region_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_1: count == 0")); \
__bs_nonsingle(rr,1,(t),(h),(o),(a),(c))
#define bus_space_read_region_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_2: count == 0")); \
__bs_nonsingle(rr,2,(t),(h),(o),(a),(c))
#define bus_space_read_region_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_4: count == 0")); \
__bs_nonsingle(rr,4,(t),(h),(o),(a),(c))
#define bus_space_read_region_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_read_region_8: count == 0")); \
__bs_nonsingle(rr,8,(t),(h),(o),(a),(c))
#define bus_space_read_region_stream_1 bus_space_read_region_1
-#define bus_space_read_region_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_read_region_stream_2: count == 0")); \
+#define bus_space_read_region_stream_2(t, h, o, a, c) \
__bs_nonsingle(rr,s_2,(t),(h),(o),(a),(c))
-#define bus_space_read_region_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_read_region_stream_4: count == 0")); \
+#define bus_space_read_region_stream_4(t, h, o, a, c) \
__bs_nonsingle(rr,s_4,(t),(h),(o),(a),(c))
-#define bus_space_read_region_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_read_region_stream_8: count == 0")); \
+#define bus_space_read_region_stream_8(t, h, o, a, c) \
__bs_nonsingle(rr,s_8,(t),(h),(o),(a),(c))
/*
@@ -384,139 +364,101 @@ extern struct bus_space bs_le_tag;
* Bus write multiple operations.
*/
#define bus_space_write_multi_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_1: count == 0")); \
__bs_nonsingle(wm,1,(t),(h),(o),(a),(c))
#define bus_space_write_multi_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_2: count == 0")); \
__bs_nonsingle(wm,2,(t),(h),(o),(a),(c))
#define bus_space_write_multi_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_4: count == 0")); \
__bs_nonsingle(wm,4,(t),(h),(o),(a),(c))
#define bus_space_write_multi_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_8: count == 0")); \
__bs_nonsingle(wm,8,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_1 bus_space_write_multi_1
#define bus_space_write_multi_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_stream_2: count == 0"));\
__bs_nonsingle(wm,s_2,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_stream_4: count == 0"));\
__bs_nonsingle(wm,s_4,(t),(h),(o),(a),(c))
#define bus_space_write_multi_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_multi_stream_8: count == 0"));\
__bs_nonsingle(wm,s_8,(t),(h),(o),(a),(c))
/*
* Bus write region operations.
*/
#define bus_space_write_region_1(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_1: count == 0")); \
__bs_nonsingle(wr,1,(t),(h),(o),(a),(c))
#define bus_space_write_region_2(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_2: count == 0")); \
__bs_nonsingle(wr,2,(t),(h),(o),(a),(c))
#define bus_space_write_region_4(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_4: count == 0")); \
__bs_nonsingle(wr,4,(t),(h),(o),(a),(c))
-#define bus_space_write_region_8(t, h, o, a, c) \
- KASSERT(c != 0, ("bus_space_write_region_8: count == 0")); \
+#define bus_space_write_region_8(t, h, o, a, c) \
__bs_nonsingle(wr,8,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_1 bus_space_write_region_1
#define bus_space_write_region_stream_2(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_2: count == 0")); \
__bs_nonsingle(wr,s_2,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_4(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_4: count == 0")); \
__bs_nonsingle(wr,s_4,(t),(h),(o),(a),(c))
#define bus_space_write_region_stream_8(t, h, o, a, c) \
- KASSERT(c != 0, \
- ("bus_space_write_region_stream_8: count == 0")); \
__bs_nonsingle(wr,s_8,(t),(h),(o),(a),(c))
/*
* Set multiple operations.
*/
#define bus_space_set_multi_1(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_1: count == 0")); \
__bs_set(sm,1,(t),(h),(o),(v),(c))
#define bus_space_set_multi_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_2: count == 0")); \
__bs_set(sm,2,(t),(h),(o),(v),(c))
#define bus_space_set_multi_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_4: count == 0")); \
__bs_set(sm,4,(t),(h),(o),(v),(c))
#define bus_space_set_multi_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_8: count == 0")); \
__bs_set(sm,8,(t),(h),(o),(v),(c))
#define bus_space_set_multi_stream_1 bus_space_set_multi_1
#define bus_space_set_multi_stream_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_stream_2: count == 0")); \
__bs_set(sm,s_2,(t),(h),(o),(v),(c))
#define bus_space_set_multi_stream_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_stream_4: count == 0")); \
__bs_set(sm,s_4,(t),(h),(o),(v),(c))
#define bus_space_set_multi_stream_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_multi_stream_8: count == 0")); \
__bs_set(sm,s_8,(t),(h),(o),(v),(c))
/*
* Set region operations.
*/
#define bus_space_set_region_1(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_1: count == 0")); \
__bs_set(sr,1,(t),(h),(o),(v),(c))
#define bus_space_set_region_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_2: count == 0")); \
__bs_set(sr,2,(t),(h),(o),(v),(c))
#define bus_space_set_region_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_4: count == 0")); \
__bs_set(sr,4,(t),(h),(o),(v),(c))
#define bus_space_set_region_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_8: count == 0")); \
__bs_set(sr,8,(t),(h),(o),(v),(c))
#define bus_space_set_region_stream_1 bus_space_set_region_1
#define bus_space_set_region_stream_2(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_stream_2: count == 0")); \
__bs_set(sr,s_2,(t),(h),(o),(v),(c))
#define bus_space_set_region_stream_4(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_stream_4: count == 0")); \
__bs_set(sr,s_4,(t),(h),(o),(v),(c))
#define bus_space_set_region_stream_8(t, h, o, v, c) \
- KASSERT(c != 0, ("bus_space_set_region_stream_8: count == 0")); \
__bs_set(sr,s_8,(t),(h),(o),(v),(c))
#if 0
/*
* Copy operations.
*/
-#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_1: count == 0")); \
+#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \
__bs_copy(1, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_2: count == 0")); \
+#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \
__bs_copy(2, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_4: count == 0")); \
+#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \
__bs_copy(4, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_8: count == 0")); \
+#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \
__bs_copy(8, t, h1, o1, h2, o2, c)
#define bus_space_copy_region_stream_1 bus_space_copy_region_1
-#define bus_space_copy_region_stream_2(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_stream_2: count == 0")) \
+#define bus_space_copy_region_stream_2(t, h1, o1, h2, o2, c) \
__bs_copy(s_2, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_stream_4: count == 0")) \
+#define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \
__bs_copy(s_4, t, h1, o1, h2, o2, c)
-#define bus_space_copy_region_stream_8(t, h1, o1, h2, o2, c) \
- KASSERT(c != 0, ("bus_space_copy_region_stream_8: count == 0")) \
+#define bus_space_copy_region_stream_8(t, h1, o1, h2, o2, c) \
__bs_copy(s_8, t, h1, o1, h2, o2, c)
#endif
diff --git a/sys/sparc64/include/bus.h b/sys/sparc64/include/bus.h
index 3348602..da942b6 100644
--- a/sys/sparc64/include/bus.h
+++ b/sys/sparc64/include/bus.h
@@ -75,9 +75,6 @@
#ifndef _MACHINE_BUS_H_
#define _MACHINE_BUS_H_
-#include <sys/param.h>
-#include <sys/systm.h>
-
#ifdef BUS_SPACE_DEBUG
#include <sys/ktr.h>
#endif
@@ -242,7 +239,7 @@ static __inline void
bus_space_read_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_1(t, h, o);
}
@@ -251,7 +248,7 @@ static __inline void
bus_space_read_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_2(t, h, o);
}
@@ -260,7 +257,7 @@ static __inline void
bus_space_read_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_4(t, h, o);
}
@@ -269,7 +266,7 @@ static __inline void
bus_space_read_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_8(t, h, o);
}
@@ -314,7 +311,7 @@ static __inline void
bus_space_write_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_1(t, h, o, *a++);
}
@@ -323,7 +320,7 @@ static __inline void
bus_space_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_2(t, h, o, *a++);
}
@@ -332,7 +329,7 @@ static __inline void
bus_space_write_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_4(t, h, o, *a++);
}
@@ -341,7 +338,7 @@ static __inline void
bus_space_write_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_8(t, h, o, *a++);
}
@@ -350,7 +347,7 @@ static __inline void
bus_space_set_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint8_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_1(t, h, o, v);
}
@@ -359,7 +356,7 @@ static __inline void
bus_space_set_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint16_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_2(t, h, o, v);
}
@@ -368,7 +365,7 @@ static __inline void
bus_space_set_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint32_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_4(t, h, o, v);
}
@@ -377,7 +374,7 @@ static __inline void
bus_space_set_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint64_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_8(t, h, o, v);
}
@@ -386,7 +383,7 @@ static __inline void
bus_space_read_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
*a = bus_space_read_1(t, h, o);
}
@@ -395,7 +392,7 @@ static __inline void
bus_space_read_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
*a = bus_space_read_2(t, h, o);
}
@@ -404,7 +401,7 @@ static __inline void
bus_space_read_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
*a = bus_space_read_4(t, h, o);
}
@@ -413,7 +410,7 @@ static __inline void
bus_space_read_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
*a = bus_space_read_8(t, h, o);
}
@@ -422,7 +419,7 @@ static __inline void
bus_space_write_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
bus_space_write_1(t, h, o, *a);
}
@@ -431,7 +428,7 @@ static __inline void
bus_space_write_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
bus_space_write_2(t, h, o, *a);
}
@@ -440,7 +437,7 @@ static __inline void
bus_space_write_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
bus_space_write_4(t, h, o, *a);
}
@@ -449,7 +446,7 @@ static __inline void
bus_space_write_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
bus_space_write_8(t, h, o, *a);
}
@@ -458,7 +455,7 @@ static __inline void
bus_space_set_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint8_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o++)
bus_space_write_1(t, h, o, v);
}
@@ -467,7 +464,7 @@ static __inline void
bus_space_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint16_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 2)
bus_space_write_2(t, h, o, v);
}
@@ -476,7 +473,7 @@ static __inline void
bus_space_set_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint32_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 4)
bus_space_write_4(t, h, o, v);
}
@@ -485,7 +482,7 @@ static __inline void
bus_space_set_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint64_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 8)
bus_space_write_8(t, h, o, v);
}
@@ -494,7 +491,7 @@ static __inline void
bus_space_copy_region_1(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1++, o2++)
bus_space_write_1(t, h1, o1, bus_space_read_1(t, h2, o2));
}
@@ -503,7 +500,7 @@ static __inline void
bus_space_copy_region_2(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 2, o2 += 2)
bus_space_write_2(t, h1, o1, bus_space_read_2(t, h2, o2));
}
@@ -512,7 +509,7 @@ static __inline void
bus_space_copy_region_4(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 4, o2 += 4)
bus_space_write_4(t, h1, o1, bus_space_read_4(t, h2, o2));
}
@@ -521,7 +518,7 @@ static __inline void
bus_space_copy_region_8(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 8, o2 += 8)
bus_space_write_8(t, h1, o1, bus_space_read_8(t, h2, o2));
}
@@ -562,7 +559,7 @@ static __inline void
bus_space_read_multi_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_1(t, h, o);
}
@@ -571,7 +568,7 @@ static __inline void
bus_space_read_multi_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_2(t, h, o);
}
@@ -580,7 +577,7 @@ static __inline void
bus_space_read_multi_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_4(t, h, o);
}
@@ -589,7 +586,7 @@ static __inline void
bus_space_read_multi_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_8(t, h, o);
}
@@ -634,7 +631,7 @@ static __inline void
bus_space_write_multi_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_1(t, h, o, *a++);
}
@@ -643,7 +640,7 @@ static __inline void
bus_space_write_multi_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_2(t, h, o, *a++);
}
@@ -652,7 +649,7 @@ static __inline void
bus_space_write_multi_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_4(t, h, o, *a++);
}
@@ -661,7 +658,7 @@ static __inline void
bus_space_write_multi_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_8(t, h, o, *a++);
}
@@ -670,7 +667,7 @@ static __inline void
bus_space_set_multi_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint8_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_1(t, h, o, v);
}
@@ -679,7 +676,7 @@ static __inline void
bus_space_set_multi_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint16_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_2(t, h, o, v);
}
@@ -688,7 +685,7 @@ static __inline void
bus_space_set_multi_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint32_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_4(t, h, o, v);
}
@@ -697,7 +694,7 @@ static __inline void
bus_space_set_multi_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint64_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_8(t, h, o, v);
}
@@ -706,7 +703,7 @@ static __inline void
bus_space_read_region_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
*a = bus_space_read_stream_1(t, h, o);
}
@@ -715,7 +712,7 @@ static __inline void
bus_space_read_region_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
*a = bus_space_read_stream_2(t, h, o);
}
@@ -724,7 +721,7 @@ static __inline void
bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
*a = bus_space_read_stream_4(t, h, o);
}
@@ -733,7 +730,7 @@ static __inline void
bus_space_read_region_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
*a = bus_space_read_stream_8(t, h, o);
}
@@ -742,7 +739,7 @@ static __inline void
bus_space_write_region_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
bus_space_write_stream_1(t, h, o, *a);
}
@@ -751,7 +748,7 @@ static __inline void
bus_space_write_region_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
bus_space_write_stream_2(t, h, o, *a);
}
@@ -760,7 +757,7 @@ static __inline void
bus_space_write_region_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
bus_space_write_stream_4(t, h, o, *a);
}
@@ -769,7 +766,7 @@ static __inline void
bus_space_write_region_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
bus_space_write_stream_8(t, h, o, *a);
}
@@ -778,7 +775,7 @@ static __inline void
bus_space_set_region_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint8_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o++)
bus_space_write_stream_1(t, h, o, v);
}
@@ -787,7 +784,7 @@ static __inline void
bus_space_set_region_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint16_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 2)
bus_space_write_stream_2(t, h, o, v);
}
@@ -796,7 +793,7 @@ static __inline void
bus_space_set_region_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint32_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 4)
bus_space_write_stream_4(t, h, o, v);
}
@@ -805,7 +802,7 @@ static __inline void
bus_space_set_region_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint64_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 8)
bus_space_write_stream_8(t, h, o, v);
}
@@ -814,7 +811,7 @@ static __inline void
bus_space_copy_region_stream_1(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1++, o2++)
bus_space_write_stream_1(t, h1, o1, bus_space_read_stream_1(t, h2,
o2));
@@ -824,7 +821,7 @@ static __inline void
bus_space_copy_region_stream_2(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 2, o2 += 2)
bus_space_write_stream_2(t, h1, o1, bus_space_read_stream_2(t, h2,
o2));
@@ -834,7 +831,7 @@ static __inline void
bus_space_copy_region_stream_4(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 4, o2 += 4)
bus_space_write_stream_4(t, h1, o1, bus_space_read_stream_4(t, h2,
o2));
@@ -844,7 +841,7 @@ static __inline void
bus_space_copy_region_stream_8(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 8, o2 += 8)
bus_space_write_stream_8(t, h1, o1, bus_space_read_8(t, h2, o2));
}
diff --git a/sys/sun4v/include/bus.h b/sys/sun4v/include/bus.h
index 8fe0731..51a7ea5 100644
--- a/sys/sun4v/include/bus.h
+++ b/sys/sun4v/include/bus.h
@@ -79,9 +79,6 @@
#include <sys/ktr.h>
#endif
-#include <sys/param.h>
-#include <sys/systm.h>
-
#include <machine/_bus.h>
#include <machine/cpufunc.h>
@@ -242,7 +239,7 @@ static __inline void
bus_space_read_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_1(t, h, o);
}
@@ -251,7 +248,7 @@ static __inline void
bus_space_read_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_2(t, h, o);
}
@@ -260,7 +257,7 @@ static __inline void
bus_space_read_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_4(t, h, o);
}
@@ -269,7 +266,7 @@ static __inline void
bus_space_read_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_8(t, h, o);
}
@@ -314,7 +311,7 @@ static __inline void
bus_space_write_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_1(t, h, o, *a++);
}
@@ -323,7 +320,7 @@ static __inline void
bus_space_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_2(t, h, o, *a++);
}
@@ -332,7 +329,7 @@ static __inline void
bus_space_write_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_4(t, h, o, *a++);
}
@@ -341,7 +338,7 @@ static __inline void
bus_space_write_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_8(t, h, o, *a++);
}
@@ -350,7 +347,7 @@ static __inline void
bus_space_set_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint8_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_1(t, h, o, v);
}
@@ -359,7 +356,7 @@ static __inline void
bus_space_set_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint16_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_2(t, h, o, v);
}
@@ -368,7 +365,7 @@ static __inline void
bus_space_set_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint32_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_4(t, h, o, v);
}
@@ -377,7 +374,7 @@ static __inline void
bus_space_set_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint64_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_8(t, h, o, v);
}
@@ -386,7 +383,7 @@ static __inline void
bus_space_read_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
*a = bus_space_read_1(t, h, o);
}
@@ -395,7 +392,7 @@ static __inline void
bus_space_read_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
*a = bus_space_read_2(t, h, o);
}
@@ -404,7 +401,7 @@ static __inline void
bus_space_read_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
*a = bus_space_read_4(t, h, o);
}
@@ -413,7 +410,7 @@ static __inline void
bus_space_read_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
*a = bus_space_read_8(t, h, o);
}
@@ -422,7 +419,7 @@ static __inline void
bus_space_write_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
bus_space_write_1(t, h, o, *a);
}
@@ -431,7 +428,7 @@ static __inline void
bus_space_write_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
bus_space_write_2(t, h, o, *a);
}
@@ -440,7 +437,7 @@ static __inline void
bus_space_write_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
bus_space_write_4(t, h, o, *a);
}
@@ -449,7 +446,7 @@ static __inline void
bus_space_write_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
bus_space_write_8(t, h, o, *a);
}
@@ -458,7 +455,7 @@ static __inline void
bus_space_set_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint8_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o++)
bus_space_write_1(t, h, o, v);
}
@@ -467,7 +464,7 @@ static __inline void
bus_space_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint16_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 2)
bus_space_write_2(t, h, o, v);
}
@@ -476,7 +473,7 @@ static __inline void
bus_space_set_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint32_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 4)
bus_space_write_4(t, h, o, v);
}
@@ -485,7 +482,7 @@ static __inline void
bus_space_set_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
const uint64_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 8)
bus_space_write_8(t, h, o, v);
}
@@ -494,7 +491,7 @@ static __inline void
bus_space_copy_region_1(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1++, o2++)
bus_space_write_1(t, h1, o1, bus_space_read_1(t, h2, o2));
}
@@ -503,7 +500,7 @@ static __inline void
bus_space_copy_region_2(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 2, o2 += 2)
bus_space_write_2(t, h1, o1, bus_space_read_2(t, h2, o2));
}
@@ -512,7 +509,7 @@ static __inline void
bus_space_copy_region_4(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 4, o2 += 4)
bus_space_write_4(t, h1, o1, bus_space_read_4(t, h2, o2));
}
@@ -521,7 +518,7 @@ static __inline void
bus_space_copy_region_8(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 8, o2 += 8)
bus_space_write_8(t, h1, o1, bus_space_read_8(t, h2, o2));
}
@@ -562,7 +559,7 @@ static __inline void
bus_space_read_multi_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_1(t, h, o);
}
@@ -571,7 +568,7 @@ static __inline void
bus_space_read_multi_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_2(t, h, o);
}
@@ -580,7 +577,7 @@ static __inline void
bus_space_read_multi_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_4(t, h, o);
}
@@ -589,7 +586,7 @@ static __inline void
bus_space_read_multi_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
*a++ = bus_space_read_stream_8(t, h, o);
}
@@ -634,7 +631,7 @@ static __inline void
bus_space_write_multi_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint8_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_1(t, h, o, *a++);
}
@@ -643,7 +640,7 @@ static __inline void
bus_space_write_multi_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint16_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_2(t, h, o, *a++);
}
@@ -652,7 +649,7 @@ static __inline void
bus_space_write_multi_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint32_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_4(t, h, o, *a++);
}
@@ -661,7 +658,7 @@ static __inline void
bus_space_write_multi_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint64_t *a, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_8(t, h, o, *a++);
}
@@ -670,7 +667,7 @@ static __inline void
bus_space_set_multi_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint8_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_1(t, h, o, v);
}
@@ -679,7 +676,7 @@ static __inline void
bus_space_set_multi_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint16_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_2(t, h, o, v);
}
@@ -688,7 +685,7 @@ static __inline void
bus_space_set_multi_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint32_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_4(t, h, o, v);
}
@@ -697,7 +694,7 @@ static __inline void
bus_space_set_multi_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint64_t v, size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
while (c-- > 0)
bus_space_write_stream_8(t, h, o, v);
}
@@ -706,7 +703,7 @@ static __inline void
bus_space_read_region_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
*a = bus_space_read_stream_1(t, h, o);
}
@@ -715,7 +712,7 @@ static __inline void
bus_space_read_region_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
*a = bus_space_read_stream_2(t, h, o);
}
@@ -724,7 +721,7 @@ static __inline void
bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
*a = bus_space_read_stream_4(t, h, o);
}
@@ -733,7 +730,7 @@ static __inline void
bus_space_read_region_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
*a = bus_space_read_stream_8(t, h, o);
}
@@ -742,7 +739,7 @@ static __inline void
bus_space_write_region_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint8_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o++)
bus_space_write_stream_1(t, h, o, *a);
}
@@ -751,7 +748,7 @@ static __inline void
bus_space_write_region_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint16_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 2)
bus_space_write_stream_2(t, h, o, *a);
}
@@ -760,7 +757,7 @@ static __inline void
bus_space_write_region_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint32_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 4)
bus_space_write_stream_4(t, h, o, *a);
}
@@ -769,7 +766,7 @@ static __inline void
bus_space_write_region_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint64_t *a, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; a++, c--, o += 8)
bus_space_write_stream_8(t, h, o, *a);
}
@@ -778,7 +775,7 @@ static __inline void
bus_space_set_region_stream_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint8_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o++)
bus_space_write_stream_1(t, h, o, v);
}
@@ -787,7 +784,7 @@ static __inline void
bus_space_set_region_stream_2(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint16_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 2)
bus_space_write_stream_2(t, h, o, v);
}
@@ -796,7 +793,7 @@ static __inline void
bus_space_set_region_stream_4(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint32_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 4)
bus_space_write_stream_4(t, h, o, v);
}
@@ -805,7 +802,7 @@ static __inline void
bus_space_set_region_stream_8(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t o, const uint64_t v, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o += 8)
bus_space_write_stream_8(t, h, o, v);
}
@@ -814,7 +811,7 @@ static __inline void
bus_space_copy_region_stream_1(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1++, o2++)
bus_space_write_stream_1(t, h1, o1, bus_space_read_stream_1(t, h2,
o2));
@@ -824,7 +821,7 @@ static __inline void
bus_space_copy_region_stream_2(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 2, o2 += 2)
bus_space_write_stream_2(t, h1, o1, bus_space_read_stream_2(t, h2,
o2));
@@ -834,7 +831,7 @@ static __inline void
bus_space_copy_region_stream_4(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 4, o2 += 4)
bus_space_write_stream_4(t, h1, o1, bus_space_read_stream_4(t, h2,
o2));
@@ -844,7 +841,7 @@ static __inline void
bus_space_copy_region_stream_8(bus_space_tag_t t, bus_space_handle_t h1,
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
{
- KASSERT(c != 0, ("%s: count == 0", __func__));
+
for (; c; c--, o1 += 8, o2 += 8)
bus_space_write_stream_8(t, h1, o1, bus_space_read_8(t, h2, o2));
}
OpenPOWER on IntegriCloud