Changeset 95397 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Timestamp:
- Jun 27, 2022 5:49:40 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151994
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r95376 r95397 151 151 bs3-cmn-ExtCtxGetMm.c \ 152 152 bs3-cmn-ExtCtxSetMm.c \ 153 bs3-cmn-ExtCtxGetXmm.c \ 154 bs3-cmn-ExtCtxSetXmm.c \ 153 155 bs3-cmn-ExtCtxGetYmm.c \ 154 156 bs3-cmn-ExtCtxSetYmm.c \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxGetXmm.c
r95372 r95397 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3ExtCtxGet Ymm3 * BS3Kit - Bs3ExtCtxGetXmm 4 4 */ 5 5 … … 32 32 33 33 34 #undef Bs3ExtCtxGet Ymm35 BS3_CMN_DEF(PRTUINT 256U, Bs3ExtCtxGetYmm,(PCBS3EXTCTX pExtCtx, uint8_t iReg, PRTUINT256U pValue))34 #undef Bs3ExtCtxGetXmm 35 BS3_CMN_DEF(PRTUINT128U, Bs3ExtCtxGetXmm,(PCBS3EXTCTX pExtCtx, uint8_t iReg, PRTUINT128U pValue)) 36 36 { 37 pValue->au128[0].au64[0] = 0; 38 pValue->au128[0].au64[1] = 0; 39 pValue->au128[1].au64[0] = 0; 40 pValue->au128[1].au64[1] = 0; 41 37 AssertCompileMembersAtSameOffset(BS3EXTCTX, Ctx.x87.aXMM, BS3EXTCTX, Ctx.x.x87.aXMM); 42 38 switch (pExtCtx->enmMethod) 43 39 { 44 40 case BS3EXTCTXMETHOD_FXSAVE: 41 case BS3EXTCTXMETHOD_XSAVE: 45 42 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aXMM)) 46 pValue->au128[0] = pExtCtx->Ctx.x87.aXMM[iReg].uXmm;47 break;48 49 case BS3EXTCTXMETHOD_XSAVE:50 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x.x87.aXMM))51 43 { 52 pValue->au128[0] = pExtCtx->Ctx.x87.aXMM[iReg].uXmm; 53 if (pExtCtx->fXcr0Nominal & XSAVE_C_YMM) 54 pValue->au128[1] = pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm; 44 pValue->u = pExtCtx->Ctx.x87.aXMM[iReg].xmm; 45 return pValue; 55 46 } 56 47 break; 57 48 } 49 50 pValue->au64[0] = 0; 51 pValue->au64[1] = 0; 58 52 return pValue; 59 53 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetXmm.c
r95374 r95397 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3ExtCtxSet Ymm3 * BS3Kit - Bs3ExtCtxSetXmm 4 4 */ 5 5 … … 32 32 33 33 34 #undef Bs3ExtCtxSet Ymm35 BS3_CMN_DEF(bool, Bs3ExtCtxSet Ymm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, bool f128Bit))34 #undef Bs3ExtCtxSetXmm 35 BS3_CMN_DEF(bool, Bs3ExtCtxSetXmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT128U pValue)) 36 36 { 37 AssertCompileMembersAtSameOffset(BS3EXTCTX, Ctx.x87.aXMM, BS3EXTCTX, Ctx.x.x87.aXMM); 37 38 switch (pExtCtx->enmMethod) 38 39 { 39 40 case BS3EXTCTXMETHOD_FXSAVE: 41 case BS3EXTCTXMETHOD_XSAVE: 40 42 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aXMM)) 41 43 { 42 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->au128[0]; 43 return true; 44 } 45 break; 46 47 case BS3EXTCTXMETHOD_XSAVE: 48 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x.x87.aXMM)) 49 { 50 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->au128[0]; 51 if ((pExtCtx->fXcr0Nominal & XSAVE_C_YMM) && !f128Bit) 52 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm = pValue->au128[1]; 44 pExtCtx->Ctx.x87.aXMM[iReg].xmm = pValue->u; 53 45 return true; 54 46 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetYmm.c
r95374 r95397 33 33 34 34 #undef Bs3ExtCtxSetYmm 35 BS3_CMN_DEF(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, bool f128Bit))35 BS3_CMN_DEF(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, uint8_t cbValue)) 36 36 { 37 BS3_ASSERT(cbValue == 16 || cbValue == 32); 37 38 switch (pExtCtx->enmMethod) 38 39 { … … 40 41 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aXMM)) 41 42 { 42 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue-> au128[0];43 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->DQWords.dqw0; 43 44 return true; 44 45 } … … 48 49 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x.x87.aXMM)) 49 50 { 50 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->au128[0]; 51 if ((pExtCtx->fXcr0Nominal & XSAVE_C_YMM) && !f128Bit) 52 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm = pValue->au128[1]; 51 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->DQWords.dqw0; 52 if (pExtCtx->fXcr0Nominal & XSAVE_C_YMM) 53 { 54 if (cbValue >= 32) 55 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm = pValue->DQWords.dqw1; 56 else 57 { 58 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].au64[0] = 0; 59 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].au64[1] = 0; 60 } 61 /** @todo zero high ZMM part. */ 62 } 53 63 return true; 54 64 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
r95376 r95397 38 38 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3RegCtxSaveEx,8) 39 39 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetMm) 40 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetXmm) 40 41 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetYmm) 41 42 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestCheckExtCtx) … … 63 64 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxInit) 64 65 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandler) 66 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxGetXmm) 65 67 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxGetYmm) 66 68 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Printf) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r95376 r95397 37 37 #define Bs3ExtCtxGetMxCsr BS3_CMN_MANGLER(Bs3ExtCtxGetMxCsr) 38 38 #define Bs3ExtCtxGetSize BS3_CMN_MANGLER(Bs3ExtCtxGetSize) 39 #define Bs3ExtCtxGetXmm BS3_CMN_MANGLER(Bs3ExtCtxGetXmm) 39 40 #define Bs3ExtCtxGetYmm BS3_CMN_MANGLER(Bs3ExtCtxGetYmm) 40 41 #define Bs3ExtCtxInit BS3_CMN_MANGLER(Bs3ExtCtxInit) … … 43 44 #define Bs3ExtCtxSetMm BS3_CMN_MANGLER(Bs3ExtCtxSetMm) 44 45 #define Bs3ExtCtxSetMxCsr BS3_CMN_MANGLER(Bs3ExtCtxSetMxCsr) 46 #define Bs3ExtCtxSetXmm BS3_CMN_MANGLER(Bs3ExtCtxSetXmm) 45 47 #define Bs3ExtCtxSetYmm BS3_CMN_MANGLER(Bs3ExtCtxSetYmm) 46 48 #define Bs3GetCpuVendor BS3_CMN_MANGLER(Bs3GetCpuVendor) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r95376 r95397 37 37 #undef Bs3ExtCtxGetMxCsr 38 38 #undef Bs3ExtCtxGetSize 39 #undef Bs3ExtCtxGetXmm 39 40 #undef Bs3ExtCtxGetYmm 40 41 #undef Bs3ExtCtxInit … … 43 44 #undef Bs3ExtCtxSetMm 44 45 #undef Bs3ExtCtxSetMxCsr 46 #undef Bs3ExtCtxSetXmm 45 47 #undef Bs3ExtCtxSetYmm 46 48 #undef Bs3GetCpuVendor -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r95376 r95397 2916 2916 2917 2917 /** 2918 * Gets the value of XMM register number @a iReg from @a pExtCtx. 2919 * 2920 * @returns pValue 2921 * @param pExtCtx The extended CPU context. 2922 * @param iReg The register to get. 2923 * @param pValue Where to return the value. Zeroed if the state 2924 * doesn't support SSE or if @a iReg is invalid. 2925 */ 2926 BS3_CMN_PROTO_STUB(PRTUINT128U, Bs3ExtCtxGetXmm,(PCBS3EXTCTX pExtCtx, uint8_t iReg, PRTUINT128U pValue)); 2927 2928 /** 2929 * Sets the value of XMM register number @a iReg in @a pExtCtx to @a pValue. 2930 * 2931 * @returns True if set, false if not set (not supported by state format or 2932 * invalid iReg). 2933 * @param pExtCtx The extended CPU context. 2934 * @param iReg The register to set. 2935 * @param pValue The new register value. 2936 */ 2937 BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetXmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT128U pValue)); 2938 2939 /** 2918 2940 * Gets the value of YMM register number @a iReg from @a pExtCtx. 2919 2941 * … … 2935 2957 * @param iReg The register to set. 2936 2958 * @param pValue The new register value. 2937 * @param f128Bit A little peculiarity grown from mixing SSE and AVX 2938 * tests: When set to true only the lower 128 bits of 2939 * the YMM register will be set. The upper bits are 2940 * untouched. When false, the whole 256-bits value 2941 * will be set. 2942 */ 2943 BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, bool f128Bit)); 2959 * @param cbValue Number of bytes to take from @a pValue, either 16 or 2960 * 32. If 16, the high part will be zeroed when present 2961 * in the state. 2962 */ 2963 BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, uint8_t cbValue)); 2944 2964 2945 2965
Note:
See TracChangeset
for help on using the changeset viewer.