Changeset 25070 in vbox
- Timestamp:
- Nov 28, 2009 2:25:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/fakedri_drv.c
r22010 r25070 140 140 void *alPatch; 141 141 void *pMesaEntry; 142 #ifdef RT_ARCH_AMD64 143 char patch[5]; 144 void *shift; 145 #endif 142 146 143 147 #ifndef VBOX_NO_MESA_PATCH_REPORTS 148 crDebug(""); 144 149 crDebug("vboxPatchMesaExport: %s", psFuncName); 145 150 #endif … … 185 190 if (sym->st_size<(pEnd-pStart)) 186 191 { 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 187 225 crDebug("Can't patch size too small.(%s)", psFuncName); 188 226 return; 227 #endif //ifdef RT_ARCH_AMD64 189 228 } 190 229
Note:
See TracChangeset
for help on using the changeset viewer.

