CFLAGS += $(PTHREAD_CFLAGS)
-# Define this to make it possible to run valgrind on code linked with these
-# libraries.
-#CFLAGS += -DVALGRIND -O0 -ggdb3
-
CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
DECLARE_HYPERCALL_BOUNCE(pfn_buf, max_pfns * sizeof(*pfn_buf), XC_HYPERCALL_BUFFER_BOUNCE_OUT);
int ret;
-#ifdef VALGRIND
- memset(pfn_buf, 0, max_pfns * sizeof(*pfn_buf));
-#endif
-
if ( xc_hypercall_bounce_pre(xch, pfn_buf) )
{
PERROR("xc_get_pfn_list: pfn_buf bounce failed");
return -ENOMEM;
}
-#ifdef VALGRIND
- if (sz != 0)
- memset(hypercall_bounce_get(bounce), 0, sz);
-#endif
-
rc = do_xen_version(xch, cmd, HYPERCALL_BUFFER(arg));
if ( sz != 0 )
#include <xen/sys/privcmd.h>
-/* valgrind cannot see when a hypercall has filled in some values. For this
- reason, we must zero the privcmd_hypercall_t or domctl/sysctl instance
- before a call, if using valgrind. */
-#ifdef VALGRIND
-#define DECLARE_HYPERCALL privcmd_hypercall_t hypercall = { 0 }
-#define DECLARE_DOMCTL struct xen_domctl domctl = { 0 }
-#define DECLARE_SYSCTL struct xen_sysctl sysctl = { 0 }
-#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op = { 0 }
-#define DECLARE_FLASK_OP struct xen_flask_op op = { 0 }
-#else
#define DECLARE_HYPERCALL privcmd_hypercall_t hypercall
#define DECLARE_DOMCTL struct xen_domctl domctl
#define DECLARE_SYSCTL struct xen_sysctl sysctl
#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op
#define DECLARE_FLASK_OP struct xen_flask_op op
-#endif
#undef PAGE_SHIFT
#undef PAGE_SIZE
op.u.ctrl.oid[1] = 0;
op.u.ctrl.oid[2] = 0;
-#ifdef VALGRIND
- if (arg1 != 0)
- memset(buf, 0, arg1);
-#endif
-
if ( subop == TMEMC_LIST && arg1 != 0 )
{
if ( buf == NULL )
op.u.ctrl.oid[1] = oid.oid[1];
op.u.ctrl.oid[2] = oid.oid[2];
-#ifdef VALGRIND
- if (arg1 != 0)
- memset(buf, 0, arg1);
-#endif
-
if ( subop == TMEMC_LIST && arg1 != 0 )
{
if ( buf == NULL )