Changeset 102133 in vbox
- Timestamp:
- Nov 17, 2023 10:05:20 AM (17 months ago)
- svn:sync-xref-src-repo-rev:
- 160257
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-3-template.c
r102130 r102133 59 59 60 60 # if ARCH_BITS != 64 61 FPFNBS3FAR pfnWorker16 = Bs3SelLnkCodePtrToCurPtr(BS3_CMN_FAR_NM(bs3CpuBasic3_lea_16)); 62 FPFNBS3FAR pfnWorker32 = Bs3SelLnkCodePtrToCurPtr(BS3_CMN_FAR_NM(bs3CpuBasic3_lea_32)); 63 for (i = 0; i < 64; i++) 64 pfnWorker16(); 65 for (i = 0; i < 64; i++) 66 pfnWorker32(); 61 { 62 FPFNBS3FAR pfnWorker16 = Bs3SelLnkCodePtrToCurPtr(BS3_CMN_FAR_NM(bs3CpuBasic3_lea_16)); 63 for (i = 0; i < 64; i++) 64 pfnWorker16(); 65 } 66 { 67 FPFNBS3FAR pfnWorker32 = Bs3SelLnkCodePtrToCurPtr(BS3_CMN_FAR_NM(bs3CpuBasic3_lea_32)); 68 for (i = 0; i < 64; i++) 69 pfnWorker32(); 70 } 67 71 # else 68 72 //for (i = 0; i < 64; i++) -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-3-template.mac
r102130 r102133 196 196 BS3_PROC_BEGIN_CMN bs3CpuBasic3_lea_32, BS3_PBC_FAR 197 197 pushad 198 mov [BS3_DATA _NM(g_bs3CpuBasic3_lea_rsp)], esp198 mov [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))], esp 199 199 200 200 ; … … 278 278 %endif 279 279 280 ; 281 ; We don't test all shift combinations, there just isn't enough space 282 ; in the image (32-bit case) or the segment (16-bit case) unfortunately. 283 ; 280 284 %if TMPL_BITS == 32 281 %assign cShiftLoops 1 ;; @todo split out the LEA tests, they are too big and we haven't done 64-bit mode yet.285 %assign cShiftLoops 2 282 286 %else 283 287 %assign cShiftLoops 1 … … 286 290 287 291 ; 288 ; We don't have room to test both 32-bit and 16-bit operand sizes here for 16-bit code. 289 ; 290 call .load_regs 291 %if iBase == 4 || iDstReg == 4 292 mov esp, LEA_ESP 293 %endif 294 295 ; lea 296 %assign iValue iBase_Value + (iIndex_Value << cShift) 297 db MY_O32 8dh, X86_MODRM_MAKE(iMod, iDstReg, iMemReg), X86_SIB_MAKE(iBase, iIndex, cShift) 298 %if iMod == X86_MOD_MEM1 299 db -119 300 %assign iValue iValue - 119 301 %elif iMod == X86_MOD_MEM4 || (iMod == 0 && iBase == 5) 302 dd -04353f1ech 303 %assign iValue iValue - 04353f1ech 304 %endif 305 306 ; cmp iDstReg, iValue 307 db MY_CMP_O32 81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg) 308 dd iValue & 0ffffffffh 309 %if iBase == 4 || iDstReg == 4 310 mov esp, [BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp)] 311 %endif 312 jz $+3 313 int3 314 315 %if TMPL_BITS == 32 292 ; LEA+SIB w/ 32-bit operand size. 293 ; 316 294 call .load_regs 317 295 %if iBase == 4 || iDstReg == 4 … … 334 312 dd iValue & 0ffffffffh 335 313 %if iBase == 4 || iDstReg == 4 336 mov esp, [BS3_DATA _NM(g_bs3CpuBasic3_lea_rsp)]314 mov esp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))] 337 315 %endif 338 316 jz $+3 339 317 int3 340 %endif ; TMPL_BITS == 32 341 342 %assign cShift (cShift + 1) & 3 318 %assign cShift (cShift + 1) & 3 319 320 ; 321 ; LEA+SIB w/ 16-bit operand size. 322 ; 323 %if TMPL_BITS == 32 ; No room in the 16-bit segment for all of this. 324 call .load_regs 325 %if iBase == 4 || iDstReg == 4 326 mov esp, LEA_ESP 327 %endif 328 329 ; lea 330 %assign iValue iBase_Value + (iIndex_Value << cShift) 331 db MY_O16 8dh, X86_MODRM_MAKE(iMod, iDstReg, iMemReg), X86_SIB_MAKE(iBase, iIndex, cShift) 332 %if iMod == X86_MOD_MEM1 333 db -7 334 %assign iValue iValue - 7 335 %elif iMod == X86_MOD_MEM4 || (iMod == 0 && iBase == 5) 336 dd -073d676e4h 337 %assign iValue iValue - 073d676e4h 338 %endif 339 340 ; cmp iDstReg, iValue 341 db MY_CMP_O32 81h, X86_MODRM_MAKE(X86_MOD_REG, 7, iDstReg) 342 dd (iValue & 00000ffffh) | (iDstReg_Value & 0ffff0000h) 343 %if 1 || iBase == 4 || iDstReg == 4 344 mov esp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))] 345 %endif 346 jz $+3 347 int3 348 %assign cShift (cShift + 2) & 3 349 %endif ; TMPL_BITS == 32 343 350 %endrep 344 351 %assign iIndex iIndex + 1 … … 347 354 %endrep 348 355 349 %else 356 %else ; !SIB 350 357 ; 351 358 ; Plain lea reg, [reg] with disp according to iMod, … … 395 402 dd iValue & 0ffffffffh 396 403 %if iDstReg == 4 397 mov esp, [BS3_DATA _NM(g_bs3CpuBasic3_lea_rsp)]404 mov esp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))] 398 405 %endif 399 406 jz $+3 … … 423 430 dd (iValue & 00000ffffh) | (iDstReg_Value & 0ffff0000h) 424 431 %if iDstReg == 4 425 mov esp, [BS3_DATA _NM(g_bs3CpuBasic3_lea_rsp)]432 mov esp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))] 426 433 %endif 427 434 jz $+3 428 435 int3 429 436 430 %endif 437 %endif ; !SIB 431 438 %assign iMemReg iMemReg + 1 432 439 %endrep … … 436 443 %endrep 437 444 438 mov esp, [BS3_DATA _NM(g_bs3CpuBasic3_lea_rsp)]445 mov esp, [BS3_DATA16_WRT(BS3_DATA_NM(g_bs3CpuBasic3_lea_rsp))] 439 446 popad 440 447 BS3_HYBRID_RET
Note:
See TracChangeset
for help on using the changeset viewer.