add FreeBSD support
[dpdk.git] / lib / librte_pmd_virtio / virtio_pci.h
index d1da019..f163877 100644 (file)
 #define _VIRTIO_PCI_H_
 
 #include <stdint.h>
+
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <machine/cpufunc.h>
+#else
 #include <sys/io.h>
+#endif
 
 #include <rte_ethdev.h>
 
@@ -204,6 +210,28 @@ struct virtio_net_config {
 /* The alignment to use between consumer and producer parts of vring. */
 #define VIRTIO_PCI_VRING_ALIGN 4096
 
+#ifdef __FreeBSD__
+
+static inline void
+outb_p(unsigned char data, unsigned int port)
+{
+
+       outb(port, (u_char)data);
+}
+
+static inline void
+outw_p(unsigned short data, unsigned int port)
+{
+       outw(port, (u_short)data);
+}
+
+static inline void
+outl_p(unsigned int data, unsigned int port)
+{
+       outl(port, (u_int)data);
+}
+#endif
+
 #define VIRTIO_PCI_REG_ADDR(hw, reg) \
        (unsigned short)((hw)->io_base + (reg))