blob: ffca4cc8a4ce667b2ccb6f67edc80f8fa72756ac [file] [log] [blame] [raw]
Fix gcc(1) warning 'variably modified ... at file scope'.
Fix for sys/dev/hptmv/vdevice.h is taken from FreeBSD base r320714.
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/dev/hptmv/vdevice.h freebsd-11.1/usr/src/sys/dev/hptmv/vdevice.h
--- /usr/src/sys/dev/hptmv/vdevice.h 2017-07-21 07:41:48.000000000 +0800
+++ freebsd-11.1/usr/src/sys/dev/hptmv/vdevice.h 2019-03-22 16:22:35.180996000 +0800
@@ -77,8 +77,8 @@
} VDevice;
-#define ARRAY_VDEV_SIZE ((UINT)(ULONG_PTR)&((PVDevice)0)->u+sizeof(RaidArray))
-#define DISK_VDEV_SIZE ((UINT)(ULONG_PTR)&((PVDevice)0)->u+sizeof(Device))
+#define ARRAY_VDEV_SIZE (offsetof(VDevice, u) + sizeof(RaidArray))
+#define DISK_VDEV_SIZE (offsetof(VDevice, u) + sizeof(Device))
#define Map2pVDevice(pDev) ((PVDevice)((UINT_PTR)pDev - (UINT)(UINT_PTR)&((PVDevice)0)->u.disk))
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/dev/xen/netfront/netfront.c freebsd-11.1/usr/src/sys/dev/xen/netfront/netfront.c
--- /usr/src/sys/dev/xen/netfront/netfront.c 2017-07-21 07:41:44.000000000 +0800
+++ freebsd-11.1/usr/src/sys/dev/xen/netfront/netfront.c 2019-03-22 16:21:33.495127000 +0800
@@ -74,8 +74,8 @@
/* Features supported by all backends. TSO and LRO can be negotiated */
#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP)
-#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE)
-#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE)
+#define NET_TX_RING_SIZE (__RD32((PAGE_SIZE - offsetof(netif_tx_sring_t, ring)) / sizeof(union netif_tx_sring_entry)))
+#define NET_RX_RING_SIZE (__RD32((PAGE_SIZE - offsetof(netif_rx_sring_t, ring)) / sizeof(union netif_rx_sring_entry)))
#define NET_RX_SLOTS_MIN (XEN_NETIF_NR_SLOTS_MIN + 1)