VirtualBox

Changeset 41218 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
May 8, 2012 8:38:10 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77857
Message:

Tweaks for DTrace.

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpumctx.h

    r40170 r41218  
    44
    55/*
    6  * Copyright (C) 2006-2010 Oracle Corporation
     6 * Copyright (C) 2006-2012 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7777} CPUMSYSENTER;
    7878
     79/**
     80 * For compilers (like DTrace) that does not grok nameless unions, we have a
     81 * little hack to make them palatable.
     82 */
     83#ifdef VBOX_FOR_DTRACE_LIB
     84# define CPUM_UNION_NAME    u
     85#elif defined(VBOX_WITHOUT_UNNAMED_UNIONS)
     86# define CPUM_UNION_NAME    u
     87#else
     88# define CPUM_UNION_NAME
     89#endif
     90
    7991
    8092/**
    8193 * CPU context core.
    8294 */
    83 #ifndef VBOX_WITHOUT_UNNAMED_UNIONS
    84 #pragma pack(1)
     95#ifndef VBOX_FOR_DTRACE_LIB
     96# pragma pack(1)
     97#endif
    8598typedef struct CPUMCTXCORE
    8699{
     
    90103        uint32_t        edi;
    91104        uint64_t        rdi;
    92     };
     105    } CPUM_UNION_NAME;
    93106    union
    94107    {
     
    96109        uint32_t        esi;
    97110        uint64_t        rsi;
    98     };
     111    } CPUM_UNION_NAME;
    99112    union
    100113    {
     
    102115        uint32_t        ebp;
    103116        uint64_t        rbp;
    104     };
     117    } CPUM_UNION_NAME;
    105118    union
    106119    {
     
    108121        uint32_t        eax;
    109122        uint64_t        rax;
    110     };
     123    } CPUM_UNION_NAME;
    111124    union
    112125    {
     
    114127        uint32_t        ebx;
    115128        uint64_t        rbx;
    116     };
     129    } CPUM_UNION_NAME;
    117130    union
    118131    {
     
    120133        uint32_t        edx;
    121134        uint64_t        rdx;
    122     };
     135    } CPUM_UNION_NAME;
    123136    union
    124137    {
     
    126139        uint32_t        ecx;
    127140        uint64_t        rcx;
    128     };
     141    } CPUM_UNION_NAME;
    129142    union
    130143    {
     
    132145        uint32_t        esp;
    133146        uint64_t        rsp;
    134     };
     147    } CPUM_UNION_NAME;
    135148    /* Note: lss esp, [] in the switcher needs some space, so we reserve it here instead of relying on the exact esp & ss layout as before. */
    136149    uint32_t            lss_esp;
     
    153166        X86EFLAGS       eflags;
    154167        X86RFLAGS       rflags;
    155     };
     168    } CPUM_UNION_NAME;
    156169    union
    157170    {
     
    159172        uint32_t        eip;
    160173        uint64_t        rip;
    161     };
     174    } CPUM_UNION_NAME;
    162175
    163176    uint64_t            r8;
     
    181194
    182195} CPUMCTXCORE;
    183 #pragma pack()
    184 #else  /* VBOX_WITHOUT_UNNAMED_UNIONS */
    185 typedef struct CPUMCTXCORE CPUMCTXCORE;
    186 #endif /* VBOX_WITHOUT_UNNAMED_UNIONS */
     196
     197# ifndef VBOX_FOR_DTRACE_LIB
     198#  pragma pack()
     199# endif
    187200
    188201
     
    190203 * CPU context.
    191204 */
    192 #ifndef VBOX_WITHOUT_UNNAMED_UNIONS
     205#ifndef VBOX_FOR_DTRACE_LIB
    193206# pragma pack(1)
     207#endif
    194208typedef struct CPUMCTX
    195209{
     
    207221        uint32_t        edi;
    208222        uint64_t        rdi;
    209     };
     223    } CPUM_UNION_NAME;
    210224    union
    211225    {
     
    214228        uint32_t        esi;
    215229        uint64_t        rsi;
    216     };
     230    } CPUM_UNION_NAME;
    217231    union
    218232    {
     
    220234        uint32_t        ebp;
    221235        uint64_t        rbp;
    222     };
     236    } CPUM_UNION_NAME;
    223237    union
    224238    {
     
    227241        uint32_t        eax;
    228242        uint64_t        rax;
    229     };
     243    } CPUM_UNION_NAME;
    230244    union
    231245    {
     
    234248        uint32_t        ebx;
    235249        uint64_t        rbx;
    236     };
     250    } CPUM_UNION_NAME;
    237251    union
    238252    {
     
    241255        uint32_t        edx;
    242256        uint64_t        rdx;
    243     };
     257    } CPUM_UNION_NAME;
    244258    union
    245259    {
     
    248262        uint32_t        ecx;
    249263        uint64_t        rcx;
    250     };
     264    } CPUM_UNION_NAME;
    251265    union
    252266    {
     
    254268        uint32_t        esp;
    255269        uint64_t        rsp;
    256     };
     270    } CPUM_UNION_NAME;
    257271    /** @note lss esp, [] in the switcher needs some space, so we reserve it here
    258272     *        instead of relying on the exact esp & ss layout as before (prevented
     
    277291        X86EFLAGS       eflags;
    278292        X86RFLAGS       rflags;
    279     };
     293    } CPUM_UNION_NAME;
    280294    union
    281295    {
     
    283297        uint32_t        eip;
    284298        uint64_t        rip;
    285     };
     299    } CPUM_UNION_NAME;
    286300
    287301    uint64_t            r8;
     
    364378# endif
    365379} CPUMCTX;
    366 # pragma pack()
    367 #else  /* VBOX_WITHOUT_UNNAMED_UNIONS */
    368 typedef struct CPUMCTX CPUMCTX;
    369 #endif /* VBOX_WITHOUT_UNNAMED_UNIONS */
     380# ifndef VBOX_FOR_DTRACE_LIB
     381#  pragma pack()
     382# endif
     383
     384#ifndef VBOX_FOR_DTRACE_LIB
    370385
    371386/**
    372387 * Gets the CPUMCTXCORE part of a CPUMCTX.
    373388 */
    374 #define CPUMCTX2CORE(pCtx) ((PCPUMCTXCORE)(void *)&(pCtx)->edi)
     389# define CPUMCTX2CORE(pCtx) ((PCPUMCTXCORE)(void *)&(pCtx)->edi)
     390
    375391
    376392/**
     
    393409 * @remarks PATM uses this, which is why it has to be here.
    394410 */
    395 #ifndef VBOX_WITHOUT_UNNAMED_UNIONS
    396411# pragma pack(1)
    397412typedef struct CPUMCTX_VER1_6
     
    408423        uint32_t        edi;
    409424        uint64_t        rdi;
    410     };
     425    } CPUM_UNION_NAME;
    411426    union
    412427    {
    413428        uint32_t        esi;
    414429        uint64_t        rsi;
    415     };
     430    } CPUM_UNION_NAME;
    416431    union
    417432    {
    418433        uint32_t        ebp;
    419434        uint64_t        rbp;
    420     };
     435    } CPUM_UNION_NAME;
    421436    union
    422437    {
    423438        uint32_t        eax;
    424439        uint64_t        rax;
    425     };
     440    } CPUM_UNION_NAME;
    426441    union
    427442    {
    428443        uint32_t        ebx;
    429444        uint64_t        rbx;
    430     };
     445    } CPUM_UNION_NAME;
    431446    union
    432447    {
    433448        uint32_t        edx;
    434449        uint64_t        rdx;
    435     };
     450    } CPUM_UNION_NAME;
    436451    union
    437452    {
    438453        uint32_t        ecx;
    439454        uint64_t        rcx;
    440     };
     455    } CPUM_UNION_NAME;
    441456    /** @note We rely on the exact layout, because we use lss esp, [] in the
    442457     *        switcher. */
     
    462477        X86EFLAGS       eflags;
    463478        X86RFLAGS       rflags;
    464     };
     479    } CPUM_UNION_NAME;
    465480    union
    466481    {
    467482        uint32_t        eip;
    468483        uint64_t        rip;
    469     };
     484    } CPUM_UNION_NAME;
    470485
    471486    uint64_t            r8;
     
    555570    uint32_t        padding[2];
    556571} CPUMCTX_VER1_6;
    557 #pragma pack()
    558 #else  /* VBOX_WITHOUT_UNNAMED_UNIONS */
    559 typedef struct CPUMCTX_VER1_6 CPUMCTX_VER1_6;
    560 #endif /* VBOX_WITHOUT_UNNAMED_UNIONS */
     572# pragma pack()
     573
     574#endif /* VBOX_FOR_DTRACE_LIB */
    561575
    562576/**
  • trunk/include/VBox/vmm/vm.h

    r41147 r41218  
    44
    55/*
    6  * Copyright (C) 2006-2011 Oracle Corporation
     6 * Copyright (C) 2006-2012 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    228228} VMCPU;
    229229
     230
     231#ifndef VBOX_FOR_DTRACE_LIB
    230232
    231233/** @name Operations on VMCPU::enmState
     
    729731                        (rc))
    730732
     733#endif /* !VBOX_FOR_DTRACE_LIB */
     734
     735
    731736
    732737/** This is the VM structure.
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