VirtualBox

Ignore:
Timestamp:
Jan 2, 2015 12:19:28 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97423
Message:

VBoxDTrace: libdtrace porting in progres... (r23)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h

    r53652 r53653  
    4747typedef unsigned int                uint_t;
    4848typedef uintptr_t                   ulong_t;
     49typedef uint64_t                    u_longlong_t;
    4950typedef uint64_t                    hrtime_t;
    5051typedef RTCCUINTREG                 greg_t;
     
    6162
    6263#define NANOSEC                     RT_NS_1SEC
     64#define MICROSEC                    RT_US_1SEC
    6365#define MILLISEC                    RT_MS_1SEC
     66#define SEC                         1
    6467#define MAXPATHLEN                  RTPATH_MAX
    6568#define PATH_MAX                    RTPATH_MAX
     
    6770#define NCPU                        RTCPUSET_MAX_CPUS
    6871
     72#define MIN(a1, a2)                 RT_MIN(a1, a2)
     73#define MAX(a1, a2)                 RT_MAX(a1, a2)
     74#define ABS(a_iValue)               RT_ABS(a_iValue)
     75#define roundup(uWhat, uUnit)       ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) )
     76
    6977#if defined(RT_ARCH_X86)
    7078# ifndef __i386
    71 #  define __i386                1
     79#  define __i386                    1
    7280# endif
    7381# ifndef __x86
    74 #  define __x86                 1
     82#  define __x86                     1
     83# endif
     84# ifndef _IPL32
     85#  define _IPL32                    1
    7586# endif
    7687
    7788#elif defined(RT_ARCH_AMD64)
    7889# ifndef __x86_64
    79 #  define __x86_64              1
     90#  define __x86_64                  1
    8091# endif
    8192# ifndef __x86
    82 #  define __x86                 1
     93#  define __x86                     1
     94# endif
     95# ifndef _LP64
     96#  define _LP64                     1
    8397# endif
    8498
     
    109123# define snprintf                   RTStrPrintf
    110124#endif
    111 
    112125
    113126/*
     
    131144#if defined(_MSC_VER) || defined(IN_RING0)
    132145# define EALREADY               (114)
     146# define EOVERFLOW              (79)
     147#endif
     148
     149/*
     150 * Bitmap stuff.
     151 */
     152#define BT_SIZEOFMAP(a_cBits)       ( (a_cBits + 63) / 8 )
     153#define BT_SET(a_aulBitmap, iBit)   ASMBitSet(a_aulBitmap, iBit)
     154#define BT_CLEAR(a_aulBitmap, iBit) ASMBitClear(a_aulBitmap, iBit)
     155#define BT_TEST(a_aulBitmap, iBit)  ASMBitTest(a_aulBitmap, iBit)
     156#if ARCH_BITS == 32
     157# define BT_NBIPUL                  32
     158# define BT_ULSHIFT                 5 /* log2(32) = 5 */
     159# define BT_ULMASK                  0x1f
     160# define BT_BITOUL(a_cBits)         ( ((a_cBits) + 31) / 32 )
     161#elif ARCH_BITS == 64
     162# define BT_NBIPUL                  64
     163# define BT_ULSHIFT                 6 /* log2(32) = 6 */
     164# define BT_ULMASK                  0x3f
     165# define BT_BITOUL(a_cBits)         ( ((a_cBits) + 63) / 64 )
     166#else
     167# error Bad ARCH_BITS...
    133168#endif
    134169
     
    141176#define P2ROUNDUP(uWhat, uAlign)    ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) )
    142177#define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) )
    143 #define roundup(uWhat, uUnit)       ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) )
    144 #define MIN(a1, a2)                 RT_MIN(a1, a2)
    145178
    146179#define B_FALSE                     (0)
     
    359392 */
    360393# include <iprt/alloca.h>
     394# include <iprt/assert.h>
    361395# include <iprt/mem.h>
    362396# include <iprt/string.h>
    363397# include <iprt/time.h>
    364398# define gethrtime()                RTTimeNanoTS()
     399# define strcasecmp(a_psz1, a_psz2) RTStrICmp(a_psz1, a_psz2)
     400# define strncasecmp(a_psz1, a_psz2, a_cch) \
     401                                    RTStrNICmp(a_psz1, a_psz2, a_cch)
     402# define assert(expr)               Assert(expr)
    365403
    366404/* This isn't necessarily making things easier at first, but allows EF and
     
    373411# define free(a_pvMem)              RTMemFree(a_pvMem)
    374412# define strdup(a_psz)              RTStrDup(a_psz)
     413# define strlcpy(a_pszDst, a_pszSrc, a_cbDst) ((void)RTStrCopy(a_pszDst, a_cbDst, a_pszSrc))
     414
    375415
    376416#endif
Note: See TracChangeset for help on using the changeset viewer.

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