VBoxTpG.h revision b2c3f5df103036986b56a7d5815b20d50399a372
/* $Id$ */
/** @file
* VBox Tracepoint Generator Structures.
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___VBox_VTG_h___
#define ___VBox_VTG_h___
/**
* Probe location.
*/
typedef struct VTGPROBELOC
{
const char *pszFunction;
#if ARCH_BITS == 64
#endif
} VTGPROBELOC;
/** Pointer to a probe location. */
typedef VTGPROBELOC *PVTGPROBELOC;
/** @def VTG_OBJ_SECT
* The name of the section containing the other probe data provided by the
* assembly / object generated by VBoxTpG. */
/** @def VTG_LOC_SECT
* The name of the section containing the VTGPROBELOC structures. This is
* filled by the probe macros, @see VTG_DECL_VTGPROBELOC. */
/** @def VTG_DECL_VTGPROBELOC
* Declares a static variable, @a a_VarName, of type VTGPROBELOC in the section
* indicated by VTG_LOC_SECT. */
#if defined(RT_OS_WINDOWS)
# define VTG_OBJ_SECT "VTGObj"
# define VTG_LOC_SECT "VTGPrLc.Data"
# ifdef _MSC_VER
# define VTG_DECL_VTGPROBELOC(a_VarName) \
# define VTG_DECL_VTGPROBELOC(a_VarName) \
# else
# error "Unsupported Windows compiler!"
# endif
#elif defined(RT_OS_DARWIN)
# define VTG_OBJ_SECT "__VTGObj"
# define VTG_LOC_SECT "__VTGPrLc"
# define VTG_LOC_SEG "__VTG"
# ifdef __GNUC__
# define VTG_DECL_VTGPROBELOC(a_VarName) \
static VTGPROBELOC __attribute__((section(VTG_LOC_SEG "," VTG_LOC_SECT ",regular")/*, aligned(16)*/)) a_VarName
# else
# error "Unsupported Darwin compiler!"
# endif
# error "OS/2 is not supported"
#else /* Assume the rest uses ELF. */
# define VTG_OBJ_SECT ".VTGObj"
# define VTG_LOC_SECT ".VTGPrLc"
# ifdef __GNUC__
# define VTG_DECL_VTGPROBELOC(a_VarName) \
# else
# error "Unsupported compiler!"
# endif
#endif
/** VTG string table offset. */
/** @name VTG type flags
* @{ */
/** Masking out the fixed size if given. */
/** Indicates that VTG_TYPE_SIZE_MASK can be applied, UNSIGNED or SIGNED is
* usually set as well, so may PHYS. */
/** It's a pointer type, the size is given by the context the probe fired in. */
/** A context specfic pointer or address, consult VTG_TYPE_CTX_XXX. */
/** The type has the same size as the host architecture. */
/** The type applies to ring-3 context. */
/** The type applies to ring-0 context. */
/** The type applies to raw-mode context. */
/** The type applies to guest context. */
/** The type context mask. */
/** The type is a physical address. */
/** The type is unsigned. */
/** The type is signed. */
/** Mask of valid bits (for simple validation). */
/** @} */
/**
* Checks if the VTG type flags indicates a large fixed size argument.
*/
#define VTG_TYPE_IS_LARGE(a_fType) \
/**
* VTG argument descriptor.
*/
typedef struct VTGDESCARG
{
} VTGDESCARG;
/** Pointer to an argument descriptor. */
typedef VTGDESCARG *PVTGDESCARG;
/**
* VTG argument list descriptor.
*/
typedef struct VTGDESCARGLIST
{
/** Pointer to a VTG argument list descriptor. */
typedef VTGDESCARGLIST *PVTGDESCARGLIST;
/**
* VTG probe descriptor.
*/
typedef struct VTGDESCPROBE
{
/** The distance from this structure to the VTG object header. */
} VTGDESCPROBE;
/** Pointer to a VTG probe descriptor. */
typedef VTGDESCPROBE *PVTGDESCPROBE;
/**
*/
typedef enum kVTGStability
{
/**
* Data dependency.
*/
typedef enum kVTGClass
{
kVTGClass_Invalid = 0,
} kVTGClass;
/**
* VTG attributes.
*/
typedef struct VTGDESCATTR
{
} VTGDESCATTR;
/** Pointer to a const VTG attribute. */
typedef VTGDESCATTR const *PCVTGDESCATTR;
/**
* VTG provider descriptor.
*/
typedef struct VTGDESCPROVIDER
{
/** Pointer to a VTG provider descriptor. */
typedef VTGDESCPROVIDER *PVTGDESCPROVIDER;
/**
* VTG data object header.
*/
typedef struct VTGOBJHDR
{
char szMagic[24];
bool *pafProbeEnabled;
char *pachStrTab;
} VTGOBJHDR;
/** Pointer to a VTG data object header. */
typedef VTGOBJHDR *PVTGOBJHDR;
/** The current VTGOBJHDR::szMagic value. */
#define VTGOBJHDR_MAGIC "VTG Object Header v1.4\0"
/** The name of the VTG data object header symbol in the object file. */
extern VTGOBJHDR g_VTGObjHeader;
#endif