VirtualBox

Ignore:
Timestamp:
Mar 22, 2017 8:56:06 PM (8 years ago)
Author:
vboxsync
Message:

bs3kit: Hacked up some FPU/SSE/AVX state stuff.

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r66179 r66214  
    108108       bs3-cmn-RegCtxSetRipCsFromFlat.c \
    109109       bs3-cmn-RegCtxSetRipCsFromLnkPtr.c \
     110       bs3-cmn-ExtCtxInit.c \
     111       bs3-cmn-ExtCtxSave.asm \
     112       bs3-cmn-ExtCtxRestore.asm \
     113       bs3-cmn-ExtCtxGetSize.c \
     114       bs3-cmn-ExtCtxAlloc.c \
     115       bs3-cmn-ExtCtxFree.c \
    110116       bs3-cmn-SelFar32ToFlat32.c \
    111117       bs3-cmn-SelFar32ToFlat32NoClobber.asm \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r66179 r66214  
    3939$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestFailedV)
    4040$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3StrCpy)
     41$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeName)
    4142$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeNameShortLower)
    42 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeName)
    4343$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingAlias)
    4444$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForLM)
    4545$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPAE)
    4646$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPP)
     47$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtect)
    4748$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtectPtr)
    48 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtect)
    4949$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingQueryAddressInfo)
    5050$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingUnalias)
    5151$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SwitchFromV86To16BitAndCallC)
     52$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxAlloc)
     53$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxInit)
    5254$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandler)
    5355$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Printf)
     
    5860$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3StrPrintf)
    5961$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3StrPrintfV)
     62$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxGetSize)
    6063$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PicUpdateMask)
    6164$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabFree)
     
    7275$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingGetPte)
    7376$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingSetupCanonicalTraps)
     77$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAlloc)
    7478$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAllocEx)
    75 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAlloc)
     79$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAlloc)
    7680$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAllocEx)
    77 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAlloc)
     81$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxFree)
     82$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxRestore)
     83$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSave)
    7884$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemFree)
    7985$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemGuardedTestPageFree)
     
    108114$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestSubV)
    109115$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestTerm)
     116$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16Init)
    110117$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16InitEx)
    111 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16Init)
    112118$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16SetGate)
    113119$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap32Init)
     
    118124$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapPrintFrame)
    119125$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapReInit)
     126$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86Init)
    120127$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86InitEx)
    121 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86Init)
    122128$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86SetGate)
    123129$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandlerEx)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r66179 r66214  
    3131#define Bs3A20EnableViaKbd BS3_CMN_MANGLER(Bs3A20EnableViaKbd)
    3232#define Bs3A20EnableViaPortA BS3_CMN_MANGLER(Bs3A20EnableViaPortA)
     33#define Bs3ExtCtxAlloc BS3_CMN_MANGLER(Bs3ExtCtxAlloc)
     34#define Bs3ExtCtxFree BS3_CMN_MANGLER(Bs3ExtCtxFree)
     35#define Bs3ExtCtxGetSize BS3_CMN_MANGLER(Bs3ExtCtxGetSize)
     36#define Bs3ExtCtxInit BS3_CMN_MANGLER(Bs3ExtCtxInit)
     37#define Bs3ExtCtxRestore BS3_CMN_MANGLER(Bs3ExtCtxRestore)
     38#define Bs3ExtCtxSave BS3_CMN_MANGLER(Bs3ExtCtxSave)
    3339#define Bs3GetModeName BS3_CMN_MANGLER(Bs3GetModeName)
    3440#define Bs3GetModeNameShortLower BS3_CMN_MANGLER(Bs3GetModeNameShortLower)
     
    149155#define Bs3TrapSetHandler BS3_CMN_MANGLER(Bs3TrapSetHandler)
    150156#define Bs3TrapSetHandlerEx BS3_CMN_MANGLER(Bs3TrapSetHandlerEx)
     157#define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp)
    151158#define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore)
    152 #define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp)
    153159#define Bs3TrapUnsetJmp BS3_CMN_MANGLER(Bs3TrapUnsetJmp)
    154160#define Bs3UInt32Div BS3_CMN_MANGLER(Bs3UInt32Div)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r66179 r66214  
    3131#undef Bs3A20EnableViaKbd
    3232#undef Bs3A20EnableViaPortA
     33#undef Bs3ExtCtxAlloc
     34#undef Bs3ExtCtxFree
     35#undef Bs3ExtCtxGetSize
     36#undef Bs3ExtCtxInit
     37#undef Bs3ExtCtxRestore
     38#undef Bs3ExtCtxSave
    3339#undef Bs3GetModeName
    3440#undef Bs3GetModeNameShortLower
     
    149155#undef Bs3TrapSetHandler
    150156#undef Bs3TrapSetHandlerEx
     157#undef Bs3TrapSetJmp
    151158#undef Bs3TrapSetJmpAndRestore
    152 #undef Bs3TrapSetJmp
    153159#undef Bs3TrapUnsetJmp
    154160#undef Bs3UInt32Div
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r66179 r66214  
    26552655
    26562656/**
     2657 * The method to be used to save and restore the extended context.
     2658 */
     2659typedef enum BS3EXTCTXMETHOD
     2660{
     2661    BS3EXTCTXMETHOD_INVALID = 0,
     2662    BS3EXTCTXMETHOD_ANCIENT,    /**< Ancient fnsave/frstor format. */
     2663    BS3EXTCTXMETHOD_FXSAVE,     /**< fxsave/fxrstor format. */
     2664    BS3EXTCTXMETHOD_XSAVE,      /**< xsave/xrstor format. */
     2665    BS3EXTCTXMETHOD_END,
     2666} BS3EXTCTXMETHOD;
     2667
     2668
     2669/**
     2670 * Extended CPU context (FPU, SSE, AVX, ++).
     2671 *
     2672 * @remarks Also in bs3kit.inc
     2673 */
     2674typedef struct BS3EXTCTX
     2675{
     2676    /** Dummy/magic value. */
     2677    uint16_t            u16Magic;
     2678    /** The size of the structure. */
     2679    uint16_t            cb;
     2680    /** The method used to save and restore the context (BS3EXTCTXMETHOD). */
     2681    uint8_t             enmMethod;
     2682
     2683    /** Explicit alignment padding. */
     2684    uint8_t             abPadding[64 - 2 - 2 - 1];
     2685
     2686    /** The context, variable size (see above).
     2687     * This must be aligned on a 64 byte boundrary. */
     2688    union
     2689    {
     2690        /** fnsave/frstor. */
     2691        X86FPUSTATE     Ancient;
     2692        /** fxsave/fxrstor   */
     2693        X86FXSTATE      x87;
     2694        /** xsave/xrstor   */
     2695        X86XSAVEAREA    x;
     2696    } Ctx;
     2697} BS3EXTCTX;
     2698AssertCompileMemberAlignment(BS3EXTCTX, Ctx, 64);
     2699/** Pointer to an extended CPU context. */
     2700typedef BS3EXTCTX BS3_FAR *PBS3EXTCTX;
     2701/** Pointer to a const extended CPU context. */
     2702typedef BS3EXTCTX const BS3_FAR *PCBS3EXTCTX;
     2703
     2704/** Magic value for BS3EXTCTX. */
     2705#define BS3EXTCTX_MAGIC     UINT16_C(0x1980)
     2706
     2707/**
     2708 * Allocates and initializes the extended CPU context structure.
     2709 *
     2710 * @returns The new extended CPU context structure.
     2711 * @param   fFlags          Flags, MBZ.
     2712 * @param   enmKind         The kind of allocation to make.
     2713 */
     2714BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxAlloc,(uint16_t fFlags, BS3MEMKIND enmKind));
     2715
     2716/**
     2717 * Frees an extended CPU context structure.
     2718 *
     2719 * @param   pExtCtx         The extended CPU context (returned by
     2720 *                          Bs3ExtCtxAlloc).
     2721 */
     2722BS3_CMN_PROTO_STUB(void,       Bs3ExtCtxFree,(PBS3EXTCTX pExtCtx));
     2723
     2724/**
     2725 * Get the size required for a BS3EXTCTX structure.
     2726 *
     2727 * @returns size in bytes of the whole structure.
     2728 * @note    Use Bs3ExtCtxAlloc when possible.
     2729 */
     2730BS3_CMN_PROTO_STUB(uint16_t,   Bs3ExtCtxGetSize,(uint16_t fFlags));
     2731
     2732/**
     2733 * Initializes the extended CPU context structure.
     2734 * @returns pExtCtx
     2735 * @param   pExtCtx         The extended CPU context.
     2736 * @param   cbExtCtx        The size of the @a pExtCtx allocation.
     2737 * @param   fFlags          Flags, MBZ.
     2738 */
     2739BS3_CMN_PROTO_STUB(PBS3EXTCTX, Bs3ExtCtxInit,(PBS3EXTCTX pExtCtx, uint16_t cbExtCtx, uint16_t fFlags));
     2740
     2741/**
     2742 * Saves the extended CPU state to the given structure.
     2743 *
     2744 * @param   pExtCtx         The extended CPU context.
     2745 * @remarks All GPRs preserved.
     2746 */
     2747BS3_CMN_PROTO_STUB(void,       Bs3ExtCtxSave,(PBS3EXTCTX pExtCtx));
     2748
     2749/**
     2750 * Restores the extended CPU state from the given structure.
     2751 *
     2752 * @param   pExtCtx         The extended CPU context.
     2753 * @remarks All GPRs preserved.
     2754 */
     2755BS3_CMN_PROTO_STUB(void,       Bs3ExtCtxRestore,(PBS3EXTCTX pExtCtx));
     2756
     2757
     2758
     2759/**
    26572760 * Trap frame.
    26582761 */
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac

    r66149 r66214  
    14171417;; @}
    14181418
     1419
     1420;;
     1421; BS3 extended register context (FPU, SSE, AVX, ++)
     1422;
     1423struc BS3EXTCTX
     1424        .u16Magic   resw 1              ; uint16_t            u16Magic;
     1425        .cb         resw 1              ; uint16_t            cb;
     1426        .enmMethod  resb 1              ; uint8_t             enmMethod;
     1427        alignb 64
     1428        .Ctx        resb 512
     1429endstruc
     1430%define BS3EXTCTXMETHOD_ANCIENT     1
     1431%define BS3EXTCTXMETHOD_FXSAVE      2
     1432%define BS3EXTCTXMETHOD_XSAVE       3
     1433
    14191434;;
    14201435; BS3 Trap Frame.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette