Changeset 66226 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Timestamp:
- Mar 23, 2017 2:34:13 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r66214 r66226 114 114 bs3-cmn-ExtCtxAlloc.c \ 115 115 bs3-cmn-ExtCtxFree.c \ 116 bs3-cmn-ExtCtxCopy.c \ 116 117 bs3-cmn-SelFar32ToFlat32.c \ 117 118 bs3-cmn-SelFar32ToFlat32NoClobber.asm \ … … 198 199 ../../../Runtime/common/asm/ASMSerializeInstruction-rdtscp.asm \ 199 200 ../../../Runtime/common/asm/ASMCpuIdExSlow.asm \ 201 ../../../Runtime/common/asm/ASMGetXcr0.asm \ 202 ../../../Runtime/common/asm/ASMSetXcr0.asm \ 200 203 201 204 # The 16-bit BS3Kit library. -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxAlloc.c
r66214 r66226 33 33 34 34 #undef Bs3ExtCtxAlloc 35 BS3_CMN_DEF(PBS3EXTCTX, Bs3ExtCtxAlloc,( uint16_t fFlags,BS3MEMKIND enmKind))35 BS3_CMN_DEF(PBS3EXTCTX, Bs3ExtCtxAlloc,(BS3MEMKIND enmKind)) 36 36 { 37 uint16_t cbExtCtx = Bs3ExtCtxGetSize(fFlags); 37 uint64_t fFlags; 38 uint16_t cbExtCtx = Bs3ExtCtxGetSize(&fFlags); 38 39 PBS3EXTCTX pExtCtx = (PBS3EXTCTX)Bs3MemAlloc(enmKind, cbExtCtx); 39 40 if (pExtCtx) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxGetSize.c
r66214 r66226 34 34 35 35 #undef Bs3ExtCtxGetSize 36 BS3_CMN_DEF(uint16_t, Bs3ExtCtxGetSize,(uint 16_tfFlags))36 BS3_CMN_DEF(uint16_t, Bs3ExtCtxGetSize,(uint64_t BS3_FAR *pfFlags)) 37 37 { 38 38 uint32_t fEcx, fEdx; 39 BS3_ASSERT(fFlags == 0);39 *pfFlags = 0; 40 40 41 41 ASMCpuIdExSlow(1, 0, 0, 0, NULL, NULL, &fEcx, &fEdx); 42 #if 1 /* To disable xsave/xrstor till IEM groks it... */ 42 43 if (fEcx & X86_CPUID_FEATURE_ECX_XSAVE) 43 44 { 44 ASMCpuIdExSlow(13, 0, 0, 0, NULL, NULL, &fEcx, NULL); 45 uint32_t fEax; 46 ASMCpuIdExSlow(13, 0, 0, 0, &fEax, NULL, &fEcx, &fEdx); 45 47 if ( fEcx >= sizeof(X86FXSTATE) + sizeof(X86XSAVEHDR) 46 48 && fEcx < _32K) 49 { 50 *pfFlags = fEax | ((uint64_t)fEdx << 32); 47 51 return RT_OFFSETOF(BS3EXTCTX, Ctx) + RT_ALIGN(fEcx, 256); 52 } 48 53 } 54 #endif 49 55 if (fEdx & X86_CPUID_FEATURE_EDX_FXSR) 50 56 return RT_OFFSETOF(BS3EXTCTX, Ctx) + sizeof(X86FXSTATE); -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxInit.c
r66214 r66226 34 34 35 35 #undef Bs3ExtCtxInit 36 BS3_CMN_DEF(PBS3EXTCTX, Bs3ExtCtxInit,(PBS3EXTCTX pExtCtx, uint16_t cbExtCtx, uint 16_t fFlags))36 BS3_CMN_DEF(PBS3EXTCTX, Bs3ExtCtxInit,(PBS3EXTCTX pExtCtx, uint16_t cbExtCtx, uint64_t fFlags)) 37 37 { 38 BS3_ASSERT(fFlags == 0);39 40 38 Bs3MemSet(pExtCtx, 0, cbExtCtx); 41 39 if (cbExtCtx >= RT_OFFSETOF(BS3EXTCTX, Ctx) + sizeof(X86FXSTATE) + sizeof(X86XSAVEHDR)) 40 { 41 BS3_ASSERT(fFlags & XSAVE_C_X87); 42 42 pExtCtx->enmMethod = BS3EXTCTXMETHOD_XSAVE; 43 pExtCtx->Ctx.x.Hdr.bmXState = fFlags; 44 } 43 45 else if (cbExtCtx >= RT_OFFSETOF(BS3EXTCTX, Ctx) + sizeof(X86FXSTATE)) 46 { 47 BS3_ASSERT(fFlags == 0); 44 48 pExtCtx->enmMethod = BS3EXTCTXMETHOD_FXSAVE; 49 } 45 50 else 46 51 { 52 BS3_ASSERT(fFlags == 0); 47 53 BS3_ASSERT(cbExtCtx >= RT_OFFSETOF(BS3EXTCTX, Ctx) + sizeof(X86FPUSTATE)); 48 54 pExtCtx->enmMethod = BS3EXTCTXMETHOD_ANCIENT; … … 50 56 pExtCtx->cb = cbExtCtx; 51 57 pExtCtx->u16Magic = BS3EXTCTX_MAGIC; 58 pExtCtx->fXcr0 = fFlags; 52 59 return pExtCtx; 53 60 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
r66214 r66226 51 51 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SwitchFromV86To16BitAndCallC) 52 52 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxAlloc) 53 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxCopy) 53 54 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxInit) 54 55 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandler) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r66214 r66226 32 32 #define Bs3A20EnableViaPortA BS3_CMN_MANGLER(Bs3A20EnableViaPortA) 33 33 #define Bs3ExtCtxAlloc BS3_CMN_MANGLER(Bs3ExtCtxAlloc) 34 #define Bs3ExtCtxCopy BS3_CMN_MANGLER(Bs3ExtCtxCopy) 34 35 #define Bs3ExtCtxFree BS3_CMN_MANGLER(Bs3ExtCtxFree) 35 36 #define Bs3ExtCtxGetSize BS3_CMN_MANGLER(Bs3ExtCtxGetSize) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r66214 r66226 32 32 #undef Bs3A20EnableViaPortA 33 33 #undef Bs3ExtCtxAlloc 34 #undef Bs3ExtCtxCopy 34 35 #undef Bs3ExtCtxFree 35 36 #undef Bs3ExtCtxGetSize -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r66216 r66226 2680 2680 /** The method used to save and restore the context (BS3EXTCTXMETHOD). */ 2681 2681 uint8_t enmMethod; 2682 uint8_t abPadding0[3]; 2683 /** XSAVE_C_XXX. */ 2684 uint64_t fXcr0; 2682 2685 2683 2686 /** Explicit alignment padding. */ 2684 uint8_t abPadding[64 - 2 - 2 - 1 ];2687 uint8_t abPadding[64 - 2 - 2 - 1 - 3 - 8]; 2685 2688 2686 2689 /** The context, variable size (see above). … … 2711 2714 * 2712 2715 * @returns The new extended CPU context structure. 2713 * @param fFlags Flags, MBZ.2714 2716 * @param enmKind The kind of allocation to make. 2715 2717 */ 2716 BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxAlloc,( uint16_t fFlags,BS3MEMKIND enmKind));2718 BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxAlloc,(BS3MEMKIND enmKind)); 2717 2719 2718 2720 /** … … 2728 2730 * 2729 2731 * @returns size in bytes of the whole structure. 2732 * @param pfFlags Where to return flags for Bs3ExtCtxInit. 2730 2733 * @note Use Bs3ExtCtxAlloc when possible. 2731 2734 */ 2732 BS3_CMN_PROTO_STUB(uint16_t, Bs3ExtCtxGetSize,(uint 16_tfFlags));2735 BS3_CMN_PROTO_STUB(uint16_t, Bs3ExtCtxGetSize,(uint64_t *pfFlags)); 2733 2736 2734 2737 /** … … 2737 2740 * @param pExtCtx The extended CPU context. 2738 2741 * @param cbExtCtx The size of the @a pExtCtx allocation. 2739 * @param fFlags Flags, MBZ.2740 */ 2741 BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxInit,(PBS3EXTCTX pExtCtx, uint16_t cbExtCtx, uint 16_t fFlags));2742 * @param fFlags XSAVE_C_XXX flags. 2743 */ 2744 BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxInit,(PBS3EXTCTX pExtCtx, uint16_t cbExtCtx, uint64_t fFlags)); 2742 2745 2743 2746 /** … … 2756 2759 */ 2757 2760 BS3_CMN_PROTO_STUB(void, Bs3ExtCtxRestore,(PBS3EXTCTX pExtCtx)); 2761 2762 /** 2763 * Copies the state from one context to another. 2764 * 2765 * @returns pDst 2766 * @param pDst The destination extended CPU context. 2767 * @param pSrc The source extended CPU context. 2768 */ 2769 BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxCopy,(PBS3EXTCTX pDst, PCBS3EXTCTX pSrc)); 2758 2770 2759 2771 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r66214 r66226 1425 1425 .cb resw 1 ; uint16_t cb; 1426 1426 .enmMethod resb 1 ; uint8_t enmMethod; 1427 alignb 64 1427 alignb 8 1428 .fXcr0 resq 1 1429 alignb 64 1428 1430 .Ctx resb 512 1429 1431 endstruc
Note:
See TracChangeset
for help on using the changeset viewer.