VirtualBox

Changeset 53647 in vbox


Ignore:
Timestamp:
Jan 2, 2015 12:17:41 PM (10 years ago)
Author:
vboxsync
Message:

VBoxDTrace: darwin build fixes. (r17)

Location:
trunk/src/VBox/ExtPacks/VBoxDTrace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/VBoxDTrace/VBoxDTrace/Makefile.kmk

    r53646 r53647  
    3333
    3434PROGRAMS += VBoxDTrace
    35 VBoxDTrace_TEMPLATE = VBOXR3NP
     35VBoxDTrace_TEMPLATE = VBOXR3NPEXE
    3636VBoxDTrace_INCS = \
    3737        ../include \
  • trunk/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h

    r53646 r53647  
    3939struct modctl;
    4040
    41 typedef unsigned char           uchar_t;
    42 typedef unsigned int            uint_t;
    43 typedef uintptr_t               ulong_t;
    44 typedef uintptr_t               pc_t;
    45 typedef uint32_t                zoneid_t;
    46 typedef char                   *caddr_t;
    47 typedef uint64_t                hrtime_t;
    48 typedef RTCPUID                 processorid_t;
    49 typedef RTCCUINTREG             greg_t;
    50 typedef unsigned int            model_t;
     41typedef unsigned char               uchar_t;
     42typedef unsigned int                uint_t;
     43typedef uintptr_t                   ulong_t;
     44typedef uintptr_t                   pc_t;
     45typedef unsigned int                model_t;
     46typedef uint32_t                    zoneid_t;
     47typedef RTCPUID                     processorid_t;
     48
     49#define NANOSEC                     RT_NS_1SEC
     50#define MILLISEC                    RT_MS_1SEC
     51
     52#if defined(RT_ARCH_X86)
     53# ifndef __i386
     54#  define __i386            1
     55# endif
     56
     57#elif defined(RT_ARCH_AMD64)
     58# ifndef __x86_64
     59#  define __x86_64          1
     60# endif
     61
     62#else
     63# error "unsupported arch!"
     64#endif
     65
     66/** Mark a cast added when porting the code to VBox.
     67 * Avoids lots of \#ifdef VBOX otherwise needed to mark up the changes. */
     68#define VBDTCAST(a_Type)        (a_Type)
     69/** Mark a type change made when porting the code to VBox.
     70 * This is usually signed -> unsigned type changes that avoids a whole lot of
     71 * comparsion warnings. */
     72#define VBDTTYPE(a_VBox, a_Org) a_VBox
     73/** Mark missing void in a parameter list. */
     74#define VBDTVOID                void
     75/** Mark missing static in a function definition. */
     76#define VBDTSTATIC              static
     77#define VBDTUNASS(a_Value)      = a_Value
     78
     79/*
     80 * string
     81 */
     82#if defined(_MSC_VER) || defined(IN_RING0)
     83# define bcopy(a_pSrc, a_pDst, a_cb) memmove(a_pDst, a_pSrc, a_cb)
     84# define bzero(a_pDst, a_cb)        RT_BZERO(a_pDst, a_cb)
     85# define bcmp(a_p1, a_p2, a_cb)     memcmp(a_p1, a_p2, a_cb)
     86# define snprintf                   RTStrPrintf
     87#endif
     88
     89
     90/*
     91 * CTF - probably needs to be ported wholesale or smth.
     92 */
     93#define CTF_MODEL_NATIVE            1
     94typedef struct VBoxDtCtfFile        ctf_file_t;
     95typedef intptr_t                    ctf_id_t;
     96
     97
     98#ifdef IN_RING0
     99
     100/*
     101 * Kernel stuff...
     102 */
     103typedef char                       *caddr_t;
     104typedef uint64_t                    hrtime_t;
     105typedef RTCCUINTREG                 greg_t;
     106typedef RTUID                       uid_t;
     107typedef RTPROCESS                   pid_t;
     108
     109#define P2ROUNDUP(uWhat, uAlign)    ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) )
     110#define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) )
     111#define roundup(uWhat, uUnit)       ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) )
     112#define MIN(a1, a2)                 RT_MIN(a1, a2)
     113
     114#define NBBY                        8
     115#define NCPU                        RTCPUSET_MAX_CPUS
     116#define B_FALSE                     (0)
     117#define B_TRUE                      (1)
     118#define CPU_ON_INTR(a_pCpu)         (false)
     119
     120#define KERNELBASE                  VBoxDtGetKernelBase()
     121uintptr_t VBoxDtGetKernelBase(void);
     122
    51123
    52124typedef struct VBoxDtCred
     
    162234
    163235
    164 #if 1 /* */
    165 
    166 typedef RTUID                   uid_t;
    167 typedef RTPROCESS               pid_t;
    168 #endif
    169 
    170 #define B_FALSE                 (0)
    171 #define B_TRUE                  (1)
    172 #define NANOSEC                 RT_NS_1SEC
    173 #define MILLISEC                RT_MS_1SEC
    174 #define NBBY                    8
    175 #define NCPU                    RTCPUSET_MAX_CPUS
    176 #define P2ROUNDUP(uWhat, uAlign)    ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) )
    177 #define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) )
    178 #define roundup(uWhat, uUnit)       ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) )
    179 #define MIN(a1, a2)             RT_MIN(a1, a2)
    180 
    181 #define CPU_ON_INTR(a_pCpu)     (false)
    182 
    183 #define KERNELBASE              VBoxDtGetKernelBase()
    184 uintptr_t VBoxDtGetKernelBase(void);
    185 
    186 
    187 #if defined(RT_ARCH_X86)
    188 # ifndef __i386
    189 #  define __i386            1
    190 # endif
    191 
    192 #elif defined(RT_ARCH_AMD64)
    193 # ifndef __x86_64
    194 #  define __x86_64          1
    195 # endif
    196 
    197 #else
    198 # error "unsupported arch!"
    199 #endif
    200 
    201 /** Mark a cast added when porting the code to VBox.
    202  * Avoids lots of \#ifdef VBOX otherwise needed to mark up the changes. */
    203 #define VBDTCAST(a_Type)        (a_Type)
    204 /** Mark a type change made when porting the code to VBox.
    205  * This is usually signed -> unsigned type changes that avoids a whole lot of
    206  * comparsion warnings. */
    207 #define VBDTTYPE(a_VBox, a_Org) a_VBox
    208 /** Mark missing void in a parameter list. */
    209 #define VBDTVOID                void
    210 /** Mark missing static in a function definition. */
    211 #define VBDTSTATIC              static
    212 #define VBDTUNASS(a_Value)      = a_Value
    213 
    214 /*
    215  * string
    216  */
    217 #define bcopy(a_pSrc, a_pDst, a_cb) memmove(a_pDst, a_pSrc, a_cb)
    218 #define bzero(a_pDst, a_cb)         RT_BZERO(a_pDst, a_cb)
    219 #define bcmp(a_p1, a_p2, a_cb)      memcmp(a_p1, a_p2, a_cb)
    220 #define snprintf                    RTStrPrintf
    221 
    222 
    223 /*
    224  * CTF - probably needs to be ported wholesale or smth.
    225  */
    226 #define CTF_MODEL_NATIVE            1
    227 typedef struct VBoxDtCtfFile        ctf_file_t;
    228 typedef intptr_t                    ctf_id_t;
    229 
    230 #ifdef IN_RING0
    231 
    232236/*
    233237 * Errno defines compatible with the CRT of the given host...
  • trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c

    r53646 r53647  
    149149static char **g_argv;
    150150static int g_argc;
     151#ifndef VBOX /* No linking. */
    151152static char **g_objv;
    152153static int g_objc;
     154#endif
    153155static dtrace_cmd_t *g_cmdv;
    154156static int g_cmdc;
     
    171173static int g_grabanon = 0;
    172174static const char *g_ofile = NULL;
    173 #ifndef _MSC_VER /* stdout isn't a constant usable in C code. */
     175#ifndef VBOX /* stdout isn't a necessarily constant usable like this in C code. */
    174176static FILE *g_ofp = stdout;
    175177#else
     
    707709}
    708710
     711#ifndef VBOX
    709712/*
    710713 * Link the specified D program in DOF form into an ELF file for use in either
     
    735738                dfatal("failed to link %s %s", dcp->dc_desc, dcp->dc_name);
    736739}
     740#endif /* !VBOX */
    737741
    738742/*ARGSUSED*/
     
    12521256        int done = 0, mode = 0;
    12531257        int err, i;
     1258#ifndef VBOX
    12541259        char c, *p, **v;
     1260#else
     1261        int c;
     1262        char *p, **v;
     1263#endif
    12551264        struct ps_prochandle *P;
    12561265        pid_t pid;
     
    12621271        if (RT_FAILURE(err))
    12631272                return RTMsgInitFailure(err);
    1264 #endif
    1265 #ifdef _MSC_VER
     1273
    12661274        g_ofp = stdout;
    12671275#endif
     
    13521360
    13531361                        case 'G':
     1362#ifndef VBOX
    13541363                                g_mode = DMODE_LINK;
    13551364                                g_oflags |= DTRACE_O_NODEV;
     
    13581367                                mode++;
    13591368                                break;
     1369#else
     1370                                fprintf(stderr, "%s: -G is not supported\n", g_pname);
     1371                                return (E_USAGE);
     1372#endif
    13601373
    13611374                        case 'l':
     
    14791492         */
    14801493        if (g_mode == DMODE_LINK) {
     1494#ifndef VBOX /* No link mode. */
    14811495                (void) dtrace_setopt(g_dtp, "linkmode", "dynamic");
    14821496                (void) dtrace_setopt(g_dtp, "unodefs", NULL);
     
    14931507                 */
    14941508                g_argc = 1;
     1509#else  /* VBOX */
     1510                AssertFailed();
     1511#endif /* VBOX */
    14951512        } else if (g_mode == DMODE_ANON)
    14961513                (void) dtrace_setopt(g_dtp, "linkmode", "primary");
     
    18121829
    18131830        case DMODE_LINK:
     1831#ifndef VBOX  /* No link mode. */
    18141832                if (g_cmdc == 0) {
    18151833                        (void) fprintf(stderr, "%s: -G requires one or more "
     
    18351853                dtrace_close(g_dtp);
    18361854                return (g_status);
     1855#else  /* VBOX */
     1856                AssertFailed();
     1857                dtrace_close(g_dtp);
     1858                return (E_USAGE);
     1859#endif /* VBOX */
    18371860
    18381861        case DMODE_LIST:
  • trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.c

    r53645 r53647  
    110110# include <iprt/asm-amd64-x86.h>
    111111# define dtrace_casptr(a_ppvDst, a_pvOld, a_pvNew) \
    112         VBoxDtCompareAndSwapPtr(a_ppvDst, a_pvOld, a_pvNew)
     112        VBoxDtCompareAndSwapPtr((void * volatile *)a_ppvDst, a_pvOld, a_pvNew)
    113113DECLINLINE(void *) VBoxDtCompareAndSwapPtr(void * volatile *ppvDst, void *pvOld, void *pvNew)
    114114{
     
    97949794        dtrace_recdesc_t *rec;
    97959795        dtrace_state_t *state = ecb->dte_state;
    9796         dtrace_optval_t *opt = state->dts_options, nframes, strsize;
     9796        dtrace_optval_t *opt = state->dts_options, nframes VBDTUNASS(0), strsize;
    97979797        uint64_t arg = desc->dtad_arg;
    97989798
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