VirtualBox

Changeset 92529 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 21, 2021 2:46:44 AM (3 years ago)
Author:
vboxsync
Message:

ValKit/bs3kit: Added Bs3TestQueryCfgBool, Bs3TestQueryCfgU8 & Bs3TestQueryCfgU32. bugref:9044

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
5 edited
2 copied

Legend:

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

    r92262 r92529  
    195195        bs3-cmn-TestIsVmmDevTestingPresent.asm \
    196196        bs3-cmn-TestCheckRegCtxEx.c \
     197        bs3-cmn-TestQueryCfgU8.asm \
     198        bs3-cmn-TestQueryCfgU32.asm \
    197199        bs3-cmn-TestHostPrintf.c \
    198200        bs3-cmn-TestPrintf.c \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestQueryCfgU32.asm

    r92524 r92529  
    3232
    3333;;
    34 ; @cproto   BS3_DECL(void) bs3TestSendCmdWithU32_c16(uint32_t uCmd, uint32_t uValue);
     34; @cproto   BS3_DECL(uint32_t) Bs3TestQueryCfgU32(uint16_t uCfg);
    3535;
    36 BS3_PROC_BEGIN_CMN bs3TestSendCmdWithU32, BS3_PBC_HYBRID
    37         BS3_CALL_CONV_PROLOG 2
     36BS3_PROC_BEGIN_CMN Bs3TestQueryCfgU8, BS3_PBC_HYBRID
     37        BS3_CALL_CONV_PROLOG 1
    3838        push    xBP
    3939        mov     xBP, xSP
    40         push    xAX
    41         push    xDX
    42         push    xSI
     40TNOT16  push    xDX
    4341
    4442        cmp     byte [BS3_DATA16_WRT(g_fbBs3VMMDevTesting)], 0
    4543        je      .no_vmmdev
    4644
    47         ; The command (uCmd) -
     45        ; Issue the query command.
    4846        mov     dx, VMMDEV_TESTING_IOPORT_CMD
    4947%if TMPL_BITS == 16
    50         mov     ax, [xBP + xCB + cbCurRetAddr] ; We ignore the top bits in 16-bit mode.
     48        mov     ax, VMMDEV_TESTING_CMD_QUERY_CFG - VMMDEV_TESTING_CMD_MAGIC_HI_WORD
    5149        out     dx, ax
    5250%else
    53         mov     eax, [xBP + xCB*2]
     51        mov     eax, VMMDEV_TESTING_CMD_QUERY_CFG
    5452        out     dx, eax
    5553%endif
    5654
     55        ; Write what we wish to query.
     56        mov     ax, [xBP + xCB + cbCurRetAddr]
     57        mov     dx, VMMDEV_TESTING_IOPORT_DATA
     58        out     dx, ax
    5759
    58         ; The value (uValue).
    59         mov     dx, VMMDEV_TESTING_IOPORT_DATA
     60        ; Read back the result.
    6061%if TMPL_BITS == 16
    61         mov     ax, [xBP + xCB + cbCurRetAddr + sCB]
    62         out     dx, ax
    63         mov     ax, [xBP + xCB + cbCurRetAddr + sCB + 2]
    64         out     dx, ax
     62        in      ax, dx
     63        push    ax
     64        in      ax, dx
     65        mov     dx, ax
     66        pop     ax
    6567%else
    66         mov     eax, [xBP + xCB*2 + sCB]
    67         out     dx, eax
     68        in      eax, dx
    6869%endif
    6970
     71.return:
     72TNOT16  pop     xDX
     73        pop     xBP
     74        BS3_CALL_CONV_EPILOG 1
     75        BS3_HYBRID_RET
    7076.no_vmmdev:
    71         pop     xSI
    72         pop     xDX
    73         pop     xAX
    74         pop     xBP
    75         BS3_CALL_CONV_EPILOG 2
    76         BS3_HYBRID_RET
    77 BS3_PROC_END_CMN   bs3TestSendCmdWithU32
     77        xor     xAX, xAX
     78%if TMPL_BITS == 16
     79        xor     xDX, xDX
     80%endif
     81        jmp     .return
     82BS3_PROC_END_CMN   Bs3TestQueryCfgU32
    7883
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestQueryCfgU8.asm

    r92524 r92529  
    3232
    3333;;
    34 ; @cproto   BS3_DECL(void) bs3TestSendCmdWithU32_c16(uint32_t uCmd, uint32_t uValue);
     34; @cproto   BS3_DECL(uint8_t) Bs3TestQueryCfgU8(uint16_t uCfg);
     35; @cproto   BS3_DECL(bool)    Bs3TestQueryCfgBool(uint16_t uCfg);
    3536;
    36 BS3_PROC_BEGIN_CMN bs3TestSendCmdWithU32, BS3_PBC_HYBRID
    37         BS3_CALL_CONV_PROLOG 2
     37BS3_GLOBAL_NAME_EX BS3_CMN_NM(Bs3TestQueryCfgBool), function, 3
     38BS3_PROC_BEGIN_CMN Bs3TestQueryCfgU8, BS3_PBC_HYBRID
     39        BS3_CALL_CONV_PROLOG 1
    3840        push    xBP
    3941        mov     xBP, xSP
    40         push    xAX
    4142        push    xDX
    42         push    xSI
    4343
     44        xor     al, al
    4445        cmp     byte [BS3_DATA16_WRT(g_fbBs3VMMDevTesting)], 0
    4546        je      .no_vmmdev
    4647
    47         ; The command (uCmd) -
     48        ; Issue the query command.
    4849        mov     dx, VMMDEV_TESTING_IOPORT_CMD
    4950%if TMPL_BITS == 16
    50         mov     ax, [xBP + xCB + cbCurRetAddr] ; We ignore the top bits in 16-bit mode.
     51        mov     ax, VMMDEV_TESTING_CMD_QUERY_CFG - VMMDEV_TESTING_CMD_MAGIC_HI_WORD
    5152        out     dx, ax
    5253%else
    53         mov     eax, [xBP + xCB*2]
     54        mov     eax, VMMDEV_TESTING_CMD_QUERY_CFG
    5455        out     dx, eax
    5556%endif
    5657
     58        ; Write what we wish to query.
     59        mov     ax, [xBP + xCB + cbCurRetAddr]
     60        mov     dx, VMMDEV_TESTING_IOPORT_DATA
     61        out     dx, ax
    5762
    58         ; The value (uValue).
    59         mov     dx, VMMDEV_TESTING_IOPORT_DATA
    60 %if TMPL_BITS == 16
    61         mov     ax, [xBP + xCB + cbCurRetAddr + sCB]
    62         out     dx, ax
    63         mov     ax, [xBP + xCB + cbCurRetAddr + sCB + 2]
    64         out     dx, ax
    65 %else
    66         mov     eax, [xBP + xCB*2 + sCB]
    67         out     dx, eax
    68 %endif
     63        ; Read back the result.
     64        in      al, dx
    6965
    7066.no_vmmdev:
    71         pop     xSI
    7267        pop     xDX
    73         pop     xAX
    7468        pop     xBP
    75         BS3_CALL_CONV_EPILOG 2
     69        BS3_CALL_CONV_EPILOG 1
    7670        BS3_HYBRID_RET
    77 BS3_PROC_END_CMN   bs3TestSendCmdWithU32
     71BS3_PROC_END_CMN   Bs3TestQueryCfgU8
    7872
     73%if TMPL_BITS == 16
     74BS3_GLOBAL_NAME_EX BS3_CMN_NM_FAR(Bs3TestQueryCfgBool), function, 3
     75        jmp     BS3_CMN_NM_FAR(Bs3TestQueryCfgU8)
     76%endif
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r92262 r92529  
    3232$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToFlat,4)
    3333$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToProtFar16,4)
    34 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelLnkPtrToCurPtr,4)
    3534$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxRestore,4)
    3635$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxSave,4)
     36$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelLnkPtrToCurPtr,4)
    3737$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelFar32ToFlat32NoClobber,6)
    3838$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3RegCtxSaveEx,8)
     
    4141$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestFailedF)
    4242$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestFailedV)
     43$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestQueryCfgBool)
    4344$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetCpuVendor)
    4445$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3StrCpy)
     46$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeNameShortLower)
    4547$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeName)
    46 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeNameShortLower)
    4748$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingAlias)
    4849$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForLM)
     
    5051$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPP)
    5152$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingMapRamAbove4GForLM)
     53$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtectPtr)
    5254$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtect)
    53 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtectPtr)
    5455$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingQueryAddressInfo)
    5556$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingUnalias)
     
    7273$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelFar32ToFlat32)
    7374$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelProtFar32ToFlat32)
     75$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestQueryCfgU32)
    7476$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestNow)
     77$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestQueryCfgU8)
    7578$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetDpl)
     79$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxFree)
    7680$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemAlloc)
    7781$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemAllocZ)
     
    8387$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingGetPte)
    8488$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingSetupCanonicalTraps)
     89$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAllocEx)
    8590$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAlloc)
    86 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAllocEx)
     91$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAllocEx)
    8792$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAlloc)
    88 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAllocEx)
    89 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxFree)
    9093$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemFree)
    9194$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemGuardedTestPageFree)
     
    124127$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestTerm)
    125128$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestValue)
     129$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16InitEx)
    126130$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16Init)
    127 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16InitEx)
    128131$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16SetGate)
    129132$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap32Init)
     
    134137$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapPrintFrame)
    135138$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapReInit)
     139$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86InitEx)
    136140$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86Init)
    137 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86InitEx)
    138141$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86SetGate)
    139142$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandlerEx)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r92262 r92529  
    165165#define Bs3TestPrintf BS3_CMN_MANGLER(Bs3TestPrintf)
    166166#define Bs3TestPrintfV BS3_CMN_MANGLER(Bs3TestPrintfV)
     167#define Bs3TestQueryCfgBool BS3_CMN_MANGLER(Bs3TestQueryCfgBool)
     168#define Bs3TestQueryCfgU32 BS3_CMN_MANGLER(Bs3TestQueryCfgU32)
     169#define Bs3TestQueryCfgU8 BS3_CMN_MANGLER(Bs3TestQueryCfgU8)
    167170#define Bs3TestSkipped BS3_CMN_MANGLER(Bs3TestSkipped)
    168171#define Bs3TestSkippedF BS3_CMN_MANGLER(Bs3TestSkippedF)
     
    191194#define Bs3TrapSetHandler BS3_CMN_MANGLER(Bs3TrapSetHandler)
    192195#define Bs3TrapSetHandlerEx BS3_CMN_MANGLER(Bs3TrapSetHandlerEx)
     196#define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore)
    193197#define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp)
    194 #define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore)
    195198#define Bs3TrapUnsetJmp BS3_CMN_MANGLER(Bs3TrapUnsetJmp)
    196199#define Bs3UInt32Div BS3_CMN_MANGLER(Bs3UInt32Div)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r92262 r92529  
    165165#undef Bs3TestPrintf
    166166#undef Bs3TestPrintfV
     167#undef Bs3TestQueryCfgBool
     168#undef Bs3TestQueryCfgU32
     169#undef Bs3TestQueryCfgU8
    167170#undef Bs3TestSkipped
    168171#undef Bs3TestSkippedF
     
    191194#undef Bs3TrapSetHandler
    192195#undef Bs3TrapSetHandlerEx
     196#undef Bs3TrapSetJmpAndRestore
    193197#undef Bs3TrapSetJmp
    194 #undef Bs3TrapSetJmpAndRestore
    195198#undef Bs3TrapUnsetJmp
    196199#undef Bs3UInt32Div
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r92524 r92529  
    32563256BS3_CMN_PROTO_STUB(uint64_t, Bs3TestNow,(void));
    32573257
     3258
     3259/**
     3260 * Queries an unsigned 8-bit configuration value.
     3261 *
     3262 * @returns Value.
     3263 * @param   uCfg        A VMMDEV_TESTING_CFG_XXX value.
     3264 */
     3265BS3_CMN_PROTO_STUB(uint8_t, Bs3TestQueryCfgU8,(uint16_t uCfg));
     3266
     3267/**
     3268 * Queries an unsigned 8-bit configuration value.
     3269 *
     3270 * @returns Value.
     3271 * @param   uCfg        A VMMDEV_TESTING_CFG_XXX value.
     3272 */
     3273BS3_CMN_PROTO_STUB(bool, Bs3TestQueryCfgBool,(uint16_t uCfg));
     3274
     3275/**
     3276 * Queries an unsigned 32-bit configuration value.
     3277 *
     3278 * @returns Value.
     3279 * @param   uCfg        A VMMDEV_TESTING_CFG_XXX value.
     3280 */
     3281BS3_CMN_PROTO_STUB(uint32_t, Bs3TestQueryCfgU32,(uint16_t uCfg));
     3282
    32583283/**
    32593284 * Equivalent to RTTestIPrintf with RTTESTLVL_ALWAYS.
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