VirtualBox

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


Ignore:
Timestamp:
Nov 15, 2015 11:00:50 PM (9 years ago)
Author:
vboxsync
Message:

bs3kit: Macros for far pointers.

File:
1 edited

Legend:

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

    r58694 r58695  
    265265# define BS3_FAR
    266266# define BS3_NEAR
     267#endif
     268
     269#if ARCH_BITS == 16 || defined(DOXYGEN_RUNNING)
     270/** @def BS3_FP_SEG
     271 * Get the selector (segment) part of a far pointer.
     272 * @returns selector.
     273 * @param   a_pv        Far pointer.
     274 */
     275# define BS3_FP_SEG(a_pv)            ((uint16_t)(void __seg *)(void BS3_FAR *)(a_pv))
     276/** @def BS3_FP_OFF
     277 * Get the segment offset part of a far pointer.
     278 * @returns offset.
     279 * @param   a_pv        Far pointer.
     280 */
     281# define BS3_FP_OFF(a_pv)            ((uint16_t)(void __near *)(a_pv))
     282/** @def BS3_FP_MAKE
     283 * Create a far pointer.
     284 * @returns selector.
     285 * @param   a_pv        Far pointer.
     286 */
     287# define BS3_FP_MAKE(a_uSeg, a_off)  ((void __seg *)(a_uSeg) + (void __near *)(a_off))
    267288#endif
    268289
     
    602623
    603624/**
     625 * Formats and prints a string to the screen.
     626 *
     627 * @param   pszFormat       The format string.  See #Bs3PrintFV for supported
     628 *                          format types and flags.
     629 * @param   ...             Format arguments.
     630 */
     631BS3_DECL(size_t) Bs3PrintF_c16(const char BS3_FAR *pszFormat, ...);
     632BS3_DECL(size_t) Bs3PrintF_c32(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3PrintF_c16 */
     633BS3_DECL(size_t) Bs3PrintF_c64(const char BS3_FAR *pszFormat, ...); /**< @copydoc Bs3PrintF_c16 */
     634#define Bs3PrintF BS3_CMN_NM(Bs3PrintF) /**< Selects #Bs3PrintF_c16, #Bs3PrintF_c32 or #Bs3PrintF_c64. */
     635
     636/**
     637 * Formats and prints a string to the screen, va_list version.
     638 *
     639 * Supported types:
     640 *      - %RI8, %RI16, %RI32, %RI64
     641 *      - %RU8, %RU16, %RU32, %RU64
     642 *      - %RX8, %RX16, %RX32, %RX64
     643 *      - %i, %d
     644 *      - %u
     645 *      - %x
     646 *      - %c
     647 *      - %p (far pointer)
     648 *      - %s (far pointer)
     649 *
     650 * @param   pszFormat       The format string.  See #Bs3PrintFV for supported
     651 *                          format types and flags.
     652 * @param   va              Format arguments.
     653 */
     654BS3_DECL(size_t) Bs3PrintFV_c16(const char BS3_FAR *pszFormat, va_list va);
     655BS3_DECL(size_t) Bs3PrintFV_c32(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3PrintFV_c16 */
     656BS3_DECL(size_t) Bs3PrintFV_c64(const char BS3_FAR *pszFormat, va_list va); /**< @copydoc Bs3PrintFV_c16 */
     657#define Bs3PrintFV BS3_CMN_NM(Bs3PrintFV) /**< Selects #Bs3PrintFV_c16, #Bs3PrintFV_c32 or #Bs3PrintFV_c64. */
     658
     659/**
    604660 * Prints a string to the screen.
    605661 *
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