VirtualBox

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


Ignore:
Timestamp:
Nov 12, 2015 12:04:31 AM (9 years ago)
Author:
vboxsync
Message:

bs3kit: started adding some useful stuff.

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

Legend:

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

    r58663 r58666  
    9191                -o $(obj)\
    9292                $(abspath $(source))
    93         ls -la $(obj)
    94         -$(VBoxBs3ObjConverter_1_TARGET) -vv "$(obj)"
     93        $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    9594        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
    9695endef
     
    113112                -o $(obj)\
    114113                $(abspath $(source))
    115         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) -v "$(obj)"
     114        $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    116115        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
    117116endef
     
    137136define TOOL_Bs3Vcc64_COMPILE_C_CMDS
    138137$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_CMDS)
    139         -$(VBoxBs3ObjConverter_1_TARGET) -vv "$(obj)"
     138        -$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    140139endef
    141140
     
    154153define TOOL_Bs3Vcc64_COMPILE_CXX_CMDS
    155154$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_CMDS)
    156         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) -v "$(obj)"
     155        $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    157156endef
    158157
     
    310309       bs3-cmn-PrintStrColonSpaces.asm \
    311310       bs3-cmn-PrintStrSpacesColonSpace.c \
     311       bs3-cmn-StrLen.c \
     312       bs3-cmn-StrNLen.c \
     313       bs3-cmn-StrCpy.c \
     314       bs3-cmn-MemCpy.c \
     315       bs3-cmn-MemPCpy.c \
    312316
    313317# The BS3Kit library.
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.h

    r58628 r58666  
    2525 */
    2626
    27 #include "bs3kit.mac"
     27#include "bs3kit.h"
    2828
    2929/** @defgroup grp_bs3kit_tmpl       BS3Kit Multi-Mode Code Templates
     
    116116#else /* !DOXYGEN_RUNNING */
    117117
     118#undef BS3_CMN_NM
     119
    118120#ifdef TMPL_RM
    119121# ifdef TMPL_PE16
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r58628 r58666  
    8989#define BS3_CMN_NM(a_Name)  RT_CONCAT3(a_Name,_c,ARCH_BITS)
    9090
     91/**
     92 * Template for createing a pointer union type.
     93 * @param   a_BaseName      The base type name.
     94 * @param   a_Modifier      The type modifier.
     95 */
     96#define BS3_PTR_UNION_TEMPLATE(a_BaseName, a_Modifiers) \
     97    typedef union a_BaseName \
     98    { \
     99        /** Pointer into the void. */ \
     100        a_Modifiers void BS3_FAR                  *pv; \
     101        /** As a signed integer. */ \
     102        intptr_t                                   i; \
     103        /** As an unsigned integer. */ \
     104        uintptr_t                                  u; \
     105        /** Pointer to char value. */ \
     106        a_Modifiers char BS3_FAR                   *pch; \
     107        /** Pointer to char value. */ \
     108        a_Modifiers unsigned char BS3_FAR          *puch; \
     109        /** Pointer to a int value. */ \
     110        a_Modifiers int BS3_FAR                    *pi; \
     111        /** Pointer to a unsigned int value. */ \
     112        a_Modifiers unsigned int BS3_FAR           *pu; \
     113        /** Pointer to a long value. */ \
     114        a_Modifiers long BS3_FAR                   *pl; \
     115        /** Pointer to a long value. */ \
     116        a_Modifiers unsigned long BS3_FAR          *pul; \
     117        /** Pointer to a memory size value. */ \
     118        a_Modifiers size_t BS3_FAR                 *pcb; \
     119        /** Pointer to a byte value. */ \
     120        a_Modifiers uint8_t BS3_FAR                *pb; \
     121        /** Pointer to a 8-bit unsigned value. */ \
     122        a_Modifiers uint8_t BS3_FAR                *pu8; \
     123        /** Pointer to a 16-bit unsigned value. */ \
     124        a_Modifiers uint16_t BS3_FAR               *pu16; \
     125        /** Pointer to a 32-bit unsigned value. */ \
     126        a_Modifiers uint32_t BS3_FAR               *pu32; \
     127        /** Pointer to a 64-bit unsigned value. */ \
     128        a_Modifiers uint64_t BS3_FAR               *pu64; \
     129        /** Pointer to a UTF-16 character. */ \
     130        a_Modifiers RTUTF16 BS3_FAR                *pwc; \
     131        /** Pointer to a UUID character. */ \
     132        a_Modifiers RTUUID BS3_FAR                 *pUuid; \
     133    } a_BaseName; \
     134    /** Pointer to a pointer union. */ \
     135    typedef a_BaseName *RT_CONCAT(P,a_BaseName)
     136BS3_PTR_UNION_TEMPLATE(BS3PTRUNION, RT_NOTHING);
     137BS3_PTR_UNION_TEMPLATE(BS3CPTRUNION, const);
     138BS3_PTR_UNION_TEMPLATE(BS3VPTRUNION, volatile);
     139BS3_PTR_UNION_TEMPLATE(BS3CVPTRUNION, const volatile);
    91140
    92141
     
    106155 */
    107156BS3_DECL(void) Bs3Panic_c16(void);
    108 BS3_DECL(void) Bs3Panic_c32(void);              /**< @copydoc Bs3Panic_c16  */
    109 BS3_DECL(void) Bs3Panic_c64(void);              /**< @copydoc Bs3Panic_c16  */
    110 #define Bs3Panic BS3_CMN_NM(Bs3Panic)           /**< Selects #Bs3Panic_c16, #Bs3Panic_c32 or #Bs3Panic_c64. */
     157BS3_DECL(void) Bs3Panic_c32(void); /**< @copydoc Bs3Panic_c16  */
     158BS3_DECL(void) Bs3Panic_c64(void); /**< @copydoc Bs3Panic_c16  */
     159#define Bs3Panic BS3_CMN_NM(Bs3Panic) /**< Selects #Bs3Panic_c16, #Bs3Panic_c32 or #Bs3Panic_c64. */
    111160
    112161/**
     
    117166 */
    118167BS3_DECL(void) Bs3Shutdown_c16(void);
    119 BS3_DECL(void) Bs3Shutdown_c32(void);           /**< @copydoc Bs3Shutdown_c16 */
    120 BS3_DECL(void) Bs3Shutdown_c64(void);           /**< @copydoc Bs3Shutdown_c16 */
    121 #define Bs3Shutdown BS3_CMN_NM(Bs3Shutdown)     /**< Selects #Bs3Shutdown_c16, #Bs3Shutdown_c32 or #Bs3Shutdown_c64. */
     168BS3_DECL(void) Bs3Shutdown_c32(void); /**< @copydoc Bs3Shutdown_c16 */
     169BS3_DECL(void) Bs3Shutdown_c64(void); /**< @copydoc Bs3Shutdown_c16 */
     170#define Bs3Shutdown BS3_CMN_NM(Bs3Shutdown) /**< Selects #Bs3Shutdown_c16, #Bs3Shutdown_c32 or #Bs3Shutdown_c64. */
    122171
    123172/**
     
    129178BS3_DECL(void) Bs3PrintU32_c32(uint32_t uValue); /**< @copydoc Bs3PrintU32_c16 */
    130179BS3_DECL(void) Bs3PrintU32_c64(uint32_t uValue); /**< @copydoc Bs3PrintU32_c16 */
    131 #define Bs3PrintU32 BS3_CMN_NM(Bs3PrintU32)      /**< Selects #Bs3PrintU32_c16, #Bs3PrintU32_c32 or #Bs3PrintU32_c64. */
     180#define Bs3PrintU32 BS3_CMN_NM(Bs3PrintU32) /**< Selects #Bs3PrintU32_c16, #Bs3PrintU32_c32 or #Bs3PrintU32_c64. */
     181
     182/**
     183 * Finds the length of a zero terminated string.
     184 *
     185 * @returns String length in chars/bytes.
     186 * @param   pszString       The string to examine.
     187 */
     188BS3_DECL(size_t) Bs3StrLen_c16(const char BS3_FAR *pszString);
     189BS3_DECL(size_t) Bs3StrLen_c32(const char BS3_FAR *pszString); /** @copydoc Bs3StrLen_c16 */
     190BS3_DECL(size_t) Bs3StrLen_c64(const char BS3_FAR *pszString); /** @copydoc Bs3StrLen_c16 */
     191#define Bs3StrLen BS3_CMN_NM(Bs3StrLen) /**< Selects #Bs3StrLen_c16, #Bs3StrLen_c32 or #Bs3StrLen_c64. */
     192
     193/**
     194 * Finds the length of a zero terminated string, but with a max length.
     195 *
     196 * @returns String length in chars/bytes, or @a cchMax if no zero-terminator
     197 *           was found before we reached the limit.
     198 * @param   pszString       The string to examine.
     199 * @param   cchMax          The max length to examine.
     200 */
     201BS3_DECL(size_t) Bs3StrNLen_c16(const char BS3_FAR *pszString, size_t cchMax);
     202BS3_DECL(size_t) Bs3StrNLen_c32(const char BS3_FAR *pszString, size_t cchMax); /** @copydoc Bs3StrNLen_c16 */
     203BS3_DECL(size_t) Bs3StrNLen_c64(const char BS3_FAR *pszString, size_t cchMax); /** @copydoc Bs3StrNLen_c16 */
     204#define Bs3StrNLen BS3_CMN_NM(Bs3StrNLen) /**< Selects #Bs3StrNLen_c16, #Bs3StrNLen_c32 or #Bs3StrNLen_c64. */
     205
     206/**
     207 * CRT style unsafe strcpy.
     208 *
     209 * @returns pszDst.
     210 * @param   pszDst          The destination buffer.  Must be large enough to
     211 *                          hold the source string.
     212 * @param   pszSrc          The source string.
     213 */
     214BS3_DECL(char BS3_FAR *) Bs3StrCpy_c16(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc);
     215BS3_DECL(char BS3_FAR *) Bs3StrCpy_c32(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc); /** @copydoc Bs3StrCpy_c16 */
     216BS3_DECL(char BS3_FAR *) Bs3StrCpy_c64(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc); /** @copydoc Bs3StrCpy_c16 */
     217#define Bs3StrCpy BS3_CMN_NM(Bs3StrCpy) /**< Selects #Bs3StrCpy_c16, #Bs3StrCpy_c32 or #Bs3StrCpy_c64. */
     218
     219/**
     220 * CRT style memcpy
     221 *
     222 * @returns pvDst
     223 * @param   pvDst           The destination buffer.
     224 * @param   pvSrc           The source buffer.
     225 * @param   cbCopy          The number of bytes to copy.
     226 */
     227BS3_DECL(void BS3_FAR *) Bs3MemCpy_c16(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy);
     228BS3_DECL(void BS3_FAR *) Bs3MemCpy_c32(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemCpy_c16 */
     229BS3_DECL(void BS3_FAR *) Bs3MemCpy_c64(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemCpy_c16 */
     230#define Bs3MemCpy BS3_CMN_NM(Bs3MemCpy) /**< Selects #Bs3MemCpy_c16, #Bs3MemCpy_c32 or #Bs3MemCpy_c64. */
     231
     232/**
     233 * GNU (?) style mempcpy
     234 *
     235 * @returns pvDst + cbCopy
     236 * @param   pvDst           The destination buffer.
     237 * @param   pvSrc           The source buffer.
     238 * @param   cbCopy          The number of bytes to copy.
     239 */
     240BS3_DECL(void BS3_FAR *) Bs3MemPCpy_c16(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy);
     241BS3_DECL(void BS3_FAR *) Bs3MemPCpy_c32(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemPCpy_c16 */
     242BS3_DECL(void BS3_FAR *) Bs3MemPCpy_c64(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy); /** @copydoc Bs3MemPCpy_c16 */
     243#define Bs3MemPCpy BS3_CMN_NM(Bs3MemPCpy) /**< Selects #Bs3MemPCpy_c16, #Bs3MemPCpy_c32 or #Bs3MemPCpy_c64. */
    132244
    133245/** @} */
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