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

[win-pv-devel] [PATCH 2/2] Introduce __FreePoolWithTag()



Being able to interpose on memory allocation can be useful during
debugging. We already have __AllocatePoolWithTag() so this patch matches
it with __FreePoolWithTag().

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/common/registry.c    | 2 +-
 src/common/util.h        | 9 +++++++++
 src/xen/acpi.c           | 2 +-
 src/xen/module.c         | 2 +-
 src/xen/system.c         | 2 +-
 src/xen/unplug.c         | 2 +-
 src/xenbus/balloon.c     | 2 +-
 src/xenbus/bus.c         | 2 +-
 src/xenbus/cache.c       | 2 +-
 src/xenbus/debug.c       | 2 +-
 src/xenbus/dma.c         | 2 +-
 src/xenbus/driver.c      | 2 +-
 src/xenbus/evtchn.c      | 2 +-
 src/xenbus/evtchn_2l.c   | 2 +-
 src/xenbus/evtchn_fifo.c | 2 +-
 src/xenbus/fdo.c         | 2 +-
 src/xenbus/filters.c     | 2 +-
 src/xenbus/gnttab.c      | 2 +-
 src/xenbus/hash_table.c  | 2 +-
 src/xenbus/pdo.c         | 2 +-
 src/xenbus/range_set.c   | 2 +-
 src/xenbus/shared_info.c | 2 +-
 src/xenbus/store.c       | 2 +-
 src/xenbus/suspend.c     | 2 +-
 src/xenbus/thread.c      | 2 +-
 src/xenbus/unplug.c      | 2 +-
 src/xenfilt/driver.c     | 2 +-
 src/xenfilt/emulated.c   | 2 +-
 src/xenfilt/fdo.c        | 2 +-
 src/xenfilt/pdo.c        | 2 +-
 src/xenfilt/thread.c     | 2 +-
 31 files changed, 39 insertions(+), 30 deletions(-)

diff --git a/src/common/registry.c b/src/common/registry.c
index 9e9f79a..d994e13 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -52,7 +52,7 @@ __RegistryFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, REGISTRY_TAG);
+    __FreePoolWithTag(Buffer, REGISTRY_TAG);
 }
 
 NTSTATUS
diff --git a/src/common/util.h b/src/common/util.h
index c772b1e..7798ebd 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -158,6 +158,15 @@ __AllocatePoolWithTag(
     return Buffer;
 }
 
+static FORCEINLINE VOID
+__FreePoolWithTag(
+    IN  PVOID   Buffer,
+    IN  ULONG   Tag
+    )
+{
+    ExFreePoolWithTag(Buffer, Tag);
+}
+
 static FORCEINLINE PMDL
 __AllocatePage(
     VOID
diff --git a/src/xen/acpi.c b/src/xen/acpi.c
index ebf8024..5defd7d 100644
--- a/src/xen/acpi.c
+++ b/src/xen/acpi.c
@@ -56,7 +56,7 @@ __AcpiFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_ACPI_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_ACPI_TAG);
 }
 
 static BOOLEAN
diff --git a/src/xen/module.c b/src/xen/module.c
index a5bf3c7..584a63d 100644
--- a/src/xen/module.c
+++ b/src/xen/module.c
@@ -72,7 +72,7 @@ __ModuleFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, MODULE_TAG);
+    __FreePoolWithTag(Buffer, MODULE_TAG);
 }
 
 static VOID
diff --git a/src/xen/system.c b/src/xen/system.c
index 65c9d0e..0dc7e14 100644
--- a/src/xen/system.c
+++ b/src/xen/system.c
@@ -79,7 +79,7 @@ __SystemFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XEN_SYSTEM_TAG);
+    __FreePoolWithTag(Buffer, XEN_SYSTEM_TAG);
 }
 
 static FORCEINLINE const CHAR *
diff --git a/src/xen/unplug.c b/src/xen/unplug.c
index 77b6b8e..2043591 100644
--- a/src/xen/unplug.c
+++ b/src/xen/unplug.c
@@ -71,7 +71,7 @@ __UnplugFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, UNPLUG_TAG);
+    __FreePoolWithTag(Buffer, UNPLUG_TAG);
 }
 
 static VOID
diff --git a/src/xenbus/balloon.c b/src/xenbus/balloon.c
index 1b3f5fa..e697722 100644
--- a/src/xenbus/balloon.c
+++ b/src/xenbus/balloon.c
@@ -80,7 +80,7 @@ __BalloonFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_BALLOON_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_BALLOON_TAG);
 }
 
 #define SWAP_NODES(_PfnArray, _X, _Y)       \
diff --git a/src/xenbus/bus.c b/src/xenbus/bus.c
index d82fe0a..6443281 100644
--- a/src/xenbus/bus.c
+++ b/src/xenbus/bus.c
@@ -64,7 +64,7 @@ __BusFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, BUS_TAG);
+    __FreePoolWithTag(Buffer, BUS_TAG);
 }
 
 static VOID
diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index 5a14411..e3073f5 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -114,7 +114,7 @@ __CacheFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, CACHE_TAG);
+    __FreePoolWithTag(Buffer, CACHE_TAG);
 }
 
 static VOID
diff --git a/src/xenbus/debug.c b/src/xenbus/debug.c
index 7b2ec73..794a432 100644
--- a/src/xenbus/debug.c
+++ b/src/xenbus/debug.c
@@ -77,7 +77,7 @@ __DebugFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_DEBUG_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_DEBUG_TAG);
 }
 
 extern USHORT
diff --git a/src/xenbus/dma.c b/src/xenbus/dma.c
index 3969778..7531f8b 100644
--- a/src/xenbus/dma.c
+++ b/src/xenbus/dma.c
@@ -208,7 +208,7 @@ __DmaFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, DMA_TAG);
+    __FreePoolWithTag(Buffer, DMA_TAG);
 }
 
 static VOID
diff --git a/src/xenbus/driver.c b/src/xenbus/driver.c
index 73625ef..cd22a72 100644
--- a/src/xenbus/driver.c
+++ b/src/xenbus/driver.c
@@ -74,7 +74,7 @@ __DriverFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_DRIVER_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_DRIVER_TAG);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index c5c97e4..afb5219 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -133,7 +133,7 @@ __EvtchnFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_EVTCHN_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_EVTCHN_TAG);
 }
 
 static NTSTATUS
diff --git a/src/xenbus/evtchn_2l.c b/src/xenbus/evtchn_2l.c
index 913160f..0982b00 100644
--- a/src/xenbus/evtchn_2l.c
+++ b/src/xenbus/evtchn_2l.c
@@ -62,7 +62,7 @@ __EvtchnTwoLevelFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_EVTCHN_TWO_LEVEL_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_EVTCHN_TWO_LEVEL_TAG);
 }
 
 static BOOLEAN
diff --git a/src/xenbus/evtchn_fifo.c b/src/xenbus/evtchn_fifo.c
index 91cbd76..c0456e0 100644
--- a/src/xenbus/evtchn_fifo.c
+++ b/src/xenbus/evtchn_fifo.c
@@ -68,7 +68,7 @@ __EvtchnFifoFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_EVTCHN_FIFO_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_EVTCHN_FIFO_TAG);
 }
 
 static event_word_t *
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index d079928..9c9e380 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -155,7 +155,7 @@ __FdoFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_FDO_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_FDO_TAG);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenbus/filters.c b/src/xenbus/filters.c
index 8eb836b..dfea119 100644
--- a/src/xenbus/filters.c
+++ b/src/xenbus/filters.c
@@ -57,7 +57,7 @@ __FiltersFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_FILTERS_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_FILTERS_TAG);
 }
 
 #define CLASS_PATH 
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Class"
diff --git a/src/xenbus/gnttab.c b/src/xenbus/gnttab.c
index 56158d8..f3fcc7c 100644
--- a/src/xenbus/gnttab.c
+++ b/src/xenbus/gnttab.c
@@ -107,7 +107,7 @@ __GnttabFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_GNTTAB_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_GNTTAB_TAG);
 }
 
 static NTSTATUS
diff --git a/src/xenbus/hash_table.c b/src/xenbus/hash_table.c
index b271abd..75206e4 100644
--- a/src/xenbus/hash_table.c
+++ b/src/xenbus/hash_table.c
@@ -71,7 +71,7 @@ __HashTableFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_HASH_TABLE_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_HASH_TABLE_TAG);
 }
 
 static ULONG
