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.
This commit is contained in:
Rebecca Cran 2010-12-03 07:09:23 +00:00
parent 549f28a438
commit c90f7d9b44
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216143
10 changed files with 194 additions and 398 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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)
/*

View File

@ -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 */

View File

@ -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;

View File

@ -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)
/*

View File

@ -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), \

View File

@ -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

View File

@ -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));
}

View File

@ -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));
}