VirtualBox

Changeset 25070 in vbox


Ignore:
Timestamp:
Nov 28, 2009 2:25:27 PM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: fix opengl&compiz on 64bit linuxes

File:
1 edited

Legend:

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

    r22010 r25070  
    140140    void *alPatch;
    141141    void *pMesaEntry;
     142#ifdef RT_ARCH_AMD64
     143    char patch[5];
     144    void *shift;
     145#endif
    142146
    143147#ifndef VBOX_NO_MESA_PATCH_REPORTS
     148    crDebug("");
    144149    crDebug("vboxPatchMesaExport: %s", psFuncName);
    145150#endif
     
    185190    if (sym->st_size<(pEnd-pStart))
    186191    {
     192#ifdef RT_ARCH_AMD64
     193        /* Try to insert 5 bytes jmpq to our stub code */
     194
     195        if (5>(pEnd-pStart))
     196        {
     197            crDebug("Can't patch size too small.(%s)", psFuncName);
     198            return;
     199        }
     200
     201        shift = pStart-(dlip.dli_saddr+5);
     202# ifndef VBOX_NO_MESA_PATCH_REPORTS
     203        crDebug("Size is small, inserting jmpq with shift %p instead", shift);
     204# endif
     205
     206        if ( ((((long)shift)&0x00000000) != 0)
     207             && ((((long)shift)&0x00000000) != 0xFFFFFFFF00000000))
     208        {
     209            crDebug("Can't patch offset is too big.(%s)", psFuncName);
     210            return;
     211        }
     212
     213        patch[0] = 0xE9;
     214        patch[1] = ((char*)&shift)[0];
     215        patch[2] = ((char*)&shift)[1];
     216        patch[3] = ((char*)&shift)[2];
     217        patch[4] = ((char*)&shift)[3];
     218
     219# ifndef VBOX_NO_MESA_PATCH_REPORTS
     220        crDebug("Patch: E9 %x", *((int*)&patch[1]));
     221# endif
     222        pStart = &patch[0];
     223        pEnd = &patch[5];
     224#else
    187225        crDebug("Can't patch size too small.(%s)", psFuncName);
    188226        return;
     227#endif //ifdef RT_ARCH_AMD64
    189228    }
    190229
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