diff --git a/src/xenbus/pdo.c b/src/xenbus/pdo.c
index 88c82a7..3a8540e 100644
--- a/src/xenbus/pdo.c
+++ b/src/xenbus/pdo.c
@@ -88,7 +88,7 @@ __PdoFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, PDO_TAG);
+    __FreePoolWithTag(Buffer, PDO_TAG);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenbus/range_set.c b/src/xenbus/range_set.c
index 1ce113f..eaf3f10 100644
--- a/src/xenbus/range_set.c
+++ b/src/xenbus/range_set.c
@@ -81,7 +81,7 @@ __RangeSetFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, RANGE_SET_TAG);
+    __FreePoolWithTag(Buffer, RANGE_SET_TAG);
 }
 
 static FORCEINLINE BOOLEAN
diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
index 9d8bf11..d6babcf 100644
--- a/src/xenbus/shared_info.c
+++ b/src/xenbus/shared_info.c
@@ -70,7 +70,7 @@ __SharedInfoFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_SHARED_INFO_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_SHARED_INFO_TAG);
 }
 
 static BOOLEAN
diff --git a/src/xenbus/store.c b/src/xenbus/store.c
index dad0f39..6bca5e9 100644
--- a/src/xenbus/store.c
+++ b/src/xenbus/store.c
@@ -165,7 +165,7 @@ __StoreFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_STORE_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_STORE_TAG);
 }
 
 static NTSTATUS
diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c
index d272862..18cae1b 100644
--- a/src/xenbus/suspend.c
+++ b/src/xenbus/suspend.c
@@ -73,7 +73,7 @@ __SuspendFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_SUSPEND_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_SUSPEND_TAG);
 }
 
 static NTSTATUS
diff --git a/src/xenbus/thread.c b/src/xenbus/thread.c
index 9048e4f..23b6e71 100644
--- a/src/xenbus/thread.c
+++ b/src/xenbus/thread.c
@@ -60,7 +60,7 @@ __ThreadFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, THREAD_TAG);
+    __FreePoolWithTag(Buffer, THREAD_TAG);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenbus/unplug.c b/src/xenbus/unplug.c
index 7414b0c..3c68c7f 100644
--- a/src/xenbus/unplug.c
+++ b/src/xenbus/unplug.c
@@ -63,7 +63,7 @@ __UnplugFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENBUS_UNPLUG_TAG);
+    __FreePoolWithTag(Buffer, XENBUS_UNPLUG_TAG);
 }
 
 static VOID
diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c
index bfc96ee..d46630f 100644
--- a/src/xenfilt/driver.c
+++ b/src/xenfilt/driver.c
@@ -78,7 +78,7 @@ __DriverFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENFILT_DRIVER_TAG);
+    __FreePoolWithTag(Buffer, XENFILT_DRIVER_TAG);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenfilt/emulated.c b/src/xenfilt/emulated.c
index 9cb656a..7eb4054 100644
--- a/src/xenfilt/emulated.c
+++ b/src/xenfilt/emulated.c
@@ -86,7 +86,7 @@ __EmulatedFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, XENFILT_EMULATED_TAG);
+    __FreePoolWithTag(Buffer, XENFILT_EMULATED_TAG);
 }
 
 static NTSTATUS
diff --git a/src/xenfilt/fdo.c b/src/xenfilt/fdo.c
index 037f892..f41288e 100644
--- a/src/xenfilt/fdo.c
+++ b/src/xenfilt/fdo.c
@@ -86,7 +86,7 @@ __FdoFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, FDO_TAG);
+    __FreePoolWithTag(Buffer, FDO_TAG);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenfilt/pdo.c b/src/xenfilt/pdo.c
index 6be7a76..6b09578 100644
--- a/src/xenfilt/pdo.c
+++ b/src/xenfilt/pdo.c
@@ -82,7 +82,7 @@ __PdoFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, PDO_TAG);
+    __FreePoolWithTag(Buffer, PDO_TAG);
 }
 
 static FORCEINLINE VOID
diff --git a/src/xenfilt/thread.c b/src/xenfilt/thread.c
index 7ec0ac8..a834129 100644
--- a/src/xenfilt/thread.c
+++ b/src/xenfilt/thread.c
@@ -60,7 +60,7 @@ __ThreadFree(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, THREAD_TAG);
+    __FreePoolWithTag(Buffer, THREAD_TAG);
 }
 
 static FORCEINLINE VOID
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

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