win-pvdrivers

diff xenpci/gnttbl.c @ 1022:cd72cd0e1c19

hooking debug doesn't survive hibernate under win8. Remove it.
Remove initial balloon down - doesn't work under xen 4.2 without xenbus being loaded
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 19 15:11:49 2013 +1100 (2013-02-19)
parents 58899e6ed48f
children 37c0c84a42e8
line diff
     1.1 --- a/xenpci/gnttbl.c	Wed Feb 13 23:37:17 2013 +1100
     1.2 +++ b/xenpci/gnttbl.c	Tue Feb 19 15:11:49 2013 +1100
     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 -  NT_ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
     1.8 +  XN_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 -  NT_ASSERT(!xpdd->gnttbl_tag[ref].tag);
    1.17 +  XN_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 -  NT_ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
    1.26 +  XN_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 -  NT_ASSERT(!xpdd->gnttbl_table[ref].flags);
    1.35 +  XN_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 -  NT_ASSERT(ref != INVALID_GRANT_REF);
    1.44 -  NT_ASSERT(xpdd->gnttbl_tag[ref].tag == tag);
    1.45 +  XN_ASSERT(ref != INVALID_GRANT_REF);
    1.46 +  XN_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 -  NT_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    1.55 +  XN_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 -  NT_ASSERT(xpdd->gnttbl_table_copy); // lazy
    1.64 +  XN_ASSERT(xpdd->gnttbl_table_copy); // lazy
    1.65    xpdd->gnttbl_table = ExAllocatePoolWithTag(NonPagedPool, xpdd->grant_frames * PAGE_SIZE, XENPCI_POOL_TAG);
    1.66 -  NT_ASSERT(xpdd->gnttbl_table); // lazy
    1.67 +  XN_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 -  NT_ASSERT(xpdd->gnttbl_mdl); // lazy
    1.71 +  XN_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 -  NT_ASSERT(new_grant_frames >= xpdd->grant_frames); // lazy
    1.80 +  XN_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);