From 6e3faf1602bf6c6c348e207557a56e715392a112 Mon Sep 17 00:00:00 2001 From: brucec Date: Fri, 3 Dec 2010 07:09:23 +0000 Subject: 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. --- sys/mips/include/bus.h | 75 ++++++-------------------------------------------- 1 file changed, 8 insertions(+), 67 deletions(-) (limited to 'sys/mips') 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 -#include - #include 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) /* -- cgit v1.1