VirtualBox

Changeset 19207 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Apr 27, 2009 12:05:38 PM (16 years ago)
Author:
vboxsync
Message:

Forward-ported r46552: TRPMR0.cpp: Workaround for darwin/amd64 tripple fault.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/TRPMR0.cpp

    r19015 r19207  
    4343VMMR0DECL(void) TRPMR0DispatchHostInterrupt(PVM pVM)
    4444{
     45    /*
     46     * Get the active interrupt vector number.
     47     */
    4548    PVMCPU pVCpu = VMMGetCpu0(pVM);
    4649    RTUINT uActiveVector = pVCpu->trpm.s.uActiveVector;
    47 
    4850    pVCpu->trpm.s.uActiveVector = ~0;
    4951    AssertMsgReturnVoid(uActiveVector < 256, ("uActiveVector=%#x is invalid! (More assertions to come, please enjoy!)\n", uActiveVector));
    5052
    51 #ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
     53#if HC_ARCH_BITS == 64 && defined(RT_OS_DARWIN)
     54    /*
     55     * Do it the simple and safe way.
     56     *
     57     * This is a workaround for an optimization bug in the code below
     58     * or a gcc 4.2 on mac (snow leopard seed 314).
     59     */
     60    trpmR0DispatchHostInterruptSimple(uActiveVector);
     61
     62#else  /* The complicated way: */
     63
     64# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
    5265    /*
    5366     * Check if we're in long mode or not.
     
    5972        return;
    6073    }
    61 #endif
     74# endif
    6275
    6376    /*
     
    6679    RTIDTR      Idtr;
    6780    ASMGetIDTR(&Idtr);
    68 #if HC_ARCH_BITS == 32
     81# if HC_ARCH_BITS == 32
    6982    PVBOXIDTE   pIdte = &((PVBOXIDTE)Idtr.pIdt)[uActiveVector];
    70 #else
     83# else
    7184    PVBOXIDTE   pIdte = &((PVBOXIDTE)Idtr.pIdt)[uActiveVector * 2];
    72 #endif
     85# endif
    7386    AssertMsgReturnVoid(pIdte->Gen.u1Present, ("The IDT entry (%d) is not present!\n", uActiveVector));
    7487    AssertMsgReturnVoid(    pIdte->Gen.u3Type1 == VBOX_IDTE_TYPE1
     
    7689                        ("The IDT entry (%d) is not 32-bit int gate! type1=%#x type2=%#x\n",
    7790                         uActiveVector, pIdte->Gen.u3Type1, pIdte->Gen.u5Type2));
    78 #if HC_ARCH_BITS == 32
     91# if HC_ARCH_BITS == 32
    7992    RTFAR32   pfnHandler;
    8093    pfnHandler.off = VBOXIDTE_OFFSET(*pIdte);
     
    8396    const RTR0UINTREG uRSP = ~(RTR0UINTREG)0;
    8497
    85 #else /* 64-bit: */
     98# else /* 64-bit: */
    8699    RTFAR64   pfnHandler;
    87100    pfnHandler.off = VBOXIDTE_OFFSET(*pIdte);
     
    96109    }
    97110
    98 #endif
     111# endif
    99112
    100113    /*
     
    102115     */
    103116    trpmR0DispatchHostInterrupt(pfnHandler.off, pfnHandler.sel, uRSP);
     117#endif
    104118}
    105119
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