VirtualBox

Ignore:
Timestamp:
Dec 9, 2008 2:05:12 PM (16 years ago)
Author:
vboxsync
Message:

an attempt to fix MacOS alignment issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler_new/tcg/i386/tcg-target.c

    r15135 r15173  
    4848    TCG_REG_ECX,
    4949    TCG_REG_EBX,
    50 #ifndef VBOX
    5150    TCG_REG_ESI,
    52 #endif
    5351    TCG_REG_EDI,
    5452    TCG_REG_EBP,
     
    549547#if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB)
    550548static 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,
    559557};
    560558
    561559static void *vbox_st_helpers[] = {
    562     remR3PhysWriteU8,
    563     remR3PhysWriteU16,
    564     remR3PhysWriteU32,
    565     remR3PhysWriteU64
     560    __stb_vbox_phys,
     561    __stw_vbox_phys,
     562    __stl_vbox_phys,
     563    __stq_vbox_phys
    566564};
    567565
     
    575573    /* out parameter (address), note that phys address is always 64-bit */
    576574    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
    580577    tcg_out8(s, 0x6a); tcg_out8(s, 0x00); /* push $0 */
    581578    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
    582583
    583584    tcg_out_long_call(s, vbox_ld_helpers[index]);
     
    589590    if (useReg2)
    590591      tcg_out_mov(s, data_reg2, TCG_REG_EDX);
    591 
    592     /* clean stack after us */
    593 # ifdef RT_OS_DARWIN
    594     tcg_out_addi(s, TCG_REG_ESP, 16);
    595 # else
    596     tcg_out_addi(s, TCG_REG_ESP, 8);
    597 # endif
    598592}
    599593
     
    603597    int useReg2 = ((index & 3) == 3);
    604598
    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
    610600    /* out parameter (value2) */
    611601    if (useReg2)
     
    617607    tcg_out8(s, 0x6a); tcg_out8(s, 0x00); /* push $0 */
    618608    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
    620620    /* call it */
    621621    tcg_out_long_call(s, vbox_st_helpers[index]);
    622622
    623623    /* clean stack after us */
    624 # ifdef RT_OS_DARWIN
    625     tcg_out_addi(s, TCG_REG_ESP, 16);
    626 # else
     624#if 0
    627625    tcg_out_addi(s, TCG_REG_ESP, 8 + (useReg2 ? 8 : 4));
    628626# endif
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