- Timestamp:
- Mar 15, 2017 9:23:01 AM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66055 r66102 235 235 /* [BS3CG1DST_OP4] = */ BS3CG1DSTSIZE_OPERAND, 236 236 /* [BS3CG1DST_EFL] = */ 4, 237 /* [BS3CG1DST_EFL_UNDEF]=*/ 4, 237 238 238 239 /* [BS3CG1DST_AL] = */ 1, … … 336 337 /* [BS3CG1DST_OP4] = */ ~0U, 337 338 /* [BS3CG1DST_EFL] = */ RT_OFFSETOF(BS3REGCTX, rflags), 339 /* [BS3CG1DST_EFL_UNDEF]=*/ ~0, /* special field */ 338 340 339 341 /* [BS3CG1DST_AL] = */ RT_OFFSETOF(BS3REGCTX, rax.u8), … … 633 635 * 634 636 * @returns Success indicator (true/false). 635 * @param pThis The state. 636 * @param pCtx The context. 637 * @param pHdr The program header. 638 * @param off The program offset relative to the end of the header. 639 * @param cb The program size. 637 * @param pThis The state. 638 * @param pCtx The context. 639 * @param pHdr The program header. 640 * @param off The program offset relative to the end of the header. 641 * @param cb The program size. 642 * @param pEflCtx The context to take undefined EFLAGS from. (This is NULL 643 * if we're processing a input context modifier program.) 640 644 */ 641 static bool Bs3Cg1RunContextModifier(PBS3CG1STATE pThis, PBS3REGCTX pCtx, PCBS3CG1TESTHDR pHdr, unsigned off, unsigned cb) 645 static bool Bs3Cg1RunContextModifier(PBS3CG1STATE pThis, PBS3REGCTX pCtx, PCBS3CG1TESTHDR pHdr, unsigned off, unsigned cb, 646 PCBS3REGCTX pEflCtx) 642 647 { 643 648 uint8_t const BS3_FAR *pbCode = (uint8_t const BS3_FAR *)(pHdr + 1) + off; … … 782 787 if (offField < sizeof(BS3REGCTX)) 783 788 PtrField.pu8 = (uint8_t BS3_FAR *)pCtx + offField; 789 /* Special field: Copying in undefined EFLAGS from the result context. */ 790 else if (idxField == BS3CG1DST_EFL_UNDEF) 791 { 792 if (!pEflCtx || (bOpcode & BS3CG1_CTXOP_OPERATOR_MASK) != BS3CG1_CTXOP_ASSIGN) 793 { 794 Bs3TestFailed("Invalid BS3CG1DST_EFL_UNDEF usage"); 795 return false; 796 } 797 PtrField.pu32 = &pCtx->rflags.u32; 798 uValue = (*PtrField.pu32 & ~(uint32_t)uValue) | (pEflCtx->rflags.u32 & (uint32_t)uValue); 799 } 784 800 //@todo else if (idxField <= BS3CG1DST_OP4) 785 801 //@todo { … … 1044 1060 This.Ctx.rip.u = BS3_FP_OFF(pbCode); 1045 1061 1046 if (Bs3Cg1RunContextModifier(&This, &This.Ctx, pHdr, pHdr->cbSelector, pHdr->cbInput ))1062 if (Bs3Cg1RunContextModifier(&This, &This.Ctx, pHdr, pHdr->cbSelector, pHdr->cbInput, NULL)) 1047 1063 { 1048 1064 /* Run the instruction. */ … … 1053 1069 1054 1070 /* Check the control exception result first. */ 1055 if ( This.TrapFrame.bXcpt == (BS3_MODE_IS_PAGED(bMode) ? X86_XCPT_PF : X86_XCPT_UD)1071 if ( This.TrapFrame.bXcpt == (BS3_MODE_IS_PAGED(bMode) ? X86_XCPT_PF : X86_XCPT_UD) 1056 1072 && This.TrapFrame.Ctx.rip.u == This.Ctx.rip.u + This.cbCurInstr) 1057 1073 { 1058 1074 /* Apply output modifications and compare the contexts. */ 1059 1075 if (Bs3Cg1RunContextModifier(&This, &This.Ctx, pHdr, 1060 pHdr->cbSelector + pHdr->cbInput, pHdr->cbOutput)) 1076 pHdr->cbSelector + pHdr->cbInput, pHdr->cbOutput, 1077 &This.TrapFrame.Ctx)) 1061 1078 { 1062 1079 Bs3TestCheckRegCtxEx(&This.TrapFrame.Ctx, &This.Ctx, This.cbCurInstr, 0 /*cbSpAdjust*/, -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r66055 r66102 201 201 /* Flags. */ 202 202 BS3CG1DST_EFL, 203 BS3CG1DST_EFL_UNDEF, /**< Special field only valid in output context modifiers: EFLAGS |= Value & Ouput.EFLAGS; */ 203 204 /* 8-bit GPRs. */ 204 205 BS3CG1DST_AL,
Note:
See TracChangeset
for help on using the changeset viewer.