win-pvdrivers

changeset 992:58899e6ed48f 0.11.0.369

Tidy Up
author James Harper <james.harper@bendigoit.com.au>
date Fri Sep 21 23:25:49 2012 +1000 (2012-09-21)
parents e9903455ba9d
children 61fea9275419
files xenpci/gnttbl.c xenpci/xenpci.c xenpci/xenpci_fdo.c
line diff
     1.1 --- a/xenpci/gnttbl.c	Fri Sep 21 23:25:36 2012 +1000
     1.2 +++ b/xenpci/gnttbl.c	Fri Sep 21 23:25:49 2012 +1000
     1.3 @@ -29,7 +29,7 @@ GntTbl_PutRef(PVOID Context, grant_ref_t
     1.4  #if DBG
     1.5    if (xpdd->gnttbl_tag[ref].tag != tag)
     1.6      KdPrint((__DRIVER_NAME "     Grant Entry %d for %.4s doesn't match %.4s\n", ref, (PUCHAR)&tag, (PUCHAR)&xpdd->gnttbl_tag[ref].tag));
     1.7 -  ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
     1.8 +  NT_ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
     1.9    xpdd->gnttbl_tag[ref].tag = 0;
    1.10    xpdd->gnttbl_tag[ref].generation = (ULONG)-1;
    1.11  #endif
    1.12 @@ -54,7 +54,7 @@ GntTbl_GetRef(PVOID Context, ULONG tag)
    1.13  #if DBG
    1.14    if (xpdd->gnttbl_tag[ref].tag)
    1.15      KdPrint((__DRIVER_NAME "     Grant Entry %d for %.4s in use by %.4s\n", ref, (PUCHAR)&tag, (PUCHAR)&xpdd->gnttbl_tag[ref].tag));
    1.16 -  ASSERT(!xpdd->gnttbl_tag[ref].tag);
    1.17 +  NT_ASSERT(!xpdd->gnttbl_tag[ref].tag);
    1.18    xpdd->gnttbl_tag[ref].generation = xpdd->gnttbl_generation;
    1.19    xpdd->gnttbl_tag[ref].tag = tag;
    1.20  #endif
    1.21 @@ -104,7 +104,7 @@ GntTbl_GrantAccess(
    1.22    if (ref == INVALID_GRANT_REF)
    1.23      return ref;
    1.24  
    1.25 -  ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
    1.26 +  NT_ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
    1.27    
    1.28    xpdd->gnttbl_table[ref].frame = frame;
    1.29    xpdd->gnttbl_table[ref].domid = domid;
    1.30 @@ -117,7 +117,7 @@ GntTbl_GrantAccess(
    1.31      KdPrint((__DRIVER_NAME "     Grant Entry %d for %.4s still in use\n", ref, (PUCHAR)&tag));
    1.32  #endif
    1.33    }
    1.34 -  ASSERT(!xpdd->gnttbl_table[ref].flags);
    1.35 +  NT_ASSERT(!xpdd->gnttbl_table[ref].flags);
    1.36  
    1.37    KeMemoryBarrier();
    1.38    readonly *= GTF_readonly;
    1.39 @@ -136,8 +136,8 @@ GntTbl_EndAccess(
    1.40    PXENPCI_DEVICE_DATA xpdd = Context;
    1.41    unsigned short flags, nflags;
    1.42  
    1.43 -  ASSERT(ref != INVALID_GRANT_REF);
    1.44 -  ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
    1.45 +  NT_ASSERT(ref != INVALID_GRANT_REF);
    1.46 +  NT_ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
    1.47    
    1.48    nflags = xpdd->gnttbl_table[ref].flags;
    1.49    do {
    1.50 @@ -178,7 +178,7 @@ GntTbl_Init(PXENPCI_DEVICE_DATA xpdd)
    1.51    int i;
    1.52    int grant_entries;
    1.53  
    1.54 -  ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    1.55 +  NT_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    1.56    
    1.57    FUNCTION_ENTER();
    1.58    
    1.59 @@ -193,12 +193,12 @@ GntTbl_Init(PXENPCI_DEVICE_DATA xpdd)
    1.60    xpdd->gnttbl_generation = 0;
    1.61    #endif
    1.62    xpdd->gnttbl_table_copy = ExAllocatePoolWithTag(NonPagedPool, xpdd->grant_frames * PAGE_SIZE, XENPCI_POOL_TAG);
    1.63 -  ASSERT(xpdd->gnttbl_table_copy); // lazy
    1.64 +  NT_ASSERT(xpdd->gnttbl_table_copy); // lazy
    1.65    xpdd->gnttbl_table = ExAllocatePoolWithTag(NonPagedPool, xpdd->grant_frames * PAGE_SIZE, XENPCI_POOL_TAG);
    1.66 -  ASSERT(xpdd->gnttbl_table); // lazy
    1.67 +  NT_ASSERT(xpdd->gnttbl_table); // lazy
    1.68    /* dom0 crashes if we allocate the wrong amount of memory here! */
    1.69    xpdd->gnttbl_mdl = IoAllocateMdl(xpdd->gnttbl_table, xpdd->grant_frames * PAGE_SIZE, FALSE, FALSE, NULL);
    1.70 -  ASSERT(xpdd->gnttbl_mdl); // lazy
    1.71 +  NT_ASSERT(xpdd->gnttbl_mdl); // lazy
    1.72    MmBuildMdlForNonPagedPool(xpdd->gnttbl_mdl);
    1.73  
    1.74    /* make some holes for the grant pages to fill in */
    1.75 @@ -332,7 +332,7 @@ GntTbl_Resume(PXENPCI_DEVICE_DATA xpdd)
    1.76  
    1.77    new_grant_frames = GntTbl_QueryMaxFrames(xpdd);
    1.78    KdPrint((__DRIVER_NAME "     new_grant_frames = %d\n", new_grant_frames));
    1.79 -  ASSERT(new_grant_frames >= xpdd->grant_frames); // lazy
    1.80 +  NT_ASSERT(new_grant_frames >= xpdd->grant_frames); // lazy
    1.81    result = GntTbl_Map(xpdd, 0, xpdd->grant_frames - 1);
    1.82    KdPrint((__DRIVER_NAME "     GntTbl_Map result = %d\n", result));
    1.83    memcpy(xpdd->gnttbl_table, xpdd->gnttbl_table_copy, xpdd->grant_frames * PAGE_SIZE);
     2.1 --- a/xenpci/xenpci.c	Fri Sep 21 23:25:36 2012 +1000
     2.2 +++ b/xenpci/xenpci.c	Fri Sep 21 23:25:49 2012 +1000
     2.3 @@ -755,7 +755,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     2.4    XenPci_HookDbgPrint();
     2.5    #endif
     2.6  
     2.7 -  ASSERT(!balloon_mdl_head);
     2.8 +  NT_ASSERT(!balloon_mdl_head);
     2.9    balloon_mdl_head = XenPci_InitialBalloonDown();
    2.10  
    2.11  #if (NTDDI_VERSION >= NTDDI_WS03SP1)
     3.1 --- a/xenpci/xenpci_fdo.c	Fri Sep 21 23:25:36 2012 +1000
     3.2 +++ b/xenpci/xenpci_fdo.c	Fri Sep 21 23:25:49 2012 +1000
     3.3 @@ -81,7 +81,7 @@ XenPci_AllocMMIO(PXENPCI_DEVICE_DATA xpd
     3.4    addr.QuadPart += xpdd->platform_mmio_alloc;
     3.5    xpdd->platform_mmio_alloc += len;
     3.6  
     3.7 -  ASSERT(xpdd->platform_mmio_alloc <= xpdd->platform_mmio_len);
     3.8 +  NT_ASSERT(xpdd->platform_mmio_alloc <= xpdd->platform_mmio_len);
     3.9  
    3.10    return addr;
    3.11  }
    3.12 @@ -113,7 +113,7 @@ XenPci_Init(PXENPCI_DEVICE_DATA xpdd)
    3.13  
    3.14    if (!xpdd->hypercall_stubs)
    3.15    {
    3.16 -    ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    3.17 +    NT_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    3.18      xpdd->hypercall_stubs = hvm_get_hypercall_stubs();
    3.19    }
    3.20    if (!xpdd->hypercall_stubs)
    3.21 @@ -121,7 +121,7 @@ XenPci_Init(PXENPCI_DEVICE_DATA xpdd)
    3.22  
    3.23    if (!xpdd->shared_info_area)
    3.24    {
    3.25 -    ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    3.26 +    NT_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    3.27      /* this should be safe as this part will never be called on resume where IRQL == HIGH_LEVEL */
    3.28      xpdd->shared_info_area_unmapped = XenPci_AllocMMIO(xpdd, PAGE_SIZE);
    3.29      xpdd->shared_info_area = MmMapIoSpace(xpdd->shared_info_area_unmapped,
    3.30 @@ -193,7 +193,7 @@ XenPci_SysrqHandler(char *path, PVOID co
    3.31      KeBugCheckEx(('X' << 16)|('E' << 8)|('N'), 0x00000001, 0x00000000, 0x00000000, 0x00000000);
    3.32      break;
    3.33    case 'A': /* cause an assert */
    3.34 -    ASSERT(1 == 0);
    3.35 +    NT_ASSERT(1 == 0);
    3.36      break;
    3.37    default:
    3.38      KdPrint(("     Unhandled sysrq letter %c\n", letter));
    3.39 @@ -694,7 +694,7 @@ XenPci_EvtDevicePrepareHardware (WDFDEVI
    3.40  
    3.41    FUNCTION_ENTER();
    3.42    
    3.43 -  ASSERT(WdfCmResourceListGetCount(resources_raw) == WdfCmResourceListGetCount(resources_translated));
    3.44 +  NT_ASSERT(WdfCmResourceListGetCount(resources_raw) == WdfCmResourceListGetCount(resources_translated));
    3.45    
    3.46    for (i = 0; i < WdfCmResourceListGetCount(resources_raw); i++)
    3.47    {