[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XENVIF-SYNC 2/4] util: sync with xenbus


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
  • Date: Thu, 22 Oct 2026 14:21:52 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
  • Delivery-date: Thu, 22 Oct 2026 12:22:03 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Sync util.h with xenbus.
Added TIME_* macros to util.h, so we drop them in controller.c,
transmitter.c and receiver.c.

Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
 src/xenvif/controller.c  | 5 -----
 src/xenvif/receiver.c    | 5 -----
 src/xenvif/transmitter.c | 5 -----
 src/xenvif/util.h        | 8 ++++++--
 4 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
index 7a8b884..f5dc178 100644
--- a/src/xenvif/controller.c
+++ b/src/xenvif/controller.c
@@ -248,11 +248,6 @@ fail1:
     return status;
 }
 
-#define TIME_US(_us)        ((_us) * 10)
-#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
-#define TIME_S(_s)          (TIME_MS((_s) * 1000))
-#define TIME_RELATIVE(_t)   (-(_t))
-
 #define XENVIF_CONTROLLER_POLL_PERIOD   TIME_MS(100)
 #define XENVIF_CONTROLLER_MAX_WAIT      TIME_S(5)
 
diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 13c376d..1c7972c 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -2364,11 +2364,6 @@ ReceiverRingEvtchnCallback(
     return TRUE;
 }
 
-#define TIME_US(_us)        ((_us) * 10)
-#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
-#define TIME_S(_s)          (TIME_MS((_s) * 1000))
-#define TIME_RELATIVE(_t)   (-(_t))
-
 #define XENVIF_RECEIVER_WATCHDOG_PERIOD 30
 
 static NTSTATUS
diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index d3d77bd..d8fe885 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -3328,11 +3328,6 @@ TransmitterRingEvtchnCallback(
     return TRUE;
 }
 
-#define TIME_US(_us)        ((_us) * 10)
-#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
-#define TIME_S(_s)          (TIME_MS((_s) * 1000))
-#define TIME_RELATIVE(_t)   (-(_t))
-
 #define XENVIF_TRANSMITTER_WATCHDOG_PERIOD  30
 
 _IRQL_requires_(PASSIVE_LEVEL)
diff --git a/src/xenvif/util.h b/src/xenvif/util.h
index 7973be3..2a09248 100644
--- a/src/xenvif/util.h
+++ b/src/xenvif/util.h
@@ -41,6 +41,11 @@
 #define        P2ROUNDUP(_t, _x, _a)   \
         (-(-((_t)(_x)) & -(((_t)(_a)))))
 
+#define TIME_US(_us)            ((_us) * 10ll)
+#define TIME_MS(_ms)            (TIME_US((_ms) * 1000ll))
+#define TIME_S(_s)              (TIME_MS((_s) * 1000ll))
+#define TIME_RELATIVE(_t)       (-(_t))
+
 static FORCEINLINE LONG
 __ffs(
     _In_ unsigned long long mask
@@ -196,13 +201,12 @@ __AllocatePages(
 
     LowAddress.QuadPart = 0ull;
     HighAddress.QuadPart = ~0ull;
+    SkipBytes.QuadPart = 0ull;
     TotalBytes = (SIZE_T)PAGE_SIZE * Count;
 
     if (Contiguous) {
-        SkipBytes.QuadPart = TotalBytes;
         Flags = MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS;
     } else {
-        SkipBytes.QuadPart = 0ull;
         Flags = MM_ALLOCATE_FULLY_REQUIRED;
     }
 
-- 
2.55.0.windows.5



--
Césaire Mounah | Vates Windows Guest Tools Engineer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.