MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bus_space_copy_region_4

Function bus_space_copy_region_4

freebsd/x86/include/bus.h:951–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

949}
950
951static __inline void
952bus_space_copy_region_4(bus_space_tag_t tag, bus_space_handle_t bsh1,
953 bus_size_t off1, bus_space_handle_t bsh2,
954 bus_size_t off2, size_t count)
955{
956 bus_space_handle_t addr1 = bsh1 + off1;
957 bus_space_handle_t addr2 = bsh2 + off2;
958
959 if (tag == X86_BUS_SPACE_IO) {
960 if (addr1 >= addr2) {
961 /* src after dest: copy forward */
962 for (; count != 0; count--, addr1 += 4, addr2 += 4)
963 outl(addr2, inl(addr1));
964 } else {
965 /* dest after src: copy backwards */
966 for (addr1 += 4 * (count - 1), addr2 += 4 * (count - 1);
967 count != 0; count--, addr1 -= 4, addr2 -= 4)
968 outl(addr2, inl(addr1));
969 }
970 } else {
971 if (addr1 >= addr2) {
972 /* src after dest: copy forward */
973 for (; count != 0; count--, addr1 += 4, addr2 += 4)
974 *(volatile u_int32_t *)(addr2) =
975 *(volatile u_int32_t *)(addr1);
976 } else {
977 /* dest after src: copy backwards */
978 for (addr1 += 4 * (count - 1), addr2 += 4 * (count - 1);
979 count != 0; count--, addr1 -= 4, addr2 -= 4)
980 *(volatile u_int32_t *)(addr2) =
981 *(volatile u_int32_t *)(addr1);
982 }
983 }
984}
985
986#if 0 /* Cause a link error for bus_space_copy_8 */
987#define bus_space_copy_region_8 !!! bus_space_copy_region_8 unimplemented !!!

Callers

nothing calls this directly

Calls 2

outlFunction · 0.50
inlFunction · 0.50

Tested by

no test coverage detected