VirtualBox

Changeset 34198 in vbox


Ignore:
Timestamp:
Nov 19, 2010 1:46:47 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: add debug message and use define for patch size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/fakedri_drv.c

    r34191 r34198  
    173173    }
    174174}
     175
     176#ifdef RT_ARCH_AMD64
     177# define FAKEDRI_JMP64_PATCH_SIZE 13
     178#endif
    175179
    176180static void
     
    291295#ifdef RT_ARCH_AMD64
    292296    /*Add rest of mesa function body to free list*/
    293     if (sym->st_size-(pEnd-pStart)>=5)
     297    if (sym->st_size-(pEnd-pStart)>=FAKEDRI_JMP64_PATCH_SIZE)
    294298    {
    295299        FAKEDRI_PatchNode *pNode = (FAKEDRI_PatchNode *)crAlloc(sizeof(FAKEDRI_PatchNode));
     
    303307                pNode->pNext = g_pFreeList;
    304308                g_pFreeList = pNode;
     309# ifndef VBOX_NO_MESA_PATCH_REPORTS
     310                crDebug("Added free node %s, func start=%p, free start=%p, size=%#lx",
     311                        psFuncName, pNode->pSrcStart, pNode->pDstStart, pNode->pDstEnd-pNode->pDstStart);
     312# endif
    305313        }
    306314    }
     
    314322    FAKEDRI_PatchNode *pFreeNode, *pPatchNode;
    315323    int64_t offset;
    316     char patch[13];
     324    char patch[FAKEDRI_JMP64_PATCH_SIZE];
    317325
    318326    pPatchNode = g_pRepatchList;
     
    326334        while (pFreeNode)
    327335        {
    328             if (pFreeNode->pDstEnd-pFreeNode->pDstStart>=13)
     336            if (pFreeNode->pDstEnd-pFreeNode->pDstStart>=FAKEDRI_JMP64_PATCH_SIZE)
    329337            {
    330338                offset = ((intptr_t)pFreeNode->pDstStart-((intptr_t)pPatchNode->pDstStart+5));
     
    363371                pPatchNode->psFuncName);
    364372# endif
    365         vboxApplyPatch(pFreeNode->psFuncName, pFreeNode->pDstStart, &patch[0], 13);
     373        vboxApplyPatch(pFreeNode->psFuncName, pFreeNode->pDstStart, &patch[0], FAKEDRI_JMP64_PATCH_SIZE);
    366374        /*mark this space as used*/
    367         pFreeNode->pDstStart = pFreeNode->pDstStart+13;
     375        pFreeNode->pDstStart = pFreeNode->pDstStart+FAKEDRI_JMP64_PATCH_SIZE;
    368376
    369377        pPatchNode = pPatchNode->pNext;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette