Date: Sat, 28 Apr 2012 10:51:34 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 210308 for review Message-ID: <201204281051.q3SApYqJ033082@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@210308?ac=10 Change 210308 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/04/28 10:51:16 Clean up the MIPS bus_space_generic.c by always implementing missing bus space methods as panic() rather than using NULL pointers. This provides much better debugging information. Primarily, this applied to 64-bit versions of calls, which are generally unimplemented as our MIPS device drivers seem almost universally to perform I/O using 32-bit (or smaller) words. However, also (a) provide panic() implementations for bus space alloc and free and (b) hook up existing unused implementations of "set multiple" methods. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/mips/bus_space_generic.c#5 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/mips/bus_space_generic.c#5 (text+ko) ==== @@ -99,8 +99,8 @@ generic_bs_subregion, /* allocation/deallocation */ - NULL, - NULL, + generic_bs_alloc, + generic_bs_free, /* barrier */ generic_bs_barrier, @@ -109,91 +109,91 @@ generic_bs_r_1, generic_bs_r_2, generic_bs_r_4, - NULL, + generic_bs_r_8, /* read multiple */ generic_bs_rm_1, generic_bs_rm_2, generic_bs_rm_4, - NULL, + generic_bs_rm_8, /* read region */ generic_bs_rr_1, generic_bs_rr_2, generic_bs_rr_4, - NULL, + generic_bs_rr_8, /* write (single) */ generic_bs_w_1, generic_bs_w_2, generic_bs_w_4, - NULL, + generic_bs_w_8, /* write multiple */ generic_bs_wm_1, generic_bs_wm_2, generic_bs_wm_4, - NULL, + generic_bs_wm_8, /* write region */ generic_bs_wr_1, generic_bs_wr_2, generic_bs_wr_4, - NULL, + generic_bs_wr_8, /* set multiple */ - NULL, - NULL, - NULL, - NULL, + generic_bs_sm_1, + generic_bs_sm_2, + generic_bs_sm_4, + generic_bs_sm_8, /* set region */ generic_bs_sr_1, generic_bs_sr_2, generic_bs_sr_4, - NULL, + generic_bs_sr_8, /* copy */ generic_bs_c_1, generic_bs_c_2, generic_bs_c_4, - NULL, + generic_bs_c_8, /* read (single) stream */ generic_bs_r_1, generic_bs_r_2, generic_bs_r_4, - NULL, + generic_bs_r_8, /* read multiple stream */ generic_bs_rm_1, generic_bs_rm_2, generic_bs_rm_4, - NULL, + generic_bs_rm_8, /* read region stream */ generic_bs_rr_1, generic_bs_rr_2, generic_bs_rr_4, - NULL, + generic_bs_rr_8, /* write (single) stream */ generic_bs_w_1, generic_bs_w_2, generic_bs_w_4, - NULL, + generic_bs_w_8, /* write multiple stream */ generic_bs_wm_1, generic_bs_wm_2, generic_bs_wm_4, - NULL, + generic_bs_wm_8, /* write region stream */ generic_bs_wr_1, generic_bs_wr_2, generic_bs_wr_4, - NULL, + generic_bs_wr_8, }; /* Ultra-gross kludge */ @@ -254,6 +254,22 @@ return (0); } +int +generic_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, + bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, + bus_addr_t *bpap, bus_space_handle_t *bshp) +{ + + panic("%s: not implemented", __func__); +} + +void +generic_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) +{ + + panic("%s: not implemented", __func__); +} + uint8_t generic_bs_r_1(void *t, bus_space_handle_t handle, bus_size_t offset) @@ -278,7 +294,13 @@ return (rd32(handle + offset)); } +uint64_t +generic_bs_r_8(void *t, bus_space_handle_t handle, bus_size_t offset) +{ + panic("%s: not implemented", __func__); +} + void generic_bs_rm_1(void *t, bus_space_handle_t bsh, bus_size_t offset, uint8_t *addr, size_t count) @@ -308,6 +330,13 @@ *addr++ = rd32(baddr); } +void +generic_bs_rm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} /* * Read `count' 1, 2, 4, or 8 byte quantities from bus space @@ -350,6 +379,14 @@ } } +void +generic_bs_rr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} + /* * Write the 1, 2, 4, or 8 byte value `value' to bus space * described by tag/handle/offset. @@ -378,6 +415,14 @@ wr32(bsh + offset, value); } +void +generic_bs_w_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t value) +{ + + panic("%s: not implemented", __func__); +} + /* * Write `count' 1, 2, 4, or 8 byte quantities from the buffer * provided to bus space described by tag/handle/offset. @@ -412,6 +457,14 @@ wr32(baddr, *addr++); } +void +generic_bs_wm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + const uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} + /* * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided * to bus space described by tag/handle starting at `offset'. @@ -452,6 +505,14 @@ } } +void +generic_bs_wr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + const uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} + /* * Write the 1, 2, 4, or 8 byte value `val' to bus space described * by tag/handle/offset `count' times. @@ -486,6 +547,14 @@ wr32(addr, value); } +void +generic_bs_sm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t value, size_t count) +{ + + panic("%s: not implemented", __func__); +} + /* * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described * by tag/handle starting at `offset'. @@ -520,6 +589,14 @@ wr32(addr, value); } +void +generic_bs_sr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t value, size_t count) +{ + + panic("%s: not implemented", __func__); +} + /* * Copy `count' 1, 2, 4, or 8 byte values from bus space starting * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. @@ -585,6 +662,14 @@ } void +generic_bs_c_8(void *t, bus_space_handle_t bsh1, bus_size_t off1, + bus_space_handle_t bsh2, bus_size_t off2, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +void generic_bs_barrier(void *t __unused, bus_space_handle_t bsh __unused, bus_size_t offset __unused, bus_size_t len __unused,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204281051.q3SApYqJ033082>