Changeset 72133 in vbox for trunk/src/VBox
- Timestamp:
- May 6, 2018 11:55:06 PM (7 years ago)
- 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 110 110 bs3-cmn-RegCtxSetRipCsFromFlat.c \ 111 111 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 \ 112 134 bs3-cmn-ExtCtxInit.c \ 113 135 bs3-cmn-ExtCtxSave.asm \ … … 165 187 bs3-cmn-TestIsVmmDevTestingPresent.asm \ 166 188 bs3-cmn-TestCheckRegCtxEx.c \ 189 bs3-cmn-TestHostPrintf.c \ 167 190 bs3-cmn-TestPrintf.c \ 168 191 bs3-cmn-TrapReInit.c \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PerCpuData.c
r69111 r72133 53 53 uint8_t g_bStupidUnalignedCompiler1 = 0xfe; 54 54 55 /** Set to disable special V8086 \#GP and \#UD handling in Bs3TrapDefaultHandler. 56 * This is useful for getting */ 57 bool volatile g_fBs3TrapNoV86Assist = false; 58 55 59 /** The context of the last Bs3TrapSetJmp call. 56 60 * 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 30 30 BS3_EXTERN_SYSTEM16 Bs3Gdt 31 31 BS3_EXTERN_DATA16 g_bBs3CurrentMode 32 BS3_EXTERN_DATA16 g_fBs3TrapNoV86Assist 32 33 %if TMPL_BITS != 64 33 34 BS3_EXTERN_DATA16 g_uBs3CpuDetected … … 148 149 mov [BS3_ONLY_16BIT(es:) BS3_DATA16_WRT(g_bBs3CurrentMode)], al 149 150 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 150 159 %if TMPL_BITS == 16 151 160 ; … … 262 271 263 272 ; Restore control registers if they've changed. 264 test cl, BS3 TRAPRESUME_F_SKIP_CRX273 test cl, BS3REGCTXRESTORE_F_SKIP_CRX 265 274 jnz .skip_control_regs 266 275 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 36 36 37 37 /********************************************************************************************************************************* 38 * Defined Constants And Macros *39 *********************************************************************************************************************************/40 #define SMALL_BUFFER 141 42 43 /*********************************************************************************************************************************44 38 * Structures and Typedefs * 45 39 *********************************************************************************************************************************/ 46 /** Output buffering for Bs3TestPrintfV. */47 typedef struct BS3TEST PRINTBUF40 /** Output state for Bs3TestHostPrintfV. */ 41 typedef struct BS3TESTHOSTPRINTF 48 42 { 49 43 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; 58 45 59 46 … … 63 50 static BS3_DECL_CALLBACK(size_t) bs3TestPrintfStrOutput(char ch, void BS3_FAR *pvUser) 64 51 { 65 BS3TEST PRINTBUF BS3_FAR *pBuf = (BS3TESTPRINTBUF BS3_FAR *)pvUser;52 BS3TESTHOSTPRINTF BS3_FAR *pState = (BS3TESTHOSTPRINTF BS3_FAR *)pvUser; 66 53 67 54 /* … … 71 58 if (g_fbBs3VMMDevTesting) 72 59 { 73 if (ch != '\n' && !p Buf->fNewCmd)60 if (ch != '\n' && !pState->fNewCmd) 74 61 ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, ch); 75 62 else if (ch != '\0') 76 63 { 77 if (p Buf->fNewCmd)64 if (pState->fNewCmd) 78 65 { 79 66 #if ARCH_BITS == 16 … … 82 69 ASMOutU32(VMMDEV_TESTING_IOPORT_CMD, VMMDEV_TESTING_CMD_PRINT); 83 70 #endif 84 p Buf->fNewCmd = false;71 pState->fNewCmd = false; 85 72 } 86 73 ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, ch); … … 88 75 { 89 76 ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, '\0'); 90 p Buf->fNewCmd = true;77 pState->fNewCmd = true; 91 78 } 92 79 } 93 80 } 94 81 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 avoid104 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;112 82 return ch != '\0'; 113 83 } 114 84 115 85 116 117 #undef Bs3TestPrintfV 118 BS3_CMN_DEF(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va)) 86 #undef Bs3TestHostPrintfV 87 BS3_CMN_DEF(void, Bs3TestHostPrintfV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va)) 119 88 { 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); 124 92 } 125 93 126 94 127 95 128 #undef Bs3Test Printf129 BS3_CMN_DEF(void, Bs3Test Printf,(const char BS3_FAR *pszFormat, ...))96 #undef Bs3TestHostPrintf 97 BS3_CMN_DEF(void, Bs3TestHostPrintf,(const char BS3_FAR *pszFormat, ...)) 130 98 { 131 99 va_list va; 132 100 va_start(va, pszFormat); 133 BS3_CMN_NM(Bs3Test PrintfV)(pszFormat, va);101 BS3_CMN_NM(Bs3TestHostPrintfV)(pszFormat, va); 134 102 va_end(va); 135 103 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapDefaultHandler.c
r69111 r72133 47 47 48 48 #if TMPL_BITS != 64 49 /** 50 * V86 syscall handler. 51 */ 49 52 static void bs3TrapDefaultHandlerV8086Syscall(PBS3TRAPFRAME pTrapFrame) 50 53 { 51 54 /* 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) 53 57 Bs3PrintChr(pTrapFrame->Ctx.rcx.u8); 54 else if ( pTrapFrame->Ctx.rax.u16== BS3_SYSCALL_PRINT_STR)58 else if (uSyscallNo == BS3_SYSCALL_PRINT_STR) 55 59 Bs3PrintStrN(Bs3XptrFlatToCurrent(((uint32_t)pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16), 56 60 pTrapFrame->Ctx.rdx.u16); 57 else if ( pTrapFrame->Ctx.rax.u16== BS3_SYSCALL_RESTORE_CTX)61 else if (uSyscallNo == BS3_SYSCALL_RESTORE_CTX) 58 62 Bs3RegCtxRestore(Bs3XptrFlatToCurrent(((uint32_t)pTrapFrame->Ctx.rcx.u16 << 4) + pTrapFrame->Ctx.rsi.u16), 59 63 pTrapFrame->Ctx.rdx.u16); 60 else if ( pTrapFrame->Ctx.rax.u16== BS3_SYSCALL_TO_RING061 || pTrapFrame->Ctx.rax.u16== BS3_SYSCALL_TO_RING162 || pTrapFrame->Ctx.rax.u16== BS3_SYSCALL_TO_RING263 || 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) 64 68 { 65 69 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; 66 126 } 67 127 else … … 77 137 * v8086 VMM tasks. 78 138 */ 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) 80 143 { 81 144 bool fHandled = true; … … 89 152 pbCode = (uint8_t const BS3_FAR *)BS3_MAKE_PROT_R0PTR_FROM_REAL(pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u16); 90 153 pbCodeStart = pbCode; 154 //Bs3TestHostPrintf("Bs3TrapDefaultHandler: V86 assist...\n"); 91 155 92 156 /* … … 95 159 if (pTrapFrame->bXcpt == X86_XCPT_GP) 96 160 { 161 //Bs3TestHostPrintf("Bs3TrapDefaultHandler: #GP %04RX16:%08RX32 %08RX32\n", pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32); 97 162 bOpCode = *pbCode++; 98 163 if (bOpCode == 0x66) … … 196 261 } 197 262 else 263 { 264 //Bs3TestHostPrintf("Bs3TrapDefaultHandler: %02x %04RX16:%08RX32 %08RX32\n", pTrapFrame->bXcpt, pTrapFrame->Ctx.cs, pTrapFrame->Ctx.rip.u32, pTrapFrame->Ctx.rflags.u32); 198 265 fHandled = false; 266 } 199 267 if (fHandled) 200 268 { … … 205 273 # endif 206 274 Bs3RegCtxRestore(&pTrapFrame->Ctx, 0 /*fFlags*/); /* does not return. */ 275 Bs3TestHostPrintf("Bs3TrapDefaultHandler: => Handled\n"); 207 276 return; 208 277 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapPrintFrame.c
r69111 r72133 36 36 { 37 37 #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 , 39 41 pTrapFrame->bXcpt, 40 42 pTrapFrame->uErrCd, 41 43 pTrapFrame->Ctx.cs, 42 44 pTrapFrame->Ctx.rip.u64, 45 g_usBs3TestStep, g_usBs3TestStep, 46 pTrapFrame->uHandlerSs, 47 pTrapFrame->uHandlerRsp, 43 48 pTrapFrame->uHandlerCs, 44 pTrapFrame-> uHandlerSs,45 g_usBs3TestStep, g_usBs3TestStep);49 pTrapFrame->cbIretFrame, 50 pTrapFrame->fHandlerRfl); 46 51 Bs3RegCtxPrint(&pTrapFrame->Ctx); 47 52 #else -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapSetJmpAndRestore.c
r69111 r72133 40 40 g_uBs3TrapEipHint = pCtxRestore->rip.u32; 41 41 #endif 42 Bs3RegCtxRestore(pCtxRestore, 0);42 Bs3RegCtxRestore(pCtxRestore, BS3REGCTXRESTORE_F_NO_V86_ASSIST); 43 43 } 44 g_fBs3TrapNoV86Assist = false; 44 45 } 45 46 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
r72125 r72133 107 107 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListFree) 108 108 $(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) 109 111 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestInit) 110 112 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestPrintf) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r72125 r72133 94 94 #define Bs3RegCtxSetRipCsFromFlat BS3_CMN_MANGLER(Bs3RegCtxSetRipCsFromFlat) 95 95 #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) 96 118 #define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32) 97 119 #define Bs3SelFar32ToFlat32NoClobber BS3_CMN_MANGLER(Bs3SelFar32ToFlat32NoClobber) … … 131 153 #define Bs3TestFailedF BS3_CMN_MANGLER(Bs3TestFailedF) 132 154 #define Bs3TestFailedV BS3_CMN_MANGLER(Bs3TestFailedV) 155 #define Bs3TestHostPrintf BS3_CMN_MANGLER(Bs3TestHostPrintf) 156 #define Bs3TestHostPrintfV BS3_CMN_MANGLER(Bs3TestHostPrintfV) 133 157 #define Bs3TestInit BS3_CMN_MANGLER(Bs3TestInit) 134 158 #define Bs3TestPrintf BS3_CMN_MANGLER(Bs3TestPrintf) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r72125 r72133 94 94 #undef Bs3RegCtxSetRipCsFromFlat 95 95 #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 96 118 #undef Bs3SelFar32ToFlat32 97 119 #undef Bs3SelFar32ToFlat32NoClobber … … 131 153 #undef Bs3TestFailedF 132 154 #undef Bs3TestFailedV 155 #undef Bs3TestHostPrintf 156 #undef Bs3TestHostPrintfV 133 157 #undef Bs3TestInit 134 158 #undef Bs3TestPrintf -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r72125 r72133 828 828 /** Restore context (pointer in cx:xSI, flags in dx). */ 829 829 #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) 830 838 /** @} */ 831 839 … … 1143 1151 extern uint32_t g_uBs3TrapEipHint; 1144 1152 1153 /** Set to disable special V8086 \#GP and \#UD handling in Bs3TrapDefaultHandler. 1154 * This is useful for getting */ 1155 extern bool volatile g_fBs3TrapNoV86Assist; 1156 1145 1157 /** Copy of the original real-mode interrupt vector table. */ 1146 1158 extern RTFAR16 g_aBs3RmIvtOriginal[256]; … … 2605 2617 #endif 2606 2618 2619 /** @name Flags for Bs3RegCtxRestore 2620 * @{ */ 2607 2621 /** 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 /** @} */ 2609 2626 2610 2627 /** … … 2798 2815 BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxCopy,(PBS3EXTCTX pDst, PCBS3EXTCTX pSrc)); 2799 2816 2817 2818 /** @name Debug register accessors for V8086 mode (works everwhere). 2819 * @{ */ 2820 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr0,(void)); 2821 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr1,(void)); 2822 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr2,(void)); 2823 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr3,(void)); 2824 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr6,(void)); 2825 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDr7,(void)); 2826 2827 BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr0,(RTCCUINTXREG uValue)); 2828 BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr1,(RTCCUINTXREG uValue)); 2829 BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr2,(RTCCUINTXREG uValue)); 2830 BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr3,(RTCCUINTXREG uValue)); 2831 BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr6,(RTCCUINTXREG uValue)); 2832 BS3_CMN_PROTO_NOSB(void, Bs3RegSetDr7,(RTCCUINTXREG uValue)); 2833 2834 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetDrX,(uint8_t iReg)); 2835 BS3_CMN_PROTO_NOSB(void, Bs3RegSetDrX,(uint8_t iReg, RTCCUINTXREG uValue)); 2836 /** @} */ 2837 2838 2839 /** @name Control register accessors for V8086 mode (works everwhere). 2840 * @{ */ 2841 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr0,(void)); 2842 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr2,(void)); 2843 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr3,(void)); 2844 BS3_CMN_PROTO_NOSB(RTCCUINTXREG, Bs3RegGetCr4,(void)); 2845 2846 BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr0,(RTCCUINTXREG uValue)); 2847 BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr2,(RTCCUINTXREG uValue)); 2848 BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr3,(RTCCUINTXREG uValue)); 2849 BS3_CMN_PROTO_NOSB(void, Bs3RegSetCr4,(RTCCUINTXREG uValue)); 2850 /** @} */ 2800 2851 2801 2852 … … 3149 3200 */ 3150 3201 BS3_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 */ 3209 BS3_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 */ 3217 BS3_CMN_PROTO_STUB(void, Bs3TestHostPrintfV,(const char BS3_FAR *pszFormat, va_list BS3_FAR va)); 3151 3218 3152 3219 /** -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r69111 r72133 1418 1418 1419 1419 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 1420 1429 ;; 1421 1430 ; BS3 extended register context (FPU, SSE, AVX, ++) … … 1450 1459 endstruc 1451 1460 AssertCompileSize(BS3TRAPFRAME, 0x20 + 0xd0) 1452 1453 ;; Flag for Bs3TrapXxResumeFrame methods.1454 %define BS3TRAPRESUME_F_SKIP_CRX 11455 1456 1461 1457 1462 ;; … … 1494 1499 ;; Restore context (pointer in cx:xDI, flags in dx). 1495 1500 %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 1496 1509 ;; The last system call value. 1497 %define BS3_SYSCALL_LAST BS3_SYSCALL_ RESTORE_CTX1510 %define BS3_SYSCALL_LAST BS3_SYSCALL_GET_CRX 1498 1511 ;; @} 1499 1512
Note:
See TracChangeset
for help on using the changeset viewer.