diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-02 15:12:06 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-02 15:12:06 +0100 |
commit | 2d0922d5159b9855c1420f418318081d607c0df1 (patch) | |
tree | 6d84b52be10d50fe6a5d4fd3be7789a8f9f6041a /tools/libxc/xc_tbuf.c | |
parent | 6a4be408e4f7be50ce912570883e6d6e9eb2cf53 (diff) | |
download | xen-2d0922d5159b9855c1420f418318081d607c0df1.tar.gz xen-2d0922d5159b9855c1420f418318081d607c0df1.tar.bz2 xen-2d0922d5159b9855c1420f418318081d607c0df1.zip |
Move Linux-specific privcmd code into private libxc implementations.
Make header path for kernel's privcmd/evtchn headers generic.
Remove pointless xi_*() interface that was using private libxc
interfaces.
Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'tools/libxc/xc_tbuf.c')
-rw-r--r-- | tools/libxc/xc_tbuf.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c index 3a427a0171..ea64c8533f 100644 --- a/tools/libxc/xc_tbuf.c +++ b/tools/libxc/xc_tbuf.c @@ -4,6 +4,14 @@ * API for manipulating and accessing trace buffer parameters * * Copyright (c) 2005, Rob Gardner + * + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, version 2 of the + * License. */ #include "xc_private.h" @@ -49,3 +57,41 @@ int xc_tbuf_get_size(int xc_handle, uint32_t *size) return rc; } +int xc_tbuf_get_mfn(int xc_handle, unsigned long *mfn) +{ + int rc; + DECLARE_DOM0_OP; + + op.cmd = DOM0_TBUFCONTROL; + op.interface_version = DOM0_INTERFACE_VERSION; + op.u.tbufcontrol.op = DOM0_TBUF_GET_INFO; + + rc = xc_dom0_op(xc_handle, &op); + if ( rc == 0 ) + *mfn = op.u.tbufcontrol.buffer_mfn; + return rc; +} + +int xc_tbuf_set_cpu_mask(int xc_handle, uint32_t mask) +{ + DECLARE_DOM0_OP; + + op.cmd = DOM0_TBUFCONTROL; + op.interface_version = DOM0_INTERFACE_VERSION; + op.u.tbufcontrol.op = DOM0_TBUF_SET_CPU_MASK; + op.u.tbufcontrol.cpu_mask = mask; + + return do_dom0_op(xc_handle, &op); +} + +int xc_tbuf_set_evt_mask(int xc_handle, uint32_t mask) +{ + DECLARE_DOM0_OP; + + op.cmd = DOM0_TBUFCONTROL; + op.interface_version = DOM0_INTERFACE_VERSION; + op.u.tbufcontrol.op = DOM0_TBUF_SET_EVT_MASK; + op.u.tbufcontrol.evt_mask = mask; + + return do_dom0_op(xc_handle, &op); +} |