Move the OS independent code from Linux dir in-order to be used
by FreeBSD
Signed-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>
Signed-off-by: Vag Singh <vag.singh@oneconvergence.com>
Signed-off-by: Anand Thulasiram <avelu@juniper.net>
---
drivers/bus/vmbus/linux/vmbus_bus.c | 13 +------------
drivers/bus/vmbus/meson.build | 5 +++++
drivers/bus/vmbus/unix/vmbus_unix.h | 11 +++++++++++
drivers/bus/vmbus/unix/vmbus_unix_bus.c | 20 ++++++++++++++++++++
4 files changed, 37 insertions(+), 12 deletions(-)
create mode 100644 drivers/bus/vmbus/unix/vmbus_unix.h
create mode 100644 drivers/bus/vmbus/unix/vmbus_unix_bus.c
@@ -21,22 +21,11 @@
#include "eal_filesystem.h"
#include "private.h"
+#include "vmbus_unix.h"
/** Pathname of VMBUS devices directory. */
#define SYSFS_VMBUS_DEVICES "/sys/bus/vmbus/devices"
-/*
- * GUID associated with network devices
- * {f8615163-df3e-46c5-913f-f2d2f965ed0e}
- */
-static const rte_uuid_t vmbus_nic_uuid = {
- 0xf8, 0x61, 0x51, 0x63,
- 0xdf, 0x3e,
- 0x46, 0xc5,
- 0x91, 0x3f,
- 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0xe
-};
-
extern struct rte_vmbus_bus rte_vmbus_bus;
/* Read sysfs file to get UUID */
@@ -16,6 +16,11 @@ sources = files(
'vmbus_common_uio.c',
)
+includes += include_directories('unix')
+sources += files(
+ 'unix/vmbus_unix_bus.c'
+)
+
if is_linux
sources += files('linux/vmbus_bus.c',
'linux/vmbus_uio.c')
new file mode 100644
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018, Microsoft Corporation.
+ * All Rights Reserved.
+ */
+
+#ifndef _VMBUS_BUS_UNIX_H_
+#define _VMBUS_BUS_UNIX_H_
+
+extern const rte_uuid_t vmbus_nic_uuid;
+
+#endif /* _VMBUS_BUS_UNIX_H_ */
new file mode 100644
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2018, Microsoft Corporation.
+ * All Rights Reserved.
+ */
+
+#include <rte_uuid.h>
+
+#include "vmbus_unix.h"
+
+/*
+ * GUID associated with network devices
+ * {f8615163-df3e-46c5-913f-f2d2f965ed0e}
+ */
+const rte_uuid_t vmbus_nic_uuid = {
+ 0xf8, 0x61, 0x51, 0x63,
+ 0xdf, 0x3e,
+ 0x46, 0xc5,
+ 0x91, 0x3f,
+ 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0xe
+};