ia64/xen-unstable

changeset 6403:6e899a3840b2

Rename libxc => libxenctrl and xc.h => xen/xenctrl.h
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Aug 24 23:07:29 2005 +0000 (2005-08-24)
parents be5c24f2709c
children fdfd511768a3
files tools/blktap/blktaplib.h tools/blktap/parallax/block-async.h tools/blktap/parallax/blockstore.h tools/console/Makefile tools/console/client/main.c tools/console/daemon/io.c tools/console/daemon/main.c tools/console/daemon/utils.c tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c tools/debugger/libxendebug/Makefile tools/debugger/libxendebug/xendebug.c tools/debugger/libxendebug/xendebug.h tools/debugger/pdb/pdb_caml_domain.c tools/debugger/pdb/pdb_caml_evtchn.c tools/debugger/pdb/pdb_caml_process.c tools/debugger/pdb/pdb_caml_xc.c tools/debugger/pdb/pdb_caml_xcs.c tools/debugger/pdb/pdb_xen.c tools/firmware/acpi/acpi2_0.h tools/ioemu/hw/i8254.c tools/ioemu/hw/i8259.c tools/ioemu/hw/ioapic.h tools/ioemu/target-i386-dm/Makefile tools/ioemu/target-i386-dm/helper2.c tools/ioemu/vl.c tools/libxc/Makefile tools/libxc/xc_private.h tools/libxc/xenctrl.h tools/misc/Makefile tools/misc/cpuperf/Makefile tools/misc/cpuperf/cpuperf_xeno.h tools/misc/xc_shadow.c tools/misc/xenperf.c tools/python/setup.py tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xu/xu.c tools/xcs/Makefile tools/xcs/dump.h tools/xcs/xcs.h tools/xcs/xcsdump.c tools/xcutils/Makefile tools/xcutils/xc_restore.c tools/xcutils/xc_save.c tools/xenstore/Makefile tools/xenstore/xs_dom0_test.c tools/xenstore/xs_lib.h tools/xentrace/Makefile tools/xentrace/xenctx.c
line diff
     1.1 --- a/tools/blktap/blktaplib.h	Wed Aug 24 21:50:52 2005 +0000
     1.2 +++ b/tools/blktap/blktaplib.h	Wed Aug 24 23:07:29 2005 +0000
     1.3 @@ -7,7 +7,7 @@
     1.4  #ifndef __BLKTAPLIB_H__
     1.5  #define __BLKTAPLIB_H__
     1.6  
     1.7 -#include <xc.h>
     1.8 +#include <xenctrl.h>
     1.9  #include <sys/user.h>
    1.10  #include <xen/xen.h>
    1.11  #include <xen/io/blkif.h>
     2.1 --- a/tools/blktap/parallax/block-async.h	Wed Aug 24 21:50:52 2005 +0000
     2.2 +++ b/tools/blktap/parallax/block-async.h	Wed Aug 24 23:07:29 2005 +0000
     2.3 @@ -7,7 +7,7 @@
     2.4  #define _BLOCKASYNC_H_
     2.5  
     2.6  #include <assert.h>
     2.7 -#include <xc.h>
     2.8 +#include <xenctrl.h>
     2.9  #include "vdi.h"
    2.10  
    2.11  struct io_ret
     3.1 --- a/tools/blktap/parallax/blockstore.h	Wed Aug 24 21:50:52 2005 +0000
     3.2 +++ b/tools/blktap/parallax/blockstore.h	Wed Aug 24 23:07:29 2005 +0000
     3.3 @@ -10,7 +10,7 @@
     3.4  #define __BLOCKSTORE_H__
     3.5  
     3.6  #include <netinet/in.h>
     3.7 -#include <xc.h>
     3.8 +#include <xenctrl.h>
     3.9  
    3.10  #define BLOCK_SIZE  4096
    3.11  #define BLOCK_SHIFT   12
     4.1 --- a/tools/console/Makefile	Wed Aug 24 21:50:52 2005 +0000
     4.2 +++ b/tools/console/Makefile	Wed Aug 24 23:07:29 2005 +0000
     4.3 @@ -26,11 +26,11 @@ clean:
     4.4  
     4.5  xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
     4.6  	$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
     4.7 -              -lxc -lxenstore
     4.8 +              -lxenctrl -lxenstore
     4.9  
    4.10  xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
    4.11  	$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
    4.12 -	      -lxc -lxenstore
    4.13 +	      -lxenctrl -lxenstore
    4.14  
    4.15  install: $(BIN)
    4.16  	$(INSTALL_DIR) -p $(DESTDIR)/$(DAEMON_INSTALL_DIR)
     5.1 --- a/tools/console/client/main.c	Wed Aug 24 21:50:52 2005 +0000
     5.2 +++ b/tools/console/client/main.c	Wed Aug 24 23:07:29 2005 +0000
     5.3 @@ -36,7 +36,7 @@
     5.4  #include <errno.h>
     5.5  #include <pty.h>
     5.6  
     5.7 -#include "xc.h"
     5.8 +#include "xenctrl.h"
     5.9  #include "xs.h"
    5.10  
    5.11  #define ESCAPE_CHARACTER 0x1d
     6.1 --- a/tools/console/daemon/io.c	Wed Aug 24 21:50:52 2005 +0000
     6.2 +++ b/tools/console/daemon/io.c	Wed Aug 24 23:07:29 2005 +0000
     6.3 @@ -23,7 +23,7 @@
     6.4  #include "utils.h"
     6.5  #include "io.h"
     6.6  
     6.7 -#include "xc.h"
     6.8 +#include "xenctrl.h"
     6.9  #include "xs.h"
    6.10  #include "xen/io/domain_controller.h"
    6.11  #include "xcs_proto.h"
     7.1 --- a/tools/console/daemon/main.c	Wed Aug 24 21:50:52 2005 +0000
     7.2 +++ b/tools/console/daemon/main.c	Wed Aug 24 23:07:29 2005 +0000
     7.3 @@ -25,7 +25,7 @@
     7.4  #include <unistd.h>
     7.5  #include <sys/types.h>
     7.6  
     7.7 -#include "xc.h"
     7.8 +#include "xenctrl.h"
     7.9  #include "xen/io/domain_controller.h"
    7.10  #include "xcs_proto.h"
    7.11  
     8.1 --- a/tools/console/daemon/utils.c	Wed Aug 24 21:50:52 2005 +0000
     8.2 +++ b/tools/console/daemon/utils.c	Wed Aug 24 23:07:29 2005 +0000
     8.3 @@ -33,7 +33,7 @@
     8.4  #include <sys/un.h>
     8.5  #include <string.h>
     8.6  
     8.7 -#include "xc.h"
     8.8 +#include "xenctrl.h"
     8.9  #include "xen/io/domain_controller.h"
    8.10  #include "xcs_proto.h"
    8.11  
     9.1 --- a/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c	Wed Aug 24 21:50:52 2005 +0000
     9.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c	Wed Aug 24 23:07:29 2005 +0000
     9.3 @@ -35,7 +35,7 @@
     9.4  #include <stdlib.h>
     9.5  #include <unistd.h>
     9.6  #include <errno.h>
     9.7 -#include <xc.h>
     9.8 +#include <xenctrl.h>
     9.9  #define TRACE_ENTER /* printf("enter %s\n", __FUNCTION__) */
    9.10  long (*myptrace)(enum __ptrace_request, pid_t, long, long);
    9.11  int (*myxcwait)(int domain, int *status, int options) ;
    10.1 --- a/tools/debugger/libxendebug/Makefile	Wed Aug 24 21:50:52 2005 +0000
    10.2 +++ b/tools/debugger/libxendebug/Makefile	Wed Aug 24 23:07:29 2005 +0000
    10.3 @@ -20,7 +20,7 @@ CFLAGS   += $(INCLUDES) -I. -I$(XEN_ROOT
    10.4  CFLAGS   += -Wp,-MD,.$(@F).d
    10.5  DEPS     = .*.d
    10.6  
    10.7 -LDFLAGS  += -L$(XEN_ROOT)/tools/libxc -lxc
    10.8 +LDFLAGS  += -L$(XEN_ROOT)/tools/libxc -lxenctrl
    10.9  
   10.10  LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
   10.11  PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
    11.1 --- a/tools/debugger/libxendebug/xendebug.c	Wed Aug 24 21:50:52 2005 +0000
    11.2 +++ b/tools/debugger/libxendebug/xendebug.c	Wed Aug 24 23:07:29 2005 +0000
    11.3 @@ -12,7 +12,7 @@
    11.4  #include <string.h>
    11.5  #include <errno.h>
    11.6  #include <sys/mman.h>
    11.7 -#include <xc.h>
    11.8 +#include <xenctrl.h>
    11.9  #include "list.h"
   11.10  
   11.11  #if defined(__i386__)
    12.1 --- a/tools/debugger/libxendebug/xendebug.h	Wed Aug 24 21:50:52 2005 +0000
    12.2 +++ b/tools/debugger/libxendebug/xendebug.h	Wed Aug 24 23:07:29 2005 +0000
    12.3 @@ -9,7 +9,7 @@
    12.4  #ifndef _XENDEBUG_H_DEFINED
    12.5  #define _XENDEBUG_H_DEFINED
    12.6  
    12.7 -#include <xc.h>
    12.8 +#include <xenctrl.h>
    12.9  
   12.10  int xendebug_attach(int xc_handle,
   12.11  		    u32 domid,
    13.1 --- a/tools/debugger/pdb/pdb_caml_domain.c	Wed Aug 24 21:50:52 2005 +0000
    13.2 +++ b/tools/debugger/pdb/pdb_caml_domain.c	Wed Aug 24 23:07:29 2005 +0000
    13.3 @@ -6,7 +6,7 @@
    13.4   * PDB's OCaml interface library for debugging domains
    13.5   */
    13.6  
    13.7 -#include <xc.h>
    13.8 +#include <xenctrl.h>
    13.9  #include <xendebug.h>
   13.10  #include <errno.h>
   13.11  #include <stdio.h>
    14.1 --- a/tools/debugger/pdb/pdb_caml_evtchn.c	Wed Aug 24 21:50:52 2005 +0000
    14.2 +++ b/tools/debugger/pdb/pdb_caml_evtchn.c	Wed Aug 24 23:07:29 2005 +0000
    14.3 @@ -6,7 +6,7 @@
    14.4   * PDB's OCaml interface library for event channels
    14.5   */
    14.6  
    14.7 -#include <xc.h>
    14.8 +#include <xenctrl.h>
    14.9  #include <stdio.h>
   14.10  #include <stdlib.h>
   14.11  #include <string.h>
    15.1 --- a/tools/debugger/pdb/pdb_caml_process.c	Wed Aug 24 21:50:52 2005 +0000
    15.2 +++ b/tools/debugger/pdb/pdb_caml_process.c	Wed Aug 24 23:07:29 2005 +0000
    15.3 @@ -15,7 +15,7 @@
    15.4  #include <caml/memory.h>
    15.5  #include <caml/mlvalues.h>
    15.6  
    15.7 -#include <xc.h>
    15.8 +#include <xenctrl.h>
    15.9  #include <xen/xen.h>
   15.10  #include <xen/io/domain_controller.h>
   15.11  #include <xen/linux/privcmd.h>
    16.1 --- a/tools/debugger/pdb/pdb_caml_xc.c	Wed Aug 24 21:50:52 2005 +0000
    16.2 +++ b/tools/debugger/pdb/pdb_caml_xc.c	Wed Aug 24 23:07:29 2005 +0000
    16.3 @@ -6,7 +6,7 @@
    16.4   * PDB's OCaml interface library for debugging domains
    16.5   */
    16.6  
    16.7 -#include <xc.h>
    16.8 +#include <xenctrl.h>
    16.9  #include <xendebug.h>
   16.10  #include <errno.h>
   16.11  #include <stdio.h>
    17.1 --- a/tools/debugger/pdb/pdb_caml_xcs.c	Wed Aug 24 21:50:52 2005 +0000
    17.2 +++ b/tools/debugger/pdb/pdb_caml_xcs.c	Wed Aug 24 23:07:29 2005 +0000
    17.3 @@ -17,7 +17,7 @@
    17.4  #include <sys/types.h>
    17.5  #include <sys/socket.h>
    17.6  #include <errno.h>
    17.7 -#include <xc.h>
    17.8 +#include <xenctrl.h>
    17.9  
   17.10  #include <xen/xen.h>
   17.11  #include <xen/io/domain_controller.h>
    18.1 --- a/tools/debugger/pdb/pdb_xen.c	Wed Aug 24 21:50:52 2005 +0000
    18.2 +++ b/tools/debugger/pdb/pdb_xen.c	Wed Aug 24 23:07:29 2005 +0000
    18.3 @@ -7,7 +7,7 @@
    18.4   * PDB interface library for accessing Xen
    18.5   */
    18.6  
    18.7 -#include <xc.h>
    18.8 +#include <xenctrl.h>
    18.9  #include <stdio.h>
   18.10  #include <stdlib.h>
   18.11  #include <errno.h>
    19.1 --- a/tools/firmware/acpi/acpi2_0.h	Wed Aug 24 21:50:52 2005 +0000
    19.2 +++ b/tools/firmware/acpi/acpi2_0.h	Wed Aug 24 23:07:29 2005 +0000
    19.3 @@ -18,7 +18,7 @@
    19.4  #ifndef _ACPI_2_0_H_
    19.5  #define _ACPI_2_0_H_
    19.6  
    19.7 -#include "xc.h"  // for u8, u16, u32, u64 definition
    19.8 +#include "xenctrl.h"  // for u8, u16, u32, u64 definition
    19.9  
   19.10  #pragma pack (1)
   19.11  
    20.1 --- a/tools/ioemu/hw/i8254.c	Wed Aug 24 21:50:52 2005 +0000
    20.2 +++ b/tools/ioemu/hw/i8254.c	Wed Aug 24 23:07:29 2005 +0000
    20.3 @@ -22,7 +22,7 @@
    20.4   * THE SOFTWARE.
    20.5   */
    20.6  #include "vl.h"
    20.7 -#include "xc.h"
    20.8 +#include "xenctrl.h"
    20.9  #include <io/ioreq.h>
   20.10  
   20.11  //#define DEBUG_PIT
    21.1 --- a/tools/ioemu/hw/i8259.c	Wed Aug 24 21:50:52 2005 +0000
    21.2 +++ b/tools/ioemu/hw/i8259.c	Wed Aug 24 23:07:29 2005 +0000
    21.3 @@ -22,7 +22,7 @@
    21.4   * THE SOFTWARE.
    21.5   */
    21.6  #include "vl.h"
    21.7 -#include "xc.h"
    21.8 +#include "xenctrl.h"
    21.9  #include <io/ioreq.h>
   21.10  
   21.11  /* debug PIC */
    22.1 --- a/tools/ioemu/hw/ioapic.h	Wed Aug 24 21:50:52 2005 +0000
    22.2 +++ b/tools/ioemu/hw/ioapic.h	Wed Aug 24 23:07:29 2005 +0000
    22.3 @@ -26,7 +26,7 @@
    22.4  #ifndef __IOAPIC_H
    22.5  #define __IOAPIC_H
    22.6  
    22.7 -#include "xc.h"
    22.8 +#include "xenctrl.h"
    22.9  #include <io/ioreq.h>
   22.10  #include <io/vmx_vlapic.h>
   22.11  
    23.1 --- a/tools/ioemu/target-i386-dm/Makefile	Wed Aug 24 21:50:52 2005 +0000
    23.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Wed Aug 24 23:07:29 2005 +0000
    23.3 @@ -188,7 +188,7 @@ endif
    23.4  #########################################################
    23.5  
    23.6  DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DAPIC_SUPPORT
    23.7 -LIBS+=-lm -L../../libxc -lxc
    23.8 +LIBS+=-lm -L../../libxc -lxenctrl
    23.9  ifndef CONFIG_USER_ONLY
   23.10  LIBS+=-lz
   23.11  endif
    24.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Wed Aug 24 21:50:52 2005 +0000
    24.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Wed Aug 24 23:07:29 2005 +0000
    24.3 @@ -47,7 +47,7 @@
    24.4  #include <fcntl.h>
    24.5  #include <sys/ioctl.h>
    24.6  
    24.7 -#include "xc.h"
    24.8 +#include "xenctrl.h"
    24.9  #include <io/ioreq.h>
   24.10  
   24.11  #include "cpu.h"
    25.1 --- a/tools/ioemu/vl.c	Wed Aug 24 21:50:52 2005 +0000
    25.2 +++ b/tools/ioemu/vl.c	Wed Aug 24 23:07:29 2005 +0000
    25.3 @@ -72,7 +72,7 @@
    25.4  #endif
    25.5  #endif /* CONFIG_SDL */
    25.6  
    25.7 -#include "xc.h"
    25.8 +#include "xenctrl.h"
    25.9  #include "exec-all.h"
   25.10  
   25.11  //#define DO_TB_FLUSH
    26.1 --- a/tools/libxc/Makefile	Wed Aug 24 21:50:52 2005 +0000
    26.2 +++ b/tools/libxc/Makefile	Wed Aug 24 23:07:29 2005 +0000
    26.3 @@ -48,8 +48,8 @@ DEPS     = .*.d
    26.4  LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
    26.5  PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
    26.6  
    26.7 -LIB      := libxc.a libxc-pic.a
    26.8 -LIB      += libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
    26.9 +LIB      := libxenctrl.a libxenctrl-pic.a
   26.10 +LIB      += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
   26.11  
   26.12  all: build
   26.13  build: check-for-zlib mk-symlinks
   26.14 @@ -77,11 +77,11 @@ mk-symlinks:
   26.15  install: build
   26.16  	[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
   26.17  	[ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
   26.18 -	$(INSTALL_PROG) libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   26.19 -	$(INSTALL_DATA) libxc.a $(DESTDIR)/usr/$(LIBDIR)
   26.20 -	ln -sf libxc.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxc.so.$(MAJOR)
   26.21 -	ln -sf libxc.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxc.so
   26.22 -	$(INSTALL_DATA) xc.h $(DESTDIR)/usr/include
   26.23 +	$(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   26.24 +	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
   26.25 +	ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
   26.26 +	ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
   26.27 +	$(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include/xen
   26.28  
   26.29  .PHONY: TAGS clean rpm install all
   26.30  
   26.31 @@ -100,18 +100,18 @@ rpm: build
   26.32  	mv staging/i386/*.rpm .
   26.33  	rm -rf staging
   26.34  
   26.35 -libxc.a: $(LIB_OBJS)
   26.36 -	$(AR) rc $@ $^
   26.37 -
   26.38 -libxc-pic.a: $(PIC_OBJS)
   26.39 +libxenctrl.a: $(LIB_OBJS)
   26.40  	$(AR) rc $@ $^
   26.41  
   26.42 -libxc.so: libxc.so.$(MAJOR)
   26.43 +libxenctrl-pic.a: $(PIC_OBJS)
   26.44 +	$(AR) rc $@ $^
   26.45 +
   26.46 +libxenctrl.so: libxenctrl.so.$(MAJOR)
   26.47  	ln -sf $< $@
   26.48 -libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
   26.49 +libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
   26.50  	ln -sf $< $@
   26.51  
   26.52 -libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
   26.53 -	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -lz
   26.54 +libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
   26.55 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR) -shared -o $@ $^ -lz
   26.56  
   26.57  -include $(DEPS)
    27.1 --- a/tools/libxc/xc.h	Wed Aug 24 21:50:52 2005 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,558 +0,0 @@
    27.4 -/******************************************************************************
    27.5 - * xc.h
    27.6 - * 
    27.7 - * A library for low-level access to the Xen control interfaces.
    27.8 - * 
    27.9 - * Copyright (c) 2003-2004, K A Fraser.
   27.10 - */
   27.11 -
   27.12 -#ifndef __XC_H__
   27.13 -#define __XC_H__
   27.14 -
   27.15 -#include <stdint.h>
   27.16 -
   27.17 -typedef uint8_t            u8;
   27.18 -typedef uint16_t           u16;
   27.19 -typedef uint32_t           u32;
   27.20 -typedef uint64_t           u64;
   27.21 -typedef int8_t             s8;
   27.22 -typedef int16_t            s16;
   27.23 -typedef int32_t            s32;
   27.24 -typedef int64_t            s64;
   27.25 -
   27.26 -#include <sys/ptrace.h>
   27.27 -#include <xen/xen.h>
   27.28 -#include <xen/dom0_ops.h>
   27.29 -#include <xen/event_channel.h>
   27.30 -#include <xen/sched_ctl.h>
   27.31 -#include <xen/acm.h>
   27.32 -
   27.33 -#ifdef __ia64__
   27.34 -#define XC_PAGE_SHIFT           14
   27.35 -#else
   27.36 -#define XC_PAGE_SHIFT           12
   27.37 -#endif
   27.38 -#define XC_PAGE_SIZE            (1UL << XC_PAGE_SHIFT)
   27.39 -#define XC_PAGE_MASK            (~(XC_PAGE_SIZE-1))
   27.40 -
   27.41 -/*
   27.42 - *  DEFINITIONS FOR CPU BARRIERS
   27.43 - */ 
   27.44 -
   27.45 -#if defined(__i386__)
   27.46 -#define mb()  __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
   27.47 -#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
   27.48 -#define wmb() __asm__ __volatile__ ( "" : : : "memory")
   27.49 -#elif defined(__x86_64__)
   27.50 -#define mb()  __asm__ __volatile__ ( "mfence" : : : "memory")
   27.51 -#define rmb() __asm__ __volatile__ ( "lfence" : : : "memory")
   27.52 -#define wmb() __asm__ __volatile__ ( "" : : : "memory")
   27.53 -#elif defined(__ia64__)
   27.54 -/* FIXME */
   27.55 -#define mb()
   27.56 -#define rmb()
   27.57 -#define wmb()
   27.58 -#else
   27.59 -#error "Define barriers"
   27.60 -#endif
   27.61 -
   27.62 -/*
   27.63 - *  INITIALIZATION FUNCTIONS
   27.64 - */ 
   27.65 -
   27.66 -/**
   27.67 - * This function opens a handle to the hypervisor interface.  This function can
   27.68 - * be called multiple times within a single process.  Multiple processes can
   27.69 - * have an open hypervisor interface at the same time.
   27.70 - *
   27.71 - * Each call to this function should have a corresponding call to
   27.72 - * xc_interface_close().
   27.73 - *
   27.74 - * This function can fail if the caller does not have superuser permission or
   27.75 - * if a Xen-enabled kernel is not currently running.
   27.76 - *
   27.77 - * @return a handle to the hypervisor interface or -1 on failure
   27.78 - */
   27.79 -int xc_interface_open(void);
   27.80 -
   27.81 -/**
   27.82 - * This function closes an open hypervisor interface.
   27.83 - *
   27.84 - * This function can fail if the handle does not represent an open interface or
   27.85 - * if there were problems closing the interface.
   27.86 - *
   27.87 - * @parm xc_handle a handle to an open hypervisor interface
   27.88 - * @return 0 on success, -1 otherwise.
   27.89 - */
   27.90 -int xc_interface_close(int xc_handle);
   27.91 -
   27.92 -/*
   27.93 - * DOMAIN DEBUGGING FUNCTIONS
   27.94 - */
   27.95 -
   27.96 -typedef struct xc_core_header {
   27.97 -    unsigned int xch_magic;
   27.98 -    unsigned int xch_nr_vcpus;
   27.99 -    unsigned int xch_nr_pages;
  27.100 -    unsigned int xch_ctxt_offset;
  27.101 -    unsigned int xch_index_offset;
  27.102 -    unsigned int xch_pages_offset;
  27.103 -} xc_core_header_t;
  27.104 -
  27.105 -
  27.106 -long xc_ptrace(enum __ptrace_request request, 
  27.107 -               u32  domid,
  27.108 -               long addr, 
  27.109 -               long data);
  27.110 -
  27.111 -long xc_ptrace_core(enum __ptrace_request request, 
  27.112 -                    u32 domid, 
  27.113 -                    long addr, 
  27.114 -                    long data);
  27.115 -
  27.116 -int xc_waitdomain(int domain, 
  27.117 -                  int *status, 
  27.118 -                  int options);
  27.119 -
  27.120 -int xc_waitdomain_core(int domain, 
  27.121 -                       int *status, 
  27.122 -                       int options);
  27.123 -
  27.124 -/*
  27.125 - * DOMAIN MANAGEMENT FUNCTIONS
  27.126 - */
  27.127 -
  27.128 -typedef struct {
  27.129 -    u32           domid;
  27.130 -    u32           ssidref;
  27.131 -    unsigned int  dying:1, crashed:1, shutdown:1, 
  27.132 -                  paused:1, blocked:1, running:1;
  27.133 -    unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
  27.134 -    unsigned long nr_pages;
  27.135 -    unsigned long shared_info_frame;
  27.136 -    u64           cpu_time;
  27.137 -    unsigned long max_memkb;
  27.138 -    unsigned int  vcpus;
  27.139 -    s32           vcpu_to_cpu[MAX_VIRT_CPUS];
  27.140 -    cpumap_t      cpumap[MAX_VIRT_CPUS];
  27.141 -} xc_dominfo_t;
  27.142 -
  27.143 -typedef dom0_getdomaininfo_t xc_domaininfo_t;
  27.144 -int xc_domain_create(int xc_handle, 
  27.145 -                     u32 ssidref,
  27.146 -                     u32 *pdomid);
  27.147 -
  27.148 -
  27.149 -int xc_domain_dumpcore(int xc_handle, 
  27.150 -                       u32 domid,
  27.151 -                       const char *corename);
  27.152 -
  27.153 -
  27.154 -/**
  27.155 - * This function pauses a domain. A paused domain still exists in memory
  27.156 - * however it does not receive any timeslices from the hypervisor.
  27.157 - *
  27.158 - * @parm xc_handle a handle to an open hypervisor interface
  27.159 - * @parm domid the domain id to pause
  27.160 - * @return 0 on success, -1 on failure.
  27.161 - */
  27.162 -int xc_domain_pause(int xc_handle, 
  27.163 -                    u32 domid);
  27.164 -/**
  27.165 - * This function unpauses a domain.  The domain should have been previously
  27.166 - * paused.
  27.167 - *
  27.168 - * @parm xc_handle a handle to an open hypervisor interface
  27.169 - * @parm domid the domain id to unpause
  27.170 - * return 0 on success, -1 on failure
  27.171 - */
  27.172 -int xc_domain_unpause(int xc_handle, 
  27.173 -                      u32 domid);
  27.174 -
  27.175 -/**
  27.176 - * This function will destroy a domain.  Destroying a domain removes the domain
  27.177 - * completely from memory.  This function should be called after sending the
  27.178 - * domain a SHUTDOWN control message to free up the domain resources.
  27.179 - *
  27.180 - * @parm xc_handle a handle to an open hypervisor interface
  27.181 - * @parm domid the domain id to destroy
  27.182 - * @return 0 on success, -1 on failure
  27.183 - */
  27.184 -int xc_domain_destroy(int xc_handle, 
  27.185 -                      u32 domid);
  27.186 -int xc_domain_pincpu(int xc_handle,
  27.187 -                     u32 domid,
  27.188 -                     int vcpu,
  27.189 -                     cpumap_t *cpumap);
  27.190 -/**
  27.191 - * This function will return information about one or more domains. It is
  27.192 - * designed to iterate over the list of domains. If a single domain is
  27.193 - * requested, this function will return the next domain in the list - if
  27.194 - * one exists. It is, therefore, important in this case to make sure the
  27.195 - * domain requested was the one returned.
  27.196 - *
  27.197 - * @parm xc_handle a handle to an open hypervisor interface
  27.198 - * @parm first_domid the first domain to enumerate information from.  Domains
  27.199 - *                   are currently enumerate in order of creation.
  27.200 - * @parm max_doms the number of elements in info
  27.201 - * @parm info an array of max_doms size that will contain the information for
  27.202 - *            the enumerated domains.
  27.203 - * @return the number of domains enumerated or -1 on error
  27.204 - */
  27.205 -int xc_domain_getinfo(int xc_handle,
  27.206 -                      u32 first_domid, 
  27.207 -                      unsigned int max_doms,
  27.208 -                      xc_dominfo_t *info);
  27.209 -
  27.210 -/**
  27.211 - * This function will return information about one or more domains, using a
  27.212 - * single hypercall.  The domain information will be stored into the supplied
  27.213 - * array of xc_domaininfo_t structures.
  27.214 - *
  27.215 - * @parm xc_handle a handle to an open hypervisor interface
  27.216 - * @parm first_domain the first domain to enumerate information from.
  27.217 - *                    Domains are currently enumerate in order of creation.
  27.218 - * @parm max_domains the number of elements in info
  27.219 - * @parm info an array of max_doms size that will contain the information for
  27.220 - *            the enumerated domains.
  27.221 - * @return the number of domains enumerated or -1 on error
  27.222 - */
  27.223 -int xc_domain_getinfolist(int xc_handle,
  27.224 -                          u32 first_domain,
  27.225 -                          unsigned int max_domains,
  27.226 -                          xc_domaininfo_t *info);
  27.227 -
  27.228 -/**
  27.229 - * This function returns information about one domain.  This information is
  27.230 - * more detailed than the information from xc_domain_getinfo().
  27.231 - *
  27.232 - * @parm xc_handle a handle to an open hypervisor interface
  27.233 - * @parm domid the domain to get information from
  27.234 - * @parm info a pointer to an xc_domaininfo_t to store the domain information
  27.235 - * @parm ctxt a pointer to a structure to store the execution context of the
  27.236 - *            domain
  27.237 - * @return 0 on success, -1 on failure
  27.238 - */
  27.239 -int xc_domain_get_vcpu_context(int xc_handle,
  27.240 -                               u32 domid,
  27.241 -                               u32 vcpu,
  27.242 -                               vcpu_guest_context_t *ctxt);
  27.243 -
  27.244 -int xc_domain_setcpuweight(int xc_handle,
  27.245 -                           u32 domid,
  27.246 -                           float weight);
  27.247 -long long xc_domain_get_cpu_usage(int xc_handle,
  27.248 -                                  domid_t domid,
  27.249 -                                  int vcpu);
  27.250 -
  27.251 -
  27.252 -typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
  27.253 -int xc_shadow_control(int xc_handle,
  27.254 -                      u32 domid, 
  27.255 -                      unsigned int sop,
  27.256 -                      unsigned long *dirty_bitmap,
  27.257 -                      unsigned long pages,
  27.258 -                      xc_shadow_control_stats_t *stats);
  27.259 -
  27.260 -
  27.261 -#define XCFLAGS_VERBOSE   1
  27.262 -#define XCFLAGS_LIVE      2
  27.263 -#define XCFLAGS_DEBUG     4
  27.264 -#define XCFLAGS_CONFIGURE 8
  27.265 -
  27.266 -struct XcIOContext;
  27.267 -
  27.268 -/**
  27.269 - * This function will save a domain running Linux.
  27.270 - *
  27.271 - * @parm xc_handle a handle to an open hypervisor interface
  27.272 - * @parm fd the file descriptor to save a domain to
  27.273 - * @parm dom the id of the domain
  27.274 - * @return 0 on success, -1 on failure
  27.275 - */
  27.276 -int xc_linux_save(int xc_handle, int fd, u32 dom);
  27.277 -
  27.278 -/**
  27.279 - * This function will restore a saved domain running Linux.
  27.280 - *
  27.281 - * @parm xc_handle a handle to an open hypervisor interface
  27.282 - * @parm fd the file descriptor to restore a domain from
  27.283 - * @parm dom the id of the domain
  27.284 - * @parm nr_pfns the number of pages
  27.285 - * @parm store_evtchn the store event channel for this domain to use
  27.286 - * @parm store_mfn returned with the mfn of the store page
  27.287 - * @return 0 on success, -1 on failure
  27.288 - */
  27.289 -int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
  27.290 -		     unsigned int store_evtchn, unsigned long *store_mfn);
  27.291 -
  27.292 -int xc_linux_build(int xc_handle,
  27.293 -                   u32 domid,
  27.294 -                   const char *image_name,
  27.295 -                   const char *ramdisk_name,
  27.296 -                   const char *cmdline,
  27.297 -                   unsigned int control_evtchn,
  27.298 -                   unsigned long flags,
  27.299 -                   unsigned int vcpus,
  27.300 -                   unsigned int store_evtchn,
  27.301 -                   unsigned long *store_mfn);
  27.302 -
  27.303 -struct mem_map;
  27.304 -int xc_vmx_build(int xc_handle,
  27.305 -                 u32 domid,
  27.306 -                 int memsize,
  27.307 -                 const char *image_name,
  27.308 -                 struct mem_map *memmap,
  27.309 -                 const char *ramdisk_name,
  27.310 -                 const char *cmdline,
  27.311 -                 unsigned int control_evtchn,
  27.312 -                 unsigned long flags,
  27.313 -                 unsigned int vcpus,
  27.314 -                 unsigned int store_evtchn,
  27.315 -                 unsigned long *store_mfn);
  27.316 -
  27.317 -int xc_bvtsched_global_set(int xc_handle,
  27.318 -                           unsigned long ctx_allow);
  27.319 -
  27.320 -int xc_bvtsched_domain_set(int xc_handle,
  27.321 -                           u32 domid,
  27.322 -                           u32 mcuadv,
  27.323 -                           int warpback,
  27.324 -                           s32 warpvalue,
  27.325 -                           long long warpl,
  27.326 -                           long long warpu);
  27.327 -
  27.328 -int xc_bvtsched_global_get(int xc_handle,
  27.329 -                           unsigned long *ctx_allow);
  27.330 -
  27.331 -int xc_bvtsched_domain_get(int xc_handle,
  27.332 -                           u32 domid,
  27.333 -                           u32 *mcuadv,
  27.334 -                           int *warpback,
  27.335 -                           s32 *warpvalue,
  27.336 -                           long long *warpl,
  27.337 -                           long long *warpu);
  27.338 -
  27.339 -int xc_sedf_domain_set(int xc_handle,
  27.340 -                          u32 domid,
  27.341 -                          u64 period, u64 slice, u64 latency, u16 extratime, u16 weight);
  27.342 -
  27.343 -int xc_sedf_domain_get(int xc_handle,
  27.344 -                          u32 domid,
  27.345 -                          u64* period, u64 *slice, u64 *latency, u16 *extratime, u16* weight);
  27.346 -
  27.347 -typedef evtchn_status_t xc_evtchn_status_t;
  27.348 -
  27.349 -/*
  27.350 - * EVENT CHANNEL FUNCTIONS
  27.351 - */
  27.352 -
  27.353 -/**
  27.354 - * This function allocates an unbound port.  Ports are named endpoints used for
  27.355 - * interdomain communication.  This function is most useful in opening a
  27.356 - * well-known port within a domain to receive events on.
  27.357 - *
  27.358 - * @parm xc_handle a handle to an open hypervisor interface
  27.359 - * @parm dom the ID of the domain.  This maybe DOMID_SELF
  27.360 - * @parm port a pointer to a port.  This is an in/out parameter.  If *port is
  27.361 - *            0, then a new port will be assigned, if port is > 0 then that
  27.362 - *            port is allocated if the port is unallocated.
  27.363 - * @return 0 on success, -1 on failure
  27.364 - */
  27.365 -int xc_evtchn_alloc_unbound(int xc_handle,
  27.366 -                            u32 dom,
  27.367 -                            int *port);
  27.368 -
  27.369 -/**
  27.370 - * This function creates a pair of ports between two domains.  A port can only
  27.371 - * be bound once within a domain.
  27.372 - *
  27.373 - * @parm xc_handle a handle to an open hypervisor interface
  27.374 - * @parm dom1 one of the two domains to connect.  Can be DOMID_SELF.
  27.375 - * @parm dom2 the other domain to connect.  Can be DOMID_SELF.
  27.376 - * @parm port1 an in/out parameter.  If > 0, then try to connect *port.  If
  27.377 - *             0, then allocate a new port and store the port in *port.
  27.378 - * @parm port2 the port connected on port2.  This parameter behaves the same
  27.379 - *             way as port1.
  27.380 - * @return 0 on success, -1 on error.
  27.381 - */
  27.382 -int xc_evtchn_bind_interdomain(int xc_handle,
  27.383 -                               u32 dom1,
  27.384 -                               u32 dom2,
  27.385 -                               int *port1,
  27.386 -                               int *port2);
  27.387 -int xc_evtchn_bind_virq(int xc_handle,
  27.388 -                        int virq,
  27.389 -                        int *port);
  27.390 -
  27.391 -/**
  27.392 - * This function will close a single port on an event channel.
  27.393 - *
  27.394 - * @parm xc_handle a handle to an open hypervisor interface
  27.395 - * @parm dom the domain that the port exists on.  May be DOMID_SELF.
  27.396 - * @parm port the port to close
  27.397 - * @return 0 on success, -1 on error
  27.398 - */
  27.399 -int xc_evtchn_close(int xc_handle,
  27.400 -                    u32 dom,   /* may be DOMID_SELF */
  27.401 -                    int port);
  27.402 -
  27.403 -/**
  27.404 - * This function generates a notify event on a bound port.
  27.405 - *
  27.406 - * Notifies can be read within Linux by opening /dev/xen/evtchn and reading
  27.407 - * a 16 bit value.  The result will be the port the event occurred on.  When
  27.408 - * events occur, the port is masked until the 16 bit port value is written back
  27.409 - * to the file.  When /dev/xen/evtchn is opened, it has to be bound via an
  27.410 - * ioctl to each port to listen on.  The ioctl for binding is _IO('E', 2).  The
  27.411 - * parameter is the port to listen on.
  27.412 - *
  27.413 - * @parm xc_handle a handle to an open hypervisor interface
  27.414 - * @parm local_port the port to generate the notify on
  27.415 - * @return 0 on success, -1 on error
  27.416 - */
  27.417 -int xc_evtchn_send(int xc_handle,
  27.418 -                   int local_port);
  27.419 -int xc_evtchn_status(int xc_handle,
  27.420 -                     u32 dom, /* may be DOMID_SELF */
  27.421 -                     int port,
  27.422 -                     xc_evtchn_status_t *status);
  27.423 -
  27.424 -int xc_physdev_pci_access_modify(int xc_handle,
  27.425 -                                 u32 domid,
  27.426 -                                 int bus,
  27.427 -                                 int dev,
  27.428 -                                 int func,
  27.429 -                                 int enable);
  27.430 -
  27.431 -int xc_readconsolering(int xc_handle,
  27.432 -                       char **pbuffer,
  27.433 -                       unsigned int *pnr_chars, 
  27.434 -                       int clear);
  27.435 -
  27.436 -typedef dom0_physinfo_t xc_physinfo_t;
  27.437 -int xc_physinfo(int xc_handle,
  27.438 -                xc_physinfo_t *info);
  27.439 -
  27.440 -int xc_sched_id(int xc_handle,
  27.441 -                int *sched_id);
  27.442 -
  27.443 -int xc_domain_setmaxmem(int xc_handle,
  27.444 -                        u32 domid, 
  27.445 -                        unsigned int max_memkb);
  27.446 -
  27.447 -int xc_domain_memory_increase_reservation(int xc_handle,
  27.448 -                                          u32 domid, 
  27.449 -                                          unsigned int mem_kb);
  27.450 -
  27.451 -typedef dom0_perfc_desc_t xc_perfc_desc_t;
  27.452 -/* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
  27.453 -int xc_perfc_control(int xc_handle,
  27.454 -                     u32 op,
  27.455 -                     xc_perfc_desc_t *desc);
  27.456 -
  27.457 -/* read/write msr */
  27.458 -long long xc_msr_read(int xc_handle, int cpu_mask, int msr);
  27.459 -int xc_msr_write(int xc_handle, int cpu_mask, int msr, unsigned int low,
  27.460 -                  unsigned int high);
  27.461 -
  27.462 -/**
  27.463 - * Memory maps a range within one domain to a local address range.  Mappings
  27.464 - * should be unmapped with munmap and should follow the same rules as mmap
  27.465 - * regarding page alignment.  Returns NULL on failure.
  27.466 - *
  27.467 - * In Linux, the ring queue for the control channel is accessible by mapping
  27.468 - * the shared_info_frame (from xc_domain_getinfo()) + 2048.  The structure
  27.469 - * stored there is of type control_if_t.
  27.470 - *
  27.471 - * @parm xc_handle a handle on an open hypervisor interface
  27.472 - * @parm dom the domain to map memory from
  27.473 - * @parm size the amount of memory to map (in multiples of page size)
  27.474 - * @parm prot same flag as in mmap().
  27.475 - * @parm mfn the frame address to map.
  27.476 - */
  27.477 -void *xc_map_foreign_range(int xc_handle, u32 dom,
  27.478 -                            int size, int prot,
  27.479 -                            unsigned long mfn );
  27.480 -
  27.481 -void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
  27.482 -                           unsigned long *arr, int num );
  27.483 -
  27.484 -int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf, 
  27.485 -                    unsigned long max_pfns);
  27.486 -
  27.487 -int xc_ia64_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf, 
  27.488 -                    unsigned int start_page, unsigned int nr_pages);
  27.489 -
  27.490 -/*\
  27.491 - *  GRANT TABLE FUNCTIONS
  27.492 -\*/ 
  27.493 -
  27.494 -/**
  27.495 - * This function opens a handle to the more restricted grant table hypervisor
  27.496 - * interface. This may be used where the standard interface is not
  27.497 - * available because the domain is not privileged.
  27.498 - * This function can  be called multiple times within a single process.
  27.499 - * Multiple processes can have an open hypervisor interface at the same time.
  27.500 - *
  27.501 - * Each call to this function should have a corresponding call to
  27.502 - * xc_grant_interface_close().
  27.503 - *
  27.504 - * This function can fail if a Xen-enabled kernel is not currently running.
  27.505 - *
  27.506 - * @return a handle to the hypervisor grant table interface or -1 on failure
  27.507 - */
  27.508 -int xc_grant_interface_open(void);
  27.509 -
  27.510 -/**
  27.511 - * This function closes an open grant table hypervisor interface.
  27.512 - *
  27.513 - * This function can fail if the handle does not represent an open interface or
  27.514 - * if there were problems closing the interface.
  27.515 - *
  27.516 - * @parm xc_handle a handle to an open grant table hypervisor interface
  27.517 - * @return 0 on success, -1 otherwise.
  27.518 - */
  27.519 -int xc_grant_interface_close(int xc_handle);
  27.520 -
  27.521 -int xc_gnttab_map_grant_ref(int  xc_handle,
  27.522 -                            u64  host_virt_addr,
  27.523 -                            u32  dom,
  27.524 -                            u16  ref,
  27.525 -                            u16  flags,
  27.526 -                            s16 *handle,
  27.527 -                            u64 *dev_bus_addr);
  27.528 -
  27.529 -int xc_gnttab_unmap_grant_ref(int  xc_handle,
  27.530 -                              u64  host_virt_addr,
  27.531 -                              u64  dev_bus_addr,
  27.532 -                              u16  handle,
  27.533 -                              s16 *status);
  27.534 -
  27.535 -int xc_gnttab_setup_table(int        xc_handle,
  27.536 -                          u32        dom,
  27.537 -                          u16        nr_frames,
  27.538 -                          s16       *status,
  27.539 -                          unsigned long **frame_list);
  27.540 -
  27.541 -/* Grant debug builds only: */
  27.542 -int xc_gnttab_dump_table(int        xc_handle,
  27.543 -                         u32        dom,
  27.544 -                         s16       *status);
  27.545 -
  27.546 -/* Get current total pages allocated to a domain. */
  27.547 -long xc_get_tot_pages(int xc_handle, u32 domid);
  27.548 -
  27.549 -/* Execute a privileged dom0 operation. */
  27.550 -int xc_dom0_op(int xc_handle, dom0_op_t *op);
  27.551 -
  27.552 -/* Initializes the store (for dom0)
  27.553 -   remote_port should be the remote end of a bound interdomain channel between
  27.554 -   the store and dom0.
  27.555 -
  27.556 -   This function returns a shared frame that should be passed to
  27.557 -   xs_introduce_domain
  27.558 - */
  27.559 -long xc_init_store(int xc_handle, int remote_port);
  27.560 -
  27.561 -#endif /* __XC_H__ */
    28.1 --- a/tools/libxc/xc_private.h	Wed Aug 24 21:50:52 2005 +0000
    28.2 +++ b/tools/libxc/xc_private.h	Wed Aug 24 23:07:29 2005 +0000
    28.3 @@ -14,7 +14,7 @@
    28.4  #include <errno.h>
    28.5  #include <string.h>
    28.6  
    28.7 -#include "xc.h"
    28.8 +#include "xenctrl.h"
    28.9  
   28.10  #include <xen/linux/privcmd.h>
   28.11  
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/tools/libxc/xenctrl.h	Wed Aug 24 23:07:29 2005 +0000
    29.3 @@ -0,0 +1,558 @@
    29.4 +/******************************************************************************
    29.5 + * xenctrl.h
    29.6 + * 
    29.7 + * A library for low-level access to the Xen control interfaces.
    29.8 + * 
    29.9 + * Copyright (c) 2003-2004, K A Fraser.
   29.10 + */
   29.11 +
   29.12 +#ifndef __XC_H__
   29.13 +#define __XC_H__
   29.14 +
   29.15 +#include <stdint.h>
   29.16 +
   29.17 +typedef uint8_t            u8;
   29.18 +typedef uint16_t           u16;
   29.19 +typedef uint32_t           u32;
   29.20 +typedef uint64_t           u64;
   29.21 +typedef int8_t             s8;
   29.22 +typedef int16_t            s16;
   29.23 +typedef int32_t            s32;
   29.24 +typedef int64_t            s64;
   29.25 +
   29.26 +#include <sys/ptrace.h>
   29.27 +#include <xen/xen.h>
   29.28 +#include <xen/dom0_ops.h>
   29.29 +#include <xen/event_channel.h>
   29.30 +#include <xen/sched_ctl.h>
   29.31 +#include <xen/acm.h>
   29.32 +
   29.33 +#ifdef __ia64__
   29.34 +#define XC_PAGE_SHIFT           14
   29.35 +#else
   29.36 +#define XC_PAGE_SHIFT           12
   29.37 +#endif
   29.38 +#define XC_PAGE_SIZE            (1UL << XC_PAGE_SHIFT)
   29.39 +#define XC_PAGE_MASK            (~(XC_PAGE_SIZE-1))
   29.40 +
   29.41 +/*
   29.42 + *  DEFINITIONS FOR CPU BARRIERS
   29.43 + */ 
   29.44 +
   29.45 +#if defined(__i386__)
   29.46 +#define mb()  __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
   29.47 +#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
   29.48 +#define wmb() __asm__ __volatile__ ( "" : : : "memory")
   29.49 +#elif defined(__x86_64__)
   29.50 +#define mb()  __asm__ __volatile__ ( "mfence" : : : "memory")
   29.51 +#define rmb() __asm__ __volatile__ ( "lfence" : : : "memory")
   29.52 +#define wmb() __asm__ __volatile__ ( "" : : : "memory")
   29.53 +#elif defined(__ia64__)
   29.54 +/* FIXME */
   29.55 +#define mb()
   29.56 +#define rmb()
   29.57 +#define wmb()
   29.58 +#else
   29.59 +#error "Define barriers"
   29.60 +#endif
   29.61 +
   29.62 +/*
   29.63 + *  INITIALIZATION FUNCTIONS
   29.64 + */ 
   29.65 +
   29.66 +/**
   29.67 + * This function opens a handle to the hypervisor interface.  This function can
   29.68 + * be called multiple times within a single process.  Multiple processes can
   29.69 + * have an open hypervisor interface at the same time.
   29.70 + *
   29.71 + * Each call to this function should have a corresponding call to
   29.72 + * xc_interface_close().
   29.73 + *
   29.74 + * This function can fail if the caller does not have superuser permission or
   29.75 + * if a Xen-enabled kernel is not currently running.
   29.76 + *
   29.77 + * @return a handle to the hypervisor interface or -1 on failure
   29.78 + */
   29.79 +int xc_interface_open(void);
   29.80 +
   29.81 +/**
   29.82 + * This function closes an open hypervisor interface.
   29.83 + *
   29.84 + * This function can fail if the handle does not represent an open interface or
   29.85 + * if there were problems closing the interface.
   29.86 + *
   29.87 + * @parm xc_handle a handle to an open hypervisor interface
   29.88 + * @return 0 on success, -1 otherwise.
   29.89 + */
   29.90 +int xc_interface_close(int xc_handle);
   29.91 +
   29.92 +/*
   29.93 + * DOMAIN DEBUGGING FUNCTIONS
   29.94 + */
   29.95 +
   29.96 +typedef struct xc_core_header {
   29.97 +    unsigned int xch_magic;
   29.98 +    unsigned int xch_nr_vcpus;
   29.99 +    unsigned int xch_nr_pages;
  29.100 +    unsigned int xch_ctxt_offset;
  29.101 +    unsigned int xch_index_offset;
  29.102 +    unsigned int xch_pages_offset;
  29.103 +} xc_core_header_t;
  29.104 +
  29.105 +
  29.106 +long xc_ptrace(enum __ptrace_request request, 
  29.107 +               u32  domid,
  29.108 +               long addr, 
  29.109 +               long data);
  29.110 +
  29.111 +long xc_ptrace_core(enum __ptrace_request request, 
  29.112 +                    u32 domid, 
  29.113 +                    long addr, 
  29.114 +                    long data);
  29.115 +
  29.116 +int xc_waitdomain(int domain, 
  29.117 +                  int *status, 
  29.118 +                  int options);
  29.119 +
  29.120 +int xc_waitdomain_core(int domain, 
  29.121 +                       int *status, 
  29.122 +                       int options);
  29.123 +
  29.124 +/*
  29.125 + * DOMAIN MANAGEMENT FUNCTIONS
  29.126 + */
  29.127 +
  29.128 +typedef struct {
  29.129 +    u32           domid;
  29.130 +    u32           ssidref;
  29.131 +    unsigned int  dying:1, crashed:1, shutdown:1, 
  29.132 +                  paused:1, blocked:1, running:1;
  29.133 +    unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
  29.134 +    unsigned long nr_pages;
  29.135 +    unsigned long shared_info_frame;
  29.136 +    u64           cpu_time;
  29.137 +    unsigned long max_memkb;
  29.138 +    unsigned int  vcpus;
  29.139 +    s32           vcpu_to_cpu[MAX_VIRT_CPUS];
  29.140 +    cpumap_t      cpumap[MAX_VIRT_CPUS];
  29.141 +} xc_dominfo_t;
  29.142 +
  29.143 +typedef dom0_getdomaininfo_t xc_domaininfo_t;
  29.144 +int xc_domain_create(int xc_handle, 
  29.145 +                     u32 ssidref,
  29.146 +                     u32 *pdomid);
  29.147 +
  29.148 +
  29.149 +int xc_domain_dumpcore(int xc_handle, 
  29.150 +                       u32 domid,
  29.151 +                       const char *corename);
  29.152 +
  29.153 +
  29.154 +/**
  29.155 + * This function pauses a domain. A paused domain still exists in memory
  29.156 + * however it does not receive any timeslices from the hypervisor.
  29.157 + *
  29.158 + * @parm xc_handle a handle to an open hypervisor interface
  29.159 + * @parm domid the domain id to pause
  29.160 + * @return 0 on success, -1 on failure.
  29.161 + */
  29.162 +int xc_domain_pause(int xc_handle, 
  29.163 +                    u32 domid);
  29.164 +/**
  29.165 + * This function unpauses a domain.  The domain should have been previously
  29.166 + * paused.
  29.167 + *
  29.168 + * @parm xc_handle a handle to an open hypervisor interface
  29.169 + * @parm domid the domain id to unpause
  29.170 + * return 0 on success, -1 on failure
  29.171 + */
  29.172 +int xc_domain_unpause(int xc_handle, 
  29.173 +                      u32 domid);
  29.174 +
  29.175 +/**
  29.176 + * This function will destroy a domain.  Destroying a domain removes the domain
  29.177 + * completely from memory.  This function should be called after sending the
  29.178 + * domain a SHUTDOWN control message to free up the domain resources.
  29.179 + *
  29.180 + * @parm xc_handle a handle to an open hypervisor interface
  29.181 + * @parm domid the domain id to destroy
  29.182 + * @return 0 on success, -1 on failure
  29.183 + */
  29.184 +int xc_domain_destroy(int xc_handle, 
  29.185 +                      u32 domid);
  29.186 +int xc_domain_pincpu(int xc_handle,
  29.187 +                     u32 domid,
  29.188 +                     int vcpu,
  29.189 +                     cpumap_t *cpumap);
  29.190 +/**
  29.191 + * This function will return information about one or more domains. It is
  29.192 + * designed to iterate over the list of domains. If a single domain is
  29.193 + * requested, this function will return the next domain in the list - if
  29.194 + * one exists. It is, therefore, important in this case to make sure the
  29.195 + * domain requested was the one returned.
  29.196 + *
  29.197 + * @parm xc_handle a handle to an open hypervisor interface
  29.198 + * @parm first_domid the first domain to enumerate information from.  Domains
  29.199 + *                   are currently enumerate in order of creation.
  29.200 + * @parm max_doms the number of elements in info
  29.201 + * @parm info an array of max_doms size that will contain the information for
  29.202 + *            the enumerated domains.
  29.203 + * @return the number of domains enumerated or -1 on error
  29.204 + */
  29.205 +int xc_domain_getinfo(int xc_handle,
  29.206 +                      u32 first_domid, 
  29.207 +                      unsigned int max_doms,
  29.208 +                      xc_dominfo_t *info);
  29.209 +
  29.210 +/**
  29.211 + * This function will return information about one or more domains, using a
  29.212 + * single hypercall.  The domain information will be stored into the supplied
  29.213 + * array of xc_domaininfo_t structures.
  29.214 + *
  29.215 + * @parm xc_handle a handle to an open hypervisor interface
  29.216 + * @parm first_domain the first domain to enumerate information from.
  29.217 + *                    Domains are currently enumerate in order of creation.
  29.218 + * @parm max_domains the number of elements in info
  29.219 + * @parm info an array of max_doms size that will contain the information for
  29.220 + *            the enumerated domains.
  29.221 + * @return the number of domains enumerated or -1 on error
  29.222 + */
  29.223 +int xc_domain_getinfolist(int xc_handle,
  29.224 +                          u32 first_domain,
  29.225 +                          unsigned int max_domains,
  29.226 +                          xc_domaininfo_t *info);
  29.227 +
  29.228 +/**
  29.229 + * This function returns information about one domain.  This information is
  29.230 + * more detailed than the information from xc_domain_getinfo().
  29.231 + *
  29.232 + * @parm xc_handle a handle to an open hypervisor interface
  29.233 + * @parm domid the domain to get information from
  29.234 + * @parm info a pointer to an xc_domaininfo_t to store the domain information
  29.235 + * @parm ctxt a pointer to a structure to store the execution context of the
  29.236 + *            domain
  29.237 + * @return 0 on success, -1 on failure
  29.238 + */
  29.239 +int xc_domain_get_vcpu_context(int xc_handle,
  29.240 +                               u32 domid,
  29.241 +                               u32 vcpu,
  29.242 +                               vcpu_guest_context_t *ctxt);
  29.243 +
  29.244 +int xc_domain_setcpuweight(int xc_handle,
  29.245 +                           u32 domid,
  29.246 +                           float weight);
  29.247 +long long xc_domain_get_cpu_usage(int xc_handle,
  29.248 +                                  domid_t domid,
  29.249 +                                  int vcpu);
  29.250 +
  29.251 +
  29.252 +typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
  29.253 +int xc_shadow_control(int xc_handle,
  29.254 +                      u32 domid, 
  29.255 +                      unsigned int sop,
  29.256 +                      unsigned long *dirty_bitmap,
  29.257 +                      unsigned long pages,
  29.258 +                      xc_shadow_control_stats_t *stats);
  29.259 +
  29.260 +
  29.261 +#define XCFLAGS_VERBOSE   1
  29.262 +#define XCFLAGS_LIVE      2
  29.263 +#define XCFLAGS_DEBUG     4
  29.264 +#define XCFLAGS_CONFIGURE 8
  29.265 +
  29.266 +struct XcIOContext;
  29.267 +
  29.268 +/**
  29.269 + * This function will save a domain running Linux.
  29.270 + *
  29.271 + * @parm xc_handle a handle to an open hypervisor interface
  29.272 + * @parm fd the file descriptor to save a domain to
  29.273 + * @parm dom the id of the domain
  29.274 + * @return 0 on success, -1 on failure
  29.275 + */
  29.276 +int xc_linux_save(int xc_handle, int fd, u32 dom);
  29.277 +
  29.278 +/**
  29.279 + * This function will restore a saved domain running Linux.
  29.280 + *
  29.281 + * @parm xc_handle a handle to an open hypervisor interface
  29.282 + * @parm fd the file descriptor to restore a domain from
  29.283 + * @parm dom the id of the domain
  29.284 + * @parm nr_pfns the number of pages
  29.285 + * @parm store_evtchn the store event channel for this domain to use
  29.286 + * @parm store_mfn returned with the mfn of the store page
  29.287 + * @return 0 on success, -1 on failure
  29.288 + */
  29.289 +int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
  29.290 +		     unsigned int store_evtchn, unsigned long *store_mfn);
  29.291 +
  29.292 +int xc_linux_build(int xc_handle,
  29.293 +                   u32 domid,
  29.294 +                   const char *image_name,
  29.295 +                   const char *ramdisk_name,
  29.296 +                   const char *cmdline,
  29.297 +                   unsigned int control_evtchn,
  29.298 +                   unsigned long flags,
  29.299 +                   unsigned int vcpus,
  29.300 +                   unsigned int store_evtchn,
  29.301 +                   unsigned long *store_mfn);
  29.302 +
  29.303 +struct mem_map;
  29.304 +int xc_vmx_build(int xc_handle,
  29.305 +                 u32 domid,
  29.306 +                 int memsize,
  29.307 +                 const char *image_name,
  29.308 +                 struct mem_map *memmap,
  29.309 +                 const char *ramdisk_name,
  29.310 +                 const char *cmdline,
  29.311 +                 unsigned int control_evtchn,
  29.312 +                 unsigned long flags,
  29.313 +                 unsigned int vcpus,
  29.314 +                 unsigned int store_evtchn,
  29.315 +                 unsigned long *store_mfn);
  29.316 +
  29.317 +int xc_bvtsched_global_set(int xc_handle,
  29.318 +                           unsigned long ctx_allow);
  29.319 +
  29.320 +int xc_bvtsched_domain_set(int xc_handle,
  29.321 +                           u32 domid,
  29.322 +                           u32 mcuadv,
  29.323 +                           int warpback,
  29.324 +                           s32 warpvalue,
  29.325 +                           long long warpl,
  29.326 +                           long long warpu);
  29.327 +
  29.328 +int xc_bvtsched_global_get(int xc_handle,
  29.329 +                           unsigned long *ctx_allow);
  29.330 +
  29.331 +int xc_bvtsched_domain_get(int xc_handle,
  29.332 +                           u32 domid,
  29.333 +                           u32 *mcuadv,
  29.334 +                           int *warpback,
  29.335 +                           s32 *warpvalue,
  29.336 +                           long long *warpl,
  29.337 +                           long long *warpu);
  29.338 +
  29.339 +int xc_sedf_domain_set(int xc_handle,
  29.340 +                          u32 domid,
  29.341 +                          u64 period, u64 slice, u64 latency, u16 extratime, u16 weight);
  29.342 +
  29.343 +int xc_sedf_domain_get(int xc_handle,
  29.344 +                          u32 domid,
  29.345 +                          u64* period, u64 *slice, u64 *latency, u16 *extratime, u16* weight);
  29.346 +
  29.347 +typedef evtchn_status_t xc_evtchn_status_t;
  29.348 +
  29.349 +/*
  29.350 + * EVENT CHANNEL FUNCTIONS
  29.351 + */
  29.352 +
  29.353 +/**
  29.354 + * This function allocates an unbound port.  Ports are named endpoints used for
  29.355 + * interdomain communication.  This function is most useful in opening a
  29.356 + * well-known port within a domain to receive events on.
  29.357 + *
  29.358 + * @parm xc_handle a handle to an open hypervisor interface
  29.359 + * @parm dom the ID of the domain.  This maybe DOMID_SELF
  29.360 + * @parm port a pointer to a port.  This is an in/out parameter.  If *port is
  29.361 + *            0, then a new port will be assigned, if port is > 0 then that
  29.362 + *            port is allocated if the port is unallocated.
  29.363 + * @return 0 on success, -1 on failure
  29.364 + */
  29.365 +int xc_evtchn_alloc_unbound(int xc_handle,
  29.366 +                            u32 dom,
  29.367 +                            int *port);
  29.368 +
  29.369 +/**
  29.370 + * This function creates a pair of ports between two domains.  A port can only
  29.371 + * be bound once within a domain.
  29.372 + *
  29.373 + * @parm xc_handle a handle to an open hypervisor interface
  29.374 + * @parm dom1 one of the two domains to connect.  Can be DOMID_SELF.
  29.375 + * @parm dom2 the other domain to connect.  Can be DOMID_SELF.
  29.376 + * @parm port1 an in/out parameter.  If > 0, then try to connect *port.  If
  29.377 + *             0, then allocate a new port and store the port in *port.
  29.378 + * @parm port2 the port connected on port2.  This parameter behaves the same
  29.379 + *             way as port1.
  29.380 + * @return 0 on success, -1 on error.
  29.381 + */
  29.382 +int xc_evtchn_bind_interdomain(int xc_handle,
  29.383 +                               u32 dom1,
  29.384 +                               u32 dom2,
  29.385 +                               int *port1,
  29.386 +                               int *port2);
  29.387 +int xc_evtchn_bind_virq(int xc_handle,
  29.388 +                        int virq,
  29.389 +                        int *port);
  29.390 +
  29.391 +/**
  29.392 + * This function will close a single port on an event channel.
  29.393 + *
  29.394 + * @parm xc_handle a handle to an open hypervisor interface
  29.395 + * @parm dom the domain that the port exists on.  May be DOMID_SELF.
  29.396 + * @parm port the port to close
  29.397 + * @return 0 on success, -1 on error
  29.398 + */
  29.399 +int xc_evtchn_close(int xc_handle,
  29.400 +                    u32 dom,   /* may be DOMID_SELF */
  29.401 +                    int port);
  29.402 +
  29.403 +/**
  29.404 + * This function generates a notify event on a bound port.
  29.405 + *
  29.406 + * Notifies can be read within Linux by opening /dev/xen/evtchn and reading
  29.407 + * a 16 bit value.  The result will be the port the event occurred on.  When
  29.408 + * events occur, the port is masked until the 16 bit port value is written back
  29.409 + * to the file.  When /dev/xen/evtchn is opened, it has to be bound via an
  29.410 + * ioctl to each port to listen on.  The ioctl for binding is _IO('E', 2).  The
  29.411 + * parameter is the port to listen on.
  29.412 + *
  29.413 + * @parm xc_handle a handle to an open hypervisor interface
  29.414 + * @parm local_port the port to generate the notify on
  29.415 + * @return 0 on success, -1 on error
  29.416 + */
  29.417 +int xc_evtchn_send(int xc_handle,
  29.418 +                   int local_port);
  29.419 +int xc_evtchn_status(int xc_handle,
  29.420 +                     u32 dom, /* may be DOMID_SELF */
  29.421 +                     int port,
  29.422 +                     xc_evtchn_status_t *status);
  29.423 +
  29.424 +int xc_physdev_pci_access_modify(int xc_handle,
  29.425 +                                 u32 domid,
  29.426 +                                 int bus,
  29.427 +                                 int dev,
  29.428 +                                 int func,
  29.429 +                                 int enable);
  29.430 +
  29.431 +int xc_readconsolering(int xc_handle,
  29.432 +                       char **pbuffer,
  29.433 +                       unsigned int *pnr_chars, 
  29.434 +                       int clear);
  29.435 +
  29.436 +typedef dom0_physinfo_t xc_physinfo_t;
  29.437 +int xc_physinfo(int xc_handle,
  29.438 +                xc_physinfo_t *info);
  29.439 +
  29.440 +int xc_sched_id(int xc_handle,
  29.441 +                int *sched_id);
  29.442 +
  29.443 +int xc_domain_setmaxmem(int xc_handle,
  29.444 +                        u32 domid, 
  29.445 +                        unsigned int max_memkb);
  29.446 +
  29.447 +int xc_domain_memory_increase_reservation(int xc_handle,
  29.448 +                                          u32 domid, 
  29.449 +                                          unsigned int mem_kb);
  29.450 +
  29.451 +typedef dom0_perfc_desc_t xc_perfc_desc_t;
  29.452 +/* IMPORTANT: The caller is responsible for mlock()'ing the @desc array. */
  29.453 +int xc_perfc_control(int xc_handle,
  29.454 +                     u32 op,
  29.455 +                     xc_perfc_desc_t *desc);
  29.456 +
  29.457 +/* read/write msr */
  29.458 +long long xc_msr_read(int xc_handle, int cpu_mask, int msr);
  29.459 +int xc_msr_write(int xc_handle, int cpu_mask, int msr, unsigned int low,
  29.460 +                  unsigned int high);
  29.461 +
  29.462 +/**
  29.463 + * Memory maps a range within one domain to a local address range.  Mappings
  29.464 + * should be unmapped with munmap and should follow the same rules as mmap
  29.465 + * regarding page alignment.  Returns NULL on failure.
  29.466 + *
  29.467 + * In Linux, the ring queue for the control channel is accessible by mapping
  29.468 + * the shared_info_frame (from xc_domain_getinfo()) + 2048.  The structure
  29.469 + * stored there is of type control_if_t.
  29.470 + *
  29.471 + * @parm xc_handle a handle on an open hypervisor interface
  29.472 + * @parm dom the domain to map memory from
  29.473 + * @parm size the amount of memory to map (in multiples of page size)
  29.474 + * @parm prot same flag as in mmap().
  29.475 + * @parm mfn the frame address to map.
  29.476 + */
  29.477 +void *xc_map_foreign_range(int xc_handle, u32 dom,
  29.478 +                            int size, int prot,
  29.479 +                            unsigned long mfn );
  29.480 +
  29.481 +void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot,
  29.482 +                           unsigned long *arr, int num );
  29.483 +
  29.484 +int xc_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf, 
  29.485 +                    unsigned long max_pfns);
  29.486 +
  29.487 +int xc_ia64_get_pfn_list(int xc_handle, u32 domid, unsigned long *pfn_buf, 
  29.488 +                    unsigned int start_page, unsigned int nr_pages);
  29.489 +
  29.490 +/*\
  29.491 + *  GRANT TABLE FUNCTIONS
  29.492 +\*/ 
  29.493 +
  29.494 +/**
  29.495 + * This function opens a handle to the more restricted grant table hypervisor
  29.496 + * interface. This may be used where the standard interface is not
  29.497 + * available because the domain is not privileged.
  29.498 + * This function can  be called multiple times within a single process.
  29.499 + * Multiple processes can have an open hypervisor interface at the same time.
  29.500 + *
  29.501 + * Each call to this function should have a corresponding call to
  29.502 + * xc_grant_interface_close().
  29.503 + *
  29.504 + * This function can fail if a Xen-enabled kernel is not currently running.
  29.505 + *
  29.506 + * @return a handle to the hypervisor grant table interface or -1 on failure
  29.507 + */
  29.508 +int xc_grant_interface_open(void);
  29.509 +
  29.510 +/**
  29.511 + * This function closes an open grant table hypervisor interface.
  29.512 + *
  29.513 + * This function can fail if the handle does not represent an open interface or
  29.514 + * if there were problems closing the interface.
  29.515 + *
  29.516 + * @parm xc_handle a handle to an open grant table hypervisor interface
  29.517 + * @return 0 on success, -1 otherwise.
  29.518 + */
  29.519 +int xc_grant_interface_close(int xc_handle);
  29.520 +
  29.521 +int xc_gnttab_map_grant_ref(int  xc_handle,
  29.522 +                            u64  host_virt_addr,
  29.523 +                            u32  dom,
  29.524 +                            u16  ref,
  29.525 +                            u16  flags,
  29.526 +                            s16 *handle,
  29.527 +                            u64 *dev_bus_addr);
  29.528 +
  29.529 +int xc_gnttab_unmap_grant_ref(int  xc_handle,
  29.530 +                              u64  host_virt_addr,
  29.531 +                              u64  dev_bus_addr,
  29.532 +                              u16  handle,
  29.533 +                              s16 *status);
  29.534 +
  29.535 +int xc_gnttab_setup_table(int        xc_handle,
  29.536 +                          u32        dom,
  29.537 +                          u16        nr_frames,
  29.538 +                          s16       *status,
  29.539 +                          unsigned long **frame_list);
  29.540 +
  29.541 +/* Grant debug builds only: */
  29.542 +int xc_gnttab_dump_table(int        xc_handle,
  29.543 +                         u32        dom,
  29.544 +                         s16       *status);
  29.545 +
  29.546 +/* Get current total pages allocated to a domain. */
  29.547 +long xc_get_tot_pages(int xc_handle, u32 domid);
  29.548 +
  29.549 +/* Execute a privileged dom0 operation. */
  29.550 +int xc_dom0_op(int xc_handle, dom0_op_t *op);
  29.551 +
  29.552 +/* Initializes the store (for dom0)
  29.553 +   remote_port should be the remote end of a bound interdomain channel between
  29.554 +   the store and dom0.
  29.555 +
  29.556 +   This function returns a shared frame that should be passed to
  29.557 +   xs_introduce_domain
  29.558 + */
  29.559 +long xc_init_store(int xc_handle, int remote_port);
  29.560 +
  29.561 +#endif /* __XC_H__ */
    30.1 --- a/tools/misc/Makefile	Wed Aug 24 21:50:52 2005 +0000
    30.2 +++ b/tools/misc/Makefile	Wed Aug 24 23:07:29 2005 +0000
    30.3 @@ -50,4 +50,4 @@ clean:
    30.4  	$(CC) -c $(CFLAGS) -o $@ $<
    30.5  
    30.6  $(TARGETS): %: %.o Makefile
    30.7 -	$(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc
    30.8 +	$(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxenctrl
    31.1 --- a/tools/misc/cpuperf/Makefile	Wed Aug 24 21:50:52 2005 +0000
    31.2 +++ b/tools/misc/cpuperf/Makefile	Wed Aug 24 23:07:29 2005 +0000
    31.3 @@ -37,7 +37,7 @@ clean:
    31.4  	$(CC) $(CFLAGS) -o $@ $<
    31.5  
    31.6  cpuperf-xen: cpuperf.c $(HDRS) Makefile
    31.7 -	$(CC) $(CFLAGS) -I $(XEN_LIBXC) -L$(XEN_LIBXC) -lxc -DXENO -o $@ $<
    31.8 +	$(CC) $(CFLAGS) -I $(XEN_LIBXC) -L$(XEN_LIBXC) -lxenctrl -DXENO -o $@ $<
    31.9  
   31.10  cpuperf-perfcntr: cpuperf.c $(HDRS) Makefile
   31.11  	$(CC) $(CFLAGS) -DPERFCNTR -o $@ $<
    32.1 --- a/tools/misc/cpuperf/cpuperf_xeno.h	Wed Aug 24 21:50:52 2005 +0000
    32.2 +++ b/tools/misc/cpuperf/cpuperf_xeno.h	Wed Aug 24 23:07:29 2005 +0000
    32.3 @@ -9,7 +9,7 @@
    32.4   *
    32.5   */
    32.6  
    32.7 -#include <xc.h>
    32.8 +#include <xenctrl.h>
    32.9  
   32.10  static int xc_handle;
   32.11  
    33.1 --- a/tools/misc/xc_shadow.c	Wed Aug 24 21:50:52 2005 +0000
    33.2 +++ b/tools/misc/xc_shadow.c	Wed Aug 24 23:07:29 2005 +0000
    33.3 @@ -11,7 +11,7 @@
    33.4   */
    33.5  
    33.6  
    33.7 -#include <xc.h>
    33.8 +#include <xenctrl.h>
    33.9  #include <stdio.h>
   33.10  #include <stdlib.h>
   33.11  #include <sys/mman.h>
    34.1 --- a/tools/misc/xenperf.c	Wed Aug 24 21:50:52 2005 +0000
    34.2 +++ b/tools/misc/xenperf.c	Wed Aug 24 23:07:29 2005 +0000
    34.3 @@ -11,7 +11,7 @@
    34.4   */
    34.5  
    34.6  
    34.7 -#include <xc.h>
    34.8 +#include <xenctrl.h>
    34.9  #include <stdio.h>
   34.10  #include <stdlib.h>
   34.11  #include <sys/mman.h>
    35.1 --- a/tools/python/setup.py	Wed Aug 24 21:50:52 2005 +0000
    35.2 +++ b/tools/python/setup.py	Wed Aug 24 23:07:29 2005 +0000
    35.3 @@ -17,7 +17,7 @@ library_dirs = [ XEN_ROOT + "/tools/libx
    35.4                   XEN_ROOT + "/tools/xenstore",
    35.5                   ]
    35.6  
    35.7 -libraries = [ "xc", "xenstore" ]
    35.8 +libraries = [ "xenctrl", "xenstore" ]
    35.9  
   35.10  xc = Extension("xc",
   35.11                 extra_compile_args = extra_compile_args,
   35.12 @@ -41,7 +41,7 @@ xs = Extension("xs",
   35.13                 sources            = [ "xen/lowlevel/xs/xs.c" ])
   35.14  
   35.15  setup(name            = 'xen',
   35.16 -      version         = '2.0',
   35.17 +      version         = '3.0',
   35.18        description     = 'Xen',
   35.19        packages        = ['xen',
   35.20                           'xen.lowlevel',
    36.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Wed Aug 24 21:50:52 2005 +0000
    36.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Wed Aug 24 23:07:29 2005 +0000
    36.3 @@ -5,7 +5,7 @@
    36.4   */
    36.5  
    36.6  #include <Python.h>
    36.7 -#include <xc.h>
    36.8 +#include <xenctrl.h>
    36.9  #include <zlib.h>
   36.10  #include <fcntl.h>
   36.11  #include <netinet/in.h>
    37.1 --- a/tools/python/xen/lowlevel/xu/xu.c	Wed Aug 24 21:50:52 2005 +0000
    37.2 +++ b/tools/python/xen/lowlevel/xu/xu.c	Wed Aug 24 23:07:29 2005 +0000
    37.3 @@ -21,7 +21,7 @@
    37.4  #include <unistd.h>
    37.5  #include <errno.h>
    37.6  #include <signal.h>
    37.7 -#include <xc.h>
    37.8 +#include <xenctrl.h>
    37.9  
   37.10  #include <xen/xen.h>
   37.11  #include <xen/io/domain_controller.h>
    38.1 --- a/tools/xcs/Makefile	Wed Aug 24 21:50:52 2005 +0000
    38.2 +++ b/tools/xcs/Makefile	Wed Aug 24 23:07:29 2005 +0000
    38.3 @@ -34,10 +34,10 @@ clean:
    38.4  
    38.5  xcsdump: xcsdump.c dump.c
    38.6  	$(CC) $(CFLAGS) -o xcsdump xcsdump.c -L$(XEN_LIBXC) \
    38.7 -              ctrl_interface.c evtchn.c dump.c -lxc
    38.8 +              ctrl_interface.c evtchn.c dump.c -lxenctrl
    38.9  
   38.10  $(BIN): $(OBJS)
   38.11 -	$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -lxc 
   38.12 +	$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -lxenctrl 
   38.13  
   38.14  $(OBJS): $(HDRS)
   38.15  
    39.1 --- a/tools/xcs/dump.h	Wed Aug 24 21:50:52 2005 +0000
    39.2 +++ b/tools/xcs/dump.h	Wed Aug 24 23:07:29 2005 +0000
    39.3 @@ -20,7 +20,7 @@
    39.4  #define XENCTLD_ERROR_H
    39.5  
    39.6  #include <stdint.h>
    39.7 -#include <xc.h>
    39.8 +#include <xenctrl.h>
    39.9  #include <xen/io/domain_controller.h>
   39.10  
   39.11  void dump_msg(const control_msg_t *msg, uint64_t flags);
    40.1 --- a/tools/xcs/xcs.h	Wed Aug 24 21:50:52 2005 +0000
    40.2 +++ b/tools/xcs/xcs.h	Wed Aug 24 23:07:29 2005 +0000
    40.3 @@ -11,7 +11,7 @@
    40.4  #define __XCS_H__
    40.5  
    40.6  #include <pthread.h>
    40.7 -#include <xc.h>
    40.8 +#include <xenctrl.h>
    40.9  #include <xen/xen.h>
   40.10  #include <xen/io/domain_controller.h>
   40.11  #include <xen/linux/privcmd.h>
    41.1 --- a/tools/xcs/xcsdump.c	Wed Aug 24 21:50:52 2005 +0000
    41.2 +++ b/tools/xcs/xcsdump.c	Wed Aug 24 23:07:29 2005 +0000
    41.3 @@ -16,7 +16,7 @@
    41.4  #include <sys/socket.h>
    41.5  #include <sys/un.h>
    41.6  #include <ctype.h>
    41.7 -#include <xc.h>
    41.8 +#include <xenctrl.h>
    41.9  #include <xen/xen.h>
   41.10  #include <xen/io/domain_controller.h>
   41.11  #include <getopt.h>
    42.1 --- a/tools/xcutils/Makefile	Wed Aug 24 21:50:52 2005 +0000
    42.2 +++ b/tools/xcutils/Makefile	Wed Aug 24 23:07:29 2005 +0000
    42.3 @@ -30,7 +30,7 @@ PROG_DEP = .*.d
    42.4  
    42.5  PROGRAMS		= xc_restore xc_save
    42.6  
    42.7 -LDLIBS			= -L$(XEN_LIBXC) -lxc
    42.8 +LDLIBS			= -L$(XEN_LIBXC) -lxenctrl
    42.9  
   42.10  .PHONY: all
   42.11  all: build
    43.1 --- a/tools/xcutils/xc_restore.c	Wed Aug 24 21:50:52 2005 +0000
    43.2 +++ b/tools/xcutils/xc_restore.c	Wed Aug 24 23:07:29 2005 +0000
    43.3 @@ -11,7 +11,7 @@
    43.4  #include <stdio.h>
    43.5  #include <err.h>
    43.6  
    43.7 -#include <xc.h>
    43.8 +#include <xenctrl.h>
    43.9  
   43.10  int
   43.11  main(int argc, char **argv)
    44.1 --- a/tools/xcutils/xc_save.c	Wed Aug 24 21:50:52 2005 +0000
    44.2 +++ b/tools/xcutils/xc_save.c	Wed Aug 24 23:07:29 2005 +0000
    44.3 @@ -11,7 +11,7 @@
    44.4  #include <stdio.h>
    44.5  #include <err.h>
    44.6  
    44.7 -#include <xc.h>
    44.8 +#include <xenctrl.h>
    44.9  
   44.10  int
   44.11  main(int argc, char **argv)
    45.1 --- a/tools/xenstore/Makefile	Wed Aug 24 21:50:52 2005 +0000
    45.2 +++ b/tools/xenstore/Makefile	Wed Aug 24 23:07:29 2005 +0000
    45.3 @@ -32,7 +32,7 @@ xen:
    45.4  	ln -sf $(XEN_ROOT)/xen/include/public $@
    45.5  
    45.6  xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o
    45.7 -	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxc -o $@
    45.8 +	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
    45.9  
   45.10  xenstored_test: xenstored_core_test.o xenstored_watch_test.o xenstored_domain_test.o xenstored_transaction_test.o xs_lib.o talloc_test.o fake_libxc.o utils.o
   45.11  	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
   45.12 @@ -103,7 +103,7 @@ stresstest: xs_stress xenstored_test
   45.13  	export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
   45.14  
   45.15  xs_dom0_test: xs_dom0_test.o utils.o
   45.16 -	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxc -o $@
   45.17 +	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
   45.18  
   45.19  TAGS:
   45.20  	etags `find . -name '*.[ch]'`
    46.1 --- a/tools/xenstore/xs_dom0_test.c	Wed Aug 24 21:50:52 2005 +0000
    46.2 +++ b/tools/xenstore/xs_dom0_test.c	Wed Aug 24 23:07:29 2005 +0000
    46.3 @@ -3,7 +3,7 @@
    46.4  #include <sys/ioctl.h>
    46.5  #include "xs.h"
    46.6  #include "utils.h"
    46.7 -#include <xc.h>
    46.8 +#include <xenctrl.h>
    46.9  #include <xen/linux/privcmd.h>
   46.10  #include <stdio.h>
   46.11  #include <unistd.h>
    47.1 --- a/tools/xenstore/xs_lib.h	Wed Aug 24 21:50:52 2005 +0000
    47.2 +++ b/tools/xenstore/xs_lib.h	Wed Aug 24 23:07:29 2005 +0000
    47.3 @@ -22,7 +22,7 @@
    47.4  
    47.5  #include <stdbool.h>
    47.6  #include <limits.h>
    47.7 -#include <xc.h>
    47.8 +#include <xenctrl.h>
    47.9  
   47.10  /* Bitmask of permissions. */
   47.11  enum xs_perm_type {
    48.1 --- a/tools/xentrace/Makefile	Wed Aug 24 21:50:52 2005 +0000
    48.2 +++ b/tools/xentrace/Makefile	Wed Aug 24 23:07:29 2005 +0000
    48.3 @@ -36,4 +36,4 @@ clean:
    48.4  	$(RM) *.a *.so *.o *.rpm $(BIN)
    48.5  
    48.6  %: %.c $(HDRS) Makefile
    48.7 -	$(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc
    48.8 +	$(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxenctrl
    49.1 --- a/tools/xentrace/xenctx.c	Wed Aug 24 21:50:52 2005 +0000
    49.2 +++ b/tools/xentrace/xenctx.c	Wed Aug 24 23:07:29 2005 +0000
    49.3 @@ -21,7 +21,7 @@
    49.4  #include <argp.h>
    49.5  #include <signal.h>
    49.6  
    49.7 -#include "xc.h"
    49.8 +#include "xenctrl.h"
    49.9  
   49.10  #ifdef __i386__
   49.11  void print_ctx(vcpu_guest_context_t *ctx1)