aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2015-10-13 17:22:23 +0000
committerConrad Meyer <cem@FreeBSD.org>2015-10-13 17:22:23 +0000
commit150be74358c384d75e84cf6ab05293180e4cf7a2 (patch)
tree2b0bcdb7d5e91f99b340167b4942d7611c06c7c7 /sys
parent08f35652eb838c54014d4bfaf4f6e9ba5c4e0b2a (diff)
downloadsrc-150be74358c384d75e84cf6ab05293180e4cf7a2.tar.gz
src-150be74358c384d75e84cf6ab05293180e4cf7a2.zip
NTB: Enable 32-bit support
Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=289234
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/files.i3862
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw.c20
2 files changed, 22 insertions, 0 deletions
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index da2097b0cfe2..9f04beff1015 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -269,6 +269,8 @@ dev/le/if_le_isa.c optional le isa
dev/mse/mse.c optional mse
dev/mse/mse_isa.c optional mse isa
dev/nfe/if_nfe.c optional nfe pci
+dev/ntb/if_ntb/if_ntb.c optional if_ntb
+dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw
dev/nvd/nvd.c optional nvd nvme
dev/nvme/nvme.c optional nvme
dev/nvme/nvme_ctrlr.c optional nvme
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.c b/sys/dev/ntb/ntb_hw/ntb_hw.c
index 280925b86332..995f73cbf9b8 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw.c
@@ -152,6 +152,26 @@ struct ntb_softc {
uint8_t link_speed;
};
+#ifdef __i386__
+static __inline uint64_t
+bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle,
+ bus_size_t offset)
+{
+
+ return (bus_space_read_4(tag, handle, offset) |
+ ((uint64_t)bus_space_read_4(tag, handle, offset + 4)) << 32);
+}
+
+static __inline void
+bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t handle,
+ bus_size_t offset, uint64_t val)
+{
+
+ bus_space_write_4(tag, handle, offset, val);
+ bus_space_write_4(tag, handle, offset + 4, val >> 32);
+}
+#endif
+
#define ntb_bar_read(SIZE, bar, offset) \
bus_space_read_ ## SIZE (ntb->bar_info[(bar)].pci_bus_tag, \
ntb->bar_info[(bar)].pci_bus_handle, (offset))