Changeset 60216 in vbox
- Timestamp:
- Mar 28, 2016 12:07:23 AM (9 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c16-Trap16Generic.asm
r60202 r60216 436 436 mov eax, cr4 437 437 mov [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr4], eax 438 jmp . dispatch_to_handler438 jmp .set_flags 439 439 .skip_crX_because_cpl_not_0: 440 440 or byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR 441 jmp . dispatch_to_handler441 jmp .set_flags 442 442 CPU 286 443 443 .save_286_control_registers: 444 444 smsw [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0] 445 445 446 .set_flags: ; The double fault code joins us here. 447 or byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_AMD64 448 446 449 ; 447 450 ; Dispatch it to C code. 448 451 ; 449 .dispatch_to_handler: ; The double fault code joins us here.452 .dispatch_to_handler: 450 453 mov di, bx 451 454 mov bl, byte [ss:bx + BS3TRAPFRAME.bXcpt] … … 652 655 ; Join code paths with the generic handler code. 653 656 ; 654 jmp bs3Trap16GenericCommon. dispatch_to_handler657 jmp bs3Trap16GenericCommon.set_flags 655 658 BS3_PROC_END Bs3Trap16DoubleFaultHandler 656 659 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c32-Trap32Generic.asm
r60204 r60216 358 358 mov eax, cr4 359 359 mov [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.cr4], eax 360 jmp . dispatch_to_handler360 jmp .set_flags 361 361 .skip_crX_because_cpl_not_0: 362 362 or byte [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR 363 363 364 .set_flags: ; The double fault code joins us here. 365 or byte [edi + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_AMD64 366 364 367 ; 365 368 ; Dispatch it to C code. 366 369 ; 367 .dispatch_to_handler: ; The double fault code joins us here.370 .dispatch_to_handler: 368 371 movzx ebx, byte [edi + BS3TRAPFRAME.bXcpt] 369 372 mov eax, [ebx * 4 + BS3_DATA16_WRT(_g_apfnBs3TrapHandlers_c32)] … … 531 534 ; Join code paths with the generic handler code. 532 535 ; 533 jmp bs3Trap32GenericCommon. dispatch_to_handler536 jmp bs3Trap32GenericCommon.set_flags 534 537 BS3_PROC_END Bs3Trap32DoubleFaultHandler 535 538 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxPrint.c
r60097 r60216 43 43 pRegCtx->cs, pRegCtx->ds, pRegCtx->es, pRegCtx->fs, pRegCtx->gs, pRegCtx->ss, 44 44 pRegCtx->cr3.u32, pRegCtx->cr4.u32); 45 Bs3TestPrintf("tr=%04RX16 ldtr=%04RX16 cpl=%d mode=%#x \n",46 pRegCtx->tr, pRegCtx->ldtr, pRegCtx->bCpl, pRegCtx->bMode );45 Bs3TestPrintf("tr=%04RX16 ldtr=%04RX16 cpl=%d mode=%#x fbFlags=%#x\n", 46 pRegCtx->tr, pRegCtx->ldtr, pRegCtx->bCpl, pRegCtx->bMode, pRegCtx->fbFlags); 47 47 //} 48 48 //else -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-RegCtxSave.asm
r60088 r60216 64 64 %endif 65 65 66 %if TMPL_BITS != 64 67 ; 68 ; Clear the whole structure first, unless 64-bit 66 ; 67 ; Clear the whole structure first. 69 68 ; 70 69 xor xAX, xAX 71 70 cld 72 %if TMPL_BITS == 16 71 AssertCompileSizeAlignment(BS3REGCTX, 4) 72 %if TMPL_BITS == 16 73 73 les xDI, [xBP + xCB*2] 74 74 mov xCX, BS3REGCTX_size / 2 75 75 rep stosw 76 76 %else 77 77 mov xDI, [xBP + xCB*2] 78 78 mov xCX, BS3REGCTX_size / 4 79 79 rep stosd 80 80 %endif 81 81 mov xDI, [xBP + xCB*2] 82 %endif83 82 84 83 ; … … 141 140 mov [xDI + BS3REGCTX.r14], r14 142 141 mov [xDI + BS3REGCTX.r15], r15 142 %else 143 or byte [xDI + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_AMD64 143 144 %endif 144 145 %if TMPL_BITS == 16 ; Save high bits. … … 156 157 mov [xDI + BS3REGCTX.gs], gs 157 158 158 ; Control registers. 159 %if TMPL_BITS == 16 ; v8086 and real mode woes. 160 mov cl, [xDI + BS3REGCTX.bMode] 161 cmp cl, BS3_MODE_RM 162 je .common_full_control_regs 163 and cl, BS3_MODE_CODE_MASK 164 cmp cl, BS3_MODE_CODE_V86 165 je .common_full_no_control_regs 166 %endif 167 mov ax, ss 168 test al, 3 169 jnz .common_full_no_control_regs 170 171 ; Control registers (ring-0 and real-mode only). 172 .common_full_control_regs: 159 173 mov sAX, cr0 160 174 mov [xDI + BS3REGCTX.cr0], sAX … … 165 179 mov sAX, cr4 166 180 mov [xDI + BS3REGCTX.cr4], sAX 181 jmp .common_80286 182 183 .common_full_no_control_regs: 184 or byte [xDI + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR 167 185 168 186 ; 80286 control registers. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestCheckRegCtxEx.c
r60199 r60216 51 51 CHECK_MEMBER("rsi", "%08RX64", pActualCtx->rsi.u, pExpectedCtx->rsi.u); 52 52 CHECK_MEMBER("rdi", "%08RX64", pActualCtx->rdi.u, pExpectedCtx->rdi.u); 53 CHECK_MEMBER("r8", "%08RX64", pActualCtx->r8.u, pExpectedCtx->r8.u); 54 CHECK_MEMBER("r9", "%08RX64", pActualCtx->r9.u, pExpectedCtx->r9.u); 55 CHECK_MEMBER("r10", "%08RX64", pActualCtx->r10.u, pExpectedCtx->r10.u); 56 CHECK_MEMBER("r11", "%08RX64", pActualCtx->r11.u, pExpectedCtx->r11.u); 57 CHECK_MEMBER("r12", "%08RX64", pActualCtx->r12.u, pExpectedCtx->r12.u); 58 CHECK_MEMBER("r13", "%08RX64", pActualCtx->r13.u, pExpectedCtx->r13.u); 59 CHECK_MEMBER("r14", "%08RX64", pActualCtx->r14.u, pExpectedCtx->r14.u); 60 CHECK_MEMBER("r15", "%08RX64", pActualCtx->r15.u, pExpectedCtx->r15.u); 53 if ( !(pActualCtx->fbFlags & BS3REG_CTX_F_NO_AMD64) 54 && !(pExpectedCtx->fbFlags & BS3REG_CTX_F_NO_AMD64) ) 55 { 56 CHECK_MEMBER("r8", "%08RX64", pActualCtx->r8.u, pExpectedCtx->r8.u); 57 CHECK_MEMBER("r9", "%08RX64", pActualCtx->r9.u, pExpectedCtx->r9.u); 58 CHECK_MEMBER("r10", "%08RX64", pActualCtx->r10.u, pExpectedCtx->r10.u); 59 CHECK_MEMBER("r11", "%08RX64", pActualCtx->r11.u, pExpectedCtx->r11.u); 60 CHECK_MEMBER("r12", "%08RX64", pActualCtx->r12.u, pExpectedCtx->r12.u); 61 CHECK_MEMBER("r13", "%08RX64", pActualCtx->r13.u, pExpectedCtx->r13.u); 62 CHECK_MEMBER("r14", "%08RX64", pActualCtx->r14.u, pExpectedCtx->r14.u); 63 CHECK_MEMBER("r15", "%08RX64", pActualCtx->r15.u, pExpectedCtx->r15.u); 64 } 61 65 CHECK_MEMBER("rflags", "%08RX64", pActualCtx->rflags.u, pExpectedCtx->rflags.u | fExtraEfl); 62 66 CHECK_MEMBER("rip", "%08RX64", pActualCtx->rip.u, pExpectedCtx->rip.u + cbPcAdjust); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r60211 r60216 1845 1845 * This is usually because it wasn't created with CPL=0. */ 1846 1846 #define BS3REG_CTX_F_NO_CR UINT8_C(0x01) 1847 /** The context doesn't have valid values for AMD64 GPR extensions. */ 1848 #define BS3REG_CTX_F_NO_AMD64 UINT8_C(0x02) 1847 1849 /** @} */ 1848 1850 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r60211 r60216 1172 1172 ; This is usually because it wasn't created with CPL=0. 1173 1173 %define BS3REG_CTX_F_NO_CR 0x01 1174 ;; The context doesn't have valid values for AMD64 GPR extensions. 1175 %define BS3REG_CTX_F_NO_AMD64 0x02 1174 1176 ;; @} 1175 1177
Note:
See TracChangeset
for help on using the changeset viewer.