diff options
Diffstat (limited to 'sys/ia64/include/bus.h')
-rw-r--r-- | sys/ia64/include/bus.h | 55 |
1 files changed, 24 insertions, 31 deletions
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; |