VirtualBox

Changeset 72133 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 6, 2018 11:55:06 PM (7 years ago)
Author:
vboxsync
Message:

bs3kit: Added some more functions for setting and setting CRx and DRx registers from v8086 mode and such.

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
22 added
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r72125 r72133  
    110110       bs3-cmn-RegCtxSetRipCsFromFlat.c \
    111111       bs3-cmn-RegCtxSetRipCsFromLnkPtr.c \
     112       bs3-cmn-RegGetCr0.asm \
     113       bs3-cmn-RegGetCr2.asm \
     114       bs3-cmn-RegGetCr3.asm \
     115       bs3-cmn-RegGetCr4.asm \
     116       bs3-cmn-RegSetCr0.asm \
     117       bs3-cmn-RegSetCr2.asm \
     118       bs3-cmn-RegSetCr3.asm \
     119       bs3-cmn-RegSetCr4.asm \
     120       bs3-cmn-RegGetDr0.asm \
     121       bs3-cmn-RegGetDr1.asm \
     122       bs3-cmn-RegGetDr2.asm \
     123       bs3-cmn-RegGetDr3.asm \
     124       bs3-cmn-RegGetDr6.asm \
     125       bs3-cmn-RegGetDr7.asm \
     126       bs3-cmn-RegGetDrX.asm \
     127       bs3-cmn-RegSetDr0.asm \
     128       bs3-cmn-RegSetDr1.asm \
     129       bs3-cmn-RegSetDr2.asm \
     130       bs3-cmn-RegSetDr3.asm \
     131       bs3-cmn-RegSetDr6.asm \
     132       bs3-cmn-RegSetDr7.asm \
     133       bs3-cmn-RegSetDrX.asm \
    112134       bs3-cmn-ExtCtxInit.c \
    113135       bs3-cmn-ExtCtxSave.asm \
     
    165187        bs3-cmn-TestIsVmmDevTestingPresent.asm \
    166188        bs3-cmn-TestCheckRegCtxEx.c \
     189        bs3-cmn-TestHostPrintf.c \
    167190        bs3-cmn-TestPrintf.c \
    168191        bs3-cmn-TrapReInit.c \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PerCpuData.c

    r69111 r72133  
    5353uint8_t  g_bStupidUnalignedCompiler1 = 0xfe;
    5454
     55/** Set to disable special V8086 \#GP and \#UD handling in Bs3TrapDefaultHandler.
     56 * This is useful for getting   */
     57bool volatile g_fBs3TrapNoV86Assist = false;
     58
    5559/** The context of the last Bs3TrapSetJmp call.
    5660 * This will have eax set to 1 and need only be restored when it triggers. */
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxRestore.asm

    r69111 r72133  
    3030BS3_EXTERN_SYSTEM16 Bs3Gdt
    3131BS3_EXTERN_DATA16 g_bBs3CurrentMode
     32BS3_EXTERN_DATA16 g_fBs3TrapNoV86Assist
    3233%if TMPL_BITS != 64
    3334BS3_EXTERN_DATA16 g_uBs3CpuDetected
     
    148149        mov     [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)], al
    149150
     151        ;
     152        ; Set g_fBs3TrapNoV86Assist if BS3REGCTXRESTORE_F_NO_V86_ASSIST specified.
     153        ;
     154        test    cl, BS3REGCTXRESTORE_F_NO_V86_ASSIST
     155        jz      .no_f_no_v86_assist
     156        mov     byte [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_fBs3TrapNoV86Assist)], 1
     157.no_f_no_v86_assist:
     158
    150159%if TMPL_BITS == 16
    151160        ;
     
    262271
    263272        ; Restore control registers if they've changed.
    264         test    cl, BS3TRAPRESUME_F_SKIP_CRX
     273        test    cl, BS3REGCTXRESTORE_F_SKIP_CRX
    265274        jnz     .skip_control_regs
    266275        test    byte [xBX + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR0_IS_MSW | BS3REG_CTX_F_NO_CR2_CR3
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestHostPrintf.c

    r72130 r72133  
    3636
    3737/*********************************************************************************************************************************
    38 *   Defined Constants And Macros                                                                                                 *
    39 *********************************************************************************************************************************/
    40 #define SMALL_BUFFER 1
    41 
    42 
    43 /*********************************************************************************************************************************
    4438*   Structures and Typedefs                                                                                                      *
    4539*********************************************************************************************************************************/
    46 /** Output buffering for Bs3TestPrintfV. */
    47 typedef struct BS3TESTPRINTBUF
     40/** Output state for Bs3TestHostPrintfV. */
     41typedef struct BS3TESTHOSTPRINTF
    4842{
    4943    bool     fNewCmd;
    50 #if SMALL_BUFFER
    51     uint8_t  cchBuf;
    52     char     achBuf[78];
    53 #else
    54     uint16_t cchBuf;
    55     char     achBuf[512];
    56 #endif
    57 } BS3TESTPRINTBUF;
     44} BS3TESTHOSTPRINTF;
    5845
    5946
     
    6350static BS3_DECL_CALLBACK(size_t) bs3TestPrintfStrOutput(char ch, void BS3_FAR *pvUser)
    6451{
    65     BS3TESTPRINTBUF BS3_FAR *pBuf = (BS3TESTPRINTBUF BS3_FAR *)pvUser;
     52    BS3TESTHOSTPRINTF BS3_FAR *pState = (BS3TESTHOSTPRINTF BS3_FAR *)pvUser;
    6653
    6754    /*
     
    7158    if (g_fbBs3VMMDevTesting)
    7259    {
    73         if (ch != '\n' && !pBuf->fNewCmd)
     60        if (ch != '\n' && !pState->fNewCmd)
    7461            ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, ch);
    7562        else if (ch != '\0')
    7663        {
    77             if (pBuf->fNewCmd)
     64            if (pState->fNewCmd)
    7865            {
    7966#if ARCH_BITS == 16
     
    8269                ASMOutU32(VMMDEV_TESTING_IOPORT_CMD, VMMDEV_TESTING_CMD_PRINT);
    8370#endif
    84                 pBuf->fNewCmd = false;
     71                pState->fNewCmd = false;
    8572            }
    8673            ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, ch);
     
    8875            {
    8976                ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, '\0');
    90                 pBuf->fNewCmd = true;
     77                pState->fNewCmd = true;
    9178            }
    9279        }
    9380    }
    9481
    95     /*
    96      * Console next.
    97      */
    98     if (ch != '\0')
    99     {
    100         BS3_ASSERT(pBuf->cchBuf < RT_ELEMENTS(pBuf->achBuf));
    101         pBuf->achBuf[pBuf->cchBuf++] = ch;
    102 
    103         /* Whether to flush the buffer.  We do line flushing here to avoid
    104            dropping too much info when the formatter crashes on bad input. */
    105         if (   pBuf->cchBuf < RT_ELEMENTS(pBuf->achBuf)
    106             && (!SMALL_BUFFER || ch != '\n') )
    107             return 1;
    108     }
    109     BS3_ASSERT(pBuf->cchBuf <= RT_ELEMENTS(pBuf->achBuf));
    110     Bs3PrintStrN(&pBuf->achBuf[0], pBuf->cchBuf);
    111     pBuf->cchBuf = 0;
    11282    return ch != '\0';
    11383}
    11484
    11585
    116 
    117 #undef Bs3TestPrintfV
    118 BS3_CMN_DEF(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va))
     86#undef Bs3TestHostPrintfV
     87BS3_CMN_DEF(void, Bs3TestHostPrintfV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va))
    11988{
    120     BS3TESTPRINTBUF Buf;
    121     Buf.fNewCmd = true;
    122     Buf.cchBuf  = 0;
    123     Bs3StrFormatV(pszFormat, va, bs3TestPrintfStrOutput, &Buf);
     89    BS3TESTHOSTPRINTF State;
     90    State.fNewCmd = true;
     91    Bs3StrFormatV(pszFormat, va, bs3TestPrintfStrOutput, &State);
    12492}
    12593
    12694
    12795
    128 #undef Bs3TestPrintf
    129 BS3_CMN_DEF(void, Bs3TestPrintf,(const char BS3_FAR *pszFormat, ...))
     96#undef Bs3TestHostPrintf
     97BS3_CMN_DEF(void, Bs3TestHostPrintf,(const char BS3_FAR *pszFormat, ...))
    13098{
    13199    va_list va;
    132100    va_start(va, pszFormat);
    133     BS3_CMN_NM(Bs3TestPrintfV)(pszFormat, va);
     101    BS3_CMN_NM(Bs3TestHostPrintfV)(pszFormat, va);
    134102    va_end(va);
    135103}
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapDefaultHandler.c

    r69111 r72133  
    4747
    4848#if TMPL_BITS != 64
     49/**
     50 * V86 syscall handler.
     51 */
    4952static void bs3TrapDefaultHandlerV8086Syscall(PBS3TRAPFRAME pTrapFrame)
    5053{
    5154    /* Minimal syscall. */
    52     if (pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_PRINT_CHR)
     55    uint16_t uSyscallNo = pTrapFrame->Ctx.rax.u16;
     56    if (uSyscallNo == BS3_SYSCALL_PRINT_CHR)
    5357        Bs3PrintChr(pTrapFrame->Ctx.rcx.u8);
    54     else if (pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_PRINT_STR)
     58    else if (uSyscallNo == BS3_SYSCALL_PRINT_STR)
    5559        Bs3PrintStrN(Bs3XptrFlatToCurrent(((uint32_t)pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16),
    5660                     pTrapFrame->Ctx.rdx.u16);
    57     else if (pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_RESTORE_CTX)
     61    else if (uSyscallNo == BS3_SYSCALL_RESTORE_CTX)
    5862        Bs3RegCtxRestore(Bs3XptrFlatToCurrent(((uint32_t)pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16),
    5963                         pTrapFrame->Ctx.rdx.u16);
    60     else if (   pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING0
    61              || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING1
    62              || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING2
    63              || pTrapFrame->Ctx.rax.u16 == BS3_SYSCALL_TO_RING3)
     64    else if (   uSyscallNo == BS3_SYSCALL_TO_RING0
     65             || uSyscallNo == BS3_SYSCALL_TO_RING1
     66             || uSyscallNo == BS3_SYSCALL_TO_RING2
     67             || uSyscallNo == BS3_SYSCALL_TO_RING3)
    6468    {
    6569        Bs3RegCtxConvertToRingX(&pTrapFrame->Ctx, pTrapFrame->Ctx.rax.u16 - BS3_SYSCALL_TO_RING0);
     70    }
     71    else if (uSyscallNo == BS3_SYSCALL_SET_DRX)
     72    {
     73        uint32_t uValue = pTrapFrame->Ctx.rsi.u32;
     74        switch (pTrapFrame->Ctx.rdx.u8)
     75        {
     76            case 0: ASMSetDR0(uValue); break;
     77            case 1: ASMSetDR1(uValue); break;
     78            case 2: ASMSetDR2(uValue); break;
     79            case 3: ASMSetDR3(uValue); break;
     80            case 6: ASMSetDR6(uValue); break;
     81            case 7: ASMSetDR7(uValue); break;
     82            default: Bs3Panic();
     83        }
     84    }
     85    else if (uSyscallNo == BS3_SYSCALL_GET_DRX)
     86    {
     87        uint32_t uValue;
     88        switch (pTrapFrame->Ctx.rdx.u8)
     89        {
     90            case 0: uValue = ASMGetDR0(); break;
     91            case 1: uValue = ASMGetDR1(); break;
     92            case 2: uValue = ASMGetDR2(); break;
     93            case 3: uValue = ASMGetDR3(); break;
     94            case 6: uValue = ASMGetDR6(); break;
     95            case 7: uValue = ASMGetDR7(); break;
     96            default: uValue = 0; Bs3Panic();
     97        }
     98        pTrapFrame->Ctx.rax.u32 = uValue;
     99        pTrapFrame->Ctx.rdx.u32 = uValue >> 16;
     100    }
     101    else if (uSyscallNo == BS3_SYSCALL_SET_CRX)
     102    {
     103        uint32_t uValue = pTrapFrame->Ctx.rsi.u32;
     104        switch (pTrapFrame->Ctx.rdx.u8)
     105        {
     106            case 0: ASMSetCR0(uValue); break;
     107            case 2: ASMSetCR2(uValue); break;
     108            case 3: ASMSetCR3(uValue); break;
     109            case 4: ASMSetCR4(uValue); break;
     110            default: Bs3Panic();
     111        }
     112    }
     113    else if (uSyscallNo == BS3_SYSCALL_GET_CRX)
     114    {
     115        uint32_t uValue;
     116        switch (pTrapFrame->Ctx.rdx.u8)
     117        {
     118            case 0: uValue = ASMGetDR0(); break;
     119            case 2: uValue = ASMGetCR2(); break;
     120            case 3: uValue = ASMGetCR3(); break;
     121            case 4: uValue = ASMGetCR4(); break;
     122            default: uValue = 0; Bs3Panic();
     123        }
     124        pTrapFrame->Ctx.rax.u32 = uValue;
     125        pTrapFrame->Ctx.rdx.u32 = uValue >> 16;
    66126    }
    67127    else
     
    77137     * v8086 VMM tasks.
    78138     */
    79     if (pTrapFrame->Ctx.rflags.u32 & X86_EFL_VM)
     139//Bs3TestHostPrintf("Bs3____DefaultHandler: %02xh %04RX16:%08RX32 %08RX32 %04RX16:%08RX32 %d %d\n", pTrapFrame->bXcpt,
     140//                  pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32, pTrapFrame->Ctx.ss, pTrapFrame->Ctx.rsp.u32, g_fBs3TrapNoV86Assist, 42);
     141    if (   (pTrapFrame->Ctx.rflags.u32 & X86_EFL_VM)
     142        && !g_fBs3TrapNoV86Assist)
    80143    {
    81144        bool                    fHandled    = true;
     
    89152        pbCode      = (uint8_t const BS3_FAR *)BS3_MAKE_PROT_R0PTR_FROM_REAL(pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u16);
    90153        pbCodeStart = pbCode;
     154//Bs3TestHostPrintf("Bs3TrapDefaultHandler: V86 assist...\n");
    91155
    92156        /*
     
    95159        if (pTrapFrame->bXcpt == X86_XCPT_GP)
    96160        {
     161//Bs3TestHostPrintf("Bs3TrapDefaultHandler: #GP %04RX16:%08RX32 %08RX32\n", pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32);
    97162            bOpCode = *pbCode++;
    98163            if (bOpCode == 0x66)
     
    196261        }
    197262        else
     263        {
     264//Bs3TestHostPrintf("Bs3TrapDefaultHandler: %02x %04RX16:%08RX32 %08RX32\n", pTrapFrame->bXcpt, pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32);
    198265            fHandled = false;
     266        }
    199267        if (fHandled)
    200268        {
     
    205273# endif
    206274            Bs3RegCtxRestore(&pTrapFrame->Ctx, 0 /*fFlags*/); /* does not return. */
     275Bs3TestHostPrintf("Bs3TrapDefaultHandler: => Handled\n");
    207276            return;
    208277        }
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapPrintFrame.c

    r69111 r72133  
    3636{
    3737#if 1
    38     Bs3TestPrintf("Trap %#04x errcd=%#06RX64 at %04x:%016RX64 (by %04x/%04x) - test step %d (%#x)\n",
     38    Bs3TestPrintf("Trap %#04x errcd=%#06RX64 at %04x:%016RX64 - test step %d (%#x)\n"
     39                  "Handler: ss:rsp=%04x:%08RX64 cs=%04x cbIret=%#x rflags=%#06RX64\n"
     40                  ,
    3941                  pTrapFrame->bXcpt,
    4042                  pTrapFrame->uErrCd,
    4143                  pTrapFrame->Ctx.cs,
    4244                  pTrapFrame->Ctx.rip.u64,
     45                  g_usBs3TestStep, g_usBs3TestStep,
     46                  pTrapFrame->uHandlerSs,
     47                  pTrapFrame->uHandlerRsp,
    4348                  pTrapFrame->uHandlerCs,
    44                   pTrapFrame->uHandlerSs,
    45                   g_usBs3TestStep, g_usBs3TestStep);
     49                  pTrapFrame->cbIretFrame,
     50                  pTrapFrame->fHandlerRfl);
    4651    Bs3RegCtxPrint(&pTrapFrame->Ctx);
    4752#else
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapSetJmpAndRestore.c

    r69111 r72133  
    4040        g_uBs3TrapEipHint = pCtxRestore->rip.u32;
    4141#endif
    42         Bs3RegCtxRestore(pCtxRestore, 0);
     42        Bs3RegCtxRestore(pCtxRestore, BS3REGCTXRESTORE_F_NO_V86_ASSIST);
    4343    }
     44    g_fBs3TrapNoV86Assist = false;
    4445}
    4546
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r72125 r72133  
    107107$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListFree)
    108108$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListInit)
     109$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestHostPrintf)
     110$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestHostPrintfV)
    109111$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestInit)
    110112$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestPrintf)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r72125 r72133  
    9494#define Bs3RegCtxSetRipCsFromFlat BS3_CMN_MANGLER(Bs3RegCtxSetRipCsFromFlat)
    9595#define Bs3RegCtxSetRipCsFromLnkPtr BS3_CMN_MANGLER(Bs3RegCtxSetRipCsFromLnkPtr)
     96#define Bs3RegGetCr0 BS3_CMN_MANGLER(Bs3RegGetCr0)
     97#define Bs3RegGetCr2 BS3_CMN_MANGLER(Bs3RegGetCr2)
     98#define Bs3RegGetCr3 BS3_CMN_MANGLER(Bs3RegGetCr3)
     99#define Bs3RegGetCr4 BS3_CMN_MANGLER(Bs3RegGetCr4)
     100#define Bs3RegGetDr0 BS3_CMN_MANGLER(Bs3RegGetDr0)
     101#define Bs3RegGetDr1 BS3_CMN_MANGLER(Bs3RegGetDr1)
     102#define Bs3RegGetDr2 BS3_CMN_MANGLER(Bs3RegGetDr2)
     103#define Bs3RegGetDr3 BS3_CMN_MANGLER(Bs3RegGetDr3)
     104#define Bs3RegGetDr6 BS3_CMN_MANGLER(Bs3RegGetDr6)
     105#define Bs3RegGetDr7 BS3_CMN_MANGLER(Bs3RegGetDr7)
     106#define Bs3RegGetDrX BS3_CMN_MANGLER(Bs3RegGetDrX)
     107#define Bs3RegSetCr0 BS3_CMN_MANGLER(Bs3RegSetCr0)
     108#define Bs3RegSetCr2 BS3_CMN_MANGLER(Bs3RegSetCr2)
     109#define Bs3RegSetCr3 BS3_CMN_MANGLER(Bs3RegSetCr3)
     110#define Bs3RegSetCr4 BS3_CMN_MANGLER(Bs3RegSetCr4)
     111#define Bs3RegSetDr0 BS3_CMN_MANGLER(Bs3RegSetDr0)
     112#define Bs3RegSetDr1 BS3_CMN_MANGLER(Bs3RegSetDr1)
     113#define Bs3RegSetDr2 BS3_CMN_MANGLER(Bs3RegSetDr2)
     114#define Bs3RegSetDr3 BS3_CMN_MANGLER(Bs3RegSetDr3)
     115#define Bs3RegSetDr6 BS3_CMN_MANGLER(Bs3RegSetDr6)
     116#define Bs3RegSetDr7 BS3_CMN_MANGLER(Bs3RegSetDr7)
     117#define Bs3RegSetDrX BS3_CMN_MANGLER(Bs3RegSetDrX)
    96118#define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32)
    97119#define Bs3SelFar32ToFlat32NoClobber BS3_CMN_MANGLER(Bs3SelFar32ToFlat32NoClobber)
     
    131153#define Bs3TestFailedF BS3_CMN_MANGLER(Bs3TestFailedF)
    132154#define Bs3TestFailedV BS3_CMN_MANGLER(Bs3TestFailedV)
     155#define Bs3TestHostPrintf BS3_CMN_MANGLER(Bs3TestHostPrintf)
     156#define Bs3TestHostPrintfV BS3_CMN_MANGLER(Bs3TestHostPrintfV)
    133157#define Bs3TestInit BS3_CMN_MANGLER(Bs3TestInit)
    134158#define Bs3TestPrintf BS3_CMN_MANGLER(Bs3TestPrintf)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r72125 r72133  
    9494#undef Bs3RegCtxSetRipCsFromFlat
    9595#undef Bs3RegCtxSetRipCsFromLnkPtr
     96#undef Bs3RegGetCr0
     97#undef Bs3RegGetCr2
     98#undef Bs3RegGetCr3
     99#undef Bs3RegGetCr4
     100#undef Bs3RegGetDr0
     101#undef Bs3RegGetDr1
     102#undef Bs3RegGetDr2
     103#undef Bs3RegGetDr3
     104#undef Bs3RegGetDr6
     105#undef Bs3RegGetDr7
     106#undef Bs3RegGetDrX
     107#undef Bs3RegSetCr0
     108#undef Bs3RegSetCr2
     109#undef Bs3RegSetCr3
     110#undef Bs3RegSetCr4
     111#undef Bs3RegSetDr0
     112#undef Bs3RegSetDr1
     113#undef Bs3RegSetDr2
     114#undef Bs3RegSetDr3
     115#undef Bs3RegSetDr6
     116#undef Bs3RegSetDr7
     117#undef Bs3RegSetDrX
    96118#undef Bs3SelFar32ToFlat32
    97119#undef Bs3SelFar32ToFlat32NoClobber
     
    131153#undef Bs3TestFailedF
    132154#undef Bs3TestFailedV
     155#undef Bs3TestHostPrintf
     156#undef Bs3TestHostPrintfV
    133157#undef Bs3TestInit
    134158#undef Bs3TestPrintf
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r72125 r72133  
    828828/** Restore context (pointer in cx:xSI, flags in dx). */
    829829#define BS3_SYSCALL_RESTORE_CTX UINT16_C(0x0007)
     830/** Set DRx register (value in ESI, register number in dl). */
     831#define BS3_SYSCALL_SET_DRX     UINT16_C(0x0008)
     832/** Get DRx register (register number in dl, value returned in ax:dx). */
     833#define BS3_SYSCALL_GET_DRX     UINT16_C(0x0009)
     834/** Set CRx register (value in ESI, register number in dl). */
     835#define BS3_SYSCALL_SET_CRX     UINT16_C(0x000a)
     836/** Get CRx register (register number in dl, value returned in ax:dx). */
     837#define BS3_SYSCALL_GET_CRX     UINT16_C(0x000b)
    830838/** @} */
    831839
     
    11431151extern uint32_t   g_uBs3TrapEipHint;
    11441152
     1153/** Set to disable special V8086 \#GP and \#UD handling in Bs3TrapDefaultHandler.
     1154 * This is useful for getting   */
     1155extern bool volatile g_fBs3TrapNoV86Assist;
     1156
    11451157/** Copy of the original real-mode interrupt vector table. */
    11461158extern RTFAR16 g_aBs3RmIvtOriginal[256];
     
    26052617#endif
    26062618
     2619/** @name Flags for Bs3RegCtxRestore
     2620 * @{ */
    26072621/** Skip restoring the CRx registers. */
    2608 #define BS3REGCTXRESTORE_F_SKIP_CRX     UINT16_C(0x0001)
     2622#define BS3REGCTXRESTORE_F_SKIP_CRX         UINT16_C(0x0001)
     2623/** Sets g_fBs3TrapNoV86Assist. */
     2624#define BS3REGCTXRESTORE_F_NO_V86_ASSIST    UINT16_C(0x0002)
     2625/** @} */
    26092626
    26102627/**
     
    27982815BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxCopy,(PBS3EXTCTX pDst, PCBS3EXTCTX pSrc));
    27992816
     2817
     2818/** @name Debug register accessors for V8086 mode (works everwhere).
     2819 * @{  */
     2820BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr0,(void));
     2821BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr1,(void));
     2822BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr2,(void));
     2823BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr3,(void));
     2824BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr6,(void));
     2825BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr7,(void));
     2826
     2827BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr0,(RTCCUINTXREG uValue));
     2828BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr1,(RTCCUINTXREG uValue));
     2829BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr2,(RTCCUINTXREG uValue));
     2830BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr3,(RTCCUINTXREG uValue));
     2831BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr6,(RTCCUINTXREG uValue));
     2832BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr7,(RTCCUINTXREG uValue));
     2833
     2834BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDrX,(uint8_t iReg));
     2835BS3_CMN_PROTO_NOSB(void, Bs3RegSetDrX,(uint8_t iReg, RTCCUINTXREG uValue));
     2836/** @} */
     2837
     2838
     2839/** @name Control register accessors for V8086 mode (works everwhere).
     2840 * @{  */
     2841BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr0,(void));
     2842BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr2,(void));
     2843BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr3,(void));
     2844BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr4,(void));
     2845
     2846BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr0,(RTCCUINTXREG uValue));
     2847BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr2,(RTCCUINTXREG uValue));
     2848BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr3,(RTCCUINTXREG uValue));
     2849BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr4,(RTCCUINTXREG uValue));
     2850/** @} */
    28002851
    28012852
     
    31493200 */
    31503201BS3_CMN_PROTO_STUB(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va));
     3202
     3203/**
     3204 * Same as Bs3TestPrintf, except no guest screen echo.
     3205 *
     3206 * @param   pszFormat   What to print, format string.  Explicit newline char.
     3207 * @param   ...         String format arguments.
     3208 */
     3209BS3_CMN_PROTO_STUB(void, Bs3TestHostPrintf,(const char BS3_FAR *pszFormat, ...));
     3210
     3211/**
     3212 * Same as Bs3TestPrintfV, except no guest screen echo.
     3213 *
     3214 * @param   pszFormat   What to print, format string.  Explicit newline char.
     3215 * @param   va          String format arguments.
     3216 */
     3217BS3_CMN_PROTO_STUB(void, Bs3TestHostPrintfV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va));
    31513218
    31523219/**
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac

    r69111 r72133  
    14181418
    14191419
     1420;; @name Flags for Bs3RegCtxRestore
     1421; @{
     1422;; Skip restoring the CRx registers.
     1423%define BS3REGCTXRESTORE_F_SKIP_CRX         1
     1424;; Sets g_fBs3TrapNoV86Assist.
     1425%define BS3REGCTXRESTORE_F_NO_V86_ASSIST    2
     1426;; @}
     1427
     1428
    14201429;;
    14211430; BS3 extended register context (FPU, SSE, AVX, ++)
     
    14501459endstruc
    14511460AssertCompileSize(BS3TRAPFRAME, 0x20 + 0xd0)
    1452 
    1453 ;; Flag for Bs3TrapXxResumeFrame methods.
    1454 %define BS3TRAPRESUME_F_SKIP_CRX 1
    1455 
    14561461
    14571462;;
     
    14941499;; Restore context (pointer in cx:xDI, flags in dx).
    14951500%define BS3_SYSCALL_RESTORE_CTX     0007h
     1501;; Set DRx register (value in ESI, register number in dl).
     1502%define BS3_SYSCALL_SET_DRX         0008h
     1503;; GET DRx register (register number in dl, value returned in ax:dx).
     1504%define BS3_SYSCALL_GET_DRX         0009h
     1505;; Set CRx register (value in ESI, register number in dl).
     1506%define BS3_SYSCALL_SET_CRX         000ah
     1507;; Get CRx register (register number in dl, value returned in ax:dx).
     1508%define BS3_SYSCALL_GET_CRX         000bh
    14961509;; The last system call value.
    1497 %define BS3_SYSCALL_LAST            BS3_SYSCALL_RESTORE_CTX
     1510%define BS3_SYSCALL_LAST            BS3_SYSCALL_GET_CRX
    14981511;; @}
    14991512
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