diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-08-02 11:21:43 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-08-02 11:21:43 +0000 |
commit | b2324587b27e11460fccb4b9b796bf4775ed729c (patch) | |
tree | 98b5e625f2908c521b41b258155740775b8a45bf | |
parent | 1e317a3c2305eb08ae54ef37ee6e30f97d01616f (diff) | |
download | VirtualBox-svn-b2324587b27e11460fccb4b9b796bf4775ed729c.tar.gz |
ValKit/Bs3Kit: Added Bs3TestValue.
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@90470 cfe28804-0f27-0410-a406-dd0f0b0b656f
6 files changed, 95 insertions, 10 deletions
diff --git a/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk b/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk index f799c7acb4d..8cc969f8cec 100644 --- a/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk +++ b/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk @@ -196,6 +196,7 @@ VBOX_BS3KIT_COMMON_SOURCES = \ bs3-cmn-TestCheckRegCtxEx.c \ bs3-cmn-TestHostPrintf.c \ bs3-cmn-TestPrintf.c \ + bs3-cmn-TestValue.c \ bs3-cmn-TrapReInit.c \ bs3-cmn-TrapRmV86Init.c \ bs3-cmn-TrapRmV86SetGate.c \ diff --git a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestValue.c b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestValue.c new file mode 100644 index 00000000000..45e2d06d450 --- /dev/null +++ b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestValue.c @@ -0,0 +1,76 @@ +/* $Id$ */ +/** @file + * BS3Kit - Bs3TestValue + */ + +/* + * Copyright (C) 2007-2021 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include "bs3kit-template-header.h" +#include "bs3-cmn-test.h" + +#include <iprt/asm-amd64-x86.h> + + +#undef Bs3TestValue +BS3_CMN_DEF(void, Bs3TestValue,(const char BS3_FAR *pszName, uint64_t u64Value, uint8_t bUnit)) +{ + const char * const pszUnit = g_aszBs3TestUnitNames[bUnit]; + Bs3Printf(" %-48s: %'16llu %s\n", pszName, u64Value, pszUnit); + + /* + * Report it to the host. + */ + if (g_fbBs3VMMDevTesting) + { +#if ARCH_BITS == 16 + ASMOutU16(VMMDEV_TESTING_IOPORT_CMD, (uint16_t)VMMDEV_TESTING_CMD_VALUE); + ASMOutU16(VMMDEV_TESTING_IOPORT_DATA, (uint16_t)u64Value); + ASMOutU16(VMMDEV_TESTING_IOPORT_DATA, (uint16_t)(u64Value >> 16)); + ASMOutU16(VMMDEV_TESTING_IOPORT_DATA, (uint16_t)(u64Value >> 32)); + ASMOutU16(VMMDEV_TESTING_IOPORT_DATA, (uint16_t)(u64Value >> 48)); + ASMOutU16(VMMDEV_TESTING_IOPORT_DATA, (uint16_t)bUnit); + ASMOutU16(VMMDEV_TESTING_IOPORT_DATA, 0); +# if 1 + ASMOutStrU8(VMMDEV_TESTING_IOPORT_DATA, pszName, Bs3StrLen(pszName) + 1); +# else + for (;;) + { + uint8_t const b = *pszName++; + ASMOutU8(VMMDEV_TESTING_IOPORT_DATA, b); + if (!b) + break; + } +# endif +#else + ASMOutU32(VMMDEV_TESTING_IOPORT_CMD, VMMDEV_TESTING_CMD_VALUE); + ASMOutU32(VMMDEV_TESTING_IOPORT_DATA, (uint32_t)u64Value); + ASMOutU32(VMMDEV_TESTING_IOPORT_DATA, (uint32_t)(u64Value >> 32)); + ASMOutU32(VMMDEV_TESTING_IOPORT_DATA, (uint32_t)bUnit); + ASMOutStrU8(VMMDEV_TESTING_IOPORT_DATA, pszName, Bs3StrLen(pszName) + 1); +#endif + } +} + diff --git a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk index 561bde120cc..cd58e24da0c 100644 --- a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk +++ b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk @@ -31,9 +31,9 @@ $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelProtFar16DataToRealMode, $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeCodeToFlat,4) $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToFlat,4) $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToProtFar16,4) +$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelLnkPtrToCurPtr,4) $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxRestore,4) $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxSave,4) -$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelLnkPtrToCurPtr,4) $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelFar32ToFlat32NoClobber,6) $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3RegCtxSaveEx,8) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestCheckRegCtxEx) @@ -42,14 +42,14 @@ $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestFailedF) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestFailedV) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetCpuVendor) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3StrCpy) -$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeNameShortLower) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeName) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3GetModeNameShortLower) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingAlias) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForLM) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPAE) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingInitRootForPP) -$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtectPtr) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtect) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingProtectPtr) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingQueryAddressInfo) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingUnalias) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SwitchFromV86To16BitAndCallC) @@ -72,7 +72,6 @@ $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelFar32ToFlat32) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelProtFar32ToFlat32) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestNow) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetDpl) -$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxFree) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemAlloc) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemAllocZ) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemCpy) @@ -82,10 +81,11 @@ $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemMove) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemPCpy) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingGetPte) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingSetupCanonicalTraps) -$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAllocEx) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAlloc) -$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAllocEx) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAllocEx) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAlloc) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAllocEx) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxFree) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemFree) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemGuardedTestPageFree) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemPrintInfo) @@ -121,8 +121,9 @@ $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestSubDone) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestSubF) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestSubV) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestTerm) -$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16InitEx) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestValue) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16Init) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16InitEx) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap16SetGate) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap32Init) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap32SetGate) @@ -131,8 +132,8 @@ $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Trap64SetGate) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapDefaultHandler) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapPrintFrame) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapReInit) -$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86InitEx) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86Init) +$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86InitEx) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapRmV86SetGate) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandlerEx) $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetJmpAndRestore) diff --git a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h index 51f2df13bc1..788451554b0 100644 --- a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h +++ b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h @@ -172,6 +172,7 @@ #define Bs3TestSubF BS3_CMN_MANGLER(Bs3TestSubF) #define Bs3TestSubV BS3_CMN_MANGLER(Bs3TestSubV) #define Bs3TestTerm BS3_CMN_MANGLER(Bs3TestTerm) +#define Bs3TestValue BS3_CMN_MANGLER(Bs3TestValue) #define Bs3Trap16Init BS3_CMN_MANGLER(Bs3Trap16Init) #define Bs3Trap16InitEx BS3_CMN_MANGLER(Bs3Trap16InitEx) #define Bs3Trap16SetGate BS3_CMN_MANGLER(Bs3Trap16SetGate) @@ -188,8 +189,8 @@ #define Bs3TrapSetDpl BS3_CMN_MANGLER(Bs3TrapSetDpl) #define Bs3TrapSetHandler BS3_CMN_MANGLER(Bs3TrapSetHandler) #define Bs3TrapSetHandlerEx BS3_CMN_MANGLER(Bs3TrapSetHandlerEx) -#define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore) #define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp) +#define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore) #define Bs3TrapUnsetJmp BS3_CMN_MANGLER(Bs3TrapUnsetJmp) #define Bs3UInt32Div BS3_CMN_MANGLER(Bs3UInt32Div) #define Bs3UInt64Div BS3_CMN_MANGLER(Bs3UInt64Div) diff --git a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h index a3ec2a3b5a8..bc76d77f71e 100644 --- a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h +++ b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h @@ -172,6 +172,7 @@ #undef Bs3TestSubF #undef Bs3TestSubV #undef Bs3TestTerm +#undef Bs3TestValue #undef Bs3Trap16Init #undef Bs3Trap16InitEx #undef Bs3Trap16SetGate @@ -188,8 +189,8 @@ #undef Bs3TrapSetDpl #undef Bs3TrapSetHandler #undef Bs3TrapSetHandlerEx -#undef Bs3TrapSetJmpAndRestore #undef Bs3TrapSetJmp +#undef Bs3TrapSetJmpAndRestore #undef Bs3TrapUnsetJmp #undef Bs3UInt32Div #undef Bs3UInt64Div diff --git a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h index 00cbde41334..161ed5124af 100644 --- a/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h +++ b/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h @@ -3210,6 +3210,11 @@ BS3_CMN_PROTO_STUB(void, Bs3TestSubV,(const char BS3_FAR *pszFormat, va_list BS3 BS3_CMN_PROTO_STUB(void, Bs3TestSubDone,(void)); /** + * Equivalent to RTTestIValue. + */ +BS3_CMN_PROTO_STUB(void, Bs3TestValue,(const char BS3_FAR *pszName, uint64_t u64Value, uint8_t bUnit)); + +/** * Equivalent to RTTestSubErrorCount. */ BS3_CMN_PROTO_STUB(uint16_t, Bs3TestSubErrorCount,(void)); |