VirtualBox

Changeset 53564 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 18, 2014 2:48:14 AM (10 years ago)
Author:
vboxsync
Message:

cidet: darwin fixes.

Location:
trunk/src/VBox/ValidationKit/utils/cpu
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/cpu/cidet-app.cpp

    r53563 r53564  
    5050#endif
    5151
     52
     53/*******************************************************************************
     54*   Defined Constants And Macros                                               *
     55*******************************************************************************/
     56/** @def CIDET_LEAVE_GS_ALONE
     57 * Leave GS alone on 64-bit darwin (gs is 0, no ldt or gdt entry to load that'll
     58 * restore the lower 32-bits of the base when saving and restoring the register).
     59 */
     60#if defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64)
     61# define CIDET_LEAVE_GS_ALONE
     62#endif
    5263
    5364
     
    923934static DECLCALLBACK(bool) CidetAppCbExecute(PCIDETCORE pThis)
    924935{
    925 #if defined(RT_OS_WINDOWS)
     936#if defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
    926937    /* Skip tricky stack because windows cannot dispatch exception if RSP/ESP is bad. */
    927938    if (pThis->InCtx.fTrickyStack)
     
    10571068                    pThis->Core.InTemplateCtx.aGRegs[X86_GREG_xSP] = (uintptr_t)pThis->pbStackEnd - 64;
    10581069
     1070                    pThis->Core.fTestCfg |= CIDET_TESTCFG_SEG_PRF_CS;
     1071                    pThis->Core.fTestCfg |= CIDET_TESTCFG_SEG_PRF_DS;
     1072                    pThis->Core.fTestCfg |= CIDET_TESTCFG_SEG_PRF_ES;
     1073#if !defined(RT_OS_WINDOWS)
     1074                    pThis->Core.fTestCfg |= CIDET_TESTCFG_SEG_PRF_FS;
     1075#endif
     1076#if !defined(CIDET_LEAVE_GS_ALONE)
     1077                    pThis->Core.fTestCfg |= CIDET_TESTCFG_SEG_PRF_GS;
     1078#endif
     1079
    10591080                    *ppThis = pThis;
    10601081                    return VINF_SUCCESS;
     
    11481169     */
    11491170    /* Alternative stack so we can play with esp/rsp. */
    1150     struct sigaltstack AltStack;
     1171    stack_t AltStack;
    11511172    RT_ZERO(AltStack);
    1152     AltStack.ss_flags = SS_ONSTACK;
     1173    AltStack.ss_flags = 0;
    11531174# ifdef SIGSTKSZ
    11541175    AltStack.ss_size  = RT_MAX(SIGSTKSZ, _128K);
  • trunk/src/VBox/ValidationKit/utils/cpu/cidet-appA.asm

    r53563 r53564  
    4343%endif
    4444
     45
     46;;
     47; Leave GS alone on 64-bit darwin (gs is 0, no ldt or gdt entry to load that'll
     48; restore the lower 32-bits of the base when saving and restoring the register).
     49%ifdef RT_OS_DARWIN
     50 %ifdef RT_ARCH_AMD64
     51  %define CIDET_LEAVE_GS_ALONE
     52 %endif
     53%endif
     54
     55
     56
     57BEGINCODE
    4558
    4659;;
     
    153166        mov     es, [xDX + CIDETCPUCTX.aSRegs + X86_SREG_ES * 2]
    154167        mov     fs, [xDX + CIDETCPUCTX.aSRegs + X86_SREG_FS * 2]
     168%ifndef CIDET_LEAVE_GS_ALONE
    155169        mov     gs, [xDX + CIDETCPUCTX.aSRegs + X86_SREG_GS * 2]
     170%endif
    156171
    157172        ; Restore most GPRs (except xCX, xAX and xSP).
  • trunk/src/VBox/ValidationKit/utils/cpu/cidet-core.cpp

    r53563 r53564  
    6161/** @def CIDET_DPRINTF
    6262 * Debug printf. */
    63 #if 0 //def DEBUG_bird
     63#ifdef DEBUG_bird
    6464# define CIDET_DPRINTF(a)   do { RTPrintf a; } while (0)
    6565#else
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