[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH 2/6] Move util.h from include to src/common
It should be co-located with headers such as assert.h and names.h Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx> --- include/util.h | 281 ----------------------------------------------- src/common/registry.c | 2 +- src/common/util.h | 281 +++++++++++++++++++++++++++++++++++++++++++++++ src/xen/acpi.c | 2 +- src/xen/hypercall.c | 2 +- src/xen/module.c | 2 +- src/xen/system.c | 2 +- src/xenbus/balloon.c | 2 +- src/xenbus/bus.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/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/sync.c | 2 +- src/xenbus/thread.c | 2 +- src/xenfilt/driver.c | 4 +- src/xenfilt/emulated.c | 2 +- src/xenfilt/fdo.c | 2 +- src/xenfilt/pdo.c | 2 +- src/xenfilt/thread.c | 2 +- src/xenfilt/unplug.c | 2 +- 31 files changed, 311 insertions(+), 311 deletions(-) delete mode 100644 include/util.h create mode 100644 src/common/util.h diff --git a/include/util.h b/include/util.h deleted file mode 100644 index 485cda4..0000000 --- a/include/util.h +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright (c) Citrix Systems Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _UTIL_H -#define _UTIL_H - -#include <ntddk.h> - -#include "assert.h" - -#define P2ROUNDUP(_x, _a) \ - (-(-(_x) & -(_a))) - -static FORCEINLINE LONG -__ffs( - IN unsigned long long mask - ) -{ - unsigned char *array = (unsigned char *)&mask; - unsigned int byte; - unsigned int bit; - unsigned char val; - - val = 0; - - byte = 0; - while (byte < 8) { - val = array[byte]; - - if (val != 0) - break; - - byte++; - } - if (byte == 8) - return -1; - - bit = 0; - while (bit < 8) { - if (val & 0x01) - break; - - val >>= 1; - bit++; - } - - return (byte * 8) + bit; -} - -#define __ffu(_mask) \ - __ffs(~(_mask)) - -static FORCEINLINE VOID -__CpuId( - IN ULONG Leaf, - OUT PULONG EAX OPTIONAL, - OUT PULONG EBX OPTIONAL, - OUT PULONG ECX OPTIONAL, - OUT PULONG EDX OPTIONAL - ) -{ - ULONG Value[4] = {0}; - - __cpuid(Value, Leaf); - - if (EAX) - *EAX = Value[0]; - - if (EBX) - *EBX = Value[1]; - - if (ECX) - *ECX = Value[2]; - - if (EDX) - *EDX = Value[3]; -} - -static FORCEINLINE LONG -__InterlockedAdd( - IN LONG *Value, - IN LONG Delta - ) -{ - LONG New; - LONG Old; - - do { - Old = *Value; - New = Old + Delta; - } while (InterlockedCompareExchange(Value, New, Old) != Old); - - return New; -} - -static FORCEINLINE LONG -__InterlockedSubtract( - IN LONG *Value, - IN LONG Delta - ) -{ - LONG New; - LONG Old; - - do { - Old = *Value; - New = Old - Delta; - } while (InterlockedCompareExchange(Value, New, Old) != Old); - - return New; -} - -static FORCEINLINE PVOID -__AllocatePoolWithTag( - IN POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag - ) -{ - PUCHAR Buffer; - - __analysis_assume(PoolType == NonPagedPool || - PoolType == PagedPool); - - Buffer = ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); - if (Buffer == NULL) - return NULL; - - RtlZeroMemory(Buffer, NumberOfBytes); - return Buffer; -} - -static FORCEINLINE PMDL -__AllocatePage( - VOID - ) -{ - PHYSICAL_ADDRESS LowAddress; - PHYSICAL_ADDRESS HighAddress; - LARGE_INTEGER SkipBytes; - SIZE_T TotalBytes; - PMDL Mdl; - PUCHAR MdlMappedSystemVa; - NTSTATUS status; - - LowAddress.QuadPart = 0ull; - HighAddress.QuadPart = ~0ull; - SkipBytes.QuadPart = 0ull; - TotalBytes = (SIZE_T)PAGE_SIZE; - - Mdl = MmAllocatePagesForMdlEx(LowAddress, - HighAddress, - SkipBytes, - TotalBytes, - MmCached, - 0); - - status = STATUS_NO_MEMORY; - if (Mdl == NULL) - goto fail1; - - ASSERT((Mdl->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | - MDL_PARTIAL_HAS_BEEN_MAPPED | - MDL_PARTIAL | - MDL_PARENT_MAPPED_SYSTEM_VA | - MDL_SOURCE_IS_NONPAGED_POOL | - MDL_IO_SPACE)) == 0); - - MdlMappedSystemVa = MmMapLockedPagesSpecifyCache(Mdl, - KernelMode, - MmCached, - NULL, - FALSE, - NormalPagePriority); - - status = STATUS_UNSUCCESSFUL; - if (MdlMappedSystemVa == NULL) - goto fail2; - - ASSERT3P(MdlMappedSystemVa, ==, Mdl->MappedSystemVa); - - RtlZeroMemory(MdlMappedSystemVa, PAGE_SIZE); - - return Mdl; - -fail2: - Error("fail2\n"); - - MmFreePagesFromMdl(Mdl); - ExFreePool(Mdl); - -fail1: - Error("fail1 (%08x)\n", status); - - return NULL; -} - -static FORCEINLINE VOID -__FreePage( - IN PMDL Mdl - ) -{ - PUCHAR MdlMappedSystemVa; - - ASSERT(Mdl->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA); - MdlMappedSystemVa = Mdl->MappedSystemVa; - - RtlFillMemory(MdlMappedSystemVa, PAGE_SIZE, 0xAA); - - MmUnmapLockedPages(MdlMappedSystemVa, Mdl); - - MmFreePagesFromMdl(Mdl); -} - -static FORCEINLINE PCHAR -__strtok_r( - IN PCHAR Buffer, - IN PCHAR Delimiter, - IN OUT PCHAR *Context - ) -{ - PCHAR Token; - PCHAR End; - - if (Buffer != NULL) - *Context = Buffer; - - Token = *Context; - - if (Token == NULL) - return NULL; - - while (*Token != L'\0' && - strchr(Delimiter, *Token) != NULL) - Token++; - - if (*Token == L'\0') - return NULL; - - End = Token + 1; - while (*End != L'\0' && - strchr(Delimiter, *End) == NULL) - End++; - - if (*End != L'\0') - *End++ = L'\0'; - - *Context = End; - - return Token; -} - -#endif // _UTIL_H diff --git a/src/common/registry.c b/src/common/registry.c index bfddbcc..4caeaa5 100644 --- a/src/common/registry.c +++ b/src/common/registry.c @@ -30,10 +30,10 @@ */ #include <ntddk.h> -#include <util.h> #include "registry.h" #include "assert.h" +#include "util.h" #define REGISTRY_TAG 'GERX' diff --git a/src/common/util.h b/src/common/util.h new file mode 100644 index 0000000..1a2bb86 --- /dev/null +++ b/src/common/util.h @@ -0,0 +1,281 @@ +/* Copyright (c) Citrix Systems Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, + * with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _COMMON_UTIL_H +#define _COMMON_UTIL_H + +#include <ntddk.h> + +#include "assert.h" + +#define P2ROUNDUP(_x, _a) \ + (-(-(_x) & -(_a))) + +static FORCEINLINE LONG +__ffs( + IN unsigned long long mask + ) +{ + unsigned char *array = (unsigned char *)&mask; + unsigned int byte; + unsigned int bit; + unsigned char val; + + val = 0; + + byte = 0; + while (byte < 8) { + val = array[byte]; + + if (val != 0) + break; + + byte++; + } + if (byte == 8) + return -1; + + bit = 0; + while (bit < 8) { + if (val & 0x01) + break; + + val >>= 1; + bit++; + } + + return (byte * 8) + bit; +} + +#define __ffu(_mask) \ + __ffs(~(_mask)) + +static FORCEINLINE VOID +__CpuId( + IN ULONG Leaf, + OUT PULONG EAX OPTIONAL, + OUT PULONG EBX OPTIONAL, + OUT PULONG ECX OPTIONAL, + OUT PULONG EDX OPTIONAL + ) +{ + ULONG Value[4] = {0}; + + __cpuid(Value, Leaf); + + if (EAX) + *EAX = Value[0]; + + if (EBX) + *EBX = Value[1]; + + if (ECX) + *ECX = Value[2]; + + if (EDX) + *EDX = Value[3]; +} + +static FORCEINLINE LONG +__InterlockedAdd( + IN LONG *Value, + IN LONG Delta + ) +{ + LONG New; + LONG Old; + + do { + Old = *Value; + New = Old + Delta; + } while (InterlockedCompareExchange(Value, New, Old) != Old); + + return New; +} + +static FORCEINLINE LONG +__InterlockedSubtract( + IN LONG *Value, + IN LONG Delta + ) +{ + LONG New; + LONG Old; + + do { + Old = *Value; + New = Old - Delta; + } while (InterlockedCompareExchange(Value, New, Old) != Old); + + return New; +} + +static FORCEINLINE PVOID +__AllocatePoolWithTag( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag + ) +{ + PUCHAR Buffer; + + __analysis_assume(PoolType == NonPagedPool || + PoolType == PagedPool); + + Buffer = ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag); + if (Buffer == NULL) + return NULL; + + RtlZeroMemory(Buffer, NumberOfBytes); + return Buffer; +} + +static FORCEINLINE PMDL +__AllocatePage( + VOID + ) +{ + PHYSICAL_ADDRESS LowAddress; + PHYSICAL_ADDRESS HighAddress; + LARGE_INTEGER SkipBytes; + SIZE_T TotalBytes; + PMDL Mdl; + PUCHAR MdlMappedSystemVa; + NTSTATUS status; + + LowAddress.QuadPart = 0ull; + HighAddress.QuadPart = ~0ull; + SkipBytes.QuadPart = 0ull; + TotalBytes = (SIZE_T)PAGE_SIZE; + + Mdl = MmAllocatePagesForMdlEx(LowAddress, + HighAddress, + SkipBytes, + TotalBytes, + MmCached, + 0); + + status = STATUS_NO_MEMORY; + if (Mdl == NULL) + goto fail1; + + ASSERT((Mdl->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | + MDL_PARTIAL_HAS_BEEN_MAPPED | + MDL_PARTIAL | + MDL_PARENT_MAPPED_SYSTEM_VA | + MDL_SOURCE_IS_NONPAGED_POOL | + MDL_IO_SPACE)) == 0); + + MdlMappedSystemVa = MmMapLockedPagesSpecifyCache(Mdl, + KernelMode, + MmCached, + NULL, + FALSE, + NormalPagePriority); + + status = STATUS_UNSUCCESSFUL; + if (MdlMappedSystemVa == NULL) + goto fail2; + + ASSERT3P(MdlMappedSystemVa, ==, Mdl->MappedSystemVa); + + RtlZeroMemory(MdlMappedSystemVa, PAGE_SIZE); + + return Mdl; + +fail2: + Error("fail2\n"); + + MmFreePagesFromMdl(Mdl); + ExFreePool(Mdl); + +fail1: + Error("fail1 (%08x)\n", status); + + return NULL; +} + +static FORCEINLINE VOID +__FreePage( + IN PMDL Mdl + ) +{ + PUCHAR MdlMappedSystemVa; + + ASSERT(Mdl->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA); + MdlMappedSystemVa = Mdl->MappedSystemVa; + + RtlFillMemory(MdlMappedSystemVa, PAGE_SIZE, 0xAA); + + MmUnmapLockedPages(MdlMappedSystemVa, Mdl); + + MmFreePagesFromMdl(Mdl); +} + +static FORCEINLINE PCHAR +__strtok_r( + IN PCHAR Buffer, + IN PCHAR Delimiter, + IN OUT PCHAR *Context + ) +{ + PCHAR Token; + PCHAR End; + + if (Buffer != NULL) + *Context = Buffer; + + Token = *Context; + + if (Token == NULL) + return NULL; + + while (*Token != L'\0' && + strchr(Delimiter, *Token) != NULL) + Token++; + + if (*Token == L'\0') + return NULL; + + End = Token + 1; + while (*End != L'\0' && + strchr(Delimiter, *End) == NULL) + End++; + + if (*End != L'\0') + *End++ = L'\0'; + + *Context = End; + + return Token; +} + +#endif // _COMMON_UTIL_H diff --git a/src/xen/acpi.c b/src/xen/acpi.c index 124dcb6..ebf8024 100644 --- a/src/xen/acpi.c +++ b/src/xen/acpi.c @@ -32,11 +32,11 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "acpi.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define XENBUS_ACPI_TAG 'IPCA' diff --git a/src/xen/hypercall.c b/src/xen/hypercall.c index 717b8c2..5f14caa 100644 --- a/src/xen/hypercall.c +++ b/src/xen/hypercall.c @@ -34,11 +34,11 @@ #include <ntddk.h> #include <xen.h> -#include <util.h> #include "hypercall.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define MAXIMUM_HYPERCALL_PAGE_COUNT 2 diff --git a/src/xen/module.c b/src/xen/module.c index a1a5448..ed8838a 100644 --- a/src/xen/module.c +++ b/src/xen/module.c @@ -34,12 +34,12 @@ #include <ntddk.h> #include <ntstrsafe.h> #include <aux_klib.h> -#include <util.h> #include "high.h" #include "module.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define MODULE_TAG 'UDOM' diff --git a/src/xen/system.c b/src/xen/system.c index ea3bc4e..b21efd8 100644 --- a/src/xen/system.c +++ b/src/xen/system.c @@ -36,7 +36,6 @@ #include <stdlib.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "registry.h" #include "system.h" @@ -44,6 +43,7 @@ #include "names.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define XEN_SYSTEM_TAG 'TSYS' diff --git a/src/xenbus/balloon.c b/src/xenbus/balloon.c index 7c1754c..2dc4a6c 100644 --- a/src/xenbus/balloon.c +++ b/src/xenbus/balloon.c @@ -32,13 +32,13 @@ #include <ntddk.h> #include <stdlib.h> #include <xen.h> -#include <util.h> #include "mutex.h" #include "balloon.h" #include "range_set.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define MDL_SIZE_MAX ((1 << (RTL_FIELD_SIZE(MDL, Size) * 8)) - 1) #define MAX_PAGES_PER_MDL ((MDL_SIZE_MAX - sizeof(MDL)) / sizeof(PFN_NUMBER)) diff --git a/src/xenbus/bus.c b/src/xenbus/bus.c index 1cd527f..d82fe0a 100644 --- a/src/xenbus/bus.c +++ b/src/xenbus/bus.c @@ -32,7 +32,6 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "bus.h" #include "dma.h" @@ -42,6 +41,7 @@ #include "sync.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" typedef struct _XENBUS_BUS_CONTEXT { LONG References; diff --git a/src/xenbus/debug.c b/src/xenbus/debug.c index f7f34f6..bd62b51 100644 --- a/src/xenbus/debug.c +++ b/src/xenbus/debug.c @@ -34,13 +34,13 @@ #include <stdarg.h> #include <stdlib.h> #include <xen.h> -#include <util.h> #include "high.h" #include "debug.h" #include "fdo.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define MAXIMUM_PREFIX_LENGTH 32 diff --git a/src/xenbus/dma.c b/src/xenbus/dma.c index 67a811e..3969778 100644 --- a/src/xenbus/dma.c +++ b/src/xenbus/dma.c @@ -32,7 +32,6 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "names.h" #include "dma.h" @@ -40,6 +39,7 @@ #include "pdo.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #pragma warning(push) #pragma warning(disable:4201) // nameless struct/union diff --git a/src/xenbus/driver.c b/src/xenbus/driver.c index 9067813..628e0fa 100644 --- a/src/xenbus/driver.c +++ b/src/xenbus/driver.c @@ -31,7 +31,6 @@ #include <ntddk.h> #include <ntstrsafe.h> -#include <util.h> #include "registry.h" #include "fdo.h" @@ -40,6 +39,7 @@ #include "names.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #include "version.h" extern PULONG InitSafeBootMode; diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c index 499127a..f44c3cf 100644 --- a/src/xenbus/evtchn.c +++ b/src/xenbus/evtchn.c @@ -32,7 +32,6 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "evtchn.h" #include "evtchn_2l.h" @@ -42,6 +41,7 @@ #include "registry.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" typedef struct _XENBUS_EVTCHN_UNBOUND_PARAMETERS { USHORT RemoteDomain; diff --git a/src/xenbus/evtchn_2l.c b/src/xenbus/evtchn_2l.c index e5af9db..fde520f 100644 --- a/src/xenbus/evtchn_2l.c +++ b/src/xenbus/evtchn_2l.c @@ -32,13 +32,13 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "evtchn_2l.h" #include "shared_info.h" #include "fdo.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" typedef struct _XENBUS_EVTCHN_TWO_LEVEL_CONTEXT { PXENBUS_FDO Fdo; diff --git a/src/xenbus/evtchn_fifo.c b/src/xenbus/evtchn_fifo.c index e3cff7a..4268809 100644 --- a/src/xenbus/evtchn_fifo.c +++ b/src/xenbus/evtchn_fifo.c @@ -32,13 +32,13 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "evtchn_fifo.h" #include "shared_info.h" #include "fdo.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define MAX_HVM_VCPUS 128 diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c index 1eb5fa8..b30c4bc 100644 --- a/src/xenbus/fdo.c +++ b/src/xenbus/fdo.c @@ -35,7 +35,6 @@ #include <wdmguid.h> #include <ntstrsafe.h> #include <stdlib.h> -#include <util.h> #include <xen.h> #include <unplug_interface.h> @@ -60,6 +59,7 @@ #include "range_set.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define XENBUS_FDO_TAG 'ODF' diff --git a/src/xenbus/gnttab.c b/src/xenbus/gnttab.c index 8b73f27..3912028 100644 --- a/src/xenbus/gnttab.c +++ b/src/xenbus/gnttab.c @@ -33,13 +33,13 @@ #include <ntstrsafe.h> #include <stdlib.h> #include <xen.h> -#include <util.h> #include "gnttab.h" #include "fdo.h" #include "range_set.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define XENBUS_GNTTAB_MAXIMUM_FRAME_COUNT 32 #define XENBUS_GNTTAB_ENTRY_PER_FRAME (PAGE_SIZE / sizeof (grant_entry_v1_t)) diff --git a/src/xenbus/hash_table.c b/src/xenbus/hash_table.c index 0cf1010..a9c1b79 100644 --- a/src/xenbus/hash_table.c +++ b/src/xenbus/hash_table.c @@ -32,11 +32,11 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "hash_table.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" typedef struct _XENBUS_HASH_TABLE_NODE { LIST_ENTRY ListEntry; diff --git a/src/xenbus/pdo.c b/src/xenbus/pdo.c index 4c6017d..58eeadd 100644 --- a/src/xenbus/pdo.c +++ b/src/xenbus/pdo.c @@ -34,7 +34,6 @@ #include <ntddk.h> #include <wdmguid.h> #include <ntstrsafe.h> -#include <util.h> #include <emulated_interface.h> #include <unplug_interface.h> @@ -48,6 +47,7 @@ #include "registry.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define PDO_TAG 'ODP' diff --git a/src/xenbus/range_set.c b/src/xenbus/range_set.c index 9186185..a0b1311 100644 --- a/src/xenbus/range_set.c +++ b/src/xenbus/range_set.c @@ -32,11 +32,11 @@ #include <ntddk.h> #include <ntstrsafe.h> #include <xen.h> -#include <util.h> #include "range_set.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define RANGE_SET_TAG 'GNAR' diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c index 244b9e1..09d035a 100644 --- a/src/xenbus/shared_info.c +++ b/src/xenbus/shared_info.c @@ -31,12 +31,12 @@ #include <ntddk.h> #include <xen.h> -#include <util.h> #include "shared_info.h" #include "fdo.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define XENBUS_SHARED_INFO_EVTCHN_PER_SELECTOR (sizeof (ULONG_PTR) * 8) #define XENBUS_SHARED_INFO_EVTCHN_SELECTOR_COUNT (RTL_FIELD_SIZE(shared_info_t, evtchn_pending) / sizeof (ULONG_PTR)) diff --git a/src/xenbus/store.c b/src/xenbus/store.c index e6119d3..16ca37b 100644 --- a/src/xenbus/store.c +++ b/src/xenbus/store.c @@ -34,13 +34,13 @@ #include <stdarg.h> #include <stdlib.h> #include <xen.h> -#include <util.h> #include "store.h" #include "evtchn.h" #include "fdo.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" extern ULONG NTAPI diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c index de70e42..663ed8e 100644 --- a/src/xenbus/suspend.c +++ b/src/xenbus/suspend.c @@ -32,7 +32,6 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include <unplug_interface.h> @@ -42,6 +41,7 @@ #include "sync.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" struct _XENBUS_SUSPEND_CALLBACK { LIST_ENTRY ListEntry; diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index 5730039..d4af525 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -32,11 +32,11 @@ #include <ntddk.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "sync.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" // Routines to capture all CPUs in a spinning state with interrupts // disabled (so that we remain in a known code context) and optionally diff --git a/src/xenbus/thread.c b/src/xenbus/thread.c index 0ab8acb..9048e4f 100644 --- a/src/xenbus/thread.c +++ b/src/xenbus/thread.c @@ -30,11 +30,11 @@ */ #include <ntddk.h> -#include <util.h> #include "thread.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define THREAD_TAG 'ERHT' diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c index 0ae5d66..8279bd7 100644 --- a/src/xenfilt/driver.c +++ b/src/xenfilt/driver.c @@ -31,17 +31,17 @@ #include <ntddk.h> #include <xen.h> -#include <util.h> +#include "registry.h" #include "fdo.h" #include "pdo.h" #include "driver.h" #include "emulated.h" #include "unplug.h" -#include "registry.h" #include "mutex.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #include "version.h" extern PULONG InitSafeBootMode; diff --git a/src/xenfilt/emulated.c b/src/xenfilt/emulated.c index 8542d84..485fed6 100644 --- a/src/xenfilt/emulated.c +++ b/src/xenfilt/emulated.c @@ -34,12 +34,12 @@ #include <stdlib.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include "registry.h" #include "emulated.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define MAXNAMELEN 128 diff --git a/src/xenfilt/fdo.c b/src/xenfilt/fdo.c index 1597a15..42a40e8 100644 --- a/src/xenfilt/fdo.c +++ b/src/xenfilt/fdo.c @@ -35,7 +35,6 @@ #include <wdmguid.h> #include <ntstrsafe.h> #include <stdlib.h> -#include <util.h> #include <xen.h> #include "emulated.h" @@ -48,6 +47,7 @@ #include "mutex.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define FDO_TAG 'ODF' diff --git a/src/xenfilt/pdo.c b/src/xenfilt/pdo.c index 392e6af..893c76d 100644 --- a/src/xenfilt/pdo.c +++ b/src/xenfilt/pdo.c @@ -35,7 +35,6 @@ #include <wdmguid.h> #include <ntstrsafe.h> #include <stdlib.h> -#include <util.h> #include "emulated.h" #include "names.h" @@ -45,6 +44,7 @@ #include "driver.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define PDO_TAG 'ODP' diff --git a/src/xenfilt/thread.c b/src/xenfilt/thread.c index 431e06a..7ec0ac8 100644 --- a/src/xenfilt/thread.c +++ b/src/xenfilt/thread.c @@ -30,11 +30,11 @@ */ #include <ntddk.h> -#include <util.h> #include "thread.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" #define THREAD_TAG 'ERHT' diff --git a/src/xenfilt/unplug.c b/src/xenfilt/unplug.c index 21f1c7e..37562c5 100644 --- a/src/xenfilt/unplug.c +++ b/src/xenfilt/unplug.c @@ -34,7 +34,6 @@ #include <stdlib.h> #include <stdarg.h> #include <xen.h> -#include <util.h> #include <version.h> #include "driver.h" @@ -43,6 +42,7 @@ #include "unplug.h" #include "dbg_print.h" #include "assert.h" +#include "util.h" struct _XENFILT_UNPLUG_CONTEXT { KSPIN_LOCK Lock; -- 2.1.1 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |