Changeset 15173 in vbox for trunk/src/recompiler_new/tcg/i386
- Timestamp:
- Dec 9, 2008 2:05:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/tcg/i386/tcg-target.c
r15135 r15173 48 48 TCG_REG_ECX, 49 49 TCG_REG_EBX, 50 #ifndef VBOX51 50 TCG_REG_ESI, 52 #endif53 51 TCG_REG_EDI, 54 52 TCG_REG_EBP, … … 549 547 #if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB) 550 548 static void *vbox_ld_helpers[] = { 551 remR3PhysReadU8,552 remR3PhysReadU16,553 remR3PhysReadU32,554 remR3PhysReadU64,555 remR3PhysReadS8,556 remR3PhysReadS16,557 remR3PhysReadS32,558 remR3PhysReadS64,549 __ldub_vbox_phys, 550 __lduw_vbox_phys, 551 __ldul_vbox_phys, 552 __ldq_vbox_phys, 553 __ldb_vbox_phys, 554 __ldw_vbox_phys, 555 __ldl_vbox_phys, 556 __ldq_vbox_phys, 559 557 }; 560 558 561 559 static void *vbox_st_helpers[] = { 562 remR3PhysWriteU8,563 remR3PhysWriteU16,564 remR3PhysWriteU32,565 remR3PhysWriteU64560 __stb_vbox_phys, 561 __stw_vbox_phys, 562 __stl_vbox_phys, 563 __stq_vbox_phys 566 564 }; 567 565 … … 575 573 /* out parameter (address), note that phys address is always 64-bit */ 576 574 AssertMsg(sizeof(RTGCPHYS) == 8, ("Physical address must be 64-bits, update caller\n")); 577 # ifdef RT_OS_DARWIN 578 tgen_arithi(s, ARITH_SUB, TCG_REG_ESP, 8); 579 # endif 575 576 #if 0 580 577 tcg_out8(s, 0x6a); tcg_out8(s, 0x00); /* push $0 */ 581 578 tcg_out_push(s, addr_reg); 579 #else 580 /* mov addr_reg, %eax */ 581 tcg_out_mov(s, TCG_REG_EAX, addr_reg); 582 #endif 582 583 583 584 tcg_out_long_call(s, vbox_ld_helpers[index]); … … 589 590 if (useReg2) 590 591 tcg_out_mov(s, data_reg2, TCG_REG_EDX); 591 592 /* clean stack after us */593 # ifdef RT_OS_DARWIN594 tcg_out_addi(s, TCG_REG_ESP, 16);595 # else596 tcg_out_addi(s, TCG_REG_ESP, 8);597 # endif598 592 } 599 593 … … 603 597 int useReg2 = ((index & 3) == 3); 604 598 605 /** @todo: should we make phys addess accessors fastcalls - probably not a big deal */ 606 # ifdef RT_OS_DARWIN 607 if (!useReg2) 608 tgen_arithi(s, ARITH_SUB, TCG_REG_ESP, 4); 609 # endif 599 #if 0 610 600 /* out parameter (value2) */ 611 601 if (useReg2) … … 617 607 tcg_out8(s, 0x6a); tcg_out8(s, 0x00); /* push $0 */ 618 608 tcg_out_push(s, addr_reg); 619 609 #else 610 Assert(val_reg != TCG_REG_EAX && (!useReg2 || (val_reg2 != TCG_REG_EAX))); 611 /* mov addr_reg, %eax */ 612 tcg_out_mov(s, TCG_REG_EAX, addr_reg); 613 Assert(!useReg2 || (val_reg2 != TCG_REG_EDX)); 614 /* mov val_reg, %edx */ 615 tcg_out_mov(s, TCG_REG_EDX, val_reg); 616 if (useReg2) 617 tcg_out_mov(s, TCG_REG_ECX, val_reg2); 618 619 #endif 620 620 /* call it */ 621 621 tcg_out_long_call(s, vbox_st_helpers[index]); 622 622 623 623 /* clean stack after us */ 624 # ifdef RT_OS_DARWIN 625 tcg_out_addi(s, TCG_REG_ESP, 16); 626 # else 624 #if 0 627 625 tcg_out_addi(s, TCG_REG_ESP, 8 + (useReg2 ? 8 : 4)); 628 626 # endif
Note:
See TracChangeset
for help on using the changeset viewer.