direct-io.hg

changeset 2789:b914ff7d73b5

bitkeeper revision 1.1159.142.4 (4184b6d4rc3Jd2irJimPyupm4TO06A)

Rename Xen public interfaces.
1. hypervisor-if.h is now xen.h
2. hypervisor-ifs/ directory is now:
<include/public/...> in Xen
<asm/xen-public/...> in Linux
<xen/...> in user space
author kaf24@freefall.cl.cam.ac.uk
date Sun Oct 31 09:56:36 2004 +0000 (2004-10-31)
parents b9377db0fc3a
children 47b3f6702111 6c9e794798b9
files .rootkeys COPYING docs/misc/blkif-drivers-explained.txt docs/src/interface.tex extras/mini-os/Makefile extras/mini-os/h/events.h extras/mini-os/h/hypervisor.h extras/mini-os/h/os.h linux-2.4.27-xen-sparse/arch/xen/Makefile linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c linux-2.4.27-xen-sparse/arch/xen/kernel/process.c linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c linux-2.4.27-xen-sparse/arch/xen/kernel/time.c linux-2.4.27-xen-sparse/include/asm-xen/page.h linux-2.4.27-xen-sparse/include/asm-xen/segment.h linux-2.4.27-xen-sparse/mkbuildtree linux-2.6.9-xen-sparse/arch/xen/Makefile linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h linux-2.6.9-xen-sparse/drivers/xen/console/console.c linux-2.6.9-xen-sparse/drivers/xen/netback/common.h linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h linux-2.6.9-xen-sparse/mkbuildtree netbsd-2.0-xen-sparse/mkbuildtree netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c tools/Make.defs tools/libxc/xc.h tools/python/setup.py tools/python/xen/lowlevel/xu/xu.c xen/COPYING xen/Makefile xen/Rules.mk xen/arch/x86/boot/x86_32.S xen/arch/x86/boot/x86_64.S xen/arch/x86/dom0_ops.c xen/arch/x86/trampoline.S xen/arch/x86/x86_32/entry.S xen/common/debug-linux.c xen/common/debug.c xen/common/dom0_ops.c xen/common/domain.c xen/common/event_channel.c xen/common/kernel.c xen/common/physdev.c xen/common/sched_atropos.c xen/common/sched_rrobin.c xen/common/schedule.c xen/common/trace.c xen/include/asm-x86/mm.h xen/include/asm-x86/pdb.h xen/include/asm-x86/processor.h xen/include/hypervisor-ifs/COPYING xen/include/hypervisor-ifs/arch-x86_32.h xen/include/hypervisor-ifs/arch-x86_64.h xen/include/hypervisor-ifs/dom0_ops.h xen/include/hypervisor-ifs/event_channel.h xen/include/hypervisor-ifs/grant_table.h xen/include/hypervisor-ifs/hypervisor-if.h xen/include/hypervisor-ifs/io/blkif.h xen/include/hypervisor-ifs/io/domain_controller.h xen/include/hypervisor-ifs/io/netif.h xen/include/hypervisor-ifs/physdev.h xen/include/hypervisor-ifs/sched_ctl.h xen/include/hypervisor-ifs/trace.h xen/include/public/COPYING xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/dom0_ops.h xen/include/public/event_channel.h xen/include/public/grant_table.h xen/include/public/io/blkif.h xen/include/public/io/domain_controller.h xen/include/public/io/netif.h xen/include/public/physdev.h xen/include/public/sched_ctl.h xen/include/public/trace.h xen/include/public/xen.h xen/include/xen/grant_table.h xen/include/xen/sched.h xen/include/xen/time.h xen/include/xen/trace.h
line diff
     1.1 --- a/.rootkeys	Sun Oct 31 08:22:21 2004 +0000
     1.2 +++ b/.rootkeys	Sun Oct 31 09:56:36 2004 +0000
     1.3 @@ -732,19 +732,19 @@ 404f1badfXZJZ2sU8sh9PS2EZvd19Q xen/inclu
     1.4  404f1bb86rAXB3aLS1vYdcqpJiEcyg xen/include/asm-x86/x86_64/ptrace.h
     1.5  40e1966azOJZfNI6Ilthe6Q-T3Hewg xen/include/asm-x86/x86_64/string.h
     1.6  404f1bc4tWkB9Qr8RkKtZGW5eMQzhw xen/include/asm-x86/x86_64/uaccess.h
     1.7 -400304fcmRQmDdFYEzDh0wcBba9alg xen/include/hypervisor-ifs/COPYING
     1.8 -404f1bc68SXxmv0zQpXBWGrCzSyp8w xen/include/hypervisor-ifs/arch-x86_32.h
     1.9 -404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/include/hypervisor-ifs/arch-x86_64.h
    1.10 -3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/hypervisor-ifs/dom0_ops.h
    1.11 -403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/hypervisor-ifs/event_channel.h
    1.12 -4121d149udGfSUGhn3k1ECz0bM31nQ xen/include/hypervisor-ifs/grant_table.h
    1.13 -3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/hypervisor-ifs/hypervisor-if.h
    1.14 -40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/hypervisor-ifs/io/blkif.h
    1.15 -40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/hypervisor-ifs/io/domain_controller.h
    1.16 -40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/hypervisor-ifs/io/netif.h
    1.17 -4051db79512nOCGweabrFWO2M2h5ng xen/include/hypervisor-ifs/physdev.h
    1.18 -40589968wmhPmV5-ENbBYmMjnedgKw xen/include/hypervisor-ifs/sched_ctl.h
    1.19 -404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/hypervisor-ifs/trace.h
    1.20 +400304fcmRQmDdFYEzDh0wcBba9alg xen/include/public/COPYING
    1.21 +404f1bc68SXxmv0zQpXBWGrCzSyp8w xen/include/public/arch-x86_32.h
    1.22 +404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/include/public/arch-x86_64.h
    1.23 +3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/public/dom0_ops.h
    1.24 +403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/public/event_channel.h
    1.25 +4121d149udGfSUGhn3k1ECz0bM31nQ xen/include/public/grant_table.h
    1.26 +40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/public/io/blkif.h
    1.27 +40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/public/io/domain_controller.h
    1.28 +40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/public/io/netif.h
    1.29 +4051db79512nOCGweabrFWO2M2h5ng xen/include/public/physdev.h
    1.30 +40589968wmhPmV5-ENbBYmMjnedgKw xen/include/public/sched_ctl.h
    1.31 +404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/public/trace.h
    1.32 +3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/public/xen.h
    1.33  3e397e66m2tO3s-J8Jnr7Ws_tGoPTg xen/include/xen/ac_timer.h
    1.34  40715b2epYl2jBbxzz9CI2rgIca7Zg xen/include/xen/acpi.h
    1.35  3ddb79c0c0cX_DZE209-Bb-Rx1v-Aw xen/include/xen/cache.h
     2.1 --- a/COPYING	Sun Oct 31 08:22:21 2004 +0000
     2.2 +++ b/COPYING	Sun Oct 31 09:56:36 2004 +0000
     2.3 @@ -17,12 +17,11 @@ Xen guests, certain files in this reposi
     2.4  GPL when distributed separately or included in software packages
     2.5  outside this repository. Instead we specify a much more relaxed
     2.6  BSD-style license. Affected files include the Xen interface headers
     2.7 -(xen/include/hypervisor-ifs/COPYING), and various drivers, support
     2.8 -functions and header files within the Linux sparse source trees. In
     2.9 -all such cases, license terms are stated at the top of the file or in
    2.10 -a COPYING file in the same directory. Note that _any_ file that is
    2.11 -modified and then distributed within a Linux kernel is still subject
    2.12 -to the GNU GPL!
    2.13 +(xen/include/public/COPYING), and various drivers, support functions
    2.14 +and header files within the Linux sparse source trees. In all such
    2.15 +cases, license terms are stated at the top of the file or in a COPYING
    2.16 +file in the same directory. Note that _any_ file that is modified and
    2.17 +then distributed within a Linux kernel is still subject to the GNU GPL.
    2.18  
    2.19   -- Keir Fraser (on behalf of the Xen team)
    2.20  
     3.1 --- a/docs/misc/blkif-drivers-explained.txt	Sun Oct 31 08:22:21 2004 +0000
     3.2 +++ b/docs/misc/blkif-drivers-explained.txt	Sun Oct 31 09:56:36 2004 +0000
     3.3 @@ -244,8 +244,8 @@ records.  Pointers may only advance, and
     3.4  By adopting the convention that every request will receive a response,
     3.5  not all four pointers need be shared and flow control on the ring
     3.6  becomes very easy to manage.  Each domain manages its own
     3.7 -consumer pointer, and the two producer pointers are visible to both (Xen/include/hypervisor-ifs/io/blkif.h):
     3.8 -
     3.9 +consumer pointer, and the two producer pointers are visible to both
    3.10 +(xen/include/public/io/blkif.h):
    3.11  
    3.12  
    3.13  /* NB. Ring size must be small enough for sizeof(blkif_ring_t) <=PAGE_SIZE.*/
     4.1 --- a/docs/src/interface.tex	Sun Oct 31 08:22:21 2004 +0000
     4.2 +++ b/docs/src/interface.tex	Sun Oct 31 09:56:36 2004 +0000
     4.3 @@ -514,7 +514,7 @@ this scheduler.
     4.4  \subsubsection{sched\_id}
     4.5  
     4.6  This is an integer that uniquely identifies this scheduler.  There should be a
     4.7 -macro corrsponding to this scheduler ID in {\tt <hypervisor-ifs/sched-if.h>}.
     4.8 +macro corrsponding to this scheduler ID in {\tt <xen/sched-if.h>}.
     4.9  
    4.10  \subsubsection{init\_scheduler}
    4.11  
     5.1 --- a/extras/mini-os/Makefile	Sun Oct 31 08:22:21 2004 +0000
     5.2 +++ b/extras/mini-os/Makefile	Sun Oct 31 09:56:36 2004 +0000
     5.3 @@ -14,16 +14,16 @@ TARGET := mini-os
     5.4  LOBJS := lib/malloc.o lib/math.o lib/printf.o lib/string.o 
     5.5  OBJS  := entry.o kernel.o traps.o hypervisor.o mm.o events.o time.o ${LOBJS}
     5.6  
     5.7 -HINTF := h/hypervisor-ifs/hypervisor-if.h
     5.8 +HINTF := h/xen-public/xen.h
     5.9  HDRS  :=  h/os.h h/types.h h/hypervisor.h h/mm.h h/events.h h/time.h h/lib.h
    5.10  HDRS  += $(HINTF)
    5.11  
    5.12  default: $(TARGET)
    5.13  
    5.14 -hypervisor-ifs:
    5.15 -	ln -sf ../../../xen/include/hypervisor-ifs h/hypervisor-ifs
    5.16 +xen-public:
    5.17 +	[ -e h/xen-public] || ln -sf ../../../xen/include/public h/xen-public
    5.18  
    5.19 -$(TARGET): hypervisor-ifs head.o $(OBJS)
    5.20 +$(TARGET): xen-public head.o $(OBJS)
    5.21  	$(LD) -N -T minios.lds head.o $(OBJS) -o $@.elf
    5.22  	objcopy -R .note -R .comment $@.elf $@
    5.23  	gzip -f -9 -c $@ >$@.gz
     6.1 --- a/extras/mini-os/h/events.h	Sun Oct 31 08:22:21 2004 +0000
     6.2 +++ b/extras/mini-os/h/events.h	Sun Oct 31 09:56:36 2004 +0000
     6.3 @@ -20,7 +20,7 @@
     6.4  #ifndef _EVENTS_H_
     6.5  #define _EVENTS_H_
     6.6  
     6.7 -/* _EVENT_* are defined in hypervisor-if.h  */
     6.8 +/* _EVENT_* are defined in xen-public/xen.h  */
     6.9  #define EV_BLKDEV _EVENT_BLKDEV
    6.10  #define EV_TIMER  _EVENT_TIMER
    6.11  #define EV_DIE    _EVENT_DIE
     7.1 --- a/extras/mini-os/h/hypervisor.h	Sun Oct 31 08:22:21 2004 +0000
     7.2 +++ b/extras/mini-os/h/hypervisor.h	Sun Oct 31 09:56:36 2004 +0000
     7.3 @@ -11,9 +11,8 @@
     7.4  
     7.5  #include <types.h>
     7.6  
     7.7 -/* include the hypervisor interface */
     7.8 -#include <hypervisor-ifs/hypervisor-if.h>
     7.9 -#include "../../../tools/xu/lib/domain_controller.h"
    7.10 +#include <xen-public/xen.h>
    7.11 +#include <xen-public/io/domain_controller.h>
    7.12  
    7.13  /*
    7.14   * a placeholder for the start of day information passed up from the hypervisor
     8.1 --- a/extras/mini-os/h/os.h	Sun Oct 31 08:22:21 2004 +0000
     8.2 +++ b/extras/mini-os/h/os.h	Sun Oct 31 09:56:36 2004 +0000
     8.3 @@ -29,7 +29,7 @@
     8.4  
     8.5  
     8.6  /*
     8.7 - * these are also defined in hypervisor-if.h but can't be pulled in as
     8.8 + * these are also defined in xen-public/xen.h but can't be pulled in as
     8.9   * they are used in start of day assembly. Need to clean up the .h files
    8.10   * a bit more...
    8.11   */
    8.12 @@ -48,7 +48,7 @@
    8.13  #ifndef __ASSEMBLY__
    8.14  
    8.15  #include <types.h>
    8.16 -#include <hypervisor-ifs/hypervisor-if.h>
    8.17 +#include <xen-public/xen.h>
    8.18  
    8.19  
    8.20  /* this struct defines the way the registers are stored on the 
     9.1 --- a/linux-2.4.27-xen-sparse/arch/xen/Makefile	Sun Oct 31 08:22:21 2004 +0000
     9.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/Makefile	Sun Oct 31 09:56:36 2004 +0000
     9.3 @@ -127,7 +127,7 @@ archclean:
     9.4  	@$(MAKEBOOT) clean
     9.5  
     9.6  archmrproper:
     9.7 -	rm -f include/asm-xen/hypervisor-ifs/arch
     9.8 +	rm -f include/asm-xen/xen-public/arch
     9.9  
    9.10  archdep:
    9.11  	@$(MAKEBOOT) dep
    10.1 --- a/linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h	Sun Oct 31 08:22:21 2004 +0000
    10.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h	Sun Oct 31 09:56:36 2004 +0000
    10.3 @@ -18,11 +18,11 @@
    10.4  #include <linux/hdreg.h>
    10.5  #include <linux/blkdev.h>
    10.6  #include <linux/major.h>
    10.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    10.8 +#include <asm/xen-public/xen.h>
    10.9  #include <asm/io.h>
   10.10  #include <asm/atomic.h>
   10.11  #include <asm/uaccess.h>
   10.12 -#include <asm-xen/hypervisor-ifs/io/blkif.h>
   10.13 +#include <asm/xen-public/io/blkif.h>
   10.14  
   10.15  #if 0
   10.16  #define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
    11.1 --- a/linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c	Sun Oct 31 08:22:21 2004 +0000
    11.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c	Sun Oct 31 09:56:36 2004 +0000
    11.3 @@ -18,8 +18,8 @@
    11.4  #include <asm/segment.h>
    11.5  #include <asm/io.h>
    11.6  
    11.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    11.8 -#include <asm/hypervisor-ifs/physdev.h>
    11.9 +#include <asm/xen-public/xen.h>
   11.10 +#include <asm/xen-public/physdev.h>
   11.11  
   11.12  #include "pci-i386.h"
   11.13  
    12.1 --- a/linux-2.4.27-xen-sparse/arch/xen/kernel/process.c	Sun Oct 31 08:22:21 2004 +0000
    12.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/process.c	Sun Oct 31 09:56:36 2004 +0000
    12.3 @@ -44,7 +44,7 @@
    12.4  #include <asm/desc.h>
    12.5  #include <asm/mmu_context.h>
    12.6  #include <asm/multicall.h>
    12.7 -#include <asm/hypervisor-ifs/dom0_ops.h>
    12.8 +#include <asm/xen-public/dom0_ops.h>
    12.9  
   12.10  #include <linux/irq.h>
   12.11  
    13.1 --- a/linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c	Sun Oct 31 08:22:21 2004 +0000
    13.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c	Sun Oct 31 09:56:36 2004 +0000
    13.3 @@ -48,7 +48,7 @@ static int errno;
    13.4  #include <asm/mmu_context.h>
    13.5  #include <asm/ctrl_if.h>
    13.6  #include <asm/hypervisor.h>
    13.7 -#include <asm/hypervisor-ifs/dom0_ops.h>
    13.8 +#include <asm/xen-public/dom0_ops.h>
    13.9  #include <linux/netdevice.h>
   13.10  #include <linux/rtnetlink.h>
   13.11  #include <linux/tqueue.h>
   13.12 @@ -335,7 +335,7 @@ void __init setup_arch(char **cmdline_p)
   13.13       * and the bootmem bitmap. 
   13.14       * NB. There is definitely enough room for the bootmem bitmap in the
   13.15       * bootstrap page table. We are guaranteed to get >=512kB unused 'padding'
   13.16 -     * for our own use after all bootstrap elements (see hypervisor-if.h).
   13.17 +     * for our own use after all bootstrap elements (see asm/xen-public/xen.h).
   13.18       */
   13.19      boot_pfn = min((int)xen_start_info.nr_pages,lmax_low_pfn);
   13.20      bootmap_size = init_bootmem(start_pfn,boot_pfn);
    14.1 --- a/linux-2.4.27-xen-sparse/arch/xen/kernel/time.c	Sun Oct 31 08:22:21 2004 +0000
    14.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/time.c	Sun Oct 31 09:56:36 2004 +0000
    14.3 @@ -52,7 +52,7 @@
    14.4  
    14.5  #include <asm/div64.h>
    14.6  #include <asm/hypervisor.h>
    14.7 -#include <asm/hypervisor-ifs/dom0_ops.h>
    14.8 +#include <asm/xen-public/dom0_ops.h>
    14.9  
   14.10  #include <linux/mc146818rtc.h>
   14.11  #include <linux/kernel.h>
    15.1 --- a/linux-2.4.27-xen-sparse/include/asm-xen/page.h	Sun Oct 31 08:22:21 2004 +0000
    15.2 +++ b/linux-2.4.27-xen-sparse/include/asm-xen/page.h	Sun Oct 31 09:56:36 2004 +0000
    15.3 @@ -12,7 +12,7 @@
    15.4  #include <linux/config.h>
    15.5  #include <linux/string.h>
    15.6  #include <asm/types.h>
    15.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    15.8 +#include <asm/xen-public/xen.h>
    15.9  
   15.10  #ifdef CONFIG_XEN_SCRUB_PAGES
   15.11  #define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
    16.1 --- a/linux-2.4.27-xen-sparse/include/asm-xen/segment.h	Sun Oct 31 08:22:21 2004 +0000
    16.2 +++ b/linux-2.4.27-xen-sparse/include/asm-xen/segment.h	Sun Oct 31 09:56:36 2004 +0000
    16.3 @@ -4,7 +4,7 @@
    16.4  #ifndef __ASSEMBLY__
    16.5  #include <linux/types.h>
    16.6  #endif
    16.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    16.8 +#include <asm/xen-public/xen.h>
    16.9  
   16.10  #define __KERNEL_CS	FLAT_RING1_CS
   16.11  #define __KERNEL_DS	FLAT_RING1_DS
    17.1 --- a/linux-2.4.27-xen-sparse/mkbuildtree	Sun Oct 31 08:22:21 2004 +0000
    17.2 +++ b/linux-2.4.27-xen-sparse/mkbuildtree	Sun Oct 31 09:56:36 2004 +0000
    17.3 @@ -107,11 +107,11 @@ set ${RS}/../linux-2.6.*-xen-sparse
    17.4  LINUX_26="$1"
    17.5  
    17.6  
    17.7 -# Create links to the shared definitions of the hypervisor interface
    17.8 -rm -rf ${AD}/include/asm-xen/hypervisor-ifs
    17.9 -mkdir  ${AD}/include/asm-xen/hypervisor-ifs
   17.10 -cd     ${AD}/include/asm-xen/hypervisor-ifs
   17.11 -relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
   17.12 +# Create links to the shared definitions of the Xen interfaces.
   17.13 +rm -rf ${AD}/include/asm-xen/xen-public
   17.14 +mkdir  ${AD}/include/asm-xen/xen-public
   17.15 +cd     ${AD}/include/asm-xen/xen-public
   17.16 +relative_lndir ../../../${RS}/../xen/include/public
   17.17  
   17.18  # Create a link to the shared definitions for the control interface
   17.19  cd ${AD}/include/asm-xen
    18.1 --- a/linux-2.6.9-xen-sparse/arch/xen/Makefile	Sun Oct 31 08:22:21 2004 +0000
    18.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/Makefile	Sun Oct 31 09:56:36 2004 +0000
    18.3 @@ -33,16 +33,16 @@ include/asm-xen/asm:
    18.4  	@echo '  SYMLINK $@ -> include/asm-xen/asm-$(XENARCH)'
    18.5  	@ln -fsn asm-$(XENARCH) $@
    18.6  
    18.7 -include/asm-xen/asm-$(XENARCH)/hypervisor-ifs:
    18.8 -	@echo '  SYMLINK $@ -> include/asm-xen/hypervisor-ifs'
    18.9 -	@ln -fsn ../hypervisor-ifs $@
   18.10 +include/asm-xen/asm-$(XENARCH)/xen-public:
   18.11 +	@echo '  SYMLINK $@ -> include/asm-xen/xen-public'
   18.12 +	@ln -fsn ../xen-public $@
   18.13  
   18.14  arch/xen/arch:
   18.15  	@rm -f $@
   18.16  	@ln -fsn $(XENARCH) $@
   18.17  
   18.18  prepare: include/.asm-ignore include/asm-xen/asm \
   18.19 -	include/asm-xen/asm-$(XENARCH)/hypervisor-ifs \
   18.20 +	include/asm-xen/asm-$(XENARCH)/xen-public \
   18.21  	arch/xen/arch ;
   18.22  
   18.23  all: vmlinuz
    19.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S	Sun Oct 31 08:22:21 2004 +0000
    19.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S	Sun Oct 31 09:56:36 2004 +0000
    19.3 @@ -48,7 +48,7 @@
    19.4  #include <asm/smp.h>
    19.5  #include <asm/page.h>
    19.6  #include "irq_vectors.h"
    19.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    19.8 +#include <asm/xen-public/xen.h>
    19.9  
   19.10  #define nr_syscalls ((syscall_table_size)/4)
   19.11  
    20.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S	Sun Oct 31 08:22:21 2004 +0000
    20.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S	Sun Oct 31 09:56:36 2004 +0000
    20.3 @@ -15,7 +15,7 @@
    20.4  #include <asm/segment.h>
    20.5  #include <asm/thread_info.h>
    20.6  #include <asm/asm_offsets.h>
    20.7 -#include <asm/hypervisor-ifs/arch-x86_32.h>
    20.8 +#include <asm/xen-public/arch-x86_32.h>
    20.9  
   20.10  /*
   20.11   * References to members of the new_cpu_data structure.
    21.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c	Sun Oct 31 08:22:21 2004 +0000
    21.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c	Sun Oct 31 09:56:36 2004 +0000
    21.3 @@ -8,7 +8,7 @@
    21.4  #include <linux/smp_lock.h>
    21.5  #include <linux/stddef.h>
    21.6  #include <linux/slab.h>
    21.7 -#include <asm/hypervisor-ifs/dom0_ops.h>
    21.8 +#include <asm/xen-public/dom0_ops.h>
    21.9  
   21.10  asmlinkage long sys_iopl(unsigned int new_io_pl)
   21.11  {
    22.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c	Sun Oct 31 08:22:21 2004 +0000
    22.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c	Sun Oct 31 09:56:36 2004 +0000
    22.3 @@ -47,7 +47,7 @@
    22.4  #include <asm/irq.h>
    22.5  #include <asm/desc.h>
    22.6  #include <asm-xen/multicall.h>
    22.7 -#include <asm/hypervisor-ifs/dom0_ops.h>
    22.8 +#include <asm/xen-public/dom0_ops.h>
    22.9  #ifdef CONFIG_MATH_EMULATION
   22.10  #include <asm/math_emu.h>
   22.11  #endif
    23.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c	Sun Oct 31 08:22:21 2004 +0000
    23.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c	Sun Oct 31 09:56:36 2004 +0000
    23.3 @@ -6,8 +6,8 @@
    23.4  #include <linux/init.h>
    23.5  #include "pci.h"
    23.6  
    23.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    23.8 -#include <asm/hypervisor-ifs/physdev.h>
    23.9 +#include <asm/xen-public/xen.h>
   23.10 +#include <asm/xen-public/physdev.h>
   23.11  
   23.12  /*
   23.13   * Functions for accessing PCI configuration space with type xen accesses
    24.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c	Sun Oct 31 08:22:21 2004 +0000
    24.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c	Sun Oct 31 09:56:36 2004 +0000
    24.3 @@ -19,8 +19,8 @@
    24.4  
    24.5  #include "pci.h"
    24.6  
    24.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    24.8 -#include <asm/hypervisor-ifs/physdev.h>
    24.9 +#include <asm/xen-public/xen.h>
   24.10 +#include <asm/xen-public/physdev.h>
   24.11  
   24.12  /*
   24.13   * Never use: 0, 1, 2 (timer, keyboard, and cascade)
    25.1 --- a/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c	Sun Oct 31 08:22:21 2004 +0000
    25.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c	Sun Oct 31 09:56:36 2004 +0000
    25.3 @@ -38,8 +38,8 @@
    25.4  #include <asm/system.h>
    25.5  #include <asm/ptrace.h>
    25.6  #include <asm/synch_bitops.h>
    25.7 -#include <asm/hypervisor-ifs/event_channel.h>
    25.8 -#include <asm/hypervisor-ifs/physdev.h>
    25.9 +#include <asm/xen-public/event_channel.h>
   25.10 +#include <asm/xen-public/physdev.h>
   25.11  #include <asm-xen/ctrl_if.h>
   25.12  #include <asm-xen/hypervisor.h>
   25.13  
    26.1 --- a/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c	Sun Oct 31 08:22:21 2004 +0000
    26.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c	Sun Oct 31 09:56:36 2004 +0000
    26.3 @@ -12,7 +12,7 @@ static int errno;
    26.4  #include <asm/mmu_context.h>
    26.5  #include <asm-xen/ctrl_if.h>
    26.6  #include <asm-xen/hypervisor.h>
    26.7 -#include <asm-xen/hypervisor-ifs/dom0_ops.h>
    26.8 +#include <asm-xen/xen-public/dom0_ops.h>
    26.9  #include <asm-xen/suspend.h>
   26.10  #include <asm-xen/queues.h>
   26.11  
    27.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h	Sun Oct 31 08:22:21 2004 +0000
    27.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h	Sun Oct 31 09:56:36 2004 +0000
    27.3 @@ -14,7 +14,7 @@
    27.4  #include <asm/pgalloc.h>
    27.5  #include <asm-xen/ctrl_if.h>
    27.6  #include <asm-xen/hypervisor.h>
    27.7 -#include <asm-xen/hypervisor-ifs/io/blkif.h>
    27.8 +#include <asm-xen/xen-public/io/blkif.h>
    27.9  
   27.10  #if 0
   27.11  #define ASSERT(_p) \
    28.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h	Sun Oct 31 08:22:21 2004 +0000
    28.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h	Sun Oct 31 09:56:36 2004 +0000
    28.3 @@ -44,8 +44,8 @@
    28.4  #include <linux/blkdev.h>
    28.5  #include <linux/major.h>
    28.6  #include <linux/devfs_fs_kernel.h>
    28.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    28.8 -#include <asm-xen/hypervisor-ifs/io/blkif.h>
    28.9 +#include <asm/xen-public/xen.h>
   28.10 +#include <asm-xen/xen-public/io/blkif.h>
   28.11  #include <asm/io.h>
   28.12  #include <asm/atomic.h>
   28.13  #include <asm/uaccess.h>
    29.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/console/console.c	Sun Oct 31 08:22:21 2004 +0000
    29.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/console/console.c	Sun Oct 31 09:56:36 2004 +0000
    29.3 @@ -47,7 +47,7 @@
    29.4  #include <asm/io.h>
    29.5  #include <asm/irq.h>
    29.6  #include <asm/uaccess.h>
    29.7 -#include <asm/hypervisor-ifs/event_channel.h>
    29.8 +#include <asm/xen-public/event_channel.h>
    29.9  #include <asm-xen/hypervisor.h>
   29.10  #include <asm-xen/evtchn.h>
   29.11  #include <asm-xen/ctrl_if.h>
    30.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/netback/common.h	Sun Oct 31 08:22:21 2004 +0000
    30.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/netback/common.h	Sun Oct 31 09:56:36 2004 +0000
    30.3 @@ -15,7 +15,7 @@
    30.4  #include <linux/netdevice.h>
    30.5  #include <linux/etherdevice.h>
    30.6  #include <asm-xen/ctrl_if.h>
    30.7 -#include <asm-xen/hypervisor-ifs/io/netif.h>
    30.8 +#include <asm-xen/xen-public/io/netif.h>
    30.9  #include <asm/io.h>
   30.10  #include <asm/pgalloc.h>
   30.11  
    31.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c	Sun Oct 31 08:22:21 2004 +0000
    31.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c	Sun Oct 31 09:56:36 2004 +0000
    31.3 @@ -44,7 +44,7 @@
    31.4  #include <asm/io.h>
    31.5  #include <asm-xen/evtchn.h>
    31.6  #include <asm-xen/ctrl_if.h>
    31.7 -#include <asm-xen/hypervisor-ifs/io/netif.h>
    31.8 +#include <asm-xen/xen-public/io/netif.h>
    31.9  #include <asm/page.h>
   31.10  
   31.11  #include <net/arp.h>
    32.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c	Sun Oct 31 08:22:21 2004 +0000
    32.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c	Sun Oct 31 09:56:36 2004 +0000
    32.3 @@ -26,7 +26,7 @@
    32.4  #include <asm/uaccess.h>
    32.5  #include <asm/tlb.h>
    32.6  #include <asm-xen/proc_cmd.h>
    32.7 -#include <asm/hypervisor-ifs/dom0_ops.h>
    32.8 +#include <asm/xen-public/dom0_ops.h>
    32.9  #include <asm-xen/xen_proc.h>
   32.10  
   32.11  static struct proc_dir_entry *privcmd_intf;
    33.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Sun Oct 31 08:22:21 2004 +0000
    33.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Sun Oct 31 09:56:36 2004 +0000
    33.3 @@ -15,7 +15,7 @@
    33.4  #include <linux/config.h>
    33.5  #include <linux/string.h>
    33.6  #include <linux/types.h>
    33.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    33.8 +#include <asm/xen-public/xen.h>
    33.9  
   33.10  #ifdef CONFIG_XEN_SCRUB_PAGES
   33.11  #define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
    34.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h	Sun Oct 31 08:22:21 2004 +0000
    34.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h	Sun Oct 31 09:56:36 2004 +0000
    34.3 @@ -35,7 +35,7 @@
    34.4  #include <asm-xen/hypervisor.h>
    34.5  #include <asm/ptrace.h>
    34.6  #include <asm/synch_bitops.h>
    34.7 -#include <asm/hypervisor-ifs/event_channel.h>
    34.8 +#include <asm/xen-public/event_channel.h>
    34.9  
   34.10  /*
   34.11   * LOW-LEVEL DEFINITIONS
    35.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h	Sun Oct 31 08:22:21 2004 +0000
    35.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h	Sun Oct 31 09:56:36 2004 +0000
    35.3 @@ -14,7 +14,7 @@
    35.4  
    35.5  #include <linux/config.h>
    35.6  #include <asm-xen/hypervisor.h>
    35.7 -#include <asm-xen/hypervisor-ifs/grant_table.h>
    35.8 +#include <asm-xen/xen-public/grant_table.h>
    35.9  
   35.10  int
   35.11  gnttab_grant_foreign_access(
    36.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Sun Oct 31 08:22:21 2004 +0000
    36.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Sun Oct 31 09:56:36 2004 +0000
    36.3 @@ -33,9 +33,9 @@
    36.4  #include <linux/types.h>
    36.5  #include <linux/kernel.h>
    36.6  #include <linux/version.h>
    36.7 -#include <asm/hypervisor-ifs/hypervisor-if.h>
    36.8 -#include <asm/hypervisor-ifs/dom0_ops.h>
    36.9 -#include <asm/hypervisor-ifs/io/domain_controller.h>
   36.10 +#include <asm/xen-public/xen.h>
   36.11 +#include <asm/xen-public/dom0_ops.h>
   36.12 +#include <asm/xen-public/io/domain_controller.h>
   36.13  #include <asm/ptrace.h>
   36.14  #include <asm/page.h>
   36.15  
    37.1 --- a/linux-2.6.9-xen-sparse/mkbuildtree	Sun Oct 31 08:22:21 2004 +0000
    37.2 +++ b/linux-2.6.9-xen-sparse/mkbuildtree	Sun Oct 31 09:56:36 2004 +0000
    37.3 @@ -103,9 +103,9 @@ relative_lndir ${RS}
    37.4  rm -f mkbuildtree
    37.5  
    37.6  
    37.7 -# Create links to the shared definitions of the hypervisor interface
    37.8 -rm -rf ${AD}/include/asm-xen/hypervisor-ifs
    37.9 -mkdir  ${AD}/include/asm-xen/hypervisor-ifs
   37.10 -cd     ${AD}/include/asm-xen/hypervisor-ifs
   37.11 -relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
   37.12 +# Create links to the shared definitions of the Xen interfaces.
   37.13 +rm -rf ${AD}/include/asm-xen/xen-public
   37.14 +mkdir  ${AD}/include/asm-xen/xen-public
   37.15 +cd     ${AD}/include/asm-xen/xen-public
   37.16 +relative_lndir ../../../${RS}/../xen/include/public
   37.17  
    38.1 --- a/netbsd-2.0-xen-sparse/mkbuildtree	Sun Oct 31 08:22:21 2004 +0000
    38.2 +++ b/netbsd-2.0-xen-sparse/mkbuildtree	Sun Oct 31 09:56:36 2004 +0000
    38.3 @@ -103,11 +103,11 @@ relative_lndir ${RS}
    38.4  rm -f mkbuildtree
    38.5  
    38.6  
    38.7 -# Create links to the shared definitions of the hypervisor interface
    38.8 -rm -rf ${AD}/sys/arch/xen/include/hypervisor-ifs
    38.9 -mkdir  ${AD}/sys/arch/xen/include/hypervisor-ifs
   38.10 -cd     ${AD}/sys/arch/xen/include/hypervisor-ifs
   38.11 -relative_lndir ../../../../../${RS}/../xen/include/hypervisor-ifs
   38.12 +# Create links to the shared definitions of the Xen interface
   38.13 +rm -rf ${AD}/sys/arch/xen/include/xen-public
   38.14 +mkdir  ${AD}/sys/arch/xen/include/xen-public
   38.15 +cd     ${AD}/sys/arch/xen/include/xen-public
   38.16 +relative_lndir ../../../../../${RS}/../xen/include/public
   38.17  
   38.18  # Remove files which don't exist anymore
   38.19  rm -rf ${AD}/sys/arch/xen/xen/events.c
    39.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h	Sun Oct 31 08:22:21 2004 +0000
    39.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h	Sun Oct 31 09:56:36 2004 +0000
    39.3 @@ -54,12 +54,12 @@ struct xen_npx_attach_args {
    39.4  
    39.5  /* include the hypervisor interface */
    39.6  #include <sys/systm.h>
    39.7 -#include <machine/hypervisor-ifs/hypervisor-if.h>
    39.8 -#include <machine/hypervisor-ifs/dom0_ops.h>
    39.9 -#include <machine/hypervisor-ifs/event_channel.h>
   39.10 -#include <machine/hypervisor-ifs/io/domain_controller.h>
   39.11 -#include <machine/hypervisor-ifs/io/netif.h>
   39.12 -#include <machine/hypervisor-ifs/io/blkif.h>
   39.13 +#include <machine/xen-public/xen.h>
   39.14 +#include <machine/xen-public/dom0_ops.h>
   39.15 +#include <machine/xen-public/event_channel.h>
   39.16 +#include <machine/xen-public/io/domain_controller.h>
   39.17 +#include <machine/xen-public/io/netif.h>
   39.18 +#include <machine/xen-public/io/blkif.h>
   39.19  
   39.20  #undef u8
   39.21  #undef u16
    40.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h	Sun Oct 31 08:22:21 2004 +0000
    40.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h	Sun Oct 31 09:56:36 2004 +0000
    40.3 @@ -85,7 +85,7 @@ void vprintk(const char *, va_list);
    40.4  
    40.5  
    40.6  /*
    40.7 - * these are also defined in hypervisor-if.h but can't be pulled in as
    40.8 + * these are also defined in xen-public/xen.h but can't be pulled in as
    40.9   * they are used in start of day assembly. Need to clean up the .h files
   40.10   * a bit more...
   40.11   */
    41.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c	Sun Oct 31 08:22:21 2004 +0000
    41.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c	Sun Oct 31 09:56:36 2004 +0000
    41.3 @@ -74,7 +74,7 @@
    41.4  #include <machine/xenkbcvar.h>
    41.5  #include <machine/xen.h>
    41.6  #include <machine/hypervisor.h>
    41.7 -#include <machine/hypervisor-ifs/kbd.h>
    41.8 +#include <machine/xen-public/kbd.h>
    41.9  #include <machine/evtchn.h>
   41.10  
   41.11  #define	KBC_DELAY	DELAY(1000)
    42.1 --- a/tools/Make.defs	Sun Oct 31 08:22:21 2004 +0000
    42.2 +++ b/tools/Make.defs	Sun Oct 31 09:56:36 2004 +0000
    42.3 @@ -1,5 +1,5 @@
    42.4  #  -*- mode: Makefile; -*-
    42.5 -XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/hypervisor-ifs
    42.6 +XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/public
    42.7  XEN_LINUX_INCLUDE  = $(XEN_ROOT)/linux-xen-sparse/include
    42.8  XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
    42.9  XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
    43.1 --- a/tools/libxc/xc.h	Sun Oct 31 08:22:21 2004 +0000
    43.2 +++ b/tools/libxc/xc.h	Sun Oct 31 09:56:36 2004 +0000
    43.3 @@ -18,7 +18,7 @@ typedef signed short       s16;
    43.4  typedef signed long        s32;
    43.5  typedef signed long long   s64;
    43.6  
    43.7 -#include "xen/hypervisor-if.h"
    43.8 +#include "xen/xen.h"
    43.9  #include "xen/dom0_ops.h"
   43.10  #include "xen/event_channel.h"
   43.11  #include "xen/sched_ctl.h"
    44.1 --- a/tools/python/setup.py	Sun Oct 31 08:22:21 2004 +0000
    44.2 +++ b/tools/python/setup.py	Sun Oct 31 09:56:36 2004 +0000
    44.3 @@ -7,8 +7,7 @@ XEN_ROOT = "../.."
    44.4  extra_compile_args  = [ "-fno-strict-aliasing", "-Wall", "-Werror" ]
    44.5  
    44.6  
    44.7 -include_dirs = [ XEN_ROOT + "/xen/include/hypervisor-ifs",
    44.8 -                 XEN_ROOT + "/linux-xen-sparse/include",
    44.9 +include_dirs = [ XEN_ROOT + "/linux-xen-sparse/include",
   44.10                   XEN_ROOT + "/tools/python/xen/lowlevel/xu",
   44.11                   XEN_ROOT + "/tools/libxc",
   44.12                   XEN_ROOT + "/tools/libxutil",
    45.1 --- a/tools/python/xen/lowlevel/xu/xu.c	Sun Oct 31 08:22:21 2004 +0000
    45.2 +++ b/tools/python/xen/lowlevel/xu/xu.c	Sun Oct 31 09:56:36 2004 +0000
    45.3 @@ -23,8 +23,8 @@
    45.4  #include <signal.h>
    45.5  #include <xc.h>
    45.6  
    45.7 -#include <hypervisor-if.h>
    45.8 -#include <io/domain_controller.h>
    45.9 +#include <xen/xen.h>
   45.10 +#include <xen/io/domain_controller.h>
   45.11  
   45.12  #include <asm-xen/proc_cmd.h>
   45.13  
    46.1 --- a/xen/COPYING	Sun Oct 31 08:22:21 2004 +0000
    46.2 +++ b/xen/COPYING	Sun Oct 31 09:56:36 2004 +0000
    46.3 @@ -10,9 +10,9 @@ virtual machine monitor) is copyrighted 
    46.4  wrote it.
    46.5  
    46.6  Further note that the guest-OS interfacing header files, which
    46.7 -includes all files within the subdirectory include/hypervisor-ifs, are
    46.8 +includes all files within the subdirectory include/public, are
    46.9  *not* covered by the GPL but by a much weaker license:
   46.10 - include/hypervisor-ifs/COPYING
   46.11 + include/public/COPYING
   46.12  
   46.13  Also note that the only valid version of the GPL as far as Xen is
   46.14  concerned is _this_ particular version of the license (i.e., *only*
    47.1 --- a/xen/Makefile	Sun Oct 31 08:22:21 2004 +0000
    47.2 +++ b/xen/Makefile	Sun Oct 31 09:56:36 2004 +0000
    47.3 @@ -23,9 +23,9 @@ install: $(TARGET)
    47.4  	install -m0644 $(TARGET).gz $(prefix)/boot
    47.5  	install -m0644 $(TARGET)-syms $(prefix)/boot
    47.6  	mkdir -p $(prefix)/usr/include/xen/io
    47.7 -	install -m0644 include/hypervisor-ifs/*.h $(prefix)/usr/include/xen
    47.8 -	install -m0644 include/hypervisor-ifs/io/*.h $(prefix)/usr/include/xen/io
    47.9 -	install -m0644 include/hypervisor-ifs/COPYING $(prefix)/usr/include/xen
   47.10 +	install -m0644 include/public/*.h $(prefix)/usr/include/xen
   47.11 +	install -m0644 include/public/io/*.h $(prefix)/usr/include/xen/io
   47.12 +	install -m0644 include/public/COPYING $(prefix)/usr/include/xen
   47.13  
   47.14  dist: $(TARGET)
   47.15  	$(MAKE) prefix=`pwd`/../install dist=yes install
    48.1 --- a/xen/Rules.mk	Sun Oct 31 08:22:21 2004 +0000
    48.2 +++ b/xen/Rules.mk	Sun Oct 31 09:56:36 2004 +0000
    48.3 @@ -18,7 +18,7 @@ TARGET_SUBARCH  ?= $(COMPILE_SUBARCH)
    48.4  TARGET  := $(BASEDIR)/xen
    48.5  HDRS    := $(wildcard $(BASEDIR)/include/xen/*.h)
    48.6  HDRS    += $(wildcard $(BASEDIR)/include/scsi/*.h)
    48.7 -HDRS    += $(wildcard $(BASEDIR)/include/hypervisor-ifs/*.h)
    48.8 +HDRS    += $(wildcard $(BASEDIR)/include/public/*.h)
    48.9  HDRS    += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
   48.10  HDRS    += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
   48.11  # compile.h is always regenerated, but other files shouldn't be rebuilt
    49.1 --- a/xen/arch/x86/boot/x86_32.S	Sun Oct 31 08:22:21 2004 +0000
    49.2 +++ b/xen/arch/x86/boot/x86_32.S	Sun Oct 31 09:56:36 2004 +0000
    49.3 @@ -1,5 +1,5 @@
    49.4  #include <xen/config.h>
    49.5 -#include <hypervisor-ifs/hypervisor-if.h>
    49.6 +#include <public/xen.h>
    49.7  #include <asm/page.h>
    49.8  
    49.9  #define  SECONDARY_CPU_FLAG 0xA5A5A5A5
    50.1 --- a/xen/arch/x86/boot/x86_64.S	Sun Oct 31 08:22:21 2004 +0000
    50.2 +++ b/xen/arch/x86/boot/x86_64.S	Sun Oct 31 09:56:36 2004 +0000
    50.3 @@ -1,5 +1,5 @@
    50.4  #include <xen/config.h>
    50.5 -#include <hypervisor-ifs/hypervisor-if.h>
    50.6 +#include <public/xen.h>
    50.7  #include <asm/page.h>
    50.8  #include <asm/msr.h>
    50.9  
    51.1 --- a/xen/arch/x86/dom0_ops.c	Sun Oct 31 08:22:21 2004 +0000
    51.2 +++ b/xen/arch/x86/dom0_ops.c	Sun Oct 31 09:56:36 2004 +0000
    51.3 @@ -10,7 +10,7 @@
    51.4  #include <xen/types.h>
    51.5  #include <xen/lib.h>
    51.6  #include <xen/mm.h>
    51.7 -#include <hypervisor-ifs/dom0_ops.h>
    51.8 +#include <public/dom0_ops.h>
    51.9  #include <xen/sched.h>
   51.10  #include <xen/event.h>
   51.11  #include <asm/domain_page.h>
   51.12 @@ -19,7 +19,7 @@
   51.13  #include <xen/trace.h>
   51.14  #include <xen/console.h>
   51.15  #include <asm/shadow.h>
   51.16 -#include <hypervisor-ifs/sched_ctl.h>
   51.17 +#include <public/sched_ctl.h>
   51.18  
   51.19  #define TRC_DOM0OP_ENTER_BASE  0x00020000
   51.20  #define TRC_DOM0OP_LEAVE_BASE  0x00030000
    52.1 --- a/xen/arch/x86/trampoline.S	Sun Oct 31 08:22:21 2004 +0000
    52.2 +++ b/xen/arch/x86/trampoline.S	Sun Oct 31 09:56:36 2004 +0000
    52.3 @@ -16,7 +16,7 @@
    52.4   */
    52.5  
    52.6  #include <xen/config.h>
    52.7 -#include <hypervisor-ifs/hypervisor-if.h>
    52.8 +#include <public/xen.h>
    52.9  #include <asm/page.h>
   52.10  
   52.11  #ifdef CONFIG_SMP
    53.1 --- a/xen/arch/x86/x86_32/entry.S	Sun Oct 31 08:22:21 2004 +0000
    53.2 +++ b/xen/arch/x86/x86_32/entry.S	Sun Oct 31 09:56:36 2004 +0000
    53.3 @@ -59,7 +59,7 @@
    53.4  #include <xen/config.h>
    53.5  #include <xen/errno.h>
    53.6  #include <xen/softirq.h>
    53.7 -#include <hypervisor-ifs/hypervisor-if.h>
    53.8 +#include <public/xen.h>
    53.9  
   53.10  EBX		= 0x00
   53.11  ECX		= 0x04
    54.1 --- a/xen/common/debug-linux.c	Sun Oct 31 08:22:21 2004 +0000
    54.2 +++ b/xen/common/debug-linux.c	Sun Oct 31 09:56:36 2004 +0000
    54.3 @@ -13,7 +13,7 @@
    54.4  #include <xen/config.h>
    54.5  #include <xen/types.h>
    54.6  #include <xen/lib.h>
    54.7 -#include <hypervisor-ifs/dom0_ops.h>
    54.8 +#include <public/dom0_ops.h>
    54.9  #include <asm/pdb.h>
   54.10  
   54.11  /* from linux/sched.h */
    55.1 --- a/xen/common/debug.c	Sun Oct 31 08:22:21 2004 +0000
    55.2 +++ b/xen/common/debug.c	Sun Oct 31 09:56:36 2004 +0000
    55.3 @@ -7,7 +7,7 @@
    55.4  #include <xen/config.h>
    55.5  #include <xen/types.h>
    55.6  #include <xen/lib.h>
    55.7 -#include <hypervisor-ifs/dom0_ops.h>
    55.8 +#include <public/dom0_ops.h>
    55.9  #include <xen/sched.h>
   55.10  #include <xen/event.h>
   55.11  #include <asm/page.h>
    56.1 --- a/xen/common/dom0_ops.c	Sun Oct 31 08:22:21 2004 +0000
    56.2 +++ b/xen/common/dom0_ops.c	Sun Oct 31 09:56:36 2004 +0000
    56.3 @@ -10,7 +10,7 @@
    56.4  #include <xen/types.h>
    56.5  #include <xen/lib.h>
    56.6  #include <xen/mm.h>
    56.7 -#include <hypervisor-ifs/dom0_ops.h>
    56.8 +#include <public/dom0_ops.h>
    56.9  #include <xen/sched.h>
   56.10  #include <xen/event.h>
   56.11  #include <asm/domain_page.h>
   56.12 @@ -18,7 +18,7 @@
   56.13  #include <xen/trace.h>
   56.14  #include <xen/console.h>
   56.15  #include <asm/shadow.h>
   56.16 -#include <hypervisor-ifs/sched_ctl.h>
   56.17 +#include <public/sched_ctl.h>
   56.18  
   56.19  #define TRC_DOM0OP_ENTER_BASE  0x00020000
   56.20  #define TRC_DOM0OP_LEAVE_BASE  0x00030000
    57.1 --- a/xen/common/domain.c	Sun Oct 31 08:22:21 2004 +0000
    57.2 +++ b/xen/common/domain.c	Sun Oct 31 09:56:36 2004 +0000
    57.3 @@ -14,7 +14,7 @@
    57.4  #include <xen/time.h>
    57.5  #include <xen/console.h>
    57.6  #include <asm/shadow.h>
    57.7 -#include <hypervisor-ifs/dom0_ops.h>
    57.8 +#include <public/dom0_ops.h>
    57.9  #include <asm/domain_page.h>
   57.10  
   57.11  /* Both these structures are protected by the tasklist_lock. */
    58.1 --- a/xen/common/event_channel.c	Sun Oct 31 08:22:21 2004 +0000
    58.2 +++ b/xen/common/event_channel.c	Sun Oct 31 09:56:36 2004 +0000
    58.3 @@ -23,8 +23,8 @@
    58.4  #include <xen/event.h>
    58.5  #include <xen/irq.h>
    58.6  
    58.7 -#include <hypervisor-ifs/hypervisor-if.h>
    58.8 -#include <hypervisor-ifs/event_channel.h>
    58.9 +#include <public/xen.h>
   58.10 +#include <public/event_channel.h>
   58.11  
   58.12  #define INIT_EVENT_CHANNELS   16
   58.13  #define MAX_EVENT_CHANNELS  1024
    59.1 --- a/xen/common/kernel.c	Sun Oct 31 08:22:21 2004 +0000
    59.2 +++ b/xen/common/kernel.c	Sun Oct 31 09:56:36 2004 +0000
    59.3 @@ -24,7 +24,7 @@
    59.4  #include <asm/io.h>
    59.5  #include <asm/uaccess.h>
    59.6  #include <asm/domain_page.h>
    59.7 -#include <hypervisor-ifs/dom0_ops.h>
    59.8 +#include <public/dom0_ops.h>
    59.9  
   59.10  unsigned long xenheap_phys_end;
   59.11  
    60.1 --- a/xen/common/physdev.c	Sun Oct 31 08:22:21 2004 +0000
    60.2 +++ b/xen/common/physdev.c	Sun Oct 31 09:56:36 2004 +0000
    60.3 @@ -26,8 +26,8 @@
    60.4  #include <xen/irq.h>
    60.5  #include <xen/event.h>
    60.6  #include <asm/pci.h>
    60.7 -#include <hypervisor-ifs/hypervisor-if.h>
    60.8 -#include <hypervisor-ifs/physdev.h>
    60.9 +#include <public/xen.h>
   60.10 +#include <public/physdev.h>
   60.11  
   60.12  /* Called by PHYSDEV_PCI_INITIALISE_DEVICE to finalise IRQ routing. */
   60.13  extern void pcibios_enable_irq(struct pci_dev *dev);
    61.1 --- a/xen/common/sched_atropos.c	Sun Oct 31 08:22:21 2004 +0000
    61.2 +++ b/xen/common/sched_atropos.c	Sun Oct 31 09:56:36 2004 +0000
    61.3 @@ -20,7 +20,7 @@
    61.4  #include <xen/time.h>
    61.5  #include <xen/sched.h>
    61.6  #include <xen/sched-if.h>
    61.7 -#include <hypervisor-ifs/sched_ctl.h>
    61.8 +#include <public/sched_ctl.h>
    61.9  #include <xen/trace.h>
   61.10  
   61.11  #define ATROPOS_TASK_UNBLOCKED 16
    62.1 --- a/xen/common/sched_rrobin.c	Sun Oct 31 08:22:21 2004 +0000
    62.2 +++ b/xen/common/sched_rrobin.c	Sun Oct 31 09:56:36 2004 +0000
    62.3 @@ -6,7 +6,7 @@
    62.4  
    62.5  #include <xen/sched.h>
    62.6  #include <xen/sched-if.h>
    62.7 -#include <hypervisor-ifs/sched_ctl.h>
    62.8 +#include <public/sched_ctl.h>
    62.9  #include <xen/ac_timer.h>
   62.10  #include <xen/softirq.h>
   62.11  #include <xen/time.h>
    63.1 --- a/xen/common/schedule.c	Sun Oct 31 08:22:21 2004 +0000
    63.2 +++ b/xen/common/schedule.c	Sun Oct 31 09:56:36 2004 +0000
    63.3 @@ -26,7 +26,7 @@
    63.4  #include <xen/sched-if.h>
    63.5  #include <xen/softirq.h>
    63.6  #include <xen/trace.h>
    63.7 -#include <hypervisor-ifs/sched_ctl.h>
    63.8 +#include <public/sched_ctl.h>
    63.9  
   63.10  /*#define WAKE_HISTO*/
   63.11  /*#define BLOCKTIME_HISTO*/
    64.1 --- a/xen/common/trace.c	Sun Oct 31 08:22:21 2004 +0000
    64.2 +++ b/xen/common/trace.c	Sun Oct 31 09:56:36 2004 +0000
    64.3 @@ -13,7 +13,7 @@
    64.4   * it's possible to reconstruct a chronological record of trace events.
    64.5   *
    64.6   * See also include/xen/trace.h and the dom0 op in
    64.7 - * include/hypervisor-ifs/dom0_ops.h
    64.8 + * include/public/dom0_ops.h
    64.9   */
   64.10  
   64.11  #include <xen/config.h>
   64.12 @@ -26,7 +26,7 @@
   64.13  #include <xen/trace.h>
   64.14  #include <xen/errno.h>
   64.15  #include <asm/atomic.h>
   64.16 -#include <hypervisor-ifs/dom0_ops.h>
   64.17 +#include <public/dom0_ops.h>
   64.18  
   64.19  /* Pointers to the meta-data objects for all system trace buffers */
   64.20  struct t_buf *t_bufs[NR_CPUS];
    65.1 --- a/xen/include/asm-x86/mm.h	Sun Oct 31 08:22:21 2004 +0000
    65.2 +++ b/xen/include/asm-x86/mm.h	Sun Oct 31 09:56:36 2004 +0000
    65.3 @@ -14,7 +14,7 @@
    65.4  #include <asm/flushtlb.h>
    65.5  #include <asm/io.h>
    65.6  
    65.7 -#include <hypervisor-ifs/hypervisor-if.h>
    65.8 +#include <public/xen.h>
    65.9  
   65.10  /*
   65.11   * Per-page-frame information.
    66.1 --- a/xen/include/asm-x86/pdb.h	Sun Oct 31 08:22:21 2004 +0000
    66.2 +++ b/xen/include/asm-x86/pdb.h	Sun Oct 31 09:56:36 2004 +0000
    66.3 @@ -14,8 +14,8 @@
    66.4  
    66.5  #include <asm/ptrace.h>
    66.6  #include <xen/list.h>
    66.7 -#include <hypervisor-ifs/dom0_ops.h>
    66.8 -#include <hypervisor-ifs/hypervisor-if.h>                   /* for domain id */
    66.9 +#include <public/dom0_ops.h>
   66.10 +#include <public/xen.h>                   /* for domain id */
   66.11  
   66.12  extern int pdb_initialized;
   66.13  extern int pdb_com_port;
    67.1 --- a/xen/include/asm-x86/processor.h	Sun Oct 31 08:22:21 2004 +0000
    67.2 +++ b/xen/include/asm-x86/processor.h	Sun Oct 31 09:56:36 2004 +0000
    67.3 @@ -15,7 +15,7 @@
    67.4  #include <asm/pdb.h>
    67.5  #include <xen/config.h>
    67.6  #include <xen/spinlock.h>
    67.7 -#include <hypervisor-ifs/hypervisor-if.h>
    67.8 +#include <public/xen.h>
    67.9  
   67.10  struct domain;
   67.11  
    68.1 --- a/xen/include/hypervisor-ifs/COPYING	Sun Oct 31 08:22:21 2004 +0000
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,28 +0,0 @@
    68.4 -XEN NOTICE
    68.5 -==========
    68.6 -
    68.7 -This copyright applies to all files within this subdirectory. All
    68.8 -other files in the Xen source distribution are covered by version 2 of
    68.9 -the GNU General Public License.
   68.10 -
   68.11 - -- Keir Fraser (on behalf of the Xen team)
   68.12 -
   68.13 -=====================================================================
   68.14 -
   68.15 -Permission is hereby granted, free of charge, to any person obtaining a copy
   68.16 -of this software and associated documentation files (the "Software"), to
   68.17 -deal in the Software without restriction, including without limitation the
   68.18 -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   68.19 -sell copies of the Software, and to permit persons to whom the Software is
   68.20 -furnished to do so, subject to the following conditions:
   68.21 -
   68.22 -The above copyright notice and this permission notice shall be included in
   68.23 -all copies or substantial portions of the Software.
   68.24 -
   68.25 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
   68.26 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   68.27 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
   68.28 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
   68.29 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
   68.30 -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
   68.31 -DEALINGS IN THE SOFTWARE.
    69.1 --- a/xen/include/hypervisor-ifs/arch-x86_32.h	Sun Oct 31 08:22:21 2004 +0000
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,141 +0,0 @@
    69.4 -/******************************************************************************
    69.5 - * arch-i386/hypervisor-if.h
    69.6 - * 
    69.7 - * Guest OS interface to x86 32-bit Xen.
    69.8 - */
    69.9 -
   69.10 -#ifndef __HYPERVISOR_IF_I386_H__
   69.11 -#define __HYPERVISOR_IF_I386_H__
   69.12 -
   69.13 -/*
   69.14 - * Pointers and other address fields inside interface structures are padded to
   69.15 - * 64 bits. This means that field alignments aren't different between 32- and
   69.16 - * 64-bit architectures. 
   69.17 - */
   69.18 -/* NB. Multi-level macro ensures __LINE__ is expanded before concatenation. */
   69.19 -#define __MEMORY_PADDING(_X) u32 __pad_ ## _X
   69.20 -#define _MEMORY_PADDING(_X)  __MEMORY_PADDING(_X)
   69.21 -#define MEMORY_PADDING       _MEMORY_PADDING(__LINE__)
   69.22 -
   69.23 -/*
   69.24 - * SEGMENT DESCRIPTOR TABLES
   69.25 - */
   69.26 -/*
   69.27 - * A number of GDT entries are reserved by Xen. These are not situated at the
   69.28 - * start of the GDT because some stupid OSes export hard-coded selector values
   69.29 - * in their ABI. These hard-coded values are always near the start of the GDT,
   69.30 - * so Xen places itself out of the way.
   69.31 - * 
   69.32 - * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
   69.33 - * and LAST_RESERVED_GDT_ENTRY are reserved).
   69.34 - */
   69.35 -#define NR_RESERVED_GDT_ENTRIES    40
   69.36 -#define FIRST_RESERVED_GDT_ENTRY   256
   69.37 -#define LAST_RESERVED_GDT_ENTRY    \
   69.38 -  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
   69.39 -
   69.40 -
   69.41 -/*
   69.42 - * These flat segments are in the Xen-private section of every GDT. Since these
   69.43 - * are also present in the initial GDT, many OSes will be able to avoid
   69.44 - * installing their own GDT.
   69.45 - */
   69.46 -#define FLAT_RING1_CS 0x0819    /* GDT index 259 */
   69.47 -#define FLAT_RING1_DS 0x0821    /* GDT index 260 */
   69.48 -#define FLAT_RING3_CS 0x082b    /* GDT index 261 */
   69.49 -#define FLAT_RING3_DS 0x0833    /* GDT index 262 */
   69.50 -
   69.51 -#define FLAT_GUESTOS_CS FLAT_RING1_CS
   69.52 -#define FLAT_GUESTOS_DS FLAT_RING1_DS
   69.53 -#define FLAT_USER_CS    FLAT_RING3_CS
   69.54 -#define FLAT_USER_DS    FLAT_RING3_DS
   69.55 -
   69.56 -/* And the trap vector is... */
   69.57 -#define TRAP_INSTR "int $0x82"
   69.58 -
   69.59 -
   69.60 -/*
   69.61 - * Virtual addresses beyond this are not modifiable by guest OSes. The 
   69.62 - * machine->physical mapping table starts at this address, read-only.
   69.63 - */
   69.64 -#define HYPERVISOR_VIRT_START (0xFC000000UL)
   69.65 -#ifndef machine_to_phys_mapping
   69.66 -#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
   69.67 -#endif
   69.68 -
   69.69 -#ifndef __ASSEMBLY__
   69.70 -
   69.71 -/* NB. Both the following are 32 bits each. */
   69.72 -typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
   69.73 -typedef unsigned long cpureg_t;   /* Full-sized register.                    */
   69.74 -
   69.75 -/*
   69.76 - * Send an array of these to HYPERVISOR_set_trap_table()
   69.77 - */
   69.78 -#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
   69.79 -#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
   69.80 -#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   69.81 -#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   69.82 -typedef struct {
   69.83 -    u8       vector;  /* 0: exception vector                              */
   69.84 -    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
   69.85 -    u16      cs;      /* 2: code selector                                 */
   69.86 -    memory_t address; /* 4: code address                                  */
   69.87 -} PACKED trap_info_t; /* 8 bytes */
   69.88 -
   69.89 -typedef struct
   69.90 -{
   69.91 -    unsigned long ebx;
   69.92 -    unsigned long ecx;
   69.93 -    unsigned long edx;
   69.94 -    unsigned long esi;
   69.95 -    unsigned long edi;
   69.96 -    unsigned long ebp;
   69.97 -    unsigned long eax;
   69.98 -    unsigned long ds;
   69.99 -    unsigned long es;
  69.100 -    unsigned long fs;
  69.101 -    unsigned long gs;
  69.102 -    unsigned long _unused;
  69.103 -    unsigned long eip;
  69.104 -    unsigned long cs;
  69.105 -    unsigned long eflags;
  69.106 -    unsigned long esp;
  69.107 -    unsigned long ss;
  69.108 -} PACKED execution_context_t;
  69.109 -
  69.110 -typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
  69.111 -
  69.112 -/*
  69.113 - * The following is all CPU context. Note that the i387_ctxt block is filled 
  69.114 - * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
  69.115 - */
  69.116 -typedef struct {
  69.117 -#define ECF_I387_VALID (1<<0)
  69.118 -    unsigned long flags;
  69.119 -    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
  69.120 -    char          fpu_ctxt[256];            /* User-level FPU registers     */
  69.121 -    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
  69.122 -    unsigned int  fast_trap_idx;            /* "Fast trap" vector offset    */
  69.123 -    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
  69.124 -    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
  69.125 -    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
  69.126 -    unsigned long pt_base;                  /* CR3 (pagetable base)         */
  69.127 -    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
  69.128 -    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
  69.129 -    unsigned long event_callback_eip;
  69.130 -    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
  69.131 -    unsigned long failsafe_callback_eip;
  69.132 -} PACKED full_execution_context_t;
  69.133 -
  69.134 -typedef struct {
  69.135 -    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
  69.136 -    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
  69.137 -				  make up p2m table */
  69.138 -} PACKED arch_shared_info_t;
  69.139 -
  69.140 -#define ARCH_HAS_FAST_TRAP
  69.141 -
  69.142 -#endif
  69.143 -
  69.144 -#endif
    70.1 --- a/xen/include/hypervisor-ifs/arch-x86_64.h	Sun Oct 31 08:22:21 2004 +0000
    70.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.3 @@ -1,134 +0,0 @@
    70.4 -/******************************************************************************
    70.5 - * arch-x86_64/hypervisor-if.h
    70.6 - * 
    70.7 - * Guest OS interface to AMD x86-64 bit Xen.
    70.8 - */
    70.9 -
   70.10 -#ifndef __HYPERVISOR_IF_X86_64_H__
   70.11 -#define __HYPERVISOR_IF_X86_64_H__
   70.12 -
   70.13 -/* Pointers are naturally 64 bits in this architecture; no padding needed. */
   70.14 -#define _MEMORY_PADDING(_X)
   70.15 -#define MEMORY_PADDING 
   70.16 -
   70.17 -/*
   70.18 - * SEGMENT DESCRIPTOR TABLES
   70.19 - */
   70.20 -/*
   70.21 - * A number of GDT entries are reserved by Xen. These are not situated at the
   70.22 - * start of the GDT because some stupid OSes export hard-coded selector values
   70.23 - * in their ABI. These hard-coded values are always near the start of the GDT,
   70.24 - * so Xen places itself out of the way.
   70.25 - * 
   70.26 - * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
   70.27 - * and LAST_RESERVED_GDT_ENTRY are reserved).
   70.28 - */
   70.29 -#define NR_RESERVED_GDT_ENTRIES    40 
   70.30 -#define FIRST_RESERVED_GDT_ENTRY   256
   70.31 -#define LAST_RESERVED_GDT_ENTRY    \
   70.32 -  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
   70.33 -
   70.34 -/*
   70.35 - * 64-bit segment selectors
   70.36 - * These flat segments are in the Xen-private section of every GDT. Since these
   70.37 - * are also present in the initial GDT, many OSes will be able to avoid
   70.38 - * installing their own GDT.
   70.39 - */
   70.40 -
   70.41 -#define FLAT_RING3_CS32 0x0823  /* GDT index 260 */
   70.42 -#define FLAT_RING3_CS64 0x082b  /* GDT index 261 */
   70.43 -#define FLAT_RING3_DS   0x0833  /* GDT index 262 */
   70.44 -
   70.45 -#define FLAT_GUESTOS_DS   FLAT_RING3_DS
   70.46 -#define FLAT_GUESTOS_CS   FLAT_RING3_CS64
   70.47 -#define FLAT_GUESTOS_CS32 FLAT_RING3_CS32
   70.48 -
   70.49 -#define FLAT_USER_DS      FLAT_RING3_DS
   70.50 -#define FLAT_USER_CS      FLAT_RING3_CS64
   70.51 -#define FLAT_USER_CS32    FLAT_RING3_CS32
   70.52 -
   70.53 -/* And the trap vector is... */
   70.54 -#define TRAP_INSTR "syscall"
   70.55 -
   70.56 -/* The machine->physical mapping table starts at this address, read-only. */
   70.57 -#ifndef machine_to_phys_mapping
   70.58 -#define machine_to_phys_mapping ((unsigned long *)0xffff810000000000ULL)
   70.59 -#endif
   70.60 -
   70.61 -#ifndef __ASSEMBLY__
   70.62 -
   70.63 -/* NB. Both the following are 64 bits each. */
   70.64 -typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
   70.65 -typedef unsigned long cpureg_t;   /* Full-sized register.                    */
   70.66 -
   70.67 -/*
   70.68 - * Send an array of these to HYPERVISOR_set_trap_table()
   70.69 - */
   70.70 -#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
   70.71 -#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
   70.72 -#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   70.73 -#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   70.74 -typedef struct {
   70.75 -    u8       vector;  /* 0: exception vector                              */
   70.76 -    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
   70.77 -    u16      cs;      /* 2: code selector                                 */
   70.78 -    u32      __pad;   /* 4 */
   70.79 -    memory_t address; /* 8: code address                                  */
   70.80 -} PACKED trap_info_t; /* 16 bytes */
   70.81 -
   70.82 -typedef struct
   70.83 -{
   70.84 -    unsigned long r15;
   70.85 -    unsigned long r14;
   70.86 -    unsigned long r13;
   70.87 -    unsigned long r12;
   70.88 -    unsigned long rbp;
   70.89 -    unsigned long rbx;
   70.90 -    unsigned long r11;
   70.91 -    unsigned long r10;
   70.92 -    unsigned long r9;
   70.93 -    unsigned long r8;
   70.94 -    unsigned long rax;
   70.95 -    unsigned long rcx;
   70.96 -    unsigned long rdx;
   70.97 -    unsigned long rsi;
   70.98 -    unsigned long rdi;
   70.99 -    unsigned long rip;
  70.100 -    unsigned long cs;
  70.101 -    unsigned long eflags;
  70.102 -    unsigned long rsp;
  70.103 -    unsigned long ss;
  70.104 -} PACKED execution_context_t;
  70.105 -
  70.106 -typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
  70.107 -
  70.108 -/*
  70.109 - * The following is all CPU context. Note that the i387_ctxt block is filled 
  70.110 - * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
  70.111 - */
  70.112 -typedef struct {
  70.113 -#define ECF_I387_VALID (1<<0)
  70.114 -    unsigned long flags;
  70.115 -    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
  70.116 -    char          fpu_ctxt[512];            /* User-level FPU registers     */
  70.117 -    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
  70.118 -    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
  70.119 -    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
  70.120 -    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
  70.121 -    unsigned long pt_base;                  /* CR3 (pagetable base)         */
  70.122 -    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
  70.123 -    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
  70.124 -    unsigned long event_callback_eip;
  70.125 -    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
  70.126 -    unsigned long failsafe_callback_eip;
  70.127 -} PACKED full_execution_context_t;
  70.128 -
  70.129 -typedef struct {
  70.130 -    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
  70.131 -    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
  70.132 -				  make up p2m table */
  70.133 -} PACKED arch_shared_info_t;
  70.134 -
  70.135 -#endif /* !__ASSEMBLY__ */
  70.136 -
  70.137 -#endif /* __HYPERVISOR_IF_H__ */
    71.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Sun Oct 31 08:22:21 2004 +0000
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,372 +0,0 @@
    71.4 -/******************************************************************************
    71.5 - * dom0_ops.h
    71.6 - * 
    71.7 - * Process command requests from domain-0 guest OS.
    71.8 - * 
    71.9 - * Copyright (c) 2002-2003, B Dragovic
   71.10 - * Copyright (c) 2002-2004, K Fraser
   71.11 - */
   71.12 -
   71.13 -
   71.14 -#ifndef __DOM0_OPS_H__
   71.15 -#define __DOM0_OPS_H__
   71.16 -
   71.17 -#include "hypervisor-if.h"
   71.18 -#include "sched_ctl.h"
   71.19 -
   71.20 -/*
   71.21 - * Make sure you increment the interface version whenever you modify this file!
   71.22 - * This makes sure that old versions of dom0 tools will stop working in a
   71.23 - * well-defined way (rather than crashing the machine, for instance).
   71.24 - */
   71.25 -#define DOM0_INTERFACE_VERSION   0xAAAA0019
   71.26 -
   71.27 -/************************************************************************/
   71.28 -
   71.29 -#define DOM0_GETMEMLIST        2
   71.30 -typedef struct {
   71.31 -    /* IN variables. */
   71.32 -    domid_t       domain;             /*  0 */
   71.33 -    u16           __pad0;
   71.34 -    u32           __pad1;
   71.35 -    memory_t      max_pfns;           /*  8 */
   71.36 -    MEMORY_PADDING;
   71.37 -    void         *buffer;             /* 16 */
   71.38 -    MEMORY_PADDING;
   71.39 -    /* OUT variables. */
   71.40 -    memory_t      num_pfns;           /* 24 */
   71.41 -    MEMORY_PADDING;
   71.42 -} PACKED dom0_getmemlist_t; /* 32 bytes */
   71.43 -
   71.44 -#define DOM0_SCHEDCTL          6
   71.45 - /* struct sched_ctl_cmd is from sched-ctl.h   */
   71.46 -typedef struct sched_ctl_cmd dom0_schedctl_t;
   71.47 -
   71.48 -#define DOM0_ADJUSTDOM         7
   71.49 -/* struct sched_adjdom_cmd is from sched-ctl.h */
   71.50 -typedef struct sched_adjdom_cmd dom0_adjustdom_t;
   71.51 -
   71.52 -#define DOM0_CREATEDOMAIN      8
   71.53 -typedef struct {
   71.54 -    /* IN parameters. */
   71.55 -    memory_t     memory_kb;           /*  0 */
   71.56 -    MEMORY_PADDING;
   71.57 -    u32          cpu;                 /*  8 */
   71.58 -    u32          __pad0;              /* 12 */
   71.59 -    /* IN/OUT parameters. */
   71.60 -    /* If 0, domain is allocated. If non-zero use it unless in use. */
   71.61 -    domid_t      domain;              /* 16 */
   71.62 -    u16          __pad1;
   71.63 -    /* OUT parameters. */
   71.64 -} PACKED dom0_createdomain_t; /* 20 bytes */
   71.65 -
   71.66 -#define DOM0_DESTROYDOMAIN     9
   71.67 -typedef struct {
   71.68 -    /* IN variables. */
   71.69 -    domid_t      domain;              /*  0 */
   71.70 -    u16          __pad;
   71.71 -} PACKED dom0_destroydomain_t; /* 4 bytes */
   71.72 -
   71.73 -#define DOM0_PAUSEDOMAIN      10
   71.74 -typedef struct {
   71.75 -    /* IN parameters. */
   71.76 -    domid_t domain;                   /*  0 */
   71.77 -    u16     __pad;
   71.78 -} PACKED dom0_pausedomain_t; /* 4 bytes */
   71.79 -
   71.80 -#define DOM0_UNPAUSEDOMAIN    11
   71.81 -typedef struct {
   71.82 -    /* IN parameters. */
   71.83 -    domid_t domain;                   /*  0 */
   71.84 -    u16     __pad;
   71.85 -} PACKED dom0_unpausedomain_t; /* 4 bytes */
   71.86 -
   71.87 -#define DOM0_GETDOMAININFO    12
   71.88 -typedef struct {
   71.89 -    /* IN variables. */
   71.90 -    domid_t  domain;                  /*  0 */ /* NB. IN/OUT variable. */
   71.91 -    u16     __pad;
   71.92 -    /* OUT variables. */
   71.93 -#define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
   71.94 -#define DOMFLAGS_CRASHED   (1<<1) /* Crashed domain; frozen for postmortem.  */
   71.95 -#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut itself down.      */
   71.96 -#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
   71.97 -#define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
   71.98 -#define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
   71.99 -#define DOMFLAGS_CPUMASK      255 /* CPU to which this domain is bound.      */
  71.100 -#define DOMFLAGS_CPUSHIFT       8
  71.101 -#define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
  71.102 -#define DOMFLAGS_SHUTDOWNSHIFT 16
  71.103 -    u32      flags;                   /*  4 */
  71.104 -    full_execution_context_t *ctxt;   /*  8 */ /* NB. IN/OUT variable. */
  71.105 -    MEMORY_PADDING;
  71.106 -    memory_t tot_pages;               /* 16 */
  71.107 -    MEMORY_PADDING;
  71.108 -    memory_t max_pages;               /* 24 */
  71.109 -    MEMORY_PADDING;
  71.110 -    memory_t shared_info_frame;       /* 32: MFN of shared_info struct */
  71.111 -    MEMORY_PADDING;
  71.112 -    u64      cpu_time;                /* 40 */
  71.113 -} PACKED dom0_getdomaininfo_t; /* 48 bytes */
  71.114 -
  71.115 -#define DOM0_BUILDDOMAIN      13
  71.116 -typedef struct {
  71.117 -    /* IN variables. */
  71.118 -    domid_t                 domain;   /*  0 */
  71.119 -    u16                     __pad0;   /*  2 */
  71.120 -    u32                     __pad1;   /*  4 */
  71.121 -    /* IN/OUT parameters */
  71.122 -    full_execution_context_t *ctxt;   /*  8 */
  71.123 -    MEMORY_PADDING;
  71.124 -} PACKED dom0_builddomain_t; /* 16 bytes */
  71.125 -
  71.126 -#define DOM0_IOPL             14
  71.127 -typedef struct {
  71.128 -    domid_t domain;                   /*  0 */
  71.129 -    u16     __pad;
  71.130 -    u32     iopl;                     /*  4 */
  71.131 -} PACKED dom0_iopl_t; /* 8 bytes */
  71.132 -
  71.133 -#define DOM0_MSR              15
  71.134 -typedef struct {
  71.135 -    /* IN variables. */
  71.136 -    u32 write;                        /*  0 */
  71.137 -    u32 cpu_mask;                     /*  4 */
  71.138 -    u32 msr;                          /*  8 */
  71.139 -    u32 in1;                          /* 12 */
  71.140 -    u32 in2;                          /* 16 */
  71.141 -    /* OUT variables. */
  71.142 -    u32 out1;                         /* 20 */
  71.143 -    u32 out2;                         /* 24 */
  71.144 -} PACKED dom0_msr_t; /* 28 bytes */
  71.145 -
  71.146 -#define DOM0_DEBUG            16
  71.147 -typedef struct {
  71.148 -    /* IN variables. */
  71.149 -    domid_t domain;                   /*  0 */
  71.150 -    u8  opcode;                       /*  2 */
  71.151 -    u8  __pad;
  71.152 -    u32 in1;                          /*  4 */
  71.153 -    u32 in2;                          /*  8 */
  71.154 -    u32 in3;                          /* 12 */
  71.155 -    u32 in4;                          /* 16 */
  71.156 -    /* OUT variables. */
  71.157 -    u32 status;                       /* 20 */
  71.158 -    u32 out1;                         /* 24 */
  71.159 -    u32 out2;                         /* 28 */
  71.160 -} PACKED dom0_debug_t; /* 32 bytes */
  71.161 -
  71.162 -/*
  71.163 - * Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
  71.164 - * 1 January, 1970 if the current system time was <system_time>.
  71.165 - */
  71.166 -#define DOM0_SETTIME          17
  71.167 -typedef struct {
  71.168 -    /* IN variables. */
  71.169 -    u32 secs;                         /*  0 */
  71.170 -    u32 usecs;                        /*  4 */
  71.171 -    u64 system_time;                  /*  8 */
  71.172 -} PACKED dom0_settime_t; /* 16 bytes */
  71.173 -
  71.174 -#define DOM0_GETPAGEFRAMEINFO 18
  71.175 -#define NOTAB 0         /* normal page */
  71.176 -#define L1TAB (1<<28)
  71.177 -#define L2TAB (2<<28)
  71.178 -#define L3TAB (3<<28)
  71.179 -#define L4TAB (4<<28)
  71.180 -#define LPINTAB  (1<<31)
  71.181 -#define XTAB  (0xf<<28) /* invalid page */
  71.182 -#define LTAB_MASK XTAB
  71.183 -#define LTABTYPE_MASK (0x7<<28)
  71.184 -
  71.185 -typedef struct {
  71.186 -    /* IN variables. */
  71.187 -    memory_t pfn;          /*  0: Machine page frame number to query.       */
  71.188 -    MEMORY_PADDING;
  71.189 -    domid_t domain;        /*  8: To which domain does the frame belong?    */
  71.190 -    u16     __pad;
  71.191 -    /* OUT variables. */
  71.192 -    /* Is the page PINNED to a type? */
  71.193 -    u32 type;              /* 12: see above type defs */
  71.194 -} PACKED dom0_getpageframeinfo_t; /* 16 bytes */
  71.195 -
  71.196 -/*
  71.197 - * Read console content from Xen buffer ring.
  71.198 - */
  71.199 -#define DOM0_READCONSOLE      19
  71.200 -typedef struct {
  71.201 -    memory_t str;                     /*  0 */
  71.202 -    MEMORY_PADDING;
  71.203 -    u32      count;                   /*  8 */
  71.204 -    u32      cmd;                     /* 12 */
  71.205 -} PACKED dom0_readconsole_t; /* 16 bytes */
  71.206 -
  71.207 -/* 
  71.208 - * Pin Domain to a particular CPU  (use -1 to unpin)
  71.209 - */
  71.210 -#define DOM0_PINCPUDOMAIN     20
  71.211 -typedef struct {
  71.212 -    /* IN variables. */
  71.213 -    domid_t      domain;              /*  0 */
  71.214 -    u16          __pad;
  71.215 -    s32          cpu;                 /*  4: -1 implies unpin */
  71.216 -} PACKED dom0_pincpudomain_t; /* 8 bytes */
  71.217 -
  71.218 -/* Get trace buffers machine base address */
  71.219 -#define DOM0_GETTBUFS         21
  71.220 -typedef struct {
  71.221 -    /* OUT variables */
  71.222 -    memory_t mach_addr;   /*  0: location of the trace buffers       */
  71.223 -    MEMORY_PADDING;
  71.224 -    u32      size;        /*  8: size of each trace buffer, in bytes */
  71.225 -} PACKED dom0_gettbufs_t; /* 12 bytes */
  71.226 -
  71.227 -/*
  71.228 - * Get physical information about the host machine
  71.229 - */
  71.230 -#define DOM0_PHYSINFO         22
  71.231 -typedef struct {
  71.232 -    u32      ht_per_core;             /*  0 */
  71.233 -    u32      cores;                   /*  4 */
  71.234 -    u32      cpu_khz;                 /*  8 */
  71.235 -    u32      __pad;                   /* 12 */
  71.236 -    memory_t total_pages;             /* 16 */
  71.237 -    MEMORY_PADDING;
  71.238 -    memory_t free_pages;              /* 24 */
  71.239 -    MEMORY_PADDING;
  71.240 -} PACKED dom0_physinfo_t; /* 32 bytes */
  71.241 -
  71.242 -/* 
  71.243 - * Allow a domain access to a physical PCI device
  71.244 - */
  71.245 -#define DOM0_PCIDEV_ACCESS    23
  71.246 -typedef struct {
  71.247 -    /* IN variables. */
  71.248 -    domid_t      domain;              /*  0 */
  71.249 -    u16          __pad;
  71.250 -    u32          bus;                 /*  4 */
  71.251 -    u32          dev;                 /*  8 */
  71.252 -    u32          func;                /* 12 */
  71.253 -    u32          enable;              /* 16 */
  71.254 -} PACKED dom0_pcidev_access_t; /* 20 bytes */
  71.255 -
  71.256 -/*
  71.257 - * Get the ID of the current scheduler.
  71.258 - */
  71.259 -#define DOM0_SCHED_ID        24
  71.260 -typedef struct {
  71.261 -    /* OUT variable */
  71.262 -    u32 sched_id;                     /*  0 */
  71.263 -} PACKED dom0_sched_id_t; /* 4 bytes */
  71.264 -
  71.265 -/* 
  71.266 - * Control shadow pagetables operation
  71.267 - */
  71.268 -#define DOM0_SHADOW_CONTROL  25
  71.269 -
  71.270 -#define DOM0_SHADOW_CONTROL_OP_OFF         0
  71.271 -#define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1
  71.272 -#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2
  71.273 -#define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3
  71.274 -#define DOM0_SHADOW_CONTROL_OP_FLUSH       10     /* table ops */
  71.275 -#define DOM0_SHADOW_CONTROL_OP_CLEAN       11
  71.276 -#define DOM0_SHADOW_CONTROL_OP_PEEK        12
  71.277 -
  71.278 -typedef struct dom0_shadow_control
  71.279 -{
  71.280 -    u32 fault_count;
  71.281 -    u32 dirty_count;
  71.282 -    u32 dirty_net_count;     
  71.283 -    u32 dirty_block_count;     
  71.284 -} dom0_shadow_control_stats_t;
  71.285 -
  71.286 -typedef struct {
  71.287 -    /* IN variables. */
  71.288 -    domid_t        domain;            /*  0 */
  71.289 -    u16            __pad;
  71.290 -    u32            op;                /*  4 */
  71.291 -    unsigned long *dirty_bitmap;      /*  8: pointer to locked buffer */
  71.292 -    MEMORY_PADDING;
  71.293 -    /* IN/OUT variables. */
  71.294 -    memory_t       pages;  /* 16: size of buffer, updated with actual size */
  71.295 -    MEMORY_PADDING;
  71.296 -    /* OUT variables. */
  71.297 -    dom0_shadow_control_stats_t stats;
  71.298 -} PACKED dom0_shadow_control_t;
  71.299 -
  71.300 -#define DOM0_SETDOMAININITIALMEM   27
  71.301 -typedef struct {
  71.302 -    /* IN variables. */
  71.303 -    domid_t     domain;               /*  0 */
  71.304 -    u16         __pad0;
  71.305 -    u32         __pad1;
  71.306 -    memory_t    initial_memkb;        /*  8 */
  71.307 -    MEMORY_PADDING;
  71.308 -} PACKED dom0_setdomaininitialmem_t; /* 16 bytes */
  71.309 -
  71.310 -#define DOM0_SETDOMAINMAXMEM   28
  71.311 -typedef struct {
  71.312 -    /* IN variables. */
  71.313 -    domid_t     domain;               /*  0 */
  71.314 -    u16         __pad0;
  71.315 -    u32         __pad1;
  71.316 -    memory_t    max_memkb;            /*  8 */
  71.317 -    MEMORY_PADDING;
  71.318 -} PACKED dom0_setdomainmaxmem_t; /* 16 bytes */
  71.319 -
  71.320 -#define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
  71.321 -typedef struct {
  71.322 -    /* IN variables. */
  71.323 -    domid_t  domain;                  /*  0 */
  71.324 -    u16      __pad0;
  71.325 -    u32      __pad1;
  71.326 -    memory_t num;                     /*  8 */
  71.327 -    MEMORY_PADDING;
  71.328 -    /* IN/OUT variables. */
  71.329 -    unsigned long *array;             /* 16 */
  71.330 -    MEMORY_PADDING;
  71.331 -} PACKED dom0_getpageframeinfo2_t; /* 24 bytes */
  71.332 -
  71.333 -#define DOM0_SETDOMAINVMASSIST   30
  71.334 -typedef struct {
  71.335 -    /* IN variables. */
  71.336 -    domid_t      domain;              /*  0 */
  71.337 -    u16          __pad0;
  71.338 -    u32          cmd;                 /*  4: vm_assist cmd */
  71.339 -    u32          type;                /*  8: vm_assist cmd */
  71.340 -} PACKED dom0_setdomainvmassist_t; /* 12 bytes */
  71.341 -
  71.342 -typedef struct {
  71.343 -    u32 cmd;                          /* 0 */
  71.344 -    u32 interface_version;            /* 4 */ /* DOM0_INTERFACE_VERSION */
  71.345 -    union {                           /* 8 */
  71.346 -	u32                      dummy[18]; /* 72 bytes */
  71.347 -        dom0_createdomain_t      createdomain;
  71.348 -        dom0_pausedomain_t       pausedomain;
  71.349 -        dom0_unpausedomain_t     unpausedomain;
  71.350 -        dom0_destroydomain_t     destroydomain;
  71.351 -        dom0_getmemlist_t        getmemlist;
  71.352 -        dom0_schedctl_t          schedctl;
  71.353 -        dom0_adjustdom_t         adjustdom;
  71.354 -        dom0_builddomain_t       builddomain;
  71.355 -        dom0_getdomaininfo_t     getdomaininfo;
  71.356 -        dom0_getpageframeinfo_t  getpageframeinfo;
  71.357 -        dom0_iopl_t              iopl;
  71.358 -	dom0_msr_t               msr;
  71.359 -	dom0_debug_t             debug;
  71.360 -	dom0_settime_t           settime;
  71.361 -	dom0_readconsole_t	 readconsole;
  71.362 -	dom0_pincpudomain_t      pincpudomain;
  71.363 -        dom0_gettbufs_t          gettbufs;
  71.364 -        dom0_physinfo_t          physinfo;
  71.365 -        dom0_pcidev_access_t     pcidev_access;
  71.366 -        dom0_sched_id_t          sched_id;
  71.367 -	dom0_shadow_control_t    shadow_control;
  71.368 -	dom0_setdomaininitialmem_t setdomaininitialmem;
  71.369 -	dom0_setdomainmaxmem_t   setdomainmaxmem;
  71.370 -	dom0_getpageframeinfo2_t getpageframeinfo2;
  71.371 -	dom0_setdomainvmassist_t setdomainvmassist;
  71.372 -    } PACKED u;
  71.373 -} PACKED dom0_op_t; /* 80 bytes */
  71.374 -
  71.375 -#endif /* __DOM0_OPS_H__ */
    72.1 --- a/xen/include/hypervisor-ifs/event_channel.h	Sun Oct 31 08:22:21 2004 +0000
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,161 +0,0 @@
    72.4 -/******************************************************************************
    72.5 - * event_channel.h
    72.6 - * 
    72.7 - * Event channels between domains.
    72.8 - * 
    72.9 - * Copyright (c) 2003-2004, K A Fraser.
   72.10 - */
   72.11 -
   72.12 -#ifndef __HYPERVISOR_IFS__EVENT_CHANNEL_H__
   72.13 -#define __HYPERVISOR_IFS__EVENT_CHANNEL_H__
   72.14 -
   72.15 -/*
   72.16 - * EVTCHNOP_alloc_unbound: Allocate a fresh local port and prepare
   72.17 - * it for binding to <dom>.
   72.18 - */
   72.19 -#define EVTCHNOP_alloc_unbound    6
   72.20 -typedef struct {
   72.21 -    /* IN parameters */
   72.22 -    domid_t dom;                      /*  0 */
   72.23 -    u16     __pad;
   72.24 -    /* OUT parameters */
   72.25 -    u32     port;                     /*  4 */
   72.26 -} PACKED evtchn_alloc_unbound_t; /* 8 bytes */
   72.27 -
   72.28 -/*
   72.29 - * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
   72.30 - * <dom1> and <dom2>. Either <port1> or <port2> may be wildcarded by setting to
   72.31 - * zero. On successful return both <port1> and <port2> are filled in and
   72.32 - * <dom1,port1> is fully bound to <dom2,port2>.
   72.33 - * 
   72.34 - * NOTES:
   72.35 - *  1. A wildcarded port is allocated from the relevant domain's free list
   72.36 - *     (i.e., some port that was previously EVTCHNSTAT_closed). However, if the
   72.37 - *     remote port pair is already fully bound then a port is not allocated,
   72.38 - *     and instead the existing local port is returned to the caller.
   72.39 - *  2. If the caller is unprivileged then <dom1> must be DOMID_SELF.
   72.40 - *  3. If the caller is unprivileged and <dom2,port2> is EVTCHNSTAT_closed
   72.41 - *     then <dom2> must be DOMID_SELF.
   72.42 - *  4. If either port is already bound then it must be bound to the other
   72.43 - *     specified domain and port (if not wildcarded).
   72.44 - *  5. If either port is awaiting binding (EVTCHNSTAT_unbound) then it must
   72.45 - *     be awaiting binding to the other domain, and the other port pair must
   72.46 - *     be closed or unbound.
   72.47 - */
   72.48 -#define EVTCHNOP_bind_interdomain 0
   72.49 -typedef struct {
   72.50 -    /* IN parameters. */
   72.51 -    domid_t dom1, dom2;               /*  0,  2 */
   72.52 -    /* IN/OUT parameters. */
   72.53 -    u32     port1, port2;             /*  4,  8 */
   72.54 -} PACKED evtchn_bind_interdomain_t; /* 12 bytes */
   72.55 -
   72.56 -/*
   72.57 - * EVTCHNOP_bind_virq: Bind a local event channel to IRQ <irq>.
   72.58 - * NOTES:
   72.59 - *  1. A virtual IRQ may be bound to at most one event channel per domain.
   72.60 - */
   72.61 -#define EVTCHNOP_bind_virq        1
   72.62 -typedef struct {
   72.63 -    /* IN parameters. */
   72.64 -    u32 virq;                         /*  0 */
   72.65 -    /* OUT parameters. */
   72.66 -    u32 port;                         /*  4 */
   72.67 -} PACKED evtchn_bind_virq_t; /* 8 bytes */
   72.68 -
   72.69 -/*
   72.70 - * EVTCHNOP_bind_pirq: Bind a local event channel to IRQ <irq>.
   72.71 - * NOTES:
   72.72 - *  1. A physical IRQ may be bound to at most one event channel per domain.
   72.73 - *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
   72.74 - */
   72.75 -#define EVTCHNOP_bind_pirq        2
   72.76 -typedef struct {
   72.77 -    /* IN parameters. */
   72.78 -    u32 pirq;                         /*  0 */
   72.79 -#define BIND_PIRQ__WILL_SHARE 1
   72.80 -    u32 flags; /* BIND_PIRQ__* */     /*  4 */
   72.81 -    /* OUT parameters. */
   72.82 -    u32 port;                         /*  8 */
   72.83 -} PACKED evtchn_bind_pirq_t; /* 12 bytes */
   72.84 -
   72.85 -/*
   72.86 - * EVTCHNOP_close: Close the communication channel which has an endpoint at
   72.87 - * <dom, port>. If the channel is interdomain then the remote end is placed in
   72.88 - * the unbound state (EVTCHNSTAT_unbound), awaiting a new connection.
   72.89 - * NOTES:
   72.90 - *  1. <dom> may be specified as DOMID_SELF.
   72.91 - *  2. Only a sufficiently-privileged domain may close an event channel
   72.92 - *     for which <dom> is not DOMID_SELF.
   72.93 - */
   72.94 -#define EVTCHNOP_close            3
   72.95 -typedef struct {
   72.96 -    /* IN parameters. */
   72.97 -    domid_t dom;                      /*  0 */
   72.98 -    u16     __pad;
   72.99 -    u32     port;                     /*  4 */
  72.100 -    /* No OUT parameters. */
  72.101 -} PACKED evtchn_close_t; /* 8 bytes */
  72.102 -
  72.103 -/*
  72.104 - * EVTCHNOP_send: Send an event to the remote end of the channel whose local
  72.105 - * endpoint is <DOMID_SELF, local_port>.
  72.106 - */
  72.107 -#define EVTCHNOP_send             4
  72.108 -typedef struct {
  72.109 -    /* IN parameters. */
  72.110 -    u32     local_port;               /*  0 */
  72.111 -    /* No OUT parameters. */
  72.112 -} PACKED evtchn_send_t; /* 4 bytes */
  72.113 -
  72.114 -/*
  72.115 - * EVTCHNOP_status: Get the current status of the communication channel which
  72.116 - * has an endpoint at <dom, port>.
  72.117 - * NOTES:
  72.118 - *  1. <dom> may be specified as DOMID_SELF.
  72.119 - *  2. Only a sufficiently-privileged domain may obtain the status of an event
  72.120 - *     channel for which <dom> is not DOMID_SELF.
  72.121 - */
  72.122 -#define EVTCHNOP_status           5
  72.123 -typedef struct {
  72.124 -    /* IN parameters */
  72.125 -    domid_t dom;                      /*  0 */
  72.126 -    u16     __pad;
  72.127 -    u32     port;                     /*  4 */
  72.128 -    /* OUT parameters */
  72.129 -#define EVTCHNSTAT_closed       0  /* Channel is not in use.                 */
  72.130 -#define EVTCHNSTAT_unbound      1  /* Channel is waiting interdom connection.*/
  72.131 -#define EVTCHNSTAT_interdomain  2  /* Channel is connected to remote domain. */
  72.132 -#define EVTCHNSTAT_pirq         3  /* Channel is bound to a phys IRQ line.   */
  72.133 -#define EVTCHNSTAT_virq         4  /* Channel is bound to a virtual IRQ line */
  72.134 -    u32     status;                   /*  8 */
  72.135 -    union {                           /* 12 */
  72.136 -        struct {
  72.137 -            domid_t dom;                              /* 12 */
  72.138 -        } PACKED unbound; /* EVTCHNSTAT_unbound */
  72.139 -        struct {
  72.140 -            domid_t dom;                              /* 12 */
  72.141 -            u16     __pad;
  72.142 -            u32     port;                             /* 16 */
  72.143 -        } PACKED interdomain; /* EVTCHNSTAT_interdomain */
  72.144 -        u32 pirq;      /* EVTCHNSTAT_pirq        */   /* 12 */
  72.145 -        u32 virq;      /* EVTCHNSTAT_virq        */   /* 12 */
  72.146 -    } PACKED u;
  72.147 -} PACKED evtchn_status_t; /* 20 bytes */
  72.148 -
  72.149 -typedef struct {
  72.150 -    u32 cmd; /* EVTCHNOP_* */         /*  0 */
  72.151 -    u32 __reserved;                   /*  4 */
  72.152 -    union {                           /*  8 */
  72.153 -        evtchn_alloc_unbound_t    alloc_unbound;
  72.154 -        evtchn_bind_interdomain_t bind_interdomain;
  72.155 -        evtchn_bind_virq_t        bind_virq;
  72.156 -        evtchn_bind_pirq_t        bind_pirq;
  72.157 -        evtchn_close_t            close;
  72.158 -        evtchn_send_t             send;
  72.159 -        evtchn_status_t           status;
  72.160 -        u8                        __dummy[24];
  72.161 -    } PACKED u;
  72.162 -} PACKED evtchn_op_t; /* 32 bytes */
  72.163 -
  72.164 -#endif /* __HYPERVISOR_IFS__EVENT_CHANNEL_H__ */
    73.1 --- a/xen/include/hypervisor-ifs/grant_table.h	Sun Oct 31 08:22:21 2004 +0000
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,251 +0,0 @@
    73.4 -/******************************************************************************
    73.5 - * grant_table.h
    73.6 - * 
    73.7 - * Interface for granting foreign access to page frames, and receiving
    73.8 - * page-ownership transfers.
    73.9 - * 
   73.10 - * Copyright (c) 2004, K A Fraser
   73.11 - */
   73.12 -
   73.13 -#ifndef __HYPERVISOR_IFS_GRANT_TABLE_H__
   73.14 -#define __HYPERVISOR_IFS_GRANT_TABLE_H__
   73.15 -
   73.16 -
   73.17 -/***********************************
   73.18 - * GRANT TABLE REPRESENTATION
   73.19 - */
   73.20 -
   73.21 -/* Some rough guidelines on accessing and updating grant-table entries
   73.22 - * in a concurrency-safe manner. For more information, Linux contains a
   73.23 - * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
   73.24 - * 
   73.25 - * NB. WMB is a no-op on current-generation x86 processors. However, a
   73.26 - *     compiler barrier will still be required.
   73.27 - * 
   73.28 - * Introducing a valid entry into the grant table:
   73.29 - *  1. Write ent->domid.
   73.30 - *  2. Write ent->frame:
   73.31 - *      GTF_permit_access:   Frame to which access is permitted.
   73.32 - *      GTF_accept_transfer: Pseudo-phys frame slot being filled by new
   73.33 - *                           frame, or zero if none.
   73.34 - *  3. Write memory barrier (WMB).
   73.35 - *  4. Write ent->flags, inc. valid type.
   73.36 - * 
   73.37 - * Invalidating an unused GTF_permit_access entry:
   73.38 - *  1. flags = ent->flags.
   73.39 - *  2. Observe that !(flags & (GTF_reading|GTF_writing)).
   73.40 - *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
   73.41 - *  NB. No need for WMB as reuse of entry is control-dependent on success of
   73.42 - *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
   73.43 - *
   73.44 - * Invalidating an in-use GTF_permit_access entry:
   73.45 - *  This cannot be done directly. Request assistance from the domain controller
   73.46 - *  which can set a timeout on the use of a grant entry and take necessary
   73.47 - *  action. (NB. This is not yet implemented!).
   73.48 - * 
   73.49 - * Invalidating an unused GTF_accept_transfer entry:
   73.50 - *  1. flags = ent->flags.
   73.51 - *  2. Observe that !(flags & GTF_transfer_committed). [*]
   73.52 - *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
   73.53 - *  NB. No need for WMB as reuse of entry is control-dependent on success of
   73.54 - *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
   73.55 - *  [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
   73.56 - *      The guest must /not/ modify the grant entry until the address of the
   73.57 - *      transferred frame is written. It is safe for the guest to spin waiting
   73.58 - *      for this to occur (detect by observing GTF_transfer_completed in
   73.59 - *      ent->flags).
   73.60 - *
   73.61 - * Invalidating a committed GTF_accept_transfer entry:
   73.62 - *  1. Wait for (ent->flags & GTF_transfer_completed).
   73.63 - *
   73.64 - * Changing a GTF_permit_access from writable to read-only:
   73.65 - *  Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
   73.66 - * 
   73.67 - * Changing a GTF_permit_access from read-only to writable:
   73.68 - *  Use SMP-safe bit-setting instruction.
   73.69 - */
   73.70 -
   73.71 -/*
   73.72 - * A grant table comprises a packed array of grant entries in one or more
   73.73 - * page frames shared between Xen and a guest.
   73.74 - * [XEN]: This field is written by Xen and read by the sharing guest.
   73.75 - * [GST]: This field is written by the guest and read by Xen.
   73.76 - */
   73.77 -typedef struct {
   73.78 -    /* GTF_xxx: various type and flag information.  [XEN,GST] */
   73.79 -    u16     flags;      /* 0 */
   73.80 -    /* The domain being granted foreign privileges. [GST] */
   73.81 -    domid_t domid;      /* 2 */
   73.82 -    /*
   73.83 -     * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
   73.84 -     * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
   73.85 -     */
   73.86 -    u32     frame;      /* 4 */
   73.87 -} PACKED grant_entry_t; /* 8 bytes */
   73.88 -
   73.89 -/*
   73.90 - * Type of grant entry.
   73.91 - *  GTF_invalid: This grant entry grants no privileges.
   73.92 - *  GTF_permit_access: Allow @domid to map/access @frame.
   73.93 - *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
   73.94 - *                       to this guest. Xen writes the page number to @frame.
   73.95 - */
   73.96 -#define GTF_invalid         (0U<<0)
   73.97 -#define GTF_permit_access   (1U<<0)
   73.98 -#define GTF_accept_transfer (2U<<0)
   73.99 -#define GTF_type_mask       (3U<<0)
  73.100 -
  73.101 -/*
  73.102 - * Subflags for GTF_permit_access.
  73.103 - *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
  73.104 - *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  73.105 - *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
  73.106 - */
  73.107 -#define _GTF_readonly       (2)
  73.108 -#define GTF_readonly        (1U<<_GTF_readonly)
  73.109 -#define _GTF_reading        (3)
  73.110 -#define GTF_reading         (1U<<_GTF_reading)
  73.111 -#define _GTF_writing        (4)
  73.112 -#define GTF_writing         (1U<<_GTF_writing)
  73.113 -
  73.114 -/*
  73.115 - * Subflags for GTF_accept_transfer:
  73.116 - *  GTF_transfer_committed: Xen sets this flag to indicate that it is committed
  73.117 - *      to transferring ownership of a page frame. When a guest sees this flag
  73.118 - *      it must /not/ modify the grant entry until GTF_transfer_completed is
  73.119 - *      set by Xen.
  73.120 - *  GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
  73.121 - *      after reading GTF_transfer_committed. Xen will always write the frame
  73.122 - *      address, followed by ORing this flag, in a timely manner.
  73.123 - */
  73.124 -#define _GTF_transfer_committed (2)
  73.125 -#define GTF_transfer_committed  (1U<<_GTF_transfer_committed)
  73.126 -#define _GTF_transfer_completed (3)
  73.127 -#define GTF_transfer_completed  (1U<<_GTF_transfer_completed)
  73.128 -
  73.129 -
  73.130 -/***********************************
  73.131 - * GRANT TABLE QUERIES AND USES
  73.132 - */
  73.133 -
  73.134 -/*
  73.135 - * Reference to a grant entry in a specified domain's grant table.
  73.136 - */
  73.137 -typedef u16 grant_ref_t;
  73.138 -
  73.139 -/*
  73.140 - * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
  73.141 - * by devices and/or host CPUs. If successful, <handle> is a tracking number
  73.142 - * that must be presented later to destroy the mapping(s). On error, <handle>
  73.143 - * is a negative status code.
  73.144 - * NOTES:
  73.145 - *  1. If GNTPIN_map_for_dev is specified then <dev_bus_addr> is the address
  73.146 - *     via which I/O devices may access the granted frame.
  73.147 - *  2. If GNTPIN_map_for_host is specified then a mapping will be added at
  73.148 - *     virtual address <host_virt_addr> in the current address space.
  73.149 - *  3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
  73.150 - *     host mapping is destroyed by other means then it is *NOT* guaranteed
  73.151 - *     to be accounted to the correct grant reference!
  73.152 - */
  73.153 -#define GNTTABOP_map_grant_ref        0
  73.154 -typedef struct {
  73.155 -    /* IN parameters. */
  73.156 -    memory_t    host_virt_addr;       /*  0 */
  73.157 -    MEMORY_PADDING;
  73.158 -    domid_t     dom;                  /*  8 */
  73.159 -    grant_ref_t ref;                  /* 10 */
  73.160 -    u16         flags;                /* 12: GNTMAP_* */
  73.161 -    /* OUT parameters. */
  73.162 -    s16         handle;               /* 14: +ve: handle; -ve: GNTST_* */
  73.163 -    memory_t    dev_bus_addr;         /* 16 */
  73.164 -    MEMORY_PADDING;
  73.165 -} PACKED gnttab_map_grant_ref_t; /* 24 bytes */
  73.166 -
  73.167 -/*
  73.168 - * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
  73.169 - * tracked by <handle>. If <host_virt_addr> or <dev_bus_addr> is zero, that
  73.170 - * field is ignored. If non-zero, they must refer to a device/host mapping
  73.171 - * that is tracked by <handle>
  73.172 - * NOTES:
  73.173 - *  1. The call may fail in an undefined manner if either mapping is not
  73.174 - *     tracked by <handle>.
  73.175 - *  3. After executing a batch of unmaps, it is guaranteed that no stale
  73.176 - *     mappings will remain in the device or host TLBs.
  73.177 - */
  73.178 -#define GNTTABOP_unmap_grant_ref      1
  73.179 -typedef struct {
  73.180 -    /* IN parameters. */
  73.181 -    memory_t    host_virt_addr;       /*  0 */
  73.182 -    MEMORY_PADDING;
  73.183 -    memory_t    dev_bus_addr;         /*  8 */
  73.184 -    MEMORY_PADDING;
  73.185 -    u16         handle;               /* 16 */
  73.186 -    /* OUT parameters. */
  73.187 -    s16         status;               /* 18: GNTST_* */
  73.188 -    u32         __pad;
  73.189 -} PACKED gnttab_unmap_grant_ref_t; /* 24 bytes */
  73.190 -
  73.191 -/*
  73.192 - * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
  73.193 - * <nr_frames> pages. The frame addresses are written to the <frame_list>.
  73.194 - * Only <nr_frames> addresses are written, even if the table is larger.
  73.195 - * NOTES:
  73.196 - *  1. <dom> may be specified as DOMID_SELF.
  73.197 - *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  73.198 - *  3. Xen may not support more than a single grant-table page per domain.
  73.199 - */
  73.200 -#define GNTTABOP_setup_table          2
  73.201 -typedef struct {
  73.202 -    /* IN parameters. */
  73.203 -    domid_t     dom;                  /*  0 */
  73.204 -    u16         nr_frames;            /*  2 */
  73.205 -    u16         __pad;
  73.206 -    /* OUT parameters. */
  73.207 -    s16         status;               /*  6: GNTST_* */
  73.208 -    unsigned long *frame_list;        /*  8 */
  73.209 -    MEMORY_PADDING;
  73.210 -} PACKED gnttab_setup_table_t; /* 16 bytes */
  73.211 -
  73.212 -/*
  73.213 - * Bitfield values for update_pin_status.flags.
  73.214 - */
  73.215 - /* Map the grant entry for access by I/O devices. */
  73.216 -#define _GNTMAP_device_map      (0)
  73.217 -#define GNTMAP_device_map       (1<<_GNTMAP_device_map)
  73.218 - /* Map the grant entry for access by host CPUs. */
  73.219 -#define _GNTMAP_host_map        (1)
  73.220 -#define GNTMAP_host_map         (1<<_GNTMAP_host_map)
  73.221 - /* Accesses to the granted frame will be restricted to read-only access. */
  73.222 -#define _GNTMAP_readonly        (2)
  73.223 -#define GNTMAP_readonly         (1<<_GNTMAP_readonly)
  73.224 - /*
  73.225 -  * GNTMAP_host_map subflag:
  73.226 -  *  0 => The host mapping is usable only by the guest OS.
  73.227 -  *  1 => The host mapping is usable by guest OS + current application.
  73.228 -  */
  73.229 -#define _GNTMAP_application_map (3)
  73.230 -#define GNTMAP_application_map  (1<<_GNTMAP_application_map)
  73.231 -
  73.232 -/*
  73.233 - * Values for error status returns. All errors are -ve.
  73.234 - */
  73.235 -#define GNTST_okay             (0)
  73.236 -#define GNTST_general_error    (-1) /* General undefined error.              */
  73.237 -#define GNTST_bad_domain       (-2) /* Unrecognsed domain id.                */
  73.238 -#define GNTST_bad_gntref       (-3) /* Unrecognised or inappropriate gntref. */
  73.239 -#define GNTST_bad_handle       (-3) /* Unrecognised or inappropriate handle. */
  73.240 -#define GNTST_no_device_space  (-4) /* Out of space in I/O MMU.              */
  73.241 -#define GNTST_permission_denied (-5) /* Not enough privilege for operation.  */
  73.242 -
  73.243 -#define GNTTABOP_error_msgs {                   \
  73.244 -    "okay",                                     \
  73.245 -    "undefined error",                          \
  73.246 -    "unrecognised domain id",                   \
  73.247 -    "invalid grant reference",                  \
  73.248 -    "invalid mapping handle",                   \
  73.249 -    "no spare translation slot in the I/O MMU", \
  73.250 -    "permission denied"                         \
  73.251 -}
  73.252 -        
  73.253 -
  73.254 -#endif /* __HYPERVISOR_IFS_GRANT_TABLE_H__ */
    74.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Sun Oct 31 08:22:21 2004 +0000
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,425 +0,0 @@
    74.4 -/******************************************************************************
    74.5 - * hypervisor-if.h
    74.6 - * 
    74.7 - * Guest OS interface to Xen.
    74.8 - * 
    74.9 - * Copyright (c) 2004, K A Fraser
   74.10 - */
   74.11 -
   74.12 -#ifndef __HYPERVISOR_IF_H__
   74.13 -#define __HYPERVISOR_IF_H__
   74.14 -
   74.15 -/* GCC-specific way to pack structure definitions (no implicit padding). */
   74.16 -#define PACKED __attribute__ ((packed))
   74.17 -
   74.18 -#if defined(__i386__)
   74.19 -#include "arch-x86_32.h"
   74.20 -#elif defined(__x86_64__)
   74.21 -#include "arch-x86_64.h"
   74.22 -#else
   74.23 -#error "Unsupported architecture"
   74.24 -#endif
   74.25 -
   74.26 -/*
   74.27 - * HYPERVISOR "SYSTEM CALLS"
   74.28 - */
   74.29 -
   74.30 -/* EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5. */
   74.31 -#define __HYPERVISOR_set_trap_table        0
   74.32 -#define __HYPERVISOR_mmu_update            1
   74.33 -#define __HYPERVISOR_set_gdt               2
   74.34 -#define __HYPERVISOR_stack_switch          3
   74.35 -#define __HYPERVISOR_set_callbacks         4
   74.36 -#define __HYPERVISOR_fpu_taskswitch        5
   74.37 -#define __HYPERVISOR_sched_op              6
   74.38 -#define __HYPERVISOR_dom0_op               7
   74.39 -#define __HYPERVISOR_set_debugreg          8
   74.40 -#define __HYPERVISOR_get_debugreg          9
   74.41 -#define __HYPERVISOR_update_descriptor    10
   74.42 -#define __HYPERVISOR_set_fast_trap        11
   74.43 -#define __HYPERVISOR_dom_mem_op           12
   74.44 -#define __HYPERVISOR_multicall            13
   74.45 -#define __HYPERVISOR_update_va_mapping    14
   74.46 -#define __HYPERVISOR_set_timer_op         15
   74.47 -#define __HYPERVISOR_event_channel_op     16
   74.48 -#define __HYPERVISOR_xen_version          17
   74.49 -#define __HYPERVISOR_console_io           18
   74.50 -#define __HYPERVISOR_physdev_op           19
   74.51 -#define __HYPERVISOR_grant_table_op       20
   74.52 -#define __HYPERVISOR_vm_assist            21
   74.53 -#define __HYPERVISOR_update_va_mapping_otherdomain 22
   74.54 -
   74.55 -/*
   74.56 - * MULTICALLS
   74.57 - * 
   74.58 - * Multicalls are listed in an array, with each element being a fixed size 
   74.59 - * (BYTES_PER_MULTICALL_ENTRY). Each is of the form (op, arg1, ..., argN)
   74.60 - * where each element of the tuple is a machine word. 
   74.61 - */
   74.62 -#define ARGS_PER_MULTICALL_ENTRY 8
   74.63 -
   74.64 -
   74.65 -/* 
   74.66 - * VIRTUAL INTERRUPTS
   74.67 - * 
   74.68 - * Virtual interrupts that a guest OS may receive from the hypervisor.
   74.69 - */
   74.70 -#define VIRQ_MISDIRECT  0  /* Catch-all interrupt for unbound VIRQs.      */
   74.71 -#define VIRQ_TIMER      1  /* Timebase update, and/or requested timeout.  */
   74.72 -#define VIRQ_DEBUG      2  /* Request guest to dump debug info.           */
   74.73 -#define VIRQ_CONSOLE    3  /* (DOM0) bytes received on emergency console. */
   74.74 -#define VIRQ_DOM_EXC    4  /* (DOM0) Exceptional event for some domain.   */
   74.75 -#define VIRQ_PARITY_ERR 5  /* (DOM0) NMI parity error.                    */
   74.76 -#define VIRQ_IO_ERR     6  /* (DOM0) NMI I/O error.                       */
   74.77 -#define NR_VIRQS        7
   74.78 -
   74.79 -/*
   74.80 - * MMU-UPDATE REQUESTS
   74.81 - * 
   74.82 - * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
   74.83 - * ptr[1:0] specifies the appropriate MMU_* command.
   74.84 - * 
   74.85 - * FOREIGN DOMAIN (FD)
   74.86 - * -------------------
   74.87 - *  Some commands recognise an explicitly-declared foreign domain,
   74.88 - *  in which case they will operate with respect to the foreigner rather than
   74.89 - *  the calling domain. Where the FD has some effect, it is described below.
   74.90 - * 
   74.91 - * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
   74.92 - * Updates an entry in a page table. If updating an L1 table, and the new
   74.93 - * table entry is valid/present, the mapped frame must belong to the FD, if
   74.94 - * an FD has been specified. If attempting to map an I/O page then the
   74.95 - * caller assumes the privilege of the FD.
   74.96 - * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
   74.97 - * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
   74.98 - * ptr[:2]  -- Machine address of the page-table entry to modify.
   74.99 - * val      -- Value to write.
  74.100 - * 
  74.101 - * ptr[1:0] == MMU_MACHPHYS_UPDATE:
  74.102 - * Updates an entry in the machine->pseudo-physical mapping table.
  74.103 - * ptr[:2]  -- Machine address within the frame whose mapping to modify.
  74.104 - *             The frame must belong to the FD, if one is specified.
  74.105 - * val      -- Value to write into the mapping entry.
  74.106 - *  
  74.107 - * ptr[1:0] == MMU_EXTENDED_COMMAND:
  74.108 - * val[7:0] -- MMUEXT_* command.
  74.109 - * 
  74.110 - *   val[7:0] == MMUEXT_(UN)PIN_*_TABLE:
  74.111 - *   ptr[:2]  -- Machine address of frame to be (un)pinned as a p.t. page.
  74.112 - *               The frame must belong to the FD, if one is specified.
  74.113 - * 
  74.114 - *   val[7:0] == MMUEXT_NEW_BASEPTR:
  74.115 - *   ptr[:2]  -- Machine address of new page-table base to install in MMU.
  74.116 - * 
  74.117 - *   val[7:0] == MMUEXT_TLB_FLUSH:
  74.118 - *   No additional arguments.
  74.119 - * 
  74.120 - *   val[7:0] == MMUEXT_INVLPG:
  74.121 - *   ptr[:2]  -- Linear address to be flushed from the TLB.
  74.122 - * 
  74.123 - *   val[7:0] == MMUEXT_FLUSH_CACHE:
  74.124 - *   No additional arguments. Writes back and flushes cache contents.
  74.125 - * 
  74.126 - *   val[7:0] == MMUEXT_SET_LDT:
  74.127 - *   ptr[:2]  -- Linear address of LDT base (NB. must be page-aligned).
  74.128 - *   val[:8]  -- Number of entries in LDT.
  74.129 - * 
  74.130 - *   val[7:0] == MMUEXT_TRANSFER_PAGE:
  74.131 - *   val[31:16] -- Domain to whom page is to be transferred.
  74.132 - *   (val[15:8],ptr[9:2]) -- 16-bit reference into transferee's grant table.
  74.133 - *   ptr[:12]  -- Page frame to be reassigned to the FD.
  74.134 - *                (NB. The frame must currently belong to the calling domain).
  74.135 - * 
  74.136 - *   val[7:0] == MMUEXT_SET_FOREIGNDOM:
  74.137 - *   val[31:16] -- Domain to set as the Foreign Domain (FD).
  74.138 - *                 (NB. DOMID_SELF is not recognised)
  74.139 - *                 If FD != DOMID_IO then the caller must be privileged.
  74.140 - * 
  74.141 - *   val[7:0] == MMUEXT_CLEAR_FOREIGNDOM:
  74.142 - *   Clears the FD.
  74.143 - * 
  74.144 - *   val[7:0] == MMUEXT_REASSIGN_PAGE:
  74.145 - *   ptr[:2]  -- A machine address within the page to be reassigned to the FD.
  74.146 - *               (NB. page must currently belong to the calling domain).
  74.147 - */
  74.148 -#define MMU_NORMAL_PT_UPDATE     0 /* checked '*ptr = val'. ptr is MA.       */
  74.149 -#define MMU_MACHPHYS_UPDATE      2 /* ptr = MA of frame to modify entry for  */
  74.150 -#define MMU_EXTENDED_COMMAND     3 /* least 8 bits of val demux further      */
  74.151 -#define MMUEXT_PIN_L1_TABLE      0 /* ptr = MA of frame to pin               */
  74.152 -#define MMUEXT_PIN_L2_TABLE      1 /* ptr = MA of frame to pin               */
  74.153 -#define MMUEXT_PIN_L3_TABLE      2 /* ptr = MA of frame to pin               */
  74.154 -#define MMUEXT_PIN_L4_TABLE      3 /* ptr = MA of frame to pin               */
  74.155 -#define MMUEXT_UNPIN_TABLE       4 /* ptr = MA of frame to unpin             */
  74.156 -#define MMUEXT_NEW_BASEPTR       5 /* ptr = MA of new pagetable base         */
  74.157 -#define MMUEXT_TLB_FLUSH         6 /* ptr = NULL                             */
  74.158 -#define MMUEXT_INVLPG            7 /* ptr = VA to invalidate                 */
  74.159 -#define MMUEXT_FLUSH_CACHE       8
  74.160 -#define MMUEXT_SET_LDT           9 /* ptr = VA of table; val = # entries     */
  74.161 -#define MMUEXT_SET_FOREIGNDOM   10 /* val[31:16] = dom                       */
  74.162 -#define MMUEXT_CLEAR_FOREIGNDOM 11
  74.163 -#define MMUEXT_TRANSFER_PAGE    12 /* ptr = MA of frame; val[31:16] = dom    */
  74.164 -#define MMUEXT_REASSIGN_PAGE    13
  74.165 -#define MMUEXT_CMD_MASK        255
  74.166 -#define MMUEXT_CMD_SHIFT         8
  74.167 -
  74.168 -/* These are passed as 'flags' to update_va_mapping. They can be ORed. */
  74.169 -#define UVMF_FLUSH_TLB          1 /* Flush entire TLB. */
  74.170 -#define UVMF_INVLPG             2 /* Flush the VA mapping being updated. */
  74.171 -
  74.172 -
  74.173 -/*
  74.174 - * Commands to HYPERVISOR_sched_op().
  74.175 - */
  74.176 -#define SCHEDOP_yield           0   /* Give up the CPU voluntarily.       */
  74.177 -#define SCHEDOP_block           1   /* Block until an event is received.  */
  74.178 -#define SCHEDOP_shutdown        2   /* Stop executing this domain.        */
  74.179 -#define SCHEDOP_cmdmask       255   /* 8-bit command. */
  74.180 -#define SCHEDOP_reasonshift     8   /* 8-bit reason code. (SCHEDOP_shutdown) */
  74.181 -
  74.182 -/*
  74.183 - * Commands to HYPERVISOR_console_io().
  74.184 - */
  74.185 -#define CONSOLEIO_write         0
  74.186 -#define CONSOLEIO_read          1
  74.187 -
  74.188 -/*
  74.189 - * Commands to HYPERVISOR_dom_mem_op().
  74.190 - */
  74.191 -#define MEMOP_increase_reservation 0
  74.192 -#define MEMOP_decrease_reservation 1
  74.193 -
  74.194 -/*
  74.195 - * Commands to HYPERVISOR_vm_assist().
  74.196 - */
  74.197 -#define VMASST_CMD_enable                0
  74.198 -#define VMASST_CMD_disable               1
  74.199 -#define VMASST_TYPE_4gb_segments         0
  74.200 -#define VMASST_TYPE_4gb_segments_notify  1
  74.201 -#define VMASST_TYPE_writable_pagetables  2
  74.202 -#define MAX_VMASST_TYPE 2
  74.203 -
  74.204 -#ifndef __ASSEMBLY__
  74.205 -
  74.206 -typedef u16 domid_t;
  74.207 -
  74.208 -/* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
  74.209 -#define DOMID_FIRST_RESERVED (0x7FF0U)
  74.210 -
  74.211 -/* DOMID_SELF is used in certain contexts to refer to oneself. */
  74.212 -#define DOMID_SELF (0x7FF0U)
  74.213 -
  74.214 -/*
  74.215 - * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
  74.216 - * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
  74.217 - * is useful to ensure that no mappings to the OS's own heap are accidentally
  74.218 - * installed. (e.g., in Linux this could cause havoc as reference counts
  74.219 - * aren't adjusted on the I/O-mapping code path).
  74.220 - * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
  74.221 - * be specified by any calling domain.
  74.222 - */
  74.223 -#define DOMID_IO   (0x7FF1U)
  74.224 -
  74.225 -/*
  74.226 - * DOMID_XEN is used to allow privileged domains to map restricted parts of
  74.227 - * Xen's heap space (e.g., the machine_to_phys table).
  74.228 - * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
  74.229 - * the caller is privileged.
  74.230 - */
  74.231 -#define DOMID_XEN  (0x7FF2U)
  74.232 -
  74.233 -/*
  74.234 - * Send an array of these to HYPERVISOR_mmu_update().
  74.235 - * NB. The fields are natural pointer/address size for this architecture.
  74.236 - */
  74.237 -typedef struct
  74.238 -{
  74.239 -    memory_t ptr;    /* Machine address of PTE. */
  74.240 -    memory_t val;    /* New contents of PTE.    */
  74.241 -} PACKED mmu_update_t;
  74.242 -
  74.243 -/*
  74.244 - * Send an array of these to HYPERVISOR_multicall().
  74.245 - * NB. The fields are natural register size for this architecture.
  74.246 - */
  74.247 -typedef struct
  74.248 -{
  74.249 -    cpureg_t op;
  74.250 -    cpureg_t args[7];
  74.251 -} PACKED multicall_entry_t;
  74.252 -
  74.253 -/* Event channel endpoints per domain. */
  74.254 -#define NR_EVENT_CHANNELS 1024
  74.255 -
  74.256 -/* No support for multi-processor guests. */
  74.257 -#define MAX_VIRT_CPUS 1
  74.258 -
  74.259 -/*
  74.260 - * Xen/guestos shared data -- pointer provided in start_info.
  74.261 - * NB. We expect that this struct is smaller than a page.
  74.262 - */
  74.263 -typedef struct shared_info_st
  74.264 -{
  74.265 -    /*
  74.266 -     * Per-VCPU information goes here. This will be cleaned up more when Xen 
  74.267 -     * actually supports multi-VCPU guests.
  74.268 -     */
  74.269 -    struct {
  74.270 -        /*
  74.271 -         * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
  74.272 -         * a pending notification for a particular VCPU. It is then cleared 
  74.273 -         * by the guest OS /before/ checking for pending work, thus avoiding
  74.274 -         * a set-and-check race. Note that the mask is only accessed by Xen
  74.275 -         * on the CPU that is currently hosting the VCPU. This means that the
  74.276 -         * pending and mask flags can be updated by the guest without special
  74.277 -         * synchronisation (i.e., no need for the x86 LOCK prefix).
  74.278 -         * This may seem suboptimal because if the pending flag is set by
  74.279 -         * a different CPU then an IPI may be scheduled even when the mask
  74.280 -         * is set. However, note:
  74.281 -         *  1. The task of 'interrupt holdoff' is covered by the per-event-
  74.282 -         *     channel mask bits. A 'noisy' event that is continually being
  74.283 -         *     triggered can be masked at source at this very precise
  74.284 -         *     granularity.
  74.285 -         *  2. The main purpose of the per-VCPU mask is therefore to restrict
  74.286 -         *     reentrant execution: whether for concurrency control, or to
  74.287 -         *     prevent unbounded stack usage. Whatever the purpose, we expect
  74.288 -         *     that the mask will be asserted only for short periods at a time,
  74.289 -         *     and so the likelihood of a 'spurious' IPI is suitably small.
  74.290 -         * The mask is read before making an event upcall to the guest: a
  74.291 -         * non-zero mask therefore guarantees that the VCPU will not receive
  74.292 -         * an upcall activation. The mask is cleared when the VCPU requests
  74.293 -         * to block: this avoids wakeup-waiting races.
  74.294 -         */
  74.295 -        u8 evtchn_upcall_pending;
  74.296 -        u8 evtchn_upcall_mask;
  74.297 -        u8 pad0, pad1;
  74.298 -    } PACKED vcpu_data[MAX_VIRT_CPUS];  /*   0 */
  74.299 -
  74.300 -    /*
  74.301 -     * A domain can have up to 1024 "event channels" on which it can send
  74.302 -     * and receive asynchronous event notifications. There are three classes
  74.303 -     * of event that are delivered by this mechanism:
  74.304 -     *  1. Bi-directional inter- and intra-domain connections. Domains must
  74.305 -     *     arrange out-of-band to set up a connection (usually the setup
  74.306 -     *     is initiated and organised by a privileged third party such as
  74.307 -     *     software running in domain 0).
  74.308 -     *  2. Physical interrupts. A domain with suitable hardware-access
  74.309 -     *     privileges can bind an event-channel port to a physical interrupt
  74.310 -     *     source.
  74.311 -     *  3. Virtual interrupts ('events'). A domain can bind an event-channel
  74.312 -     *     port to a virtual interrupt source, such as the virtual-timer
  74.313 -     *     device or the emergency console.
  74.314 -     * 
  74.315 -     * Event channels are addressed by a "port index" between 0 and 1023.
  74.316 -     * Each channel is associated with two bits of information:
  74.317 -     *  1. PENDING -- notifies the domain that there is a pending notification
  74.318 -     *     to be processed. This bit is cleared by the guest.
  74.319 -     *  2. MASK -- if this bit is clear then a 0->1 transition of PENDING
  74.320 -     *     will cause an asynchronous upcall to be scheduled. This bit is only
  74.321 -     *     updated by the guest. It is read-only within Xen. If a channel
  74.322 -     *     becomes pending while the channel is masked then the 'edge' is lost
  74.323 -     *     (i.e., when the channel is unmasked, the guest must manually handle
  74.324 -     *     pending notifications as no upcall will be scheduled by Xen).
  74.325 -     * 
  74.326 -     * To expedite scanning of pending notifications, any 0->1 pending
  74.327 -     * transition on an unmasked channel causes a corresponding bit in a
  74.328 -     * 32-bit selector to be set. Each bit in the selector covers a 32-bit
  74.329 -     * word in the PENDING bitfield array.
  74.330 -     */
  74.331 -    u32 evtchn_pending[32];             /*   4 */
  74.332 -    u32 evtchn_pending_sel;             /* 132 */
  74.333 -    u32 evtchn_mask[32];                /* 136 */
  74.334 -
  74.335 -    /*
  74.336 -     * Time: The following abstractions are exposed: System Time, Clock Time,
  74.337 -     * Domain Virtual Time. Domains can access Cycle counter time directly.
  74.338 -     */
  74.339 -    u64                cpu_freq;        /* 264: CPU frequency (Hz).          */
  74.340 -
  74.341 -    /*
  74.342 -     * The following values are updated periodically (and not necessarily
  74.343 -     * atomically!). The guest OS detects this because 'time_version1' is
  74.344 -     * incremented just before updating these values, and 'time_version2' is
  74.345 -     * incremented immediately after. See the Xen-specific Linux code for an
  74.346 -     * example of how to read these values safely (arch/xen/kernel/time.c).
  74.347 -     */
  74.348 -    u32                time_version1;   /* 272 */
  74.349 -    u32                time_version2;   /* 276 */
  74.350 -    tsc_timestamp_t    tsc_timestamp;   /* TSC at last update of time vals.  */
  74.351 -    u64                system_time;     /* Time, in nanosecs, since boot.    */
  74.352 -    u32                wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
  74.353 -    u32                wc_usec;         /* Usecs 00:00:00 UTC, Jan 1, 1970.  */
  74.354 -    u64                domain_time;     /* Domain virtual time, in nanosecs. */
  74.355 -
  74.356 -    /*
  74.357 -     * Timeout values:
  74.358 -     * Allow a domain to specify a timeout value in system time and 
  74.359 -     * domain virtual time.
  74.360 -     */
  74.361 -    u64                wall_timeout;    /* 312 */
  74.362 -    u64                domain_timeout;  /* 320 */
  74.363 -
  74.364 -    arch_shared_info_t arch;
  74.365 -
  74.366 -} PACKED shared_info_t;
  74.367 -
  74.368 -/*
  74.369 - * Start-of-day memory layout for the initial domain (DOM0):
  74.370 - *  1. The domain is started within contiguous virtual-memory region.
  74.371 - *  2. The contiguous region begins and ends on an aligned 4MB boundary.
  74.372 - *  3. The region start corresponds to the load address of the OS image.
  74.373 - *     If the load address is not 4MB aligned then the address is rounded down.
  74.374 - *  4. This the order of bootstrap elements in the initial virtual region:
  74.375 - *      a. relocated kernel image
  74.376 - *      b. initial ram disk              [mod_start, mod_len]
  74.377 - *      c. list of allocated page frames [mfn_list, nr_pages]
  74.378 - *      d. bootstrap page tables         [pt_base, CR3 (x86)]
  74.379 - *      e. start_info_t structure        [register ESI (x86)]
  74.380 - *      f. bootstrap stack               [register ESP (x86)]
  74.381 - *  5. Bootstrap elements are packed together, but each is 4kB-aligned.
  74.382 - *  6. The initial ram disk may be omitted.
  74.383 - *  7. The list of page frames forms a contiguous 'pseudo-physical' memory
  74.384 - *     layout for the domain. In particular, the bootstrap virtual-memory
  74.385 - *     region is a 1:1 mapping to the first section of the pseudo-physical map.
  74.386 - *  8. All bootstrap elements are mapped read-writable for the guest OS. The
  74.387 - *     only exception is the bootstrap page table, which is mapped read-only.
  74.388 - *  9. There is guaranteed to be at least 512kB padding after the final
  74.389 - *     bootstrap element. If necessary, the bootstrap virtual region is
  74.390 - *     extended by an extra 4MB to ensure this.
  74.391 - */
  74.392 -
  74.393 -#define MAX_CMDLINE 256
  74.394 -typedef struct {
  74.395 -    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.     */
  74.396 -    memory_t nr_pages;        /*  0: Total pages allocated to this domain. */
  74.397 -    _MEMORY_PADDING(A);
  74.398 -    memory_t shared_info;     /*  8: MACHINE address of shared info struct.*/
  74.399 -    _MEMORY_PADDING(B);
  74.400 -    u32      flags;           /* 16: SIF_xxx flags.                        */
  74.401 -    u16      domain_controller_evtchn; /* 20 */
  74.402 -    u16      __pad;
  74.403 -    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).      */
  74.404 -    memory_t pt_base;         /* 24: VIRTUAL address of page directory.    */
  74.405 -    _MEMORY_PADDING(C);
  74.406 -    memory_t nr_pt_frames;    /* 32: Number of bootstrap p.t. frames.      */
  74.407 -    _MEMORY_PADDING(D);
  74.408 -    memory_t mfn_list;        /* 40: VIRTUAL address of page-frame list.   */
  74.409 -    _MEMORY_PADDING(E);
  74.410 -    memory_t mod_start;       /* 48: VIRTUAL address of pre-loaded module. */
  74.411 -    _MEMORY_PADDING(F);
  74.412 -    memory_t mod_len;         /* 56: Size (bytes) of pre-loaded module.    */
  74.413 -    _MEMORY_PADDING(G);
  74.414 -    u8 cmd_line[MAX_CMDLINE]; /* 64 */
  74.415 -} PACKED start_info_t; /* 320 bytes */
  74.416 -
  74.417 -/* These flags are passed in the 'flags' field of start_info_t. */
  74.418 -#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
  74.419 -#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
  74.420 -#define SIF_BLK_BE_DOMAIN (1<<4)  /* Is this a block backend domain? */
  74.421 -#define SIF_NET_BE_DOMAIN (1<<5)  /* Is this a net backend domain? */
  74.422 -
  74.423 -/* For use in guest OSes. */
  74.424 -extern shared_info_t *HYPERVISOR_shared_info;
  74.425 -
  74.426 -#endif /* !__ASSEMBLY__ */
  74.427 -
  74.428 -#endif /* __HYPERVISOR_IF_H__ */
    75.1 --- a/xen/include/hypervisor-ifs/io/blkif.h	Sun Oct 31 08:22:21 2004 +0000
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,115 +0,0 @@
    75.4 -/******************************************************************************
    75.5 - * blkif.h
    75.6 - * 
    75.7 - * Unified block-device I/O interface for Xen guest OSes.
    75.8 - * 
    75.9 - * Copyright (c) 2003-2004, Keir Fraser
   75.10 - */
   75.11 -
   75.12 -#ifndef __SHARED_BLKIF_H__
   75.13 -#define __SHARED_BLKIF_H__
   75.14 -
   75.15 -#define blkif_vdev_t   u16
   75.16 -#define blkif_sector_t u64
   75.17 -
   75.18 -#define BLKIF_OP_READ      0
   75.19 -#define BLKIF_OP_WRITE     1
   75.20 -#define BLKIF_OP_PROBE     2
   75.21 -
   75.22 -/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
   75.23 -#define BLKIF_RING_SIZE        64
   75.24 -
   75.25 -/*
   75.26 - * Maximum scatter/gather segments per request.
   75.27 - * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
   75.28 - * NB. This could be 12 if the ring indexes weren't stored in the same page.
   75.29 - */
   75.30 -#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
   75.31 -
   75.32 -typedef struct {
   75.33 -    u8             operation;    /*  0: BLKIF_OP_???                         */
   75.34 -    u8             nr_segments;  /*  1: number of segments                   */
   75.35 -    blkif_vdev_t   device;       /*  2: only for read/write requests         */
   75.36 -    unsigned long  id;           /*  4: private guest value, echoed in resp  */
   75.37 -    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
   75.38 -    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
   75.39 -    /* @first_sect: first sector in frame to transfer (inclusive).           */
   75.40 -    /* @last_sect: last sector in frame to transfer (inclusive).             */
   75.41 -    /* @frame: machine page frame number.                                    */
   75.42 -    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   75.43 -} PACKED blkif_request_t;
   75.44 -
   75.45 -#define blkif_first_sect(_fas) (((_fas)>>3)&7)
   75.46 -#define blkif_last_sect(_fas)  ((_fas)&7)
   75.47 -
   75.48 -typedef struct {
   75.49 -    unsigned long   id;              /* copied from request */
   75.50 -    u8              operation;       /* copied from request */
   75.51 -    s16             status;          /* BLKIF_RSP_???       */
   75.52 -} PACKED blkif_response_t;
   75.53 -
   75.54 -#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
   75.55 -#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
   75.56 -
   75.57 -/*
   75.58 - * We use a special capitalised type name because it is _essential_ that all 
   75.59 - * arithmetic on indexes is done on an integer type of the correct size.
   75.60 - */
   75.61 -typedef u32 BLKIF_RING_IDX;
   75.62 -
   75.63 -/*
   75.64 - * Ring indexes are 'free running'. That is, they are not stored modulo the
   75.65 - * size of the ring buffer. The following macro converts a free-running counter
   75.66 - * into a value that can directly index a ring-buffer array.
   75.67 - */
   75.68 -#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
   75.69 -
   75.70 -typedef struct {
   75.71 -    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
   75.72 -    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
   75.73 -    union {                   /*  8 */
   75.74 -        blkif_request_t  req;
   75.75 -        blkif_response_t resp;
   75.76 -    } PACKED ring[BLKIF_RING_SIZE];
   75.77 -} PACKED blkif_ring_t;
   75.78 -
   75.79 -
   75.80 -/*
   75.81 - * BLKIF_OP_PROBE:
   75.82 - * The request format for a probe request is constrained as follows:
   75.83 - *  @operation   == BLKIF_OP_PROBE
   75.84 - *  @nr_segments == size of probe buffer in pages
   75.85 - *  @device      == unused (zero)
   75.86 - *  @id          == any value (echoed in response message)
   75.87 - *  @sector_num  == unused (zero)
   75.88 - *  @frame_and_sects == list of page-sized buffers.
   75.89 - *                       (i.e., @first_sect == 0, @last_sect == 7).
   75.90 - * 
   75.91 - * The response is a list of vdisk_t elements copied into the out-of-band
   75.92 - * probe buffer. On success the response status field contains the number
   75.93 - * of vdisk_t elements.
   75.94 - */
   75.95 -
   75.96 -/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
   75.97 -#define VDISK_TYPE_FLOPPY  0x00
   75.98 -#define VDISK_TYPE_TAPE    0x01
   75.99 -#define VDISK_TYPE_CDROM   0x05
  75.100 -#define VDISK_TYPE_OPTICAL 0x07
  75.101 -#define VDISK_TYPE_DISK    0x20 
  75.102 -
  75.103 -#define VDISK_TYPE_MASK    0x3F
  75.104 -#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
  75.105 -
  75.106 -/* The top two bits of the type field encode various flags. */
  75.107 -#define VDISK_FLAG_RO      0x40
  75.108 -#define VDISK_FLAG_VIRT    0x80
  75.109 -#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
  75.110 -#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
  75.111 -
  75.112 -typedef struct {
  75.113 -    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
  75.114 -    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
  75.115 -    u16            info;         /* 10: Device type and flags (VDISK_*).     */
  75.116 -} PACKED vdisk_t; /* 12 bytes */
  75.117 -
  75.118 -#endif /* __SHARED_BLKIF_H__ */
    76.1 --- a/xen/include/hypervisor-ifs/io/domain_controller.h	Sun Oct 31 08:22:21 2004 +0000
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,578 +0,0 @@
    76.4 -/******************************************************************************
    76.5 - * domain_controller.h
    76.6 - * 
    76.7 - * Interface to server controller (e.g., 'xend'). This header file defines the 
    76.8 - * interface that is shared with guest OSes.
    76.9 - * 
   76.10 - * Copyright (c) 2004, K A Fraser
   76.11 - */
   76.12 -
   76.13 -#ifndef __DOMAIN_CONTROLLER_H__
   76.14 -#define __DOMAIN_CONTROLLER_H__
   76.15 -
   76.16 -
   76.17 -/*
   76.18 - * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
   76.19 - * interpreted by control software to determine the appropriate action. These 
   76.20 - * are only really advisories: the controller can actually do as it likes.
   76.21 - */
   76.22 -#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
   76.23 -#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
   76.24 -#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
   76.25 -
   76.26 -
   76.27 -/*
   76.28 - * CONTROLLER MESSAGING INTERFACE.
   76.29 - */
   76.30 -
   76.31 -typedef struct {
   76.32 -    u8 type;     /*  0: echoed in response */
   76.33 -    u8 subtype;  /*  1: echoed in response */
   76.34 -    u8 id;       /*  2: echoed in response */
   76.35 -    u8 length;   /*  3: number of bytes in 'msg' */
   76.36 -    u8 msg[60];  /*  4: type-specific message data */
   76.37 -} PACKED control_msg_t; /* 64 bytes */
   76.38 -
   76.39 -#define CONTROL_RING_SIZE 8
   76.40 -typedef u32 CONTROL_RING_IDX;
   76.41 -#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
   76.42 -
   76.43 -typedef struct {
   76.44 -    control_msg_t tx_ring[CONTROL_RING_SIZE];   /*    0: guest -> controller */
   76.45 -    control_msg_t rx_ring[CONTROL_RING_SIZE];   /*  512: controller -> guest */
   76.46 -    CONTROL_RING_IDX tx_req_prod, tx_resp_prod; /* 1024, 1028 */
   76.47 -    CONTROL_RING_IDX rx_req_prod, rx_resp_prod; /* 1032, 1036 */
   76.48 -} PACKED control_if_t; /* 1040 bytes */
   76.49 -
   76.50 -/*
   76.51 - * Top-level command types.
   76.52 - */
   76.53 -#define CMSG_CONSOLE        0  /* Console                 */
   76.54 -#define CMSG_BLKIF_BE       1  /* Block-device backend    */
   76.55 -#define CMSG_BLKIF_FE       2  /* Block-device frontend   */
   76.56 -#define CMSG_NETIF_BE       3  /* Network-device backend  */
   76.57 -#define CMSG_NETIF_FE       4  /* Network-device frontend */
   76.58 -#define CMSG_SHUTDOWN       6  /* Shutdown messages       */
   76.59 -#define CMSG_MEM_REQUEST    7  /* Memory reservation reqs */
   76.60 -
   76.61 -
   76.62 -/******************************************************************************
   76.63 - * CONSOLE DEFINITIONS
   76.64 - */
   76.65 -
   76.66 -/*
   76.67 - * Subtypes for console messages.
   76.68 - */
   76.69 -#define CMSG_CONSOLE_DATA       0
   76.70 -
   76.71 -
   76.72 -/******************************************************************************
   76.73 - * BLOCK-INTERFACE FRONTEND DEFINITIONS
   76.74 - */
   76.75 -
   76.76 -/* Messages from domain controller to guest. */
   76.77 -#define CMSG_BLKIF_FE_INTERFACE_STATUS           0
   76.78 -
   76.79 -/* Messages from guest to domain controller. */
   76.80 -#define CMSG_BLKIF_FE_DRIVER_STATUS             32
   76.81 -#define CMSG_BLKIF_FE_INTERFACE_CONNECT         33
   76.82 -#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT      34
   76.83 -#define CMSG_BLKIF_FE_INTERFACE_QUERY           35
   76.84 -
   76.85 -/* These are used by both front-end and back-end drivers. */
   76.86 -#define blkif_vdev_t   u16
   76.87 -#define blkif_pdev_t   u16
   76.88 -#define blkif_sector_t u64
   76.89 -
   76.90 -/*
   76.91 - * CMSG_BLKIF_FE_INTERFACE_STATUS:
   76.92 - *  Notify a guest about a status change on one of its block interfaces.
   76.93 - *  If the interface is DESTROYED or DOWN then the interface is disconnected:
   76.94 - *   1. The shared-memory frame is available for reuse.
   76.95 - *   2. Any unacknowledged messages pending on the interface were dropped.
   76.96 - */
   76.97 -#define BLKIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
   76.98 -#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
   76.99 -#define BLKIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  76.100 -#define BLKIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
  76.101 -typedef struct {
  76.102 -    u32 handle; /*  0 */
  76.103 -    u32 status; /*  4 */
  76.104 -    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
  76.105 -    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
  76.106 -} PACKED blkif_fe_interface_status_t; /* 12 bytes */
  76.107 -
  76.108 -/*
  76.109 - * CMSG_BLKIF_FE_DRIVER_STATUS:
  76.110 - *  Notify the domain controller that the front-end driver is DOWN or UP.
  76.111 - *  When the driver goes DOWN then the controller will send no more
  76.112 - *  status-change notifications.
  76.113 - *  If the driver goes DOWN while interfaces are still UP, the domain
  76.114 - *  will automatically take the interfaces DOWN.
  76.115 - * 
  76.116 - *  NB. The controller should not send an INTERFACE_STATUS_CHANGED message
  76.117 - *  for interfaces that are active when it receives an UP notification. We
  76.118 - *  expect that the frontend driver will query those interfaces itself.
  76.119 - */
  76.120 -#define BLKIF_DRIVER_STATUS_DOWN   0
  76.121 -#define BLKIF_DRIVER_STATUS_UP     1
  76.122 -typedef struct {
  76.123 -    /* IN */
  76.124 -    u32 status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  76.125 -    /* OUT */
  76.126 -    /* Driver should query interfaces [0..max_handle]. */
  76.127 -    u32 max_handle;    /*  4 */
  76.128 -} PACKED blkif_fe_driver_status_t; /* 8 bytes */
  76.129 -
  76.130 -/*
  76.131 - * CMSG_BLKIF_FE_INTERFACE_CONNECT:
  76.132 - *  If successful, the domain controller will acknowledge with a
  76.133 - *  STATUS_CONNECTED message.
  76.134 - */
  76.135 -typedef struct {
  76.136 -    u32      handle;      /*  0 */
  76.137 -    u32      __pad;
  76.138 -    memory_t shmem_frame; /*  8 */
  76.139 -    MEMORY_PADDING;
  76.140 -} PACKED blkif_fe_interface_connect_t; /* 16 bytes */
  76.141 -
  76.142 -/*
  76.143 - * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
  76.144 - *  If successful, the domain controller will acknowledge with a
  76.145 - *  STATUS_DISCONNECTED message.
  76.146 - */
  76.147 -typedef struct {
  76.148 -    u32 handle; /*  0 */
  76.149 -} PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
  76.150 -
  76.151 -/*
  76.152 - * CMSG_BLKIF_FE_INTERFACE_QUERY:
  76.153 - */
  76.154 -typedef struct {
  76.155 -    /* IN */
  76.156 -    u32 handle; /*  0 */
  76.157 -    /* OUT */
  76.158 -    u32 status; /*  4 */
  76.159 -    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
  76.160 -    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
  76.161 -} PACKED blkif_fe_interface_query_t; /* 12 bytes */
  76.162 -
  76.163 -
  76.164 -/******************************************************************************
  76.165 - * BLOCK-INTERFACE BACKEND DEFINITIONS
  76.166 - */
  76.167 -
  76.168 -/* Messages from domain controller. */
  76.169 -#define CMSG_BLKIF_BE_CREATE      0  /* Create a new block-device interface. */
  76.170 -#define CMSG_BLKIF_BE_DESTROY     1  /* Destroy a block-device interface.    */
  76.171 -#define CMSG_BLKIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  76.172 -#define CMSG_BLKIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  76.173 -#define CMSG_BLKIF_BE_VBD_CREATE  4  /* Create a new VBD for an interface.   */
  76.174 -#define CMSG_BLKIF_BE_VBD_DESTROY 5  /* Delete a VBD from an interface.      */
  76.175 -#define CMSG_BLKIF_BE_VBD_GROW    6  /* Append an extent to a given VBD.     */
  76.176 -#define CMSG_BLKIF_BE_VBD_SHRINK  7  /* Remove last extent from a given VBD. */
  76.177 -
  76.178 -/* Messages to domain controller. */
  76.179 -#define CMSG_BLKIF_BE_DRIVER_STATUS 32
  76.180 -
  76.181 -/*
  76.182 - * Message request/response definitions for block-device messages.
  76.183 - */
  76.184 -
  76.185 -typedef struct {
  76.186 -    blkif_sector_t sector_start;   /*  0 */
  76.187 -    blkif_sector_t sector_length;  /*  8 */
  76.188 -    blkif_pdev_t   device;         /* 16 */
  76.189 -    u16            __pad;          /* 18 */
  76.190 -} PACKED blkif_extent_t; /* 20 bytes */
  76.191 -
  76.192 -/* Non-specific 'okay' return. */
  76.193 -#define BLKIF_BE_STATUS_OKAY                0
  76.194 -/* Non-specific 'error' return. */
  76.195 -#define BLKIF_BE_STATUS_ERROR               1
  76.196 -/* The following are specific error returns. */
  76.197 -#define BLKIF_BE_STATUS_INTERFACE_EXISTS    2
  76.198 -#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  76.199 -#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
  76.200 -#define BLKIF_BE_STATUS_VBD_EXISTS          5
  76.201 -#define BLKIF_BE_STATUS_VBD_NOT_FOUND       6
  76.202 -#define BLKIF_BE_STATUS_OUT_OF_MEMORY       7
  76.203 -#define BLKIF_BE_STATUS_EXTENT_NOT_FOUND    8
  76.204 -#define BLKIF_BE_STATUS_MAPPING_ERROR       9
  76.205 -
  76.206 -/* This macro can be used to create an array of descriptive error strings. */
  76.207 -#define BLKIF_BE_STATUS_ERRORS {    \
  76.208 -    "Okay",                         \
  76.209 -    "Non-specific error",           \
  76.210 -    "Interface already exists",     \
  76.211 -    "Interface not found",          \
  76.212 -    "Interface is still connected", \
  76.213 -    "VBD already exists",           \
  76.214 -    "VBD not found",                \
  76.215 -    "Out of memory",                \
  76.216 -    "Extent not found for VBD",     \
  76.217 -    "Could not map domain memory" }
  76.218 -
  76.219 -/*
  76.220 - * CMSG_BLKIF_BE_CREATE:
  76.221 - *  When the driver sends a successful response then the interface is fully
  76.222 - *  created. The controller will send a DOWN notification to the front-end
  76.223 - *  driver.
  76.224 - */
  76.225 -typedef struct { 
  76.226 -    /* IN */
  76.227 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  76.228 -    u16        __pad;
  76.229 -    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  76.230 -    /* OUT */
  76.231 -    u32        status;        /*  8 */
  76.232 -} PACKED blkif_be_create_t; /* 12 bytes */
  76.233 -
  76.234 -/*
  76.235 - * CMSG_BLKIF_BE_DESTROY:
  76.236 - *  When the driver sends a successful response then the interface is fully
  76.237 - *  torn down. The controller will send a DESTROYED notification to the
  76.238 - *  front-end driver.
  76.239 - */
  76.240 -typedef struct { 
  76.241 -    /* IN */
  76.242 -    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  76.243 -    u16        __pad;
  76.244 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  76.245 -    /* OUT */
  76.246 -    u32        status;        /*  8 */
  76.247 -} PACKED blkif_be_destroy_t; /* 12 bytes */
  76.248 -
  76.249 -/*
  76.250 - * CMSG_BLKIF_BE_CONNECT:
  76.251 - *  When the driver sends a successful response then the interface is fully
  76.252 - *  connected. The controller will send a CONNECTED notification to the
  76.253 - *  front-end driver.
  76.254 - */
  76.255 -typedef struct { 
  76.256 -    /* IN */
  76.257 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  76.258 -    u16        __pad;
  76.259 -    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  76.260 -    memory_t   shmem_frame;   /*  8: Page cont. shared comms window.     */
  76.261 -    MEMORY_PADDING;
  76.262 -    u32        evtchn;        /* 16: Event channel for notifications.    */
  76.263 -    /* OUT */
  76.264 -    u32        status;        /* 20 */
  76.265 -} PACKED blkif_be_connect_t;  /* 24 bytes */
  76.266 -
  76.267 -/*
  76.268 - * CMSG_BLKIF_BE_DISCONNECT:
  76.269 - *  When the driver sends a successful response then the interface is fully
  76.270 - *  disconnected. The controller will send a DOWN notification to the front-end
  76.271 - *  driver.
  76.272 - */
  76.273 -typedef struct { 
  76.274 -    /* IN */
  76.275 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  76.276 -    u16        __pad;
  76.277 -    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  76.278 -    /* OUT */
  76.279 -    u32        status;        /*  8 */
  76.280 -} PACKED blkif_be_disconnect_t; /* 12 bytes */
  76.281 -
  76.282 -/* CMSG_BLKIF_BE_VBD_CREATE */
  76.283 -typedef struct { 
  76.284 -    /* IN */
  76.285 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  76.286 -    u16        __pad;
  76.287 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  76.288 -    blkif_vdev_t vdevice;     /*  8: Interface-specific id for this VBD. */
  76.289 -    u16        readonly;      /* 10: Non-zero -> VBD isn't writable.     */
  76.290 -    /* OUT */
  76.291 -    u32        status;        /* 12 */
  76.292 -} PACKED blkif_be_vbd_create_t; /* 16 bytes */
  76.293 -
  76.294 -/* CMSG_BLKIF_BE_VBD_DESTROY */
  76.295 -typedef struct {
  76.296 -    /* IN */
  76.297 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  76.298 -    u16        __pad0;        /*  2 */
  76.299 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  76.300 -    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  76.301 -    u16        __pad1;        /* 10 */
  76.302 -    /* OUT */
  76.303 -    u32        status;        /* 12 */
  76.304 -} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
  76.305 -
  76.306 -/* CMSG_BLKIF_BE_VBD_GROW */
  76.307 -typedef struct { 
  76.308 -    /* IN */
  76.309 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  76.310 -    u16        __pad0;        /*  2 */
  76.311 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  76.312 -    blkif_extent_t extent;    /*  8: Physical extent to append to VBD.   */
  76.313 -    blkif_vdev_t vdevice;     /* 28: Interface-specific id of the VBD.   */
  76.314 -    u16        __pad1;        /* 30 */
  76.315 -    /* OUT */
  76.316 -    u32        status;        /* 32 */
  76.317 -} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
  76.318 -
  76.319 -/* CMSG_BLKIF_BE_VBD_SHRINK */
  76.320 -typedef struct { 
  76.321 -    /* IN */
  76.322 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  76.323 -    u16        __pad0;        /*  2 */
  76.324 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  76.325 -    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  76.326 -    u16        __pad1;        /* 10 */
  76.327 -    /* OUT */
  76.328 -    u32        status;        /* 12 */
  76.329 -} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
  76.330 -
  76.331 -/*
  76.332 - * CMSG_BLKIF_BE_DRIVER_STATUS:
  76.333 - *  Notify the domain controller that the back-end driver is DOWN or UP.
  76.334 - *  If the driver goes DOWN while interfaces are still UP, the controller
  76.335 - *  will automatically send DOWN notifications.
  76.336 - */
  76.337 -typedef struct {
  76.338 -    u32        status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  76.339 -} PACKED blkif_be_driver_status_t; /* 4 bytes */
  76.340 -
  76.341 -
  76.342 -/******************************************************************************
  76.343 - * NETWORK-INTERFACE FRONTEND DEFINITIONS
  76.344 - */
  76.345 -
  76.346 -/* Messages from domain controller to guest. */
  76.347 -#define CMSG_NETIF_FE_INTERFACE_STATUS   0
  76.348 -
  76.349 -/* Messages from guest to domain controller. */
  76.350 -#define CMSG_NETIF_FE_DRIVER_STATUS             32
  76.351 -#define CMSG_NETIF_FE_INTERFACE_CONNECT         33
  76.352 -#define CMSG_NETIF_FE_INTERFACE_DISCONNECT      34
  76.353 -#define CMSG_NETIF_FE_INTERFACE_QUERY           35
  76.354 -
  76.355 -/*
  76.356 - * CMSG_NETIF_FE_INTERFACE_STATUS:
  76.357 - *  Notify a guest about a status change on one of its network interfaces.
  76.358 - *  If the interface is CLOSED or DOWN then the interface is disconnected:
  76.359 - *   1. The shared-memory frame is available for reuse.
  76.360 - *   2. Any unacknowledged messgaes pending on the interface were dropped.
  76.361 - */
  76.362 -#define NETIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
  76.363 -#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
  76.364 -#define NETIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  76.365 -#define NETIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
  76.366 -typedef struct {
  76.367 -    u32        handle; /*  0 */
  76.368 -    u32        status; /*  4 */
  76.369 -    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
  76.370 -    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
  76.371 -    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
  76.372 -} PACKED netif_fe_interface_status_t; /* 18 bytes */
  76.373 -
  76.374 -/*
  76.375 - * CMSG_NETIF_FE_DRIVER_STATUS:
  76.376 - *  Notify the domain controller that the front-end driver is DOWN or UP.
  76.377 - *  When the driver goes DOWN then the controller will send no more
  76.378 - *  status-change notifications.
  76.379 - *  If the driver goes DOWN while interfaces are still UP, the domain
  76.380 - *  will automatically take the interfaces DOWN.
  76.381 - * 
  76.382 - *  NB. The controller should not send an INTERFACE_STATUS message
  76.383 - *  for interfaces that are active when it receives an UP notification. We
  76.384 - *  expect that the frontend driver will query those interfaces itself.
  76.385 - */
  76.386 -#define NETIF_DRIVER_STATUS_DOWN   0
  76.387 -#define NETIF_DRIVER_STATUS_UP     1
  76.388 -typedef struct {
  76.389 -    /* IN */
  76.390 -    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  76.391 -    /* OUT */
  76.392 -    /* Driver should query interfaces [0..max_handle]. */
  76.393 -    u32        max_handle;    /*  4 */
  76.394 -} PACKED netif_fe_driver_status_t; /* 8 bytes */
  76.395 -
  76.396 -/*
  76.397 - * CMSG_NETIF_FE_INTERFACE_CONNECT:
  76.398 - *  If successful, the domain controller will acknowledge with a
  76.399 - *  STATUS_CONNECTED message.
  76.400 - */
  76.401 -typedef struct {
  76.402 -    u32        handle;         /*  0 */
  76.403 -    u32        __pad;          /*  4 */
  76.404 -    memory_t   tx_shmem_frame; /*  8 */
  76.405 -    MEMORY_PADDING;
  76.406 -    memory_t   rx_shmem_frame; /* 16 */
  76.407 -    MEMORY_PADDING;
  76.408 -} PACKED netif_fe_interface_connect_t; /* 24 bytes */
  76.409 -
  76.410 -/*
  76.411 - * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
  76.412 - *  If successful, the domain controller will acknowledge with a
  76.413 - *  STATUS_DISCONNECTED message.
  76.414 - */
  76.415 -typedef struct {
  76.416 -    u32        handle;        /*  0 */
  76.417 -} PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
  76.418 -
  76.419 -/*
  76.420 - * CMSG_NETIF_FE_INTERFACE_QUERY:
  76.421 - */
  76.422 -typedef struct {
  76.423 -    /* IN */
  76.424 -    u32        handle; /*  0 */
  76.425 -    /* OUT */
  76.426 -    u32        status; /*  4 */
  76.427 -    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
  76.428 -    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
  76.429 -    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
  76.430 -} PACKED netif_fe_interface_query_t; /* 18 bytes */
  76.431 -
  76.432 -
  76.433 -/******************************************************************************
  76.434 - * NETWORK-INTERFACE BACKEND DEFINITIONS
  76.435 - */
  76.436 -
  76.437 -/* Messages from domain controller. */
  76.438 -#define CMSG_NETIF_BE_CREATE      0  /* Create a new net-device interface. */
  76.439 -#define CMSG_NETIF_BE_DESTROY     1  /* Destroy a net-device interface.    */
  76.440 -#define CMSG_NETIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  76.441 -#define CMSG_NETIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  76.442 -
  76.443 -/* Messages to domain controller. */
  76.444 -#define CMSG_NETIF_BE_DRIVER_STATUS 32
  76.445 -
  76.446 -/*
  76.447 - * Message request/response definitions for net-device messages.
  76.448 - */
  76.449 -
  76.450 -/* Non-specific 'okay' return. */
  76.451 -#define NETIF_BE_STATUS_OKAY                0
  76.452 -/* Non-specific 'error' return. */
  76.453 -#define NETIF_BE_STATUS_ERROR               1
  76.454 -/* The following are specific error returns. */
  76.455 -#define NETIF_BE_STATUS_INTERFACE_EXISTS    2
  76.456 -#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  76.457 -#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
  76.458 -#define NETIF_BE_STATUS_OUT_OF_MEMORY       5
  76.459 -#define NETIF_BE_STATUS_MAPPING_ERROR       6
  76.460 -
  76.461 -/* This macro can be used to create an array of descriptive error strings. */
  76.462 -#define NETIF_BE_STATUS_ERRORS {    \
  76.463 -    "Okay",                         \
  76.464 -    "Non-specific error",           \
  76.465 -    "Interface already exists",     \
  76.466 -    "Interface not found",          \
  76.467 -    "Interface is still connected", \
  76.468 -    "Out of memory",                \
  76.469 -    "Could not map domain memory" }
  76.470 -
  76.471 -/*
  76.472 - * CMSG_NETIF_BE_CREATE:
  76.473 - *  When the driver sends a successful response then the interface is fully
  76.474 - *  created. The controller will send a DOWN notification to the front-end
  76.475 - *  driver.
  76.476 - */
  76.477 -typedef struct { 
  76.478 -    /* IN */
  76.479 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  76.480 -    u16        __pad0;        /*  2 */
  76.481 -    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  76.482 -    u8         mac[6];        /*  8 */
  76.483 -    u16        __pad1;        /* 14 */
  76.484 -    /* OUT */
  76.485 -    u32        status;        /* 16 */
  76.486 -} PACKED netif_be_create_t; /* 20 bytes */
  76.487 -
  76.488 -/*
  76.489 - * CMSG_NETIF_BE_DESTROY:
  76.490 - *  When the driver sends a successful response then the interface is fully
  76.491 - *  torn down. The controller will send a DESTROYED notification to the
  76.492 - *  front-end driver.
  76.493 - */
  76.494 -typedef struct { 
  76.495 -    /* IN */
  76.496 -    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  76.497 -    u16        __pad;
  76.498 -    u32        netif_handle;  /*  4: ...ditto...                         */
  76.499 -    /* OUT */
  76.500 -    u32   status;             /*  8 */
  76.501 -} PACKED netif_be_destroy_t; /* 12 bytes */
  76.502 -
  76.503 -/*
  76.504 - * CMSG_NETIF_BE_CONNECT:
  76.505 - *  When the driver sends a successful response then the interface is fully
  76.506 - *  connected. The controller will send a CONNECTED notification to the
  76.507 - *  front-end driver.
  76.508 - */
  76.509 -typedef struct { 
  76.510 -    /* IN */
  76.511 -    domid_t    domid;          /*  0: Domain attached to new interface.   */
  76.512 -    u16        __pad0;         /*  2 */
  76.513 -    u32        netif_handle;   /*  4: Domain-specific interface handle.   */
  76.514 -    memory_t   tx_shmem_frame; /*  8: Page cont. tx shared comms window.  */
  76.515 -    MEMORY_PADDING;
  76.516 -    memory_t   rx_shmem_frame; /* 16: Page cont. rx shared comms window.  */
  76.517 -    MEMORY_PADDING;
  76.518 -    u16        evtchn;         /* 24: Event channel for notifications.    */
  76.519 -    u16        __pad1;         /* 26 */
  76.520 -    /* OUT */
  76.521 -    u32        status;         /* 28 */
  76.522 -} PACKED netif_be_connect_t; /* 32 bytes */
  76.523 -
  76.524 -/*
  76.525 - * CMSG_NETIF_BE_DISCONNECT:
  76.526 - *  When the driver sends a successful response then the interface is fully
  76.527 - *  disconnected. The controller will send a DOWN notification to the front-end
  76.528 - *  driver.
  76.529 - */
  76.530 -typedef struct { 
  76.531 -    /* IN */
  76.532 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  76.533 -    u16        __pad;
  76.534 -    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  76.535 -    /* OUT */
  76.536 -    u32        status;        /*  8 */
  76.537 -} PACKED netif_be_disconnect_t; /* 12 bytes */
  76.538 -
  76.539 -/*
  76.540 - * CMSG_NETIF_BE_DRIVER_STATUS:
  76.541 - *  Notify the domain controller that the back-end driver is DOWN or UP.
  76.542 - *  If the driver goes DOWN while interfaces are still UP, the domain
  76.543 - *  will automatically send DOWN notifications.
  76.544 - */
  76.545 -typedef struct {
  76.546 -    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  76.547 -} PACKED netif_be_driver_status_t; /* 4 bytes */
  76.548 -
  76.549 -
  76.550 -/******************************************************************************
  76.551 - * SHUTDOWN DEFINITIONS
  76.552 - */
  76.553 -
  76.554 -/*
  76.555 - * Subtypes for shutdown messages.
  76.556 - */
  76.557 -#define CMSG_SHUTDOWN_POWEROFF  0   /* Clean shutdown (SHUTDOWN_poweroff).   */
  76.558 -#define CMSG_SHUTDOWN_REBOOT    1   /* Clean shutdown (SHUTDOWN_reboot).     */
  76.559 -#define CMSG_SHUTDOWN_SUSPEND   2   /* Create suspend info, then             */
  76.560 -                                    /* SHUTDOWN_suspend.                     */
  76.561 -
  76.562 -
  76.563 -/******************************************************************************
  76.564 - * MEMORY CONTROLS
  76.565 - */
  76.566 -
  76.567 -#define CMSG_MEM_REQUEST_SET 0 /* Request a domain to set its mem footprint. */
  76.568 -
  76.569 -/*
  76.570 - * CMSG_MEM_REQUEST:
  76.571 - *  Request that the domain change its memory reservation.
  76.572 - */
  76.573 -typedef struct {
  76.574 -    /* OUT */
  76.575 -    u32 target;       /* 0: Target memory reservation in pages.       */
  76.576 -    /* IN  */
  76.577 -    u32 status;       /* 4: Return code indicates success or failure. */
  76.578 -} PACKED mem_request_t; /* 8 bytes */
  76.579 -
  76.580 -
  76.581 -#endif /* __DOMAIN_CONTROLLER_H__ */
    77.1 --- a/xen/include/hypervisor-ifs/io/netif.h	Sun Oct 31 08:22:21 2004 +0000
    77.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.3 @@ -1,92 +0,0 @@
    77.4 -/******************************************************************************
    77.5 - * netif.h
    77.6 - * 
    77.7 - * Unified network-device I/O interface for Xen guest OSes.
    77.8 - * 
    77.9 - * Copyright (c) 2003-2004, Keir Fraser
   77.10 - */
   77.11 -
   77.12 -#ifndef __SHARED_NETIF_H__
   77.13 -#define __SHARED_NETIF_H__
   77.14 -
   77.15 -typedef struct {
   77.16 -    memory_t addr;   /*  0: Machine address of packet.  */
   77.17 -    MEMORY_PADDING;
   77.18 -    u16      id;     /*  8: Echoed in response message. */
   77.19 -    u16      size;   /* 10: Packet size in bytes.       */
   77.20 -} PACKED netif_tx_request_t; /* 12 bytes */
   77.21 -
   77.22 -typedef struct {
   77.23 -    u16      id;     /*  0 */
   77.24 -    s8       status; /*  2 */
   77.25 -    u8       __pad;  /*  3 */
   77.26 -} PACKED netif_tx_response_t; /* 4 bytes */
   77.27 -
   77.28 -typedef struct {
   77.29 -    u16       id;    /*  0: Echoed in response message.        */
   77.30 -} PACKED netif_rx_request_t; /* 2 bytes */
   77.31 -
   77.32 -typedef struct {
   77.33 -    memory_t addr;   /*  0: Machine address of packet.              */
   77.34 -    MEMORY_PADDING;
   77.35 -    u16      id;     /*  8:  */
   77.36 -    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
   77.37 -} PACKED netif_rx_response_t; /* 12 bytes */
   77.38 -
   77.39 -/*
   77.40 - * We use a special capitalised type name because it is _essential_ that all 
   77.41 - * arithmetic on indexes is done on an integer type of the correct size.
   77.42 - */
   77.43 -typedef u32 NETIF_RING_IDX;
   77.44 -
   77.45 -/*
   77.46 - * Ring indexes are 'free running'. That is, they are not stored modulo the
   77.47 - * size of the ring buffer. The following macros convert a free-running counter
   77.48 - * into a value that can directly index a ring-buffer array.
   77.49 - */
   77.50 -#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
   77.51 -#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
   77.52 -
   77.53 -#define NETIF_TX_RING_SIZE 256
   77.54 -#define NETIF_RX_RING_SIZE 256
   77.55 -
   77.56 -/* This structure must fit in a memory page. */
   77.57 -typedef struct {
   77.58 -    /*
   77.59 -     * Frontend places packets into ring at tx_req_prod.
   77.60 -     * Frontend receives event when tx_resp_prod passes tx_event.
   77.61 -     * 'req_cons' is a shadow of the backend's request consumer -- the frontend
   77.62 -     * may use it to determine if all queued packets have been seen by the
   77.63 -     * backend.
   77.64 -     */
   77.65 -    NETIF_RING_IDX req_prod;       /*  0 */
   77.66 -    NETIF_RING_IDX req_cons;       /*  4 */
   77.67 -    NETIF_RING_IDX resp_prod;      /*  8 */
   77.68 -    NETIF_RING_IDX event;          /* 12 */
   77.69 -    union {                        /* 16 */
   77.70 -        netif_tx_request_t  req;
   77.71 -        netif_tx_response_t resp;
   77.72 -    } PACKED ring[NETIF_TX_RING_SIZE];
   77.73 -} PACKED netif_tx_interface_t;
   77.74 -
   77.75 -/* This structure must fit in a memory page. */
   77.76 -typedef struct {
   77.77 -    /*
   77.78 -     * Frontend places empty buffers into ring at rx_req_prod.
   77.79 -     * Frontend receives event when rx_resp_prod passes rx_event.
   77.80 -     */
   77.81 -    NETIF_RING_IDX req_prod;       /*  0 */
   77.82 -    NETIF_RING_IDX resp_prod;      /*  4 */
   77.83 -    NETIF_RING_IDX event;          /*  8 */
   77.84 -    union {                        /* 12 */
   77.85 -        netif_rx_request_t  req;
   77.86 -        netif_rx_response_t resp;
   77.87 -    } PACKED ring[NETIF_RX_RING_SIZE];
   77.88 -} PACKED netif_rx_interface_t;
   77.89 -
   77.90 -/* Descriptor status values */
   77.91 -#define NETIF_RSP_DROPPED         -2
   77.92 -#define NETIF_RSP_ERROR           -1
   77.93 -#define NETIF_RSP_OKAY             0
   77.94 -
   77.95 -#endif
    78.1 --- a/xen/include/hypervisor-ifs/physdev.h	Sun Oct 31 08:22:21 2004 +0000
    78.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.3 @@ -1,80 +0,0 @@
    78.4 -/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
    78.5 - ****************************************************************************
    78.6 - * (c) 2004 - Rolf Neugebauer - Intel Research Cambridge
    78.7 - * (c) 2004 - Keir Fraser - University of Cambridge
    78.8 - ****************************************************************************
    78.9 - * Description: Interface for domains to access physical devices on the PCI bus
   78.10 - */
   78.11 -
   78.12 -#ifndef __HYPERVISOR_IFS_PHYSDEV_H__
   78.13 -#define __HYPERVISOR_IFS_PHYSDEV_H__
   78.14 -
   78.15 -/* Commands to HYPERVISOR_physdev_op() */
   78.16 -#define PHYSDEVOP_PCI_CFGREG_READ       0
   78.17 -#define PHYSDEVOP_PCI_CFGREG_WRITE      1
   78.18 -#define PHYSDEVOP_PCI_INITIALISE_DEVICE 2
   78.19 -#define PHYSDEVOP_PCI_PROBE_ROOT_BUSES  3
   78.20 -#define PHYSDEVOP_IRQ_UNMASK_NOTIFY     4
   78.21 -#define PHYSDEVOP_IRQ_STATUS_QUERY      5
   78.22 -
   78.23 -/* Read from PCI configuration space. */
   78.24 -typedef struct {
   78.25 -    /* IN */
   78.26 -    u32 bus;                          /*  0 */
   78.27 -    u32 dev;                          /*  4 */
   78.28 -    u32 func;                         /*  8 */
   78.29 -    u32 reg;                          /* 12 */
   78.30 -    u32 len;                          /* 16 */
   78.31 -    /* OUT */
   78.32 -    u32 value;                        /* 20 */
   78.33 -} PACKED physdevop_pci_cfgreg_read_t; /* 24 bytes */
   78.34 -
   78.35 -/* Write to PCI configuration space. */
   78.36 -typedef struct {
   78.37 -    /* IN */
   78.38 -    u32 bus;                          /*  0 */
   78.39 -    u32 dev;                          /*  4 */
   78.40 -    u32 func;                         /*  8 */
   78.41 -    u32 reg;                          /* 12 */
   78.42 -    u32 len;                          /* 16 */
   78.43 -    u32 value;                        /* 20 */
   78.44 -} PACKED physdevop_pci_cfgreg_write_t; /* 24 bytes */
   78.45 -
   78.46 -/* Do final initialisation of a PCI device (e.g., last-moment IRQ routing). */
   78.47 -typedef struct {
   78.48 -    /* IN */
   78.49 -    u32 bus;                          /*  0 */
   78.50 -    u32 dev;                          /*  4 */
   78.51 -    u32 func;                         /*  8 */
   78.52 -} PACKED physdevop_pci_initialise_device_t; /* 12 bytes */
   78.53 -
   78.54 -/* Find the root buses for subsequent scanning. */
   78.55 -typedef struct {
   78.56 -    /* OUT */
   78.57 -    u32 busmask[256/32];              /*  0 */
   78.58 -} PACKED physdevop_pci_probe_root_buses_t; /* 32 bytes */
   78.59 -
   78.60 -typedef struct {
   78.61 -    /* IN */
   78.62 -    u32 irq;                          /*  0 */
   78.63 -    /* OUT */
   78.64 -/* Need to call PHYSDEVOP_IRQ_UNMASK_NOTIFY when the IRQ has been serviced? */
   78.65 -#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY (1<<0)
   78.66 -    u32 flags;                        /*  4 */
   78.67 -} PACKED physdevop_irq_status_query_t; /* 8 bytes */
   78.68 -
   78.69 -typedef struct _physdev_op_st 
   78.70 -{
   78.71 -    u32 cmd;                          /*  0 */
   78.72 -    u32 __pad;                        /*  4 */
   78.73 -    union {                           /*  8 */
   78.74 -        physdevop_pci_cfgreg_read_t       pci_cfgreg_read;
   78.75 -        physdevop_pci_cfgreg_write_t      pci_cfgreg_write;
   78.76 -        physdevop_pci_initialise_device_t pci_initialise_device;
   78.77 -        physdevop_pci_probe_root_buses_t  pci_probe_root_buses;
   78.78 -        physdevop_irq_status_query_t      irq_status_query;
   78.79 -        u8                                __dummy[32];
   78.80 -    } PACKED u;
   78.81 -} PACKED physdev_op_t; /* 40 bytes */
   78.82 -
   78.83 -#endif /* __HYPERVISOR_IFS_PHYSDEV_H__ */
    79.1 --- a/xen/include/hypervisor-ifs/sched_ctl.h	Sun Oct 31 08:22:21 2004 +0000
    79.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.3 @@ -1,70 +0,0 @@
    79.4 -/**
    79.5 - * Generic scheduler control interface.
    79.6 - *
    79.7 - * Mark Williamson, (C) 2004 Intel Research Cambridge
    79.8 - */
    79.9 -
   79.10 -#ifndef __SCHED_CTL_H__
   79.11 -#define __SCHED_CTL_H__
   79.12 -
   79.13 -/* Scheduler types */
   79.14 -#define SCHED_BVT      0
   79.15 -#define SCHED_ATROPOS  2
   79.16 -#define SCHED_RROBIN   3
   79.17 -
   79.18 -/* these describe the intended direction used for a scheduler control or domain
   79.19 - * command */
   79.20 -#define SCHED_INFO_PUT 0
   79.21 -#define SCHED_INFO_GET 1
   79.22 -
   79.23 -/*
   79.24 - * Generic scheduler control command - used to adjust system-wide scheduler
   79.25 - * parameters
   79.26 - */
   79.27 -struct sched_ctl_cmd
   79.28 -{
   79.29 -    u32 sched_id;                     /*  0 */
   79.30 -    u32 direction;                    /*  4 */
   79.31 -    union {                           /*  8 */
   79.32 -        struct bvt_ctl
   79.33 -        {
   79.34 -            /* IN variables. */
   79.35 -            u32 ctx_allow;            /*  8: context switch allowance */
   79.36 -        } PACKED bvt;
   79.37 -
   79.38 -        struct rrobin_ctl
   79.39 -        {
   79.40 -            /* IN variables */
   79.41 -            u64 slice;                /*  8: round robin time slice */
   79.42 -        } PACKED rrobin;
   79.43 -    } PACKED u;
   79.44 -} PACKED; /* 16 bytes */
   79.45 -
   79.46 -struct sched_adjdom_cmd
   79.47 -{
   79.48 -    u32     sched_id;                 /*  0 */
   79.49 -    u32     direction;                /*  4 */
   79.50 -    domid_t domain;                   /*  8 */
   79.51 -    u16     __pad0;
   79.52 -    u32     __pad1;
   79.53 -    union {                           /* 16 */
   79.54 -        struct bvt_adjdom
   79.55 -        {
   79.56 -            u32 mcu_adv;            /* 16: mcu advance: inverse of weight */
   79.57 -            u32 warpback;           /* 20: warp? */
   79.58 -            s32 warpvalue;          /* 24: warp value */
   79.59 -            long long warpl;        /* 32: warp limit */
   79.60 -            long long warpu;        /* 40: unwarp time requirement */
   79.61 -        } PACKED bvt;
   79.62 -
   79.63 -        struct atropos_adjdom
   79.64 -        {
   79.65 -            u64 nat_period; /* 16 */
   79.66 -            u64 nat_slice;  /* 24 */
   79.67 -            u64 latency;    /* 32 */
   79.68 -            u32 xtratime;   /* 36 */
   79.69 -        } PACKED atropos;
   79.70 -    } PACKED u;
   79.71 -} PACKED; /* 40 bytes */
   79.72 -
   79.73 -#endif /* __SCHED_CTL_H__ */
    80.1 --- a/xen/include/hypervisor-ifs/trace.h	Sun Oct 31 08:22:21 2004 +0000
    80.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.3 @@ -1,31 +0,0 @@
    80.4 -/******************************************************************************
    80.5 - * include/hypervisor-ifs/trace.h
    80.6 - */
    80.7 -
    80.8 -#ifndef __HYPERVISOR_IFS_TRACE_H__
    80.9 -#define __HYPERVISOR_IFS_TRACE_H__
   80.10 -
   80.11 -/* This structure represents a single trace buffer record. */
   80.12 -struct t_rec {
   80.13 -    u64 cycles;               /* 64 bit cycle counter timestamp */
   80.14 -    u32 event;                /* 32 bit event ID                */
   80.15 -    u32 d1, d2, d3, d4, d5;   /* event data items               */
   80.16 -};
   80.17 -
   80.18 -/*
   80.19 - * This structure contains the metadata for a single trace buffer.  The head
   80.20 - * field, indexes into an array of struct t_rec's.
   80.21 - */
   80.22 -struct t_buf {
   80.23 -    unsigned long data;      /* pointer to data area.  machine address
   80.24 -                              * for convenience in user space code           */
   80.25 -
   80.26 -    unsigned long size;      /* size of the data area, in t_recs             */
   80.27 -    unsigned long head;      /* array index of the most recent record        */
   80.28 -
   80.29 -    /* Xen-private elements follow... */
   80.30 -    struct t_rec *head_ptr; /* pointer to the head record                    */
   80.31 -    struct t_rec *vdata;    /* virtual address pointer to data               */
   80.32 -};
   80.33 -
   80.34 -#endif /* __HYPERVISOR_IFS_TRACE_H__ */
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/xen/include/public/COPYING	Sun Oct 31 09:56:36 2004 +0000
    81.3 @@ -0,0 +1,28 @@
    81.4 +XEN NOTICE
    81.5 +==========
    81.6 +
    81.7 +This copyright applies to all files within this subdirectory. All
    81.8 +other files in the Xen source distribution are covered by version 2 of
    81.9 +the GNU General Public License.
   81.10 +
   81.11 + -- Keir Fraser (on behalf of the Xen team)
   81.12 +
   81.13 +=====================================================================
   81.14 +
   81.15 +Permission is hereby granted, free of charge, to any person obtaining a copy
   81.16 +of this software and associated documentation files (the "Software"), to
   81.17 +deal in the Software without restriction, including without limitation the
   81.18 +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   81.19 +sell copies of the Software, and to permit persons to whom the Software is
   81.20 +furnished to do so, subject to the following conditions:
   81.21 +
   81.22 +The above copyright notice and this permission notice shall be included in
   81.23 +all copies or substantial portions of the Software.
   81.24 +
   81.25 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
   81.26 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   81.27 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
   81.28 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
   81.29 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
   81.30 +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
   81.31 +DEALINGS IN THE SOFTWARE.
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/xen/include/public/arch-x86_32.h	Sun Oct 31 09:56:36 2004 +0000
    82.3 @@ -0,0 +1,141 @@
    82.4 +/******************************************************************************
    82.5 + * arch-x86_32.h
    82.6 + * 
    82.7 + * Guest OS interface to x86 32-bit Xen.
    82.8 + */
    82.9 +
   82.10 +#ifndef __XEN_PUBLIC_ARCH_X86_32_H__
   82.11 +#define __XEN_PUBLIC_ARCH_X86_32_H__
   82.12 +
   82.13 +/*
   82.14 + * Pointers and other address fields inside interface structures are padded to
   82.15 + * 64 bits. This means that field alignments aren't different between 32- and
   82.16 + * 64-bit architectures. 
   82.17 + */
   82.18 +/* NB. Multi-level macro ensures __LINE__ is expanded before concatenation. */
   82.19 +#define __MEMORY_PADDING(_X) u32 __pad_ ## _X
   82.20 +#define _MEMORY_PADDING(_X)  __MEMORY_PADDING(_X)
   82.21 +#define MEMORY_PADDING       _MEMORY_PADDING(__LINE__)
   82.22 +
   82.23 +/*
   82.24 + * SEGMENT DESCRIPTOR TABLES
   82.25 + */
   82.26 +/*
   82.27 + * A number of GDT entries are reserved by Xen. These are not situated at the
   82.28 + * start of the GDT because some stupid OSes export hard-coded selector values
   82.29 + * in their ABI. These hard-coded values are always near the start of the GDT,
   82.30 + * so Xen places itself out of the way.
   82.31 + * 
   82.32 + * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
   82.33 + * and LAST_RESERVED_GDT_ENTRY are reserved).
   82.34 + */
   82.35 +#define NR_RESERVED_GDT_ENTRIES    40
   82.36 +#define FIRST_RESERVED_GDT_ENTRY   256
   82.37 +#define LAST_RESERVED_GDT_ENTRY    \
   82.38 +  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
   82.39 +
   82.40 +
   82.41 +/*
   82.42 + * These flat segments are in the Xen-private section of every GDT. Since these
   82.43 + * are also present in the initial GDT, many OSes will be able to avoid
   82.44 + * installing their own GDT.
   82.45 + */
   82.46 +#define FLAT_RING1_CS 0x0819    /* GDT index 259 */
   82.47 +#define FLAT_RING1_DS 0x0821    /* GDT index 260 */
   82.48 +#define FLAT_RING3_CS 0x082b    /* GDT index 261 */
   82.49 +#define FLAT_RING3_DS 0x0833    /* GDT index 262 */
   82.50 +
   82.51 +#define FLAT_GUESTOS_CS FLAT_RING1_CS
   82.52 +#define FLAT_GUESTOS_DS FLAT_RING1_DS
   82.53 +#define FLAT_USER_CS    FLAT_RING3_CS
   82.54 +#define FLAT_USER_DS    FLAT_RING3_DS
   82.55 +
   82.56 +/* And the trap vector is... */
   82.57 +#define TRAP_INSTR "int $0x82"
   82.58 +
   82.59 +
   82.60 +/*
   82.61 + * Virtual addresses beyond this are not modifiable by guest OSes. The 
   82.62 + * machine->physical mapping table starts at this address, read-only.
   82.63 + */
   82.64 +#define HYPERVISOR_VIRT_START (0xFC000000UL)
   82.65 +#ifndef machine_to_phys_mapping
   82.66 +#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
   82.67 +#endif
   82.68 +
   82.69 +#ifndef __ASSEMBLY__
   82.70 +
   82.71 +/* NB. Both the following are 32 bits each. */
   82.72 +typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
   82.73 +typedef unsigned long cpureg_t;   /* Full-sized register.                    */
   82.74 +
   82.75 +/*
   82.76 + * Send an array of these to HYPERVISOR_set_trap_table()
   82.77 + */
   82.78 +#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
   82.79 +#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
   82.80 +#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   82.81 +#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   82.82 +typedef struct {
   82.83 +    u8       vector;  /* 0: exception vector                              */
   82.84 +    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
   82.85 +    u16      cs;      /* 2: code selector                                 */
   82.86 +    memory_t address; /* 4: code address                                  */
   82.87 +} PACKED trap_info_t; /* 8 bytes */
   82.88 +
   82.89 +typedef struct
   82.90 +{
   82.91 +    unsigned long ebx;
   82.92 +    unsigned long ecx;
   82.93 +    unsigned long edx;
   82.94 +    unsigned long esi;
   82.95 +    unsigned long edi;
   82.96 +    unsigned long ebp;
   82.97 +    unsigned long eax;
   82.98 +    unsigned long ds;
   82.99 +    unsigned long es;
  82.100 +    unsigned long fs;
  82.101 +    unsigned long gs;
  82.102 +    unsigned long _unused;
  82.103 +    unsigned long eip;
  82.104 +    unsigned long cs;
  82.105 +    unsigned long eflags;
  82.106 +    unsigned long esp;
  82.107 +    unsigned long ss;
  82.108 +} PACKED execution_context_t;
  82.109 +
  82.110 +typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
  82.111 +
  82.112 +/*
  82.113 + * The following is all CPU context. Note that the i387_ctxt block is filled 
  82.114 + * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
  82.115 + */
  82.116 +typedef struct {
  82.117 +#define ECF_I387_VALID (1<<0)
  82.118 +    unsigned long flags;
  82.119 +    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
  82.120 +    char          fpu_ctxt[256];            /* User-level FPU registers     */
  82.121 +    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
  82.122 +    unsigned int  fast_trap_idx;            /* "Fast trap" vector offset    */
  82.123 +    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
  82.124 +    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
  82.125 +    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
  82.126 +    unsigned long pt_base;                  /* CR3 (pagetable base)         */
  82.127 +    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
  82.128 +    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
  82.129 +    unsigned long event_callback_eip;
  82.130 +    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
  82.131 +    unsigned long failsafe_callback_eip;
  82.132 +} PACKED full_execution_context_t;
  82.133 +
  82.134 +typedef struct {
  82.135 +    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
  82.136 +    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
  82.137 +				  make up p2m table */
  82.138 +} PACKED arch_shared_info_t;
  82.139 +
  82.140 +#define ARCH_HAS_FAST_TRAP
  82.141 +
  82.142 +#endif
  82.143 +
  82.144 +#endif
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/xen/include/public/arch-x86_64.h	Sun Oct 31 09:56:36 2004 +0000
    83.3 @@ -0,0 +1,134 @@
    83.4 +/******************************************************************************
    83.5 + * arch-x86_64.h
    83.6 + * 
    83.7 + * Guest OS interface to x86 64-bit Xen.
    83.8 + */
    83.9 +
   83.10 +#ifndef __XEN_PUBLIC_ARCH_X86_64_H__
   83.11 +#define __XEN_PUBLIC_ARCH_X86_64_H__
   83.12 +
   83.13 +/* Pointers are naturally 64 bits in this architecture; no padding needed. */
   83.14 +#define _MEMORY_PADDING(_X)
   83.15 +#define MEMORY_PADDING 
   83.16 +
   83.17 +/*
   83.18 + * SEGMENT DESCRIPTOR TABLES
   83.19 + */
   83.20 +/*
   83.21 + * A number of GDT entries are reserved by Xen. These are not situated at the
   83.22 + * start of the GDT because some stupid OSes export hard-coded selector values
   83.23 + * in their ABI. These hard-coded values are always near the start of the GDT,
   83.24 + * so Xen places itself out of the way.
   83.25 + * 
   83.26 + * NB. The reserved range is inclusive (that is, both FIRST_RESERVED_GDT_ENTRY
   83.27 + * and LAST_RESERVED_GDT_ENTRY are reserved).
   83.28 + */
   83.29 +#define NR_RESERVED_GDT_ENTRIES    40 
   83.30 +#define FIRST_RESERVED_GDT_ENTRY   256
   83.31 +#define LAST_RESERVED_GDT_ENTRY    \
   83.32 +  (FIRST_RESERVED_GDT_ENTRY + NR_RESERVED_GDT_ENTRIES - 1)
   83.33 +
   83.34 +/*
   83.35 + * 64-bit segment selectors
   83.36 + * These flat segments are in the Xen-private section of every GDT. Since these
   83.37 + * are also present in the initial GDT, many OSes will be able to avoid
   83.38 + * installing their own GDT.
   83.39 + */
   83.40 +
   83.41 +#define FLAT_RING3_CS32 0x0823  /* GDT index 260 */
   83.42 +#define FLAT_RING3_CS64 0x082b  /* GDT index 261 */
   83.43 +#define FLAT_RING3_DS   0x0833  /* GDT index 262 */
   83.44 +
   83.45 +#define FLAT_GUESTOS_DS   FLAT_RING3_DS
   83.46 +#define FLAT_GUESTOS_CS   FLAT_RING3_CS64
   83.47 +#define FLAT_GUESTOS_CS32 FLAT_RING3_CS32
   83.48 +
   83.49 +#define FLAT_USER_DS      FLAT_RING3_DS
   83.50 +#define FLAT_USER_CS      FLAT_RING3_CS64
   83.51 +#define FLAT_USER_CS32    FLAT_RING3_CS32
   83.52 +
   83.53 +/* And the trap vector is... */
   83.54 +#define TRAP_INSTR "syscall"
   83.55 +
   83.56 +/* The machine->physical mapping table starts at this address, read-only. */
   83.57 +#ifndef machine_to_phys_mapping
   83.58 +#define machine_to_phys_mapping ((unsigned long *)0xffff810000000000ULL)
   83.59 +#endif
   83.60 +
   83.61 +#ifndef __ASSEMBLY__
   83.62 +
   83.63 +/* NB. Both the following are 64 bits each. */
   83.64 +typedef unsigned long memory_t;   /* Full-sized pointer/address/memory-size. */
   83.65 +typedef unsigned long cpureg_t;   /* Full-sized register.                    */
   83.66 +
   83.67 +/*
   83.68 + * Send an array of these to HYPERVISOR_set_trap_table()
   83.69 + */
   83.70 +#define TI_GET_DPL(_ti)      ((_ti)->flags & 3)
   83.71 +#define TI_GET_IF(_ti)       ((_ti)->flags & 4)
   83.72 +#define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
   83.73 +#define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
   83.74 +typedef struct {
   83.75 +    u8       vector;  /* 0: exception vector                              */
   83.76 +    u8       flags;   /* 1: 0-3: privilege level; 4: clear event enable?  */
   83.77 +    u16      cs;      /* 2: code selector                                 */
   83.78 +    u32      __pad;   /* 4 */
   83.79 +    memory_t address; /* 8: code address                                  */
   83.80 +} PACKED trap_info_t; /* 16 bytes */
   83.81 +
   83.82 +typedef struct
   83.83 +{
   83.84 +    unsigned long r15;
   83.85 +    unsigned long r14;
   83.86 +    unsigned long r13;
   83.87 +    unsigned long r12;
   83.88 +    unsigned long rbp;
   83.89 +    unsigned long rbx;
   83.90 +    unsigned long r11;
   83.91 +    unsigned long r10;
   83.92 +    unsigned long r9;
   83.93 +    unsigned long r8;
   83.94 +    unsigned long rax;
   83.95 +    unsigned long rcx;
   83.96 +    unsigned long rdx;
   83.97 +    unsigned long rsi;
   83.98 +    unsigned long rdi;
   83.99 +    unsigned long rip;
  83.100 +    unsigned long cs;
  83.101 +    unsigned long eflags;
  83.102 +    unsigned long rsp;
  83.103 +    unsigned long ss;
  83.104 +} PACKED execution_context_t;
  83.105 +
  83.106 +typedef u64 tsc_timestamp_t; /* RDTSC timestamp */
  83.107 +
  83.108 +/*
  83.109 + * The following is all CPU context. Note that the i387_ctxt block is filled 
  83.110 + * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
  83.111 + */
  83.112 +typedef struct {
  83.113 +#define ECF_I387_VALID (1<<0)
  83.114 +    unsigned long flags;
  83.115 +    execution_context_t cpu_ctxt;           /* User-level CPU registers     */
  83.116 +    char          fpu_ctxt[512];            /* User-level FPU registers     */
  83.117 +    trap_info_t   trap_ctxt[256];           /* Virtual IDT                  */
  83.118 +    unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
  83.119 +    unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
  83.120 +    unsigned long guestos_ss, guestos_esp;  /* Virtual TSS (only SS1/ESP1)  */
  83.121 +    unsigned long pt_base;                  /* CR3 (pagetable base)         */
  83.122 +    unsigned long debugreg[8];              /* DB0-DB7 (debug registers)    */
  83.123 +    unsigned long event_callback_cs;        /* CS:EIP of event callback     */
  83.124 +    unsigned long event_callback_eip;
  83.125 +    unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
  83.126 +    unsigned long failsafe_callback_eip;
  83.127 +} PACKED full_execution_context_t;
  83.128 +
  83.129 +typedef struct {
  83.130 +    u64 mfn_to_pfn_start;      /* MFN of start of m2p table */
  83.131 +    u64 pfn_to_mfn_frame_list; /* MFN of a table of MFNs that 
  83.132 +				  make up p2m table */
  83.133 +} PACKED arch_shared_info_t;
  83.134 +
  83.135 +#endif /* !__ASSEMBLY__ */
  83.136 +
  83.137 +#endif
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/xen/include/public/dom0_ops.h	Sun Oct 31 09:56:36 2004 +0000
    84.3 @@ -0,0 +1,372 @@
    84.4 +/******************************************************************************
    84.5 + * dom0_ops.h
    84.6 + * 
    84.7 + * Process command requests from domain-0 guest OS.
    84.8 + * 
    84.9 + * Copyright (c) 2002-2003, B Dragovic
   84.10 + * Copyright (c) 2002-2004, K Fraser
   84.11 + */
   84.12 +
   84.13 +
   84.14 +#ifndef __XEN_PUBLIC_DOM0_OPS_H__
   84.15 +#define __XEN_PUBLIC_DOM0_OPS_H__
   84.16 +
   84.17 +#include "xen.h"
   84.18 +#include "sched_ctl.h"
   84.19 +
   84.20 +/*
   84.21 + * Make sure you increment the interface version whenever you modify this file!
   84.22 + * This makes sure that old versions of dom0 tools will stop working in a
   84.23 + * well-defined way (rather than crashing the machine, for instance).
   84.24 + */
   84.25 +#define DOM0_INTERFACE_VERSION   0xAAAA0019
   84.26 +
   84.27 +/************************************************************************/
   84.28 +
   84.29 +#define DOM0_GETMEMLIST        2
   84.30 +typedef struct {
   84.31 +    /* IN variables. */
   84.32 +    domid_t       domain;             /*  0 */
   84.33 +    u16           __pad0;
   84.34 +    u32           __pad1;
   84.35 +    memory_t      max_pfns;           /*  8 */
   84.36 +    MEMORY_PADDING;
   84.37 +    void         *buffer;             /* 16 */
   84.38 +    MEMORY_PADDING;
   84.39 +    /* OUT variables. */
   84.40 +    memory_t      num_pfns;           /* 24 */
   84.41 +    MEMORY_PADDING;
   84.42 +} PACKED dom0_getmemlist_t; /* 32 bytes */
   84.43 +
   84.44 +#define DOM0_SCHEDCTL          6
   84.45 + /* struct sched_ctl_cmd is from sched-ctl.h   */
   84.46 +typedef struct sched_ctl_cmd dom0_schedctl_t;
   84.47 +
   84.48 +#define DOM0_ADJUSTDOM         7
   84.49 +/* struct sched_adjdom_cmd is from sched-ctl.h */
   84.50 +typedef struct sched_adjdom_cmd dom0_adjustdom_t;
   84.51 +
   84.52 +#define DOM0_CREATEDOMAIN      8
   84.53 +typedef struct {
   84.54 +    /* IN parameters. */
   84.55 +    memory_t     memory_kb;           /*  0 */
   84.56 +    MEMORY_PADDING;
   84.57 +    u32          cpu;                 /*  8 */
   84.58 +    u32          __pad0;              /* 12 */
   84.59 +    /* IN/OUT parameters. */
   84.60 +    /* If 0, domain is allocated. If non-zero use it unless in use. */
   84.61 +    domid_t      domain;              /* 16 */
   84.62 +    u16          __pad1;
   84.63 +    /* OUT parameters. */
   84.64 +} PACKED dom0_createdomain_t; /* 20 bytes */
   84.65 +
   84.66 +#define DOM0_DESTROYDOMAIN     9
   84.67 +typedef struct {
   84.68 +    /* IN variables. */
   84.69 +    domid_t      domain;              /*  0 */
   84.70 +    u16          __pad;
   84.71 +} PACKED dom0_destroydomain_t; /* 4 bytes */
   84.72 +
   84.73 +#define DOM0_PAUSEDOMAIN      10
   84.74 +typedef struct {
   84.75 +    /* IN parameters. */
   84.76 +    domid_t domain;                   /*  0 */
   84.77 +    u16     __pad;
   84.78 +} PACKED dom0_pausedomain_t; /* 4 bytes */
   84.79 +
   84.80 +#define DOM0_UNPAUSEDOMAIN    11
   84.81 +typedef struct {
   84.82 +    /* IN parameters. */
   84.83 +    domid_t domain;                   /*  0 */
   84.84 +    u16     __pad;
   84.85 +} PACKED dom0_unpausedomain_t; /* 4 bytes */
   84.86 +
   84.87 +#define DOM0_GETDOMAININFO    12
   84.88 +typedef struct {
   84.89 +    /* IN variables. */
   84.90 +    domid_t  domain;                  /*  0 */ /* NB. IN/OUT variable. */
   84.91 +    u16     __pad;
   84.92 +    /* OUT variables. */
   84.93 +#define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
   84.94 +#define DOMFLAGS_CRASHED   (1<<1) /* Crashed domain; frozen for postmortem.  */
   84.95 +#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut itself down.      */
   84.96 +#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
   84.97 +#define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
   84.98 +#define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
   84.99 +#define DOMFLAGS_CPUMASK      255 /* CPU to which this domain is bound.      */
  84.100 +#define DOMFLAGS_CPUSHIFT       8
  84.101 +#define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
  84.102 +#define DOMFLAGS_SHUTDOWNSHIFT 16
  84.103 +    u32      flags;                   /*  4 */
  84.104 +    full_execution_context_t *ctxt;   /*  8 */ /* NB. IN/OUT variable. */
  84.105 +    MEMORY_PADDING;
  84.106 +    memory_t tot_pages;               /* 16 */
  84.107 +    MEMORY_PADDING;
  84.108 +    memory_t max_pages;               /* 24 */
  84.109 +    MEMORY_PADDING;
  84.110 +    memory_t shared_info_frame;       /* 32: MFN of shared_info struct */
  84.111 +    MEMORY_PADDING;
  84.112 +    u64      cpu_time;                /* 40 */
  84.113 +} PACKED dom0_getdomaininfo_t; /* 48 bytes */
  84.114 +
  84.115 +#define DOM0_BUILDDOMAIN      13
  84.116 +typedef struct {
  84.117 +    /* IN variables. */
  84.118 +    domid_t                 domain;   /*  0 */
  84.119 +    u16                     __pad0;   /*  2 */
  84.120 +    u32                     __pad1;   /*  4 */
  84.121 +    /* IN/OUT parameters */
  84.122 +    full_execution_context_t *ctxt;   /*  8 */
  84.123 +    MEMORY_PADDING;
  84.124 +} PACKED dom0_builddomain_t; /* 16 bytes */
  84.125 +
  84.126 +#define DOM0_IOPL             14
  84.127 +typedef struct {
  84.128 +    domid_t domain;                   /*  0 */
  84.129 +    u16     __pad;
  84.130 +    u32     iopl;                     /*  4 */
  84.131 +} PACKED dom0_iopl_t; /* 8 bytes */
  84.132 +
  84.133 +#define DOM0_MSR              15
  84.134 +typedef struct {
  84.135 +    /* IN variables. */
  84.136 +    u32 write;                        /*  0 */
  84.137 +    u32 cpu_mask;                     /*  4 */
  84.138 +    u32 msr;                          /*  8 */
  84.139 +    u32 in1;                          /* 12 */
  84.140 +    u32 in2;                          /* 16 */
  84.141 +    /* OUT variables. */
  84.142 +    u32 out1;                         /* 20 */
  84.143 +    u32 out2;                         /* 24 */
  84.144 +} PACKED dom0_msr_t; /* 28 bytes */
  84.145 +
  84.146 +#define DOM0_DEBUG            16
  84.147 +typedef struct {
  84.148 +    /* IN variables. */
  84.149 +    domid_t domain;                   /*  0 */
  84.150 +    u8  opcode;                       /*  2 */
  84.151 +    u8  __pad;
  84.152 +    u32 in1;                          /*  4 */
  84.153 +    u32 in2;                          /*  8 */
  84.154 +    u32 in3;                          /* 12 */
  84.155 +    u32 in4;                          /* 16 */
  84.156 +    /* OUT variables. */
  84.157 +    u32 status;                       /* 20 */
  84.158 +    u32 out1;                         /* 24 */
  84.159 +    u32 out2;                         /* 28 */
  84.160 +} PACKED dom0_debug_t; /* 32 bytes */
  84.161 +
  84.162 +/*
  84.163 + * Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
  84.164 + * 1 January, 1970 if the current system time was <system_time>.
  84.165 + */
  84.166 +#define DOM0_SETTIME          17
  84.167 +typedef struct {
  84.168 +    /* IN variables. */
  84.169 +    u32 secs;                         /*  0 */
  84.170 +    u32 usecs;                        /*  4 */
  84.171 +    u64 system_time;                  /*  8 */
  84.172 +} PACKED dom0_settime_t; /* 16 bytes */
  84.173 +
  84.174 +#define DOM0_GETPAGEFRAMEINFO 18
  84.175 +#define NOTAB 0         /* normal page */
  84.176 +#define L1TAB (1<<28)
  84.177 +#define L2TAB (2<<28)
  84.178 +#define L3TAB (3<<28)
  84.179 +#define L4TAB (4<<28)
  84.180 +#define LPINTAB  (1<<31)
  84.181 +#define XTAB  (0xf<<28) /* invalid page */
  84.182 +#define LTAB_MASK XTAB
  84.183 +#define LTABTYPE_MASK (0x7<<28)
  84.184 +
  84.185 +typedef struct {
  84.186 +    /* IN variables. */
  84.187 +    memory_t pfn;          /*  0: Machine page frame number to query.       */
  84.188 +    MEMORY_PADDING;
  84.189 +    domid_t domain;        /*  8: To which domain does the frame belong?    */
  84.190 +    u16     __pad;
  84.191 +    /* OUT variables. */
  84.192 +    /* Is the page PINNED to a type? */
  84.193 +    u32 type;              /* 12: see above type defs */
  84.194 +} PACKED dom0_getpageframeinfo_t; /* 16 bytes */
  84.195 +
  84.196 +/*
  84.197 + * Read console content from Xen buffer ring.
  84.198 + */
  84.199 +#define DOM0_READCONSOLE      19
  84.200 +typedef struct {
  84.201 +    memory_t str;                     /*  0 */
  84.202 +    MEMORY_PADDING;
  84.203 +    u32      count;                   /*  8 */
  84.204 +    u32      cmd;                     /* 12 */
  84.205 +} PACKED dom0_readconsole_t; /* 16 bytes */
  84.206 +
  84.207 +/* 
  84.208 + * Pin Domain to a particular CPU  (use -1 to unpin)
  84.209 + */
  84.210 +#define DOM0_PINCPUDOMAIN     20
  84.211 +typedef struct {
  84.212 +    /* IN variables. */
  84.213 +    domid_t      domain;              /*  0 */
  84.214 +    u16          __pad;
  84.215 +    s32          cpu;                 /*  4: -1 implies unpin */
  84.216 +} PACKED dom0_pincpudomain_t; /* 8 bytes */
  84.217 +
  84.218 +/* Get trace buffers machine base address */
  84.219 +#define DOM0_GETTBUFS         21
  84.220 +typedef struct {
  84.221 +    /* OUT variables */
  84.222 +    memory_t mach_addr;   /*  0: location of the trace buffers       */
  84.223 +    MEMORY_PADDING;
  84.224 +    u32      size;        /*  8: size of each trace buffer, in bytes */
  84.225 +} PACKED dom0_gettbufs_t; /* 12 bytes */
  84.226 +
  84.227 +/*
  84.228 + * Get physical information about the host machine
  84.229 + */
  84.230 +#define DOM0_PHYSINFO         22
  84.231 +typedef struct {
  84.232 +    u32      ht_per_core;             /*  0 */
  84.233 +    u32      cores;                   /*  4 */
  84.234 +    u32      cpu_khz;                 /*  8 */
  84.235 +    u32      __pad;                   /* 12 */
  84.236 +    memory_t total_pages;             /* 16 */
  84.237 +    MEMORY_PADDING;
  84.238 +    memory_t free_pages;              /* 24 */
  84.239 +    MEMORY_PADDING;
  84.240 +} PACKED dom0_physinfo_t; /* 32 bytes */
  84.241 +
  84.242 +/* 
  84.243 + * Allow a domain access to a physical PCI device
  84.244 + */
  84.245 +#define DOM0_PCIDEV_ACCESS    23
  84.246 +typedef struct {
  84.247 +    /* IN variables. */
  84.248 +    domid_t      domain;              /*  0 */
  84.249 +    u16          __pad;
  84.250 +    u32          bus;                 /*  4 */
  84.251 +    u32          dev;                 /*  8 */
  84.252 +    u32          func;                /* 12 */
  84.253 +    u32          enable;              /* 16 */
  84.254 +} PACKED dom0_pcidev_access_t; /* 20 bytes */
  84.255 +
  84.256 +/*
  84.257 + * Get the ID of the current scheduler.
  84.258 + */
  84.259 +#define DOM0_SCHED_ID        24
  84.260 +typedef struct {
  84.261 +    /* OUT variable */
  84.262 +    u32 sched_id;                     /*  0 */
  84.263 +} PACKED dom0_sched_id_t; /* 4 bytes */
  84.264 +
  84.265 +/* 
  84.266 + * Control shadow pagetables operation
  84.267 + */
  84.268 +#define DOM0_SHADOW_CONTROL  25
  84.269 +
  84.270 +#define DOM0_SHADOW_CONTROL_OP_OFF         0
  84.271 +#define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1
  84.272 +#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2
  84.273 +#define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3
  84.274 +#define DOM0_SHADOW_CONTROL_OP_FLUSH       10     /* table ops */
  84.275 +#define DOM0_SHADOW_CONTROL_OP_CLEAN       11
  84.276 +#define DOM0_SHADOW_CONTROL_OP_PEEK        12
  84.277 +
  84.278 +typedef struct dom0_shadow_control
  84.279 +{
  84.280 +    u32 fault_count;
  84.281 +    u32 dirty_count;
  84.282 +    u32 dirty_net_count;     
  84.283 +    u32 dirty_block_count;     
  84.284 +} dom0_shadow_control_stats_t;
  84.285 +
  84.286 +typedef struct {
  84.287 +    /* IN variables. */
  84.288 +    domid_t        domain;            /*  0 */
  84.289 +    u16            __pad;
  84.290 +    u32            op;                /*  4 */
  84.291 +    unsigned long *dirty_bitmap;      /*  8: pointer to locked buffer */
  84.292 +    MEMORY_PADDING;
  84.293 +    /* IN/OUT variables. */
  84.294 +    memory_t       pages;  /* 16: size of buffer, updated with actual size */
  84.295 +    MEMORY_PADDING;
  84.296 +    /* OUT variables. */
  84.297 +    dom0_shadow_control_stats_t stats;
  84.298 +} PACKED dom0_shadow_control_t;
  84.299 +
  84.300 +#define DOM0_SETDOMAININITIALMEM   27
  84.301 +typedef struct {
  84.302 +    /* IN variables. */
  84.303 +    domid_t     domain;               /*  0 */
  84.304 +    u16         __pad0;
  84.305 +    u32         __pad1;
  84.306 +    memory_t    initial_memkb;        /*  8 */
  84.307 +    MEMORY_PADDING;
  84.308 +} PACKED dom0_setdomaininitialmem_t; /* 16 bytes */
  84.309 +
  84.310 +#define DOM0_SETDOMAINMAXMEM   28
  84.311 +typedef struct {
  84.312 +    /* IN variables. */
  84.313 +    domid_t     domain;               /*  0 */
  84.314 +    u16         __pad0;
  84.315 +    u32         __pad1;
  84.316 +    memory_t    max_memkb;            /*  8 */
  84.317 +    MEMORY_PADDING;
  84.318 +} PACKED dom0_setdomainmaxmem_t; /* 16 bytes */
  84.319 +
  84.320 +#define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
  84.321 +typedef struct {
  84.322 +    /* IN variables. */
  84.323 +    domid_t  domain;                  /*  0 */
  84.324 +    u16      __pad0;
  84.325 +    u32      __pad1;
  84.326 +    memory_t num;                     /*  8 */
  84.327 +    MEMORY_PADDING;
  84.328 +    /* IN/OUT variables. */
  84.329 +    unsigned long *array;             /* 16 */
  84.330 +    MEMORY_PADDING;
  84.331 +} PACKED dom0_getpageframeinfo2_t; /* 24 bytes */
  84.332 +
  84.333 +#define DOM0_SETDOMAINVMASSIST   30
  84.334 +typedef struct {
  84.335 +    /* IN variables. */
  84.336 +    domid_t      domain;              /*  0 */
  84.337 +    u16          __pad0;
  84.338 +    u32          cmd;                 /*  4: vm_assist cmd */
  84.339 +    u32          type;                /*  8: vm_assist cmd */
  84.340 +} PACKED dom0_setdomainvmassist_t; /* 12 bytes */
  84.341 +
  84.342 +typedef struct {
  84.343 +    u32 cmd;                          /* 0 */
  84.344 +    u32 interface_version;            /* 4 */ /* DOM0_INTERFACE_VERSION */
  84.345 +    union {                           /* 8 */
  84.346 +	u32                      dummy[18]; /* 72 bytes */
  84.347 +        dom0_createdomain_t      createdomain;
  84.348 +        dom0_pausedomain_t       pausedomain;
  84.349 +        dom0_unpausedomain_t     unpausedomain;
  84.350 +        dom0_destroydomain_t     destroydomain;
  84.351 +        dom0_getmemlist_t        getmemlist;
  84.352 +        dom0_schedctl_t          schedctl;
  84.353 +        dom0_adjustdom_t         adjustdom;
  84.354 +        dom0_builddomain_t       builddomain;
  84.355 +        dom0_getdomaininfo_t     getdomaininfo;
  84.356 +        dom0_getpageframeinfo_t  getpageframeinfo;
  84.357 +        dom0_iopl_t              iopl;
  84.358 +	dom0_msr_t               msr;
  84.359 +	dom0_debug_t             debug;
  84.360 +	dom0_settime_t           settime;
  84.361 +	dom0_readconsole_t	 readconsole;
  84.362 +	dom0_pincpudomain_t      pincpudomain;
  84.363 +        dom0_gettbufs_t          gettbufs;
  84.364 +        dom0_physinfo_t          physinfo;
  84.365 +        dom0_pcidev_access_t     pcidev_access;
  84.366 +        dom0_sched_id_t          sched_id;
  84.367 +	dom0_shadow_control_t    shadow_control;
  84.368 +	dom0_setdomaininitialmem_t setdomaininitialmem;
  84.369 +	dom0_setdomainmaxmem_t   setdomainmaxmem;
  84.370 +	dom0_getpageframeinfo2_t getpageframeinfo2;
  84.371 +	dom0_setdomainvmassist_t setdomainvmassist;
  84.372 +    } PACKED u;
  84.373 +} PACKED dom0_op_t; /* 80 bytes */
  84.374 +
  84.375 +#endif /* __XEN_PUBLIC_DOM0_OPS_H__ */
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/xen/include/public/event_channel.h	Sun Oct 31 09:56:36 2004 +0000
    85.3 @@ -0,0 +1,161 @@
    85.4 +/******************************************************************************
    85.5 + * event_channel.h
    85.6 + * 
    85.7 + * Event channels between domains.
    85.8 + * 
    85.9 + * Copyright (c) 2003-2004, K A Fraser.
   85.10 + */
   85.11 +
   85.12 +#ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
   85.13 +#define __XEN_PUBLIC_EVENT_CHANNEL_H__
   85.14 +
   85.15 +/*
   85.16 + * EVTCHNOP_alloc_unbound: Allocate a fresh local port and prepare
   85.17 + * it for binding to <dom>.
   85.18 + */
   85.19 +#define EVTCHNOP_alloc_unbound    6
   85.20 +typedef struct {
   85.21 +    /* IN parameters */
   85.22 +    domid_t dom;                      /*  0 */
   85.23 +    u16     __pad;
   85.24 +    /* OUT parameters */
   85.25 +    u32     port;                     /*  4 */
   85.26 +} PACKED evtchn_alloc_unbound_t; /* 8 bytes */
   85.27 +
   85.28 +/*
   85.29 + * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
   85.30 + * <dom1> and <dom2>. Either <port1> or <port2> may be wildcarded by setting to
   85.31 + * zero. On successful return both <port1> and <port2> are filled in and
   85.32 + * <dom1,port1> is fully bound to <dom2,port2>.
   85.33 + * 
   85.34 + * NOTES:
   85.35 + *  1. A wildcarded port is allocated from the relevant domain's free list
   85.36 + *     (i.e., some port that was previously EVTCHNSTAT_closed). However, if the
   85.37 + *     remote port pair is already fully bound then a port is not allocated,
   85.38 + *     and instead the existing local port is returned to the caller.
   85.39 + *  2. If the caller is unprivileged then <dom1> must be DOMID_SELF.
   85.40 + *  3. If the caller is unprivileged and <dom2,port2> is EVTCHNSTAT_closed
   85.41 + *     then <dom2> must be DOMID_SELF.
   85.42 + *  4. If either port is already bound then it must be bound to the other
   85.43 + *     specified domain and port (if not wildcarded).
   85.44 + *  5. If either port is awaiting binding (EVTCHNSTAT_unbound) then it must
   85.45 + *     be awaiting binding to the other domain, and the other port pair must
   85.46 + *     be closed or unbound.
   85.47 + */
   85.48 +#define EVTCHNOP_bind_interdomain 0
   85.49 +typedef struct {
   85.50 +    /* IN parameters. */
   85.51 +    domid_t dom1, dom2;               /*  0,  2 */
   85.52 +    /* IN/OUT parameters. */
   85.53 +    u32     port1, port2;             /*  4,  8 */
   85.54 +} PACKED evtchn_bind_interdomain_t; /* 12 bytes */
   85.55 +
   85.56 +/*
   85.57 + * EVTCHNOP_bind_virq: Bind a local event channel to IRQ <irq>.
   85.58 + * NOTES:
   85.59 + *  1. A virtual IRQ may be bound to at most one event channel per domain.
   85.60 + */
   85.61 +#define EVTCHNOP_bind_virq        1
   85.62 +typedef struct {
   85.63 +    /* IN parameters. */
   85.64 +    u32 virq;                         /*  0 */
   85.65 +    /* OUT parameters. */
   85.66 +    u32 port;                         /*  4 */
   85.67 +} PACKED evtchn_bind_virq_t; /* 8 bytes */
   85.68 +
   85.69 +/*
   85.70 + * EVTCHNOP_bind_pirq: Bind a local event channel to IRQ <irq>.
   85.71 + * NOTES:
   85.72 + *  1. A physical IRQ may be bound to at most one event channel per domain.
   85.73 + *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
   85.74 + */
   85.75 +#define EVTCHNOP_bind_pirq        2
   85.76 +typedef struct {
   85.77 +    /* IN parameters. */
   85.78 +    u32 pirq;                         /*  0 */
   85.79 +#define BIND_PIRQ__WILL_SHARE 1
   85.80 +    u32 flags; /* BIND_PIRQ__* */     /*  4 */
   85.81 +    /* OUT parameters. */
   85.82 +    u32 port;                         /*  8 */
   85.83 +} PACKED evtchn_bind_pirq_t; /* 12 bytes */
   85.84 +
   85.85 +/*
   85.86 + * EVTCHNOP_close: Close the communication channel which has an endpoint at
   85.87 + * <dom, port>. If the channel is interdomain then the remote end is placed in
   85.88 + * the unbound state (EVTCHNSTAT_unbound), awaiting a new connection.
   85.89 + * NOTES:
   85.90 + *  1. <dom> may be specified as DOMID_SELF.
   85.91 + *  2. Only a sufficiently-privileged domain may close an event channel
   85.92 + *     for which <dom> is not DOMID_SELF.
   85.93 + */
   85.94 +#define EVTCHNOP_close            3
   85.95 +typedef struct {
   85.96 +    /* IN parameters. */
   85.97 +    domid_t dom;                      /*  0 */
   85.98 +    u16     __pad;
   85.99 +    u32     port;                     /*  4 */
  85.100 +    /* No OUT parameters. */
  85.101 +} PACKED evtchn_close_t; /* 8 bytes */
  85.102 +
  85.103 +/*
  85.104 + * EVTCHNOP_send: Send an event to the remote end of the channel whose local
  85.105 + * endpoint is <DOMID_SELF, local_port>.
  85.106 + */
  85.107 +#define EVTCHNOP_send             4
  85.108 +typedef struct {
  85.109 +    /* IN parameters. */
  85.110 +    u32     local_port;               /*  0 */
  85.111 +    /* No OUT parameters. */
  85.112 +} PACKED evtchn_send_t; /* 4 bytes */
  85.113 +
  85.114 +/*
  85.115 + * EVTCHNOP_status: Get the current status of the communication channel which
  85.116 + * has an endpoint at <dom, port>.
  85.117 + * NOTES:
  85.118 + *  1. <dom> may be specified as DOMID_SELF.
  85.119 + *  2. Only a sufficiently-privileged domain may obtain the status of an event
  85.120 + *     channel for which <dom> is not DOMID_SELF.
  85.121 + */
  85.122 +#define EVTCHNOP_status           5
  85.123 +typedef struct {
  85.124 +    /* IN parameters */
  85.125 +    domid_t dom;                      /*  0 */
  85.126 +    u16     __pad;
  85.127 +    u32     port;                     /*  4 */
  85.128 +    /* OUT parameters */
  85.129 +#define EVTCHNSTAT_closed       0  /* Channel is not in use.                 */
  85.130 +#define EVTCHNSTAT_unbound      1  /* Channel is waiting interdom connection.*/
  85.131 +#define EVTCHNSTAT_interdomain  2  /* Channel is connected to remote domain. */
  85.132 +#define EVTCHNSTAT_pirq         3  /* Channel is bound to a phys IRQ line.   */
  85.133 +#define EVTCHNSTAT_virq         4  /* Channel is bound to a virtual IRQ line */
  85.134 +    u32     status;                   /*  8 */
  85.135 +    union {                           /* 12 */
  85.136 +        struct {
  85.137 +            domid_t dom;                              /* 12 */
  85.138 +        } PACKED unbound; /* EVTCHNSTAT_unbound */
  85.139 +        struct {
  85.140 +            domid_t dom;                              /* 12 */
  85.141 +            u16     __pad;
  85.142 +            u32     port;                             /* 16 */
  85.143 +        } PACKED interdomain; /* EVTCHNSTAT_interdomain */
  85.144 +        u32 pirq;      /* EVTCHNSTAT_pirq        */   /* 12 */
  85.145 +        u32 virq;      /* EVTCHNSTAT_virq        */   /* 12 */
  85.146 +    } PACKED u;
  85.147 +} PACKED evtchn_status_t; /* 20 bytes */
  85.148 +
  85.149 +typedef struct {
  85.150 +    u32 cmd; /* EVTCHNOP_* */         /*  0 */
  85.151 +    u32 __reserved;                   /*  4 */
  85.152 +    union {                           /*  8 */
  85.153 +        evtchn_alloc_unbound_t    alloc_unbound;
  85.154 +        evtchn_bind_interdomain_t bind_interdomain;
  85.155 +        evtchn_bind_virq_t        bind_virq;
  85.156 +        evtchn_bind_pirq_t        bind_pirq;
  85.157 +        evtchn_close_t            close;
  85.158 +        evtchn_send_t             send;
  85.159 +        evtchn_status_t           status;
  85.160 +        u8                        __dummy[24];
  85.161 +    } PACKED u;
  85.162 +} PACKED evtchn_op_t; /* 32 bytes */
  85.163 +
  85.164 +#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/xen/include/public/grant_table.h	Sun Oct 31 09:56:36 2004 +0000
    86.3 @@ -0,0 +1,251 @@
    86.4 +/******************************************************************************
    86.5 + * grant_table.h
    86.6 + * 
    86.7 + * Interface for granting foreign access to page frames, and receiving
    86.8 + * page-ownership transfers.
    86.9 + * 
   86.10 + * Copyright (c) 2004, K A Fraser
   86.11 + */
   86.12 +
   86.13 +#ifndef __XEN_PUBLIC_GRANT_TABLE_H__
   86.14 +#define __XEN_PUBLIC_GRANT_TABLE_H__
   86.15 +
   86.16 +
   86.17 +/***********************************
   86.18 + * GRANT TABLE REPRESENTATION
   86.19 + */
   86.20 +
   86.21 +/* Some rough guidelines on accessing and updating grant-table entries
   86.22 + * in a concurrency-safe manner. For more information, Linux contains a
   86.23 + * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
   86.24 + * 
   86.25 + * NB. WMB is a no-op on current-generation x86 processors. However, a
   86.26 + *     compiler barrier will still be required.
   86.27 + * 
   86.28 + * Introducing a valid entry into the grant table:
   86.29 + *  1. Write ent->domid.
   86.30 + *  2. Write ent->frame:
   86.31 + *      GTF_permit_access:   Frame to which access is permitted.
   86.32 + *      GTF_accept_transfer: Pseudo-phys frame slot being filled by new
   86.33 + *                           frame, or zero if none.
   86.34 + *  3. Write memory barrier (WMB).
   86.35 + *  4. Write ent->flags, inc. valid type.
   86.36 + * 
   86.37 + * Invalidating an unused GTF_permit_access entry:
   86.38 + *  1. flags = ent->flags.
   86.39 + *  2. Observe that !(flags & (GTF_reading|GTF_writing)).
   86.40 + *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
   86.41 + *  NB. No need for WMB as reuse of entry is control-dependent on success of
   86.42 + *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
   86.43 + *
   86.44 + * Invalidating an in-use GTF_permit_access entry:
   86.45 + *  This cannot be done directly. Request assistance from the domain controller
   86.46 + *  which can set a timeout on the use of a grant entry and take necessary
   86.47 + *  action. (NB. This is not yet implemented!).
   86.48 + * 
   86.49 + * Invalidating an unused GTF_accept_transfer entry:
   86.50 + *  1. flags = ent->flags.
   86.51 + *  2. Observe that !(flags & GTF_transfer_committed). [*]
   86.52 + *  3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
   86.53 + *  NB. No need for WMB as reuse of entry is control-dependent on success of
   86.54 + *      step 3, and all architectures guarantee ordering of ctrl-dep writes.
   86.55 + *  [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
   86.56 + *      The guest must /not/ modify the grant entry until the address of the
   86.57 + *      transferred frame is written. It is safe for the guest to spin waiting
   86.58 + *      for this to occur (detect by observing GTF_transfer_completed in
   86.59 + *      ent->flags).
   86.60 + *
   86.61 + * Invalidating a committed GTF_accept_transfer entry:
   86.62 + *  1. Wait for (ent->flags & GTF_transfer_completed).
   86.63 + *
   86.64 + * Changing a GTF_permit_access from writable to read-only:
   86.65 + *  Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
   86.66 + * 
   86.67 + * Changing a GTF_permit_access from read-only to writable:
   86.68 + *  Use SMP-safe bit-setting instruction.
   86.69 + */
   86.70 +
   86.71 +/*
   86.72 + * A grant table comprises a packed array of grant entries in one or more
   86.73 + * page frames shared between Xen and a guest.
   86.74 + * [XEN]: This field is written by Xen and read by the sharing guest.
   86.75 + * [GST]: This field is written by the guest and read by Xen.
   86.76 + */
   86.77 +typedef struct {
   86.78 +    /* GTF_xxx: various type and flag information.  [XEN,GST] */
   86.79 +    u16     flags;      /* 0 */
   86.80 +    /* The domain being granted foreign privileges. [GST] */
   86.81 +    domid_t domid;      /* 2 */
   86.82 +    /*
   86.83 +     * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
   86.84 +     * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
   86.85 +     */
   86.86 +    u32     frame;      /* 4 */
   86.87 +} PACKED grant_entry_t; /* 8 bytes */
   86.88 +
   86.89 +/*
   86.90 + * Type of grant entry.
   86.91 + *  GTF_invalid: This grant entry grants no privileges.
   86.92 + *  GTF_permit_access: Allow @domid to map/access @frame.
   86.93 + *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
   86.94 + *                       to this guest. Xen writes the page number to @frame.
   86.95 + */
   86.96 +#define GTF_invalid         (0U<<0)
   86.97 +#define GTF_permit_access   (1U<<0)
   86.98 +#define GTF_accept_transfer (2U<<0)
   86.99 +#define GTF_type_mask       (3U<<0)
  86.100 +
  86.101 +/*
  86.102 + * Subflags for GTF_permit_access.
  86.103 + *  GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
  86.104 + *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  86.105 + *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
  86.106 + */
  86.107 +#define _GTF_readonly       (2)
  86.108 +#define GTF_readonly        (1U<<_GTF_readonly)
  86.109 +#define _GTF_reading        (3)
  86.110 +#define GTF_reading         (1U<<_GTF_reading)
  86.111 +#define _GTF_writing        (4)
  86.112 +#define GTF_writing         (1U<<_GTF_writing)
  86.113 +
  86.114 +/*
  86.115 + * Subflags for GTF_accept_transfer:
  86.116 + *  GTF_transfer_committed: Xen sets this flag to indicate that it is committed
  86.117 + *      to transferring ownership of a page frame. When a guest sees this flag
  86.118 + *      it must /not/ modify the grant entry until GTF_transfer_completed is
  86.119 + *      set by Xen.
  86.120 + *  GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
  86.121 + *      after reading GTF_transfer_committed. Xen will always write the frame
  86.122 + *      address, followed by ORing this flag, in a timely manner.
  86.123 + */
  86.124 +#define _GTF_transfer_committed (2)
  86.125 +#define GTF_transfer_committed  (1U<<_GTF_transfer_committed)
  86.126 +#define _GTF_transfer_completed (3)
  86.127 +#define GTF_transfer_completed  (1U<<_GTF_transfer_completed)
  86.128 +
  86.129 +
  86.130 +/***********************************
  86.131 + * GRANT TABLE QUERIES AND USES
  86.132 + */
  86.133 +
  86.134 +/*
  86.135 + * Reference to a grant entry in a specified domain's grant table.
  86.136 + */
  86.137 +typedef u16 grant_ref_t;
  86.138 +
  86.139 +/*
  86.140 + * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
  86.141 + * by devices and/or host CPUs. If successful, <handle> is a tracking number
  86.142 + * that must be presented later to destroy the mapping(s). On error, <handle>
  86.143 + * is a negative status code.
  86.144 + * NOTES:
  86.145 + *  1. If GNTPIN_map_for_dev is specified then <dev_bus_addr> is the address
  86.146 + *     via which I/O devices may access the granted frame.
  86.147 + *  2. If GNTPIN_map_for_host is specified then a mapping will be added at
  86.148 + *     virtual address <host_virt_addr> in the current address space.
  86.149 + *  3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
  86.150 + *     host mapping is destroyed by other means then it is *NOT* guaranteed
  86.151 + *     to be accounted to the correct grant reference!
  86.152 + */
  86.153 +#define GNTTABOP_map_grant_ref        0
  86.154 +typedef struct {
  86.155 +    /* IN parameters. */
  86.156 +    memory_t    host_virt_addr;       /*  0 */
  86.157 +    MEMORY_PADDING;
  86.158 +    domid_t     dom;                  /*  8 */
  86.159 +    grant_ref_t ref;                  /* 10 */
  86.160 +    u16         flags;                /* 12: GNTMAP_* */
  86.161 +    /* OUT parameters. */
  86.162 +    s16         handle;               /* 14: +ve: handle; -ve: GNTST_* */
  86.163 +    memory_t    dev_bus_addr;         /* 16 */
  86.164 +    MEMORY_PADDING;
  86.165 +} PACKED gnttab_map_grant_ref_t; /* 24 bytes */
  86.166 +
  86.167 +/*
  86.168 + * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
  86.169 + * tracked by <handle>. If <host_virt_addr> or <dev_bus_addr> is zero, that
  86.170 + * field is ignored. If non-zero, they must refer to a device/host mapping
  86.171 + * that is tracked by <handle>
  86.172 + * NOTES:
  86.173 + *  1. The call may fail in an undefined manner if either mapping is not
  86.174 + *     tracked by <handle>.
  86.175 + *  3. After executing a batch of unmaps, it is guaranteed that no stale
  86.176 + *     mappings will remain in the device or host TLBs.
  86.177 + */
  86.178 +#define GNTTABOP_unmap_grant_ref      1
  86.179 +typedef struct {
  86.180 +    /* IN parameters. */
  86.181 +    memory_t    host_virt_addr;       /*  0 */
  86.182 +    MEMORY_PADDING;
  86.183 +    memory_t    dev_bus_addr;         /*  8 */
  86.184 +    MEMORY_PADDING;
  86.185 +    u16         handle;               /* 16 */
  86.186 +    /* OUT parameters. */
  86.187 +    s16         status;               /* 18: GNTST_* */
  86.188 +    u32         __pad;
  86.189 +} PACKED gnttab_unmap_grant_ref_t; /* 24 bytes */
  86.190 +
  86.191 +/*
  86.192 + * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
  86.193 + * <nr_frames> pages. The frame addresses are written to the <frame_list>.
  86.194 + * Only <nr_frames> addresses are written, even if the table is larger.
  86.195 + * NOTES:
  86.196 + *  1. <dom> may be specified as DOMID_SELF.
  86.197 + *  2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
  86.198 + *  3. Xen may not support more than a single grant-table page per domain.
  86.199 + */
  86.200 +#define GNTTABOP_setup_table          2
  86.201 +typedef struct {
  86.202 +    /* IN parameters. */
  86.203 +    domid_t     dom;                  /*  0 */
  86.204 +    u16         nr_frames;            /*  2 */
  86.205 +    u16         __pad;
  86.206 +    /* OUT parameters. */
  86.207 +    s16         status;               /*  6: GNTST_* */
  86.208 +    unsigned long *frame_list;        /*  8 */
  86.209 +    MEMORY_PADDING;
  86.210 +} PACKED gnttab_setup_table_t; /* 16 bytes */
  86.211 +
  86.212 +/*
  86.213 + * Bitfield values for update_pin_status.flags.
  86.214 + */
  86.215 + /* Map the grant entry for access by I/O devices. */
  86.216 +#define _GNTMAP_device_map      (0)
  86.217 +#define GNTMAP_device_map       (1<<_GNTMAP_device_map)
  86.218 + /* Map the grant entry for access by host CPUs. */
  86.219 +#define _GNTMAP_host_map        (1)
  86.220 +#define GNTMAP_host_map         (1<<_GNTMAP_host_map)
  86.221 + /* Accesses to the granted frame will be restricted to read-only access. */
  86.222 +#define _GNTMAP_readonly        (2)
  86.223 +#define GNTMAP_readonly         (1<<_GNTMAP_readonly)
  86.224 + /*
  86.225 +  * GNTMAP_host_map subflag:
  86.226 +  *  0 => The host mapping is usable only by the guest OS.
  86.227 +  *  1 => The host mapping is usable by guest OS + current application.
  86.228 +  */
  86.229 +#define _GNTMAP_application_map (3)
  86.230 +#define GNTMAP_application_map  (1<<_GNTMAP_application_map)
  86.231 +
  86.232 +/*
  86.233 + * Values for error status returns. All errors are -ve.
  86.234 + */
  86.235 +#define GNTST_okay             (0)
  86.236 +#define GNTST_general_error    (-1) /* General undefined error.              */
  86.237 +#define GNTST_bad_domain       (-2) /* Unrecognsed domain id.                */
  86.238 +#define GNTST_bad_gntref       (-3) /* Unrecognised or inappropriate gntref. */
  86.239 +#define GNTST_bad_handle       (-3) /* Unrecognised or inappropriate handle. */
  86.240 +#define GNTST_no_device_space  (-4) /* Out of space in I/O MMU.              */
  86.241 +#define GNTST_permission_denied (-5) /* Not enough privilege for operation.  */
  86.242 +
  86.243 +#define GNTTABOP_error_msgs {                   \
  86.244 +    "okay",                                     \
  86.245 +    "undefined error",                          \
  86.246 +    "unrecognised domain id",                   \
  86.247 +    "invalid grant reference",                  \
  86.248 +    "invalid mapping handle",                   \
  86.249 +    "no spare translation slot in the I/O MMU", \
  86.250 +    "permission denied"                         \
  86.251 +}
  86.252 +        
  86.253 +
  86.254 +#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/xen/include/public/io/blkif.h	Sun Oct 31 09:56:36 2004 +0000
    87.3 @@ -0,0 +1,115 @@
    87.4 +/******************************************************************************
    87.5 + * blkif.h
    87.6 + * 
    87.7 + * Unified block-device I/O interface for Xen guest OSes.
    87.8 + * 
    87.9 + * Copyright (c) 2003-2004, Keir Fraser
   87.10 + */
   87.11 +
   87.12 +#ifndef __XEN_PUBLIC_IO_BLKIF_H__
   87.13 +#define __XEN_PUBLIC_IO_BLKIF_H__
   87.14 +
   87.15 +#define blkif_vdev_t   u16
   87.16 +#define blkif_sector_t u64
   87.17 +
   87.18 +#define BLKIF_OP_READ      0
   87.19 +#define BLKIF_OP_WRITE     1
   87.20 +#define BLKIF_OP_PROBE     2
   87.21 +
   87.22 +/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
   87.23 +#define BLKIF_RING_SIZE        64
   87.24 +
   87.25 +/*
   87.26 + * Maximum scatter/gather segments per request.
   87.27 + * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
   87.28 + * NB. This could be 12 if the ring indexes weren't stored in the same page.
   87.29 + */
   87.30 +#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
   87.31 +
   87.32 +typedef struct {
   87.33 +    u8             operation;    /*  0: BLKIF_OP_???                         */
   87.34 +    u8             nr_segments;  /*  1: number of segments                   */
   87.35 +    blkif_vdev_t   device;       /*  2: only for read/write requests         */
   87.36 +    unsigned long  id;           /*  4: private guest value, echoed in resp  */
   87.37 +    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
   87.38 +    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
   87.39 +    /* @first_sect: first sector in frame to transfer (inclusive).           */
   87.40 +    /* @last_sect: last sector in frame to transfer (inclusive).             */
   87.41 +    /* @frame: machine page frame number.                                    */
   87.42 +    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   87.43 +} PACKED blkif_request_t;
   87.44 +
   87.45 +#define blkif_first_sect(_fas) (((_fas)>>3)&7)
   87.46 +#define blkif_last_sect(_fas)  ((_fas)&7)
   87.47 +
   87.48 +typedef struct {
   87.49 +    unsigned long   id;              /* copied from request */
   87.50 +    u8              operation;       /* copied from request */
   87.51 +    s16             status;          /* BLKIF_RSP_???       */
   87.52 +} PACKED blkif_response_t;
   87.53 +
   87.54 +#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
   87.55 +#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
   87.56 +
   87.57 +/*
   87.58 + * We use a special capitalised type name because it is _essential_ that all 
   87.59 + * arithmetic on indexes is done on an integer type of the correct size.
   87.60 + */
   87.61 +typedef u32 BLKIF_RING_IDX;
   87.62 +
   87.63 +/*
   87.64 + * Ring indexes are 'free running'. That is, they are not stored modulo the
   87.65 + * size of the ring buffer. The following macro converts a free-running counter
   87.66 + * into a value that can directly index a ring-buffer array.
   87.67 + */
   87.68 +#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
   87.69 +
   87.70 +typedef struct {
   87.71 +    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
   87.72 +    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
   87.73 +    union {                   /*  8 */
   87.74 +        blkif_request_t  req;
   87.75 +        blkif_response_t resp;
   87.76 +    } PACKED ring[BLKIF_RING_SIZE];
   87.77 +} PACKED blkif_ring_t;
   87.78 +
   87.79 +
   87.80 +/*
   87.81 + * BLKIF_OP_PROBE:
   87.82 + * The request format for a probe request is constrained as follows:
   87.83 + *  @operation   == BLKIF_OP_PROBE
   87.84 + *  @nr_segments == size of probe buffer in pages
   87.85 + *  @device      == unused (zero)
   87.86 + *  @id          == any value (echoed in response message)
   87.87 + *  @sector_num  == unused (zero)
   87.88 + *  @frame_and_sects == list of page-sized buffers.
   87.89 + *                       (i.e., @first_sect == 0, @last_sect == 7).
   87.90 + * 
   87.91 + * The response is a list of vdisk_t elements copied into the out-of-band
   87.92 + * probe buffer. On success the response status field contains the number
   87.93 + * of vdisk_t elements.
   87.94 + */
   87.95 +
   87.96 +/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
   87.97 +#define VDISK_TYPE_FLOPPY  0x00
   87.98 +#define VDISK_TYPE_TAPE    0x01
   87.99 +#define VDISK_TYPE_CDROM   0x05
  87.100 +#define VDISK_TYPE_OPTICAL 0x07
  87.101 +#define VDISK_TYPE_DISK    0x20 
  87.102 +
  87.103 +#define VDISK_TYPE_MASK    0x3F
  87.104 +#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
  87.105 +
  87.106 +/* The top two bits of the type field encode various flags. */
  87.107 +#define VDISK_FLAG_RO      0x40
  87.108 +#define VDISK_FLAG_VIRT    0x80
  87.109 +#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
  87.110 +#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
  87.111 +
  87.112 +typedef struct {
  87.113 +    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
  87.114 +    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
  87.115 +    u16            info;         /* 10: Device type and flags (VDISK_*).     */
  87.116 +} PACKED vdisk_t; /* 12 bytes */
  87.117 +
  87.118 +#endif /* __XEN_PUBLIC_IO_BLKIF_H__ */
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/xen/include/public/io/domain_controller.h	Sun Oct 31 09:56:36 2004 +0000
    88.3 @@ -0,0 +1,578 @@
    88.4 +/******************************************************************************
    88.5 + * domain_controller.h
    88.6 + * 
    88.7 + * Interface to server controller (e.g., 'xend'). This header file defines the 
    88.8 + * interface that is shared with guest OSes.
    88.9 + * 
   88.10 + * Copyright (c) 2004, K A Fraser
   88.11 + */
   88.12 +
   88.13 +#ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
   88.14 +#define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
   88.15 +
   88.16 +
   88.17 +/*
   88.18 + * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
   88.19 + * interpreted by control software to determine the appropriate action. These 
   88.20 + * are only really advisories: the controller can actually do as it likes.
   88.21 + */
   88.22 +#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
   88.23 +#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
   88.24 +#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
   88.25 +
   88.26 +
   88.27 +/*
   88.28 + * CONTROLLER MESSAGING INTERFACE.
   88.29 + */
   88.30 +
   88.31 +typedef struct {
   88.32 +    u8 type;     /*  0: echoed in response */
   88.33 +    u8 subtype;  /*  1: echoed in response */
   88.34 +    u8 id;       /*  2: echoed in response */
   88.35 +    u8 length;   /*  3: number of bytes in 'msg' */
   88.36 +    u8 msg[60];  /*  4: type-specific message data */
   88.37 +} PACKED control_msg_t; /* 64 bytes */
   88.38 +
   88.39 +#define CONTROL_RING_SIZE 8
   88.40 +typedef u32 CONTROL_RING_IDX;
   88.41 +#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
   88.42 +
   88.43 +typedef struct {
   88.44 +    control_msg_t tx_ring[CONTROL_RING_SIZE];   /*    0: guest -> controller */
   88.45 +    control_msg_t rx_ring[CONTROL_RING_SIZE];   /*  512: controller -> guest */
   88.46 +    CONTROL_RING_IDX tx_req_prod, tx_resp_prod; /* 1024, 1028 */
   88.47 +    CONTROL_RING_IDX rx_req_prod, rx_resp_prod; /* 1032, 1036 */
   88.48 +} PACKED control_if_t; /* 1040 bytes */
   88.49 +
   88.50 +/*
   88.51 + * Top-level command types.
   88.52 + */
   88.53 +#define CMSG_CONSOLE        0  /* Console                 */
   88.54 +#define CMSG_BLKIF_BE       1  /* Block-device backend    */
   88.55 +#define CMSG_BLKIF_FE       2  /* Block-device frontend   */
   88.56 +#define CMSG_NETIF_BE       3  /* Network-device backend  */
   88.57 +#define CMSG_NETIF_FE       4  /* Network-device frontend */
   88.58 +#define CMSG_SHUTDOWN       6  /* Shutdown messages       */
   88.59 +#define CMSG_MEM_REQUEST    7  /* Memory reservation reqs */
   88.60 +
   88.61 +
   88.62 +/******************************************************************************
   88.63 + * CONSOLE DEFINITIONS
   88.64 + */
   88.65 +
   88.66 +/*
   88.67 + * Subtypes for console messages.
   88.68 + */
   88.69 +#define CMSG_CONSOLE_DATA       0
   88.70 +
   88.71 +
   88.72 +/******************************************************************************
   88.73 + * BLOCK-INTERFACE FRONTEND DEFINITIONS
   88.74 + */
   88.75 +
   88.76 +/* Messages from domain controller to guest. */
   88.77 +#define CMSG_BLKIF_FE_INTERFACE_STATUS           0
   88.78 +
   88.79 +/* Messages from guest to domain controller. */
   88.80 +#define CMSG_BLKIF_FE_DRIVER_STATUS             32
   88.81 +#define CMSG_BLKIF_FE_INTERFACE_CONNECT         33
   88.82 +#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT      34
   88.83 +#define CMSG_BLKIF_FE_INTERFACE_QUERY           35
   88.84 +
   88.85 +/* These are used by both front-end and back-end drivers. */
   88.86 +#define blkif_vdev_t   u16
   88.87 +#define blkif_pdev_t   u16
   88.88 +#define blkif_sector_t u64
   88.89 +
   88.90 +/*
   88.91 + * CMSG_BLKIF_FE_INTERFACE_STATUS:
   88.92 + *  Notify a guest about a status change on one of its block interfaces.
   88.93 + *  If the interface is DESTROYED or DOWN then the interface is disconnected:
   88.94 + *   1. The shared-memory frame is available for reuse.
   88.95 + *   2. Any unacknowledged messages pending on the interface were dropped.
   88.96 + */
   88.97 +#define BLKIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
   88.98 +#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
   88.99 +#define BLKIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  88.100 +#define BLKIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
  88.101 +typedef struct {
  88.102 +    u32 handle; /*  0 */
  88.103 +    u32 status; /*  4 */
  88.104 +    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
  88.105 +    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
  88.106 +} PACKED blkif_fe_interface_status_t; /* 12 bytes */
  88.107 +
  88.108 +/*
  88.109 + * CMSG_BLKIF_FE_DRIVER_STATUS:
  88.110 + *  Notify the domain controller that the front-end driver is DOWN or UP.
  88.111 + *  When the driver goes DOWN then the controller will send no more
  88.112 + *  status-change notifications.
  88.113 + *  If the driver goes DOWN while interfaces are still UP, the domain
  88.114 + *  will automatically take the interfaces DOWN.
  88.115 + * 
  88.116 + *  NB. The controller should not send an INTERFACE_STATUS_CHANGED message
  88.117 + *  for interfaces that are active when it receives an UP notification. We
  88.118 + *  expect that the frontend driver will query those interfaces itself.
  88.119 + */
  88.120 +#define BLKIF_DRIVER_STATUS_DOWN   0
  88.121 +#define BLKIF_DRIVER_STATUS_UP     1
  88.122 +typedef struct {
  88.123 +    /* IN */
  88.124 +    u32 status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  88.125 +    /* OUT */
  88.126 +    /* Driver should query interfaces [0..max_handle]. */
  88.127 +    u32 max_handle;    /*  4 */
  88.128 +} PACKED blkif_fe_driver_status_t; /* 8 bytes */
  88.129 +
  88.130 +/*
  88.131 + * CMSG_BLKIF_FE_INTERFACE_CONNECT:
  88.132 + *  If successful, the domain controller will acknowledge with a
  88.133 + *  STATUS_CONNECTED message.
  88.134 + */
  88.135 +typedef struct {
  88.136 +    u32      handle;      /*  0 */
  88.137 +    u32      __pad;
  88.138 +    memory_t shmem_frame; /*  8 */
  88.139 +    MEMORY_PADDING;
  88.140 +} PACKED blkif_fe_interface_connect_t; /* 16 bytes */
  88.141 +
  88.142 +/*
  88.143 + * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
  88.144 + *  If successful, the domain controller will acknowledge with a
  88.145 + *  STATUS_DISCONNECTED message.
  88.146 + */
  88.147 +typedef struct {
  88.148 +    u32 handle; /*  0 */
  88.149 +} PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
  88.150 +
  88.151 +/*
  88.152 + * CMSG_BLKIF_FE_INTERFACE_QUERY:
  88.153 + */
  88.154 +typedef struct {
  88.155 +    /* IN */
  88.156 +    u32 handle; /*  0 */
  88.157 +    /* OUT */
  88.158 +    u32 status; /*  4 */
  88.159 +    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
  88.160 +    domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */
  88.161 +} PACKED blkif_fe_interface_query_t; /* 12 bytes */
  88.162 +
  88.163 +
  88.164 +/******************************************************************************
  88.165 + * BLOCK-INTERFACE BACKEND DEFINITIONS
  88.166 + */
  88.167 +
  88.168 +/* Messages from domain controller. */
  88.169 +#define CMSG_BLKIF_BE_CREATE      0  /* Create a new block-device interface. */
  88.170 +#define CMSG_BLKIF_BE_DESTROY     1  /* Destroy a block-device interface.    */
  88.171 +#define CMSG_BLKIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  88.172 +#define CMSG_BLKIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  88.173 +#define CMSG_BLKIF_BE_VBD_CREATE  4  /* Create a new VBD for an interface.   */
  88.174 +#define CMSG_BLKIF_BE_VBD_DESTROY 5  /* Delete a VBD from an interface.      */
  88.175 +#define CMSG_BLKIF_BE_VBD_GROW    6  /* Append an extent to a given VBD.     */
  88.176 +#define CMSG_BLKIF_BE_VBD_SHRINK  7  /* Remove last extent from a given VBD. */
  88.177 +
  88.178 +/* Messages to domain controller. */
  88.179 +#define CMSG_BLKIF_BE_DRIVER_STATUS 32
  88.180 +
  88.181 +/*
  88.182 + * Message request/response definitions for block-device messages.
  88.183 + */
  88.184 +
  88.185 +typedef struct {
  88.186 +    blkif_sector_t sector_start;   /*  0 */
  88.187 +    blkif_sector_t sector_length;  /*  8 */
  88.188 +    blkif_pdev_t   device;         /* 16 */
  88.189 +    u16            __pad;          /* 18 */
  88.190 +} PACKED blkif_extent_t; /* 20 bytes */
  88.191 +
  88.192 +/* Non-specific 'okay' return. */
  88.193 +#define BLKIF_BE_STATUS_OKAY                0
  88.194 +/* Non-specific 'error' return. */
  88.195 +#define BLKIF_BE_STATUS_ERROR               1
  88.196 +/* The following are specific error returns. */
  88.197 +#define BLKIF_BE_STATUS_INTERFACE_EXISTS    2
  88.198 +#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  88.199 +#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
  88.200 +#define BLKIF_BE_STATUS_VBD_EXISTS          5
  88.201 +#define BLKIF_BE_STATUS_VBD_NOT_FOUND       6
  88.202 +#define BLKIF_BE_STATUS_OUT_OF_MEMORY       7
  88.203 +#define BLKIF_BE_STATUS_EXTENT_NOT_FOUND    8
  88.204 +#define BLKIF_BE_STATUS_MAPPING_ERROR       9
  88.205 +
  88.206 +/* This macro can be used to create an array of descriptive error strings. */
  88.207 +#define BLKIF_BE_STATUS_ERRORS {    \
  88.208 +    "Okay",                         \
  88.209 +    "Non-specific error",           \
  88.210 +    "Interface already exists",     \
  88.211 +    "Interface not found",          \
  88.212 +    "Interface is still connected", \
  88.213 +    "VBD already exists",           \
  88.214 +    "VBD not found",                \
  88.215 +    "Out of memory",                \
  88.216 +    "Extent not found for VBD",     \
  88.217 +    "Could not map domain memory" }
  88.218 +
  88.219 +/*
  88.220 + * CMSG_BLKIF_BE_CREATE:
  88.221 + *  When the driver sends a successful response then the interface is fully
  88.222 + *  created. The controller will send a DOWN notification to the front-end
  88.223 + *  driver.
  88.224 + */
  88.225 +typedef struct { 
  88.226 +    /* IN */
  88.227 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  88.228 +    u16        __pad;
  88.229 +    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  88.230 +    /* OUT */
  88.231 +    u32        status;        /*  8 */
  88.232 +} PACKED blkif_be_create_t; /* 12 bytes */
  88.233 +
  88.234 +/*
  88.235 + * CMSG_BLKIF_BE_DESTROY:
  88.236 + *  When the driver sends a successful response then the interface is fully
  88.237 + *  torn down. The controller will send a DESTROYED notification to the
  88.238 + *  front-end driver.
  88.239 + */
  88.240 +typedef struct { 
  88.241 +    /* IN */
  88.242 +    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  88.243 +    u16        __pad;
  88.244 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  88.245 +    /* OUT */
  88.246 +    u32        status;        /*  8 */
  88.247 +} PACKED blkif_be_destroy_t; /* 12 bytes */
  88.248 +
  88.249 +/*
  88.250 + * CMSG_BLKIF_BE_CONNECT:
  88.251 + *  When the driver sends a successful response then the interface is fully
  88.252 + *  connected. The controller will send a CONNECTED notification to the
  88.253 + *  front-end driver.
  88.254 + */
  88.255 +typedef struct { 
  88.256 +    /* IN */
  88.257 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  88.258 +    u16        __pad;
  88.259 +    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  88.260 +    memory_t   shmem_frame;   /*  8: Page cont. shared comms window.     */
  88.261 +    MEMORY_PADDING;
  88.262 +    u32        evtchn;        /* 16: Event channel for notifications.    */
  88.263 +    /* OUT */
  88.264 +    u32        status;        /* 20 */
  88.265 +} PACKED blkif_be_connect_t;  /* 24 bytes */
  88.266 +
  88.267 +/*
  88.268 + * CMSG_BLKIF_BE_DISCONNECT:
  88.269 + *  When the driver sends a successful response then the interface is fully
  88.270 + *  disconnected. The controller will send a DOWN notification to the front-end
  88.271 + *  driver.
  88.272 + */
  88.273 +typedef struct { 
  88.274 +    /* IN */
  88.275 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  88.276 +    u16        __pad;
  88.277 +    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  88.278 +    /* OUT */
  88.279 +    u32        status;        /*  8 */
  88.280 +} PACKED blkif_be_disconnect_t; /* 12 bytes */
  88.281 +
  88.282 +/* CMSG_BLKIF_BE_VBD_CREATE */
  88.283 +typedef struct { 
  88.284 +    /* IN */
  88.285 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  88.286 +    u16        __pad;
  88.287 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  88.288 +    blkif_vdev_t vdevice;     /*  8: Interface-specific id for this VBD. */
  88.289 +    u16        readonly;      /* 10: Non-zero -> VBD isn't writable.     */
  88.290 +    /* OUT */
  88.291 +    u32        status;        /* 12 */
  88.292 +} PACKED blkif_be_vbd_create_t; /* 16 bytes */
  88.293 +
  88.294 +/* CMSG_BLKIF_BE_VBD_DESTROY */
  88.295 +typedef struct {
  88.296 +    /* IN */
  88.297 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  88.298 +    u16        __pad0;        /*  2 */
  88.299 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  88.300 +    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  88.301 +    u16        __pad1;        /* 10 */
  88.302 +    /* OUT */
  88.303 +    u32        status;        /* 12 */
  88.304 +} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
  88.305 +
  88.306 +/* CMSG_BLKIF_BE_VBD_GROW */
  88.307 +typedef struct { 
  88.308 +    /* IN */
  88.309 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  88.310 +    u16        __pad0;        /*  2 */
  88.311 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  88.312 +    blkif_extent_t extent;    /*  8: Physical extent to append to VBD.   */
  88.313 +    blkif_vdev_t vdevice;     /* 28: Interface-specific id of the VBD.   */
  88.314 +    u16        __pad1;        /* 30 */
  88.315 +    /* OUT */
  88.316 +    u32        status;        /* 32 */
  88.317 +} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
  88.318 +
  88.319 +/* CMSG_BLKIF_BE_VBD_SHRINK */
  88.320 +typedef struct { 
  88.321 +    /* IN */
  88.322 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  88.323 +    u16        __pad0;        /*  2 */
  88.324 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  88.325 +    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  88.326 +    u16        __pad1;        /* 10 */
  88.327 +    /* OUT */
  88.328 +    u32        status;        /* 12 */
  88.329 +} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
  88.330 +
  88.331 +/*
  88.332 + * CMSG_BLKIF_BE_DRIVER_STATUS:
  88.333 + *  Notify the domain controller that the back-end driver is DOWN or UP.
  88.334 + *  If the driver goes DOWN while interfaces are still UP, the controller
  88.335 + *  will automatically send DOWN notifications.
  88.336 + */
  88.337 +typedef struct {
  88.338 +    u32        status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  88.339 +} PACKED blkif_be_driver_status_t; /* 4 bytes */
  88.340 +
  88.341 +
  88.342 +/******************************************************************************
  88.343 + * NETWORK-INTERFACE FRONTEND DEFINITIONS
  88.344 + */
  88.345 +
  88.346 +/* Messages from domain controller to guest. */
  88.347 +#define CMSG_NETIF_FE_INTERFACE_STATUS   0
  88.348 +
  88.349 +/* Messages from guest to domain controller. */
  88.350 +#define CMSG_NETIF_FE_DRIVER_STATUS             32
  88.351 +#define CMSG_NETIF_FE_INTERFACE_CONNECT         33
  88.352 +#define CMSG_NETIF_FE_INTERFACE_DISCONNECT      34
  88.353 +#define CMSG_NETIF_FE_INTERFACE_QUERY           35
  88.354 +
  88.355 +/*
  88.356 + * CMSG_NETIF_FE_INTERFACE_STATUS:
  88.357 + *  Notify a guest about a status change on one of its network interfaces.
  88.358 + *  If the interface is CLOSED or DOWN then the interface is disconnected:
  88.359 + *   1. The shared-memory frame is available for reuse.
  88.360 + *   2. Any unacknowledged messgaes pending on the interface were dropped.
  88.361 + */
  88.362 +#define NETIF_INTERFACE_STATUS_CLOSED       0 /* Interface doesn't exist.    */
  88.363 +#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
  88.364 +#define NETIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  88.365 +#define NETIF_INTERFACE_STATUS_CHANGED      3 /* A device has been added or removed. */
  88.366 +typedef struct {
  88.367 +    u32        handle; /*  0 */
  88.368 +    u32        status; /*  4 */
  88.369 +    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
  88.370 +    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
  88.371 +    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
  88.372 +} PACKED netif_fe_interface_status_t; /* 18 bytes */
  88.373 +
  88.374 +/*
  88.375 + * CMSG_NETIF_FE_DRIVER_STATUS:
  88.376 + *  Notify the domain controller that the front-end driver is DOWN or UP.
  88.377 + *  When the driver goes DOWN then the controller will send no more
  88.378 + *  status-change notifications.
  88.379 + *  If the driver goes DOWN while interfaces are still UP, the domain
  88.380 + *  will automatically take the interfaces DOWN.
  88.381 + * 
  88.382 + *  NB. The controller should not send an INTERFACE_STATUS message
  88.383 + *  for interfaces that are active when it receives an UP notification. We
  88.384 + *  expect that the frontend driver will query those interfaces itself.
  88.385 + */
  88.386 +#define NETIF_DRIVER_STATUS_DOWN   0
  88.387 +#define NETIF_DRIVER_STATUS_UP     1
  88.388 +typedef struct {
  88.389 +    /* IN */
  88.390 +    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  88.391 +    /* OUT */
  88.392 +    /* Driver should query interfaces [0..max_handle]. */
  88.393 +    u32        max_handle;    /*  4 */
  88.394 +} PACKED netif_fe_driver_status_t; /* 8 bytes */
  88.395 +
  88.396 +/*
  88.397 + * CMSG_NETIF_FE_INTERFACE_CONNECT:
  88.398 + *  If successful, the domain controller will acknowledge with a
  88.399 + *  STATUS_CONNECTED message.
  88.400 + */
  88.401 +typedef struct {
  88.402 +    u32        handle;         /*  0 */
  88.403 +    u32        __pad;          /*  4 */
  88.404 +    memory_t   tx_shmem_frame; /*  8 */
  88.405 +    MEMORY_PADDING;
  88.406 +    memory_t   rx_shmem_frame; /* 16 */
  88.407 +    MEMORY_PADDING;
  88.408 +} PACKED netif_fe_interface_connect_t; /* 24 bytes */
  88.409 +
  88.410 +/*
  88.411 + * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
  88.412 + *  If successful, the domain controller will acknowledge with a
  88.413 + *  STATUS_DISCONNECTED message.
  88.414 + */
  88.415 +typedef struct {
  88.416 +    u32        handle;        /*  0 */
  88.417 +} PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
  88.418 +
  88.419 +/*
  88.420 + * CMSG_NETIF_FE_INTERFACE_QUERY:
  88.421 + */
  88.422 +typedef struct {
  88.423 +    /* IN */
  88.424 +    u32        handle; /*  0 */
  88.425 +    /* OUT */
  88.426 +    u32        status; /*  4 */
  88.427 +    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
  88.428 +    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
  88.429 +    domid_t    domid;  /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */
  88.430 +} PACKED netif_fe_interface_query_t; /* 18 bytes */
  88.431 +
  88.432 +
  88.433 +/******************************************************************************
  88.434 + * NETWORK-INTERFACE BACKEND DEFINITIONS
  88.435 + */
  88.436 +
  88.437 +/* Messages from domain controller. */
  88.438 +#define CMSG_NETIF_BE_CREATE      0  /* Create a new net-device interface. */
  88.439 +#define CMSG_NETIF_BE_DESTROY     1  /* Destroy a net-device interface.    */
  88.440 +#define CMSG_NETIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  88.441 +#define CMSG_NETIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  88.442 +
  88.443 +/* Messages to domain controller. */
  88.444 +#define CMSG_NETIF_BE_DRIVER_STATUS 32
  88.445 +
  88.446 +/*
  88.447 + * Message request/response definitions for net-device messages.
  88.448 + */
  88.449 +
  88.450 +/* Non-specific 'okay' return. */
  88.451 +#define NETIF_BE_STATUS_OKAY                0
  88.452 +/* Non-specific 'error' return. */
  88.453 +#define NETIF_BE_STATUS_ERROR               1
  88.454 +/* The following are specific error returns. */
  88.455 +#define NETIF_BE_STATUS_INTERFACE_EXISTS    2
  88.456 +#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  88.457 +#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
  88.458 +#define NETIF_BE_STATUS_OUT_OF_MEMORY       5
  88.459 +#define NETIF_BE_STATUS_MAPPING_ERROR       6
  88.460 +
  88.461 +/* This macro can be used to create an array of descriptive error strings. */
  88.462 +#define NETIF_BE_STATUS_ERRORS {    \
  88.463 +    "Okay",                         \
  88.464 +    "Non-specific error",           \
  88.465 +    "Interface already exists",     \
  88.466 +    "Interface not found",          \
  88.467 +    "Interface is still connected", \
  88.468 +    "Out of memory",                \
  88.469 +    "Could not map domain memory" }
  88.470 +
  88.471 +/*
  88.472 + * CMSG_NETIF_BE_CREATE:
  88.473 + *  When the driver sends a successful response then the interface is fully
  88.474 + *  created. The controller will send a DOWN notification to the front-end
  88.475 + *  driver.
  88.476 + */
  88.477 +typedef struct { 
  88.478 +    /* IN */
  88.479 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  88.480 +    u16        __pad0;        /*  2 */
  88.481 +    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  88.482 +    u8         mac[6];        /*  8 */
  88.483 +    u16        __pad1;        /* 14 */
  88.484 +    /* OUT */
  88.485 +    u32        status;        /* 16 */
  88.486 +} PACKED netif_be_create_t; /* 20 bytes */
  88.487 +
  88.488 +/*
  88.489 + * CMSG_NETIF_BE_DESTROY:
  88.490 + *  When the driver sends a successful response then the interface is fully
  88.491 + *  torn down. The controller will send a DESTROYED notification to the
  88.492 + *  front-end driver.
  88.493 + */
  88.494 +typedef struct { 
  88.495 +    /* IN */
  88.496 +    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  88.497 +    u16        __pad;
  88.498 +    u32        netif_handle;  /*  4: ...ditto...                         */
  88.499 +    /* OUT */
  88.500 +    u32   status;             /*  8 */
  88.501 +} PACKED netif_be_destroy_t; /* 12 bytes */
  88.502 +
  88.503 +/*
  88.504 + * CMSG_NETIF_BE_CONNECT:
  88.505 + *  When the driver sends a successful response then the interface is fully
  88.506 + *  connected. The controller will send a CONNECTED notification to the
  88.507 + *  front-end driver.
  88.508 + */
  88.509 +typedef struct { 
  88.510 +    /* IN */
  88.511 +    domid_t    domid;          /*  0: Domain attached to new interface.   */
  88.512 +    u16        __pad0;         /*  2 */
  88.513 +    u32        netif_handle;   /*  4: Domain-specific interface handle.   */
  88.514 +    memory_t   tx_shmem_frame; /*  8: Page cont. tx shared comms window.  */
  88.515 +    MEMORY_PADDING;
  88.516 +    memory_t   rx_shmem_frame; /* 16: Page cont. rx shared comms window.  */
  88.517 +    MEMORY_PADDING;
  88.518 +    u16        evtchn;         /* 24: Event channel for notifications.    */
  88.519 +    u16        __pad1;         /* 26 */
  88.520 +    /* OUT */
  88.521 +    u32        status;         /* 28 */
  88.522 +} PACKED netif_be_connect_t; /* 32 bytes */
  88.523 +
  88.524 +/*
  88.525 + * CMSG_NETIF_BE_DISCONNECT:
  88.526 + *  When the driver sends a successful response then the interface is fully
  88.527 + *  disconnected. The controller will send a DOWN notification to the front-end
  88.528 + *  driver.
  88.529 + */
  88.530 +typedef struct { 
  88.531 +    /* IN */
  88.532 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  88.533 +    u16        __pad;
  88.534 +    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  88.535 +    /* OUT */
  88.536 +    u32        status;        /*  8 */
  88.537 +} PACKED netif_be_disconnect_t; /* 12 bytes */
  88.538 +
  88.539 +/*
  88.540 + * CMSG_NETIF_BE_DRIVER_STATUS:
  88.541 + *  Notify the domain controller that the back-end driver is DOWN or UP.
  88.542 + *  If the driver goes DOWN while interfaces are still UP, the domain
  88.543 + *  will automatically send DOWN notifications.
  88.544 + */
  88.545 +typedef struct {
  88.546 +    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  88.547 +} PACKED netif_be_driver_status_t; /* 4 bytes */
  88.548 +
  88.549 +
  88.550 +/******************************************************************************
  88.551 + * SHUTDOWN DEFINITIONS
  88.552 + */
  88.553 +
  88.554 +/*
  88.555 + * Subtypes for shutdown messages.
  88.556 + */
  88.557 +#define CMSG_SHUTDOWN_POWEROFF  0   /* Clean shutdown (SHUTDOWN_poweroff).   */
  88.558 +#define CMSG_SHUTDOWN_REBOOT    1   /* Clean shutdown (SHUTDOWN_reboot).     */
  88.559 +#define CMSG_SHUTDOWN_SUSPEND   2   /* Create suspend info, then             */
  88.560 +                                    /* SHUTDOWN_suspend.                     */
  88.561 +
  88.562 +
  88.563 +/******************************************************************************
  88.564 + * MEMORY CONTROLS
  88.565 + */
  88.566 +
  88.567 +#define CMSG_MEM_REQUEST_SET 0 /* Request a domain to set its mem footprint. */
  88.568 +
  88.569 +/*
  88.570 + * CMSG_MEM_REQUEST:
  88.571 + *  Request that the domain change its memory reservation.
  88.572 + */
  88.573 +typedef struct {
  88.574 +    /* OUT */
  88.575 +    u32 target;       /* 0: Target memory reservation in pages.       */
  88.576 +    /* IN  */
  88.577 +    u32 status;       /* 4: Return code indicates success or failure. */
  88.578 +} PACKED mem_request_t; /* 8 bytes */
  88.579 +
  88.580 +
  88.581 +#endif /* __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ */
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/xen/include/public/io/netif.h	Sun Oct 31 09:56:36 2004 +0000
    89.3 @@ -0,0 +1,92 @@
    89.4 +/******************************************************************************
    89.5 + * netif.h
    89.6 + * 
    89.7 + * Unified network-device I/O interface for Xen guest OSes.
    89.8 + * 
    89.9 + * Copyright (c) 2003-2004, Keir Fraser
   89.10 + */
   89.11 +
   89.12 +#ifndef __XEN_PUBLIC_IO_NETIF_H__
   89.13 +#define __XEN_PUBLIC_IO_NETIF_H__
   89.14 +
   89.15 +typedef struct {
   89.16 +    memory_t addr;   /*  0: Machine address of packet.  */
   89.17 +    MEMORY_PADDING;
   89.18 +    u16      id;     /*  8: Echoed in response message. */
   89.19 +    u16      size;   /* 10: Packet size in bytes.       */
   89.20 +} PACKED netif_tx_request_t; /* 12 bytes */
   89.21 +
   89.22 +typedef struct {
   89.23 +    u16      id;     /*  0 */
   89.24 +    s8       status; /*  2 */
   89.25 +    u8       __pad;  /*  3 */
   89.26 +} PACKED netif_tx_response_t; /* 4 bytes */
   89.27 +
   89.28 +typedef struct {
   89.29 +    u16       id;    /*  0: Echoed in response message.        */
   89.30 +} PACKED netif_rx_request_t; /* 2 bytes */
   89.31 +
   89.32 +typedef struct {
   89.33 +    memory_t addr;   /*  0: Machine address of packet.              */
   89.34 +    MEMORY_PADDING;
   89.35 +    u16      id;     /*  8:  */
   89.36 +    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
   89.37 +} PACKED netif_rx_response_t; /* 12 bytes */
   89.38 +
   89.39 +/*
   89.40 + * We use a special capitalised type name because it is _essential_ that all 
   89.41 + * arithmetic on indexes is done on an integer type of the correct size.
   89.42 + */
   89.43 +typedef u32 NETIF_RING_IDX;
   89.44 +
   89.45 +/*
   89.46 + * Ring indexes are 'free running'. That is, they are not stored modulo the
   89.47 + * size of the ring buffer. The following macros convert a free-running counter
   89.48 + * into a value that can directly index a ring-buffer array.
   89.49 + */
   89.50 +#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
   89.51 +#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
   89.52 +
   89.53 +#define NETIF_TX_RING_SIZE 256
   89.54 +#define NETIF_RX_RING_SIZE 256
   89.55 +
   89.56 +/* This structure must fit in a memory page. */
   89.57 +typedef struct {
   89.58 +    /*
   89.59 +     * Frontend places packets into ring at tx_req_prod.
   89.60 +     * Frontend receives event when tx_resp_prod passes tx_event.
   89.61 +     * 'req_cons' is a shadow of the backend's request consumer -- the frontend
   89.62 +     * may use it to determine if all queued packets have been seen by the
   89.63 +     * backend.
   89.64 +     */
   89.65 +    NETIF_RING_IDX req_prod;       /*  0 */
   89.66 +    NETIF_RING_IDX req_cons;       /*  4 */
   89.67 +    NETIF_RING_IDX resp_prod;      /*  8 */
   89.68 +    NETIF_RING_IDX event;          /* 12 */
   89.69 +    union {                        /* 16 */
   89.70 +        netif_tx_request_t  req;
   89.71 +        netif_tx_response_t resp;
   89.72 +    } PACKED ring[NETIF_TX_RING_SIZE];
   89.73 +} PACKED netif_tx_interface_t;
   89.74 +
   89.75 +/* This structure must fit in a memory page. */
   89.76 +typedef struct {
   89.77 +    /*
   89.78 +     * Frontend places empty buffers into ring at rx_req_prod.
   89.79 +     * Frontend receives event when rx_resp_prod passes rx_event.
   89.80 +     */
   89.81 +    NETIF_RING_IDX req_prod;       /*  0 */
   89.82 +    NETIF_RING_IDX resp_prod;      /*  4 */
   89.83 +    NETIF_RING_IDX event;          /*  8 */
   89.84 +    union {                        /* 12 */
   89.85 +        netif_rx_request_t  req;
   89.86 +        netif_rx_response_t resp;
   89.87 +    } PACKED ring[NETIF_RX_RING_SIZE];
   89.88 +} PACKED netif_rx_interface_t;
   89.89 +
   89.90 +/* Descriptor status values */
   89.91 +#define NETIF_RSP_DROPPED         -2
   89.92 +#define NETIF_RSP_ERROR           -1
   89.93 +#define NETIF_RSP_OKAY             0
   89.94 +
   89.95 +#endif
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/xen/include/public/physdev.h	Sun Oct 31 09:56:36 2004 +0000
    90.3 @@ -0,0 +1,80 @@
    90.4 +/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
    90.5 + ****************************************************************************
    90.6 + * (c) 2004 - Rolf Neugebauer - Intel Research Cambridge
    90.7 + * (c) 2004 - Keir Fraser - University of Cambridge
    90.8 + ****************************************************************************
    90.9 + * Description: Interface for domains to access physical devices on the PCI bus
   90.10 + */
   90.11 +
   90.12 +#ifndef __XEN_PUBLIC_PHYSDEV_H__
   90.13 +#define __XEN_PUBLIC_PHYSDEV_H__
   90.14 +
   90.15 +/* Commands to HYPERVISOR_physdev_op() */
   90.16 +#define PHYSDEVOP_PCI_CFGREG_READ       0
   90.17 +#define PHYSDEVOP_PCI_CFGREG_WRITE      1
   90.18 +#define PHYSDEVOP_PCI_INITIALISE_DEVICE 2
   90.19 +#define PHYSDEVOP_PCI_PROBE_ROOT_BUSES  3
   90.20 +#define PHYSDEVOP_IRQ_UNMASK_NOTIFY     4
   90.21 +#define PHYSDEVOP_IRQ_STATUS_QUERY      5
   90.22 +
   90.23 +/* Read from PCI configuration space. */
   90.24 +typedef struct {
   90.25 +    /* IN */
   90.26 +    u32 bus;                          /*  0 */
   90.27 +    u32 dev;                          /*  4 */
   90.28 +    u32 func;                         /*  8 */
   90.29 +    u32 reg;                          /* 12 */
   90.30 +    u32 len;                          /* 16 */
   90.31 +    /* OUT */
   90.32 +    u32 value;                        /* 20 */
   90.33 +} PACKED physdevop_pci_cfgreg_read_t; /* 24 bytes */
   90.34 +
   90.35 +/* Write to PCI configuration space. */
   90.36 +typedef struct {
   90.37 +    /* IN */
   90.38 +    u32 bus;                          /*  0 */
   90.39 +    u32 dev;                          /*  4 */
   90.40 +    u32 func;                         /*  8 */
   90.41 +    u32 reg;                          /* 12 */
   90.42 +    u32 len;                          /* 16 */
   90.43 +    u32 value;                        /* 20 */
   90.44 +} PACKED physdevop_pci_cfgreg_write_t; /* 24 bytes */
   90.45 +
   90.46 +/* Do final initialisation of a PCI device (e.g., last-moment IRQ routing). */
   90.47 +typedef struct {
   90.48 +    /* IN */
   90.49 +    u32 bus;                          /*  0 */
   90.50 +    u32 dev;                          /*  4 */
   90.51 +    u32 func;                         /*  8 */
   90.52 +} PACKED physdevop_pci_initialise_device_t; /* 12 bytes */
   90.53 +
   90.54 +/* Find the root buses for subsequent scanning. */
   90.55 +typedef struct {
   90.56 +    /* OUT */
   90.57 +    u32 busmask[256/32];              /*  0 */
   90.58 +} PACKED physdevop_pci_probe_root_buses_t; /* 32 bytes */
   90.59 +
   90.60 +typedef struct {
   90.61 +    /* IN */
   90.62 +    u32 irq;                          /*  0 */
   90.63 +    /* OUT */
   90.64 +/* Need to call PHYSDEVOP_IRQ_UNMASK_NOTIFY when the IRQ has been serviced? */
   90.65 +#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY (1<<0)
   90.66 +    u32 flags;                        /*  4 */
   90.67 +} PACKED physdevop_irq_status_query_t; /* 8 bytes */
   90.68 +
   90.69 +typedef struct _physdev_op_st 
   90.70 +{
   90.71 +    u32 cmd;                          /*  0 */
   90.72 +    u32 __pad;                        /*  4 */
   90.73 +    union {                           /*  8 */
   90.74 +        physdevop_pci_cfgreg_read_t       pci_cfgreg_read;
   90.75 +        physdevop_pci_cfgreg_write_t      pci_cfgreg_write;
   90.76 +        physdevop_pci_initialise_device_t pci_initialise_device;
   90.77 +        physdevop_pci_probe_root_buses_t  pci_probe_root_buses;
   90.78 +        physdevop_irq_status_query_t      irq_status_query;
   90.79 +        u8                                __dummy[32];
   90.80 +    } PACKED u;
   90.81 +} PACKED physdev_op_t; /* 40 bytes */
   90.82 +
   90.83 +#endif /* __XEN_PUBLIC_PHYSDEV_H__ */
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/xen/include/public/sched_ctl.h	Sun Oct 31 09:56:36 2004 +0000
    91.3 @@ -0,0 +1,70 @@
    91.4 +/**
    91.5 + * Generic scheduler control interface.
    91.6 + *
    91.7 + * Mark Williamson, (C) 2004 Intel Research Cambridge
    91.8 + */
    91.9 +
   91.10 +#ifndef __XEN_PUBLIC_SCHED_CTL_H__
   91.11 +#define __XEN_PUBLIC_SCHED_CTL_H__
   91.12 +
   91.13 +/* Scheduler types */
   91.14 +#define SCHED_BVT      0
   91.15 +#define SCHED_ATROPOS  2
   91.16 +#define SCHED_RROBIN   3
   91.17 +
   91.18 +/* these describe the intended direction used for a scheduler control or domain
   91.19 + * command */
   91.20 +#define SCHED_INFO_PUT 0
   91.21 +#define SCHED_INFO_GET 1
   91.22 +
   91.23 +/*
   91.24 + * Generic scheduler control command - used to adjust system-wide scheduler
   91.25 + * parameters
   91.26 + */
   91.27 +struct sched_ctl_cmd
   91.28 +{
   91.29 +    u32 sched_id;                     /*  0 */
   91.30 +    u32 direction;                    /*  4 */
   91.31 +    union {                           /*  8 */
   91.32 +        struct bvt_ctl
   91.33 +        {
   91.34 +            /* IN variables. */
   91.35 +            u32 ctx_allow;            /*  8: context switch allowance */
   91.36 +        } PACKED bvt;
   91.37 +
   91.38 +        struct rrobin_ctl
   91.39 +        {
   91.40 +            /* IN variables */
   91.41 +            u64 slice;                /*  8: round robin time slice */
   91.42 +        } PACKED rrobin;
   91.43 +    } PACKED u;
   91.44 +} PACKED; /* 16 bytes */
   91.45 +
   91.46 +struct sched_adjdom_cmd
   91.47 +{
   91.48 +    u32     sched_id;                 /*  0 */
   91.49 +    u32     direction;                /*  4 */
   91.50 +    domid_t domain;                   /*  8 */
   91.51 +    u16     __pad0;
   91.52 +    u32     __pad1;
   91.53 +    union {                           /* 16 */
   91.54 +        struct bvt_adjdom
   91.55 +        {
   91.56 +            u32 mcu_adv;            /* 16: mcu advance: inverse of weight */
   91.57 +            u32 warpback;           /* 20: warp? */
   91.58 +            s32 warpvalue;          /* 24: warp value */
   91.59 +            long long warpl;        /* 32: warp limit */
   91.60 +            long long warpu;        /* 40: unwarp time requirement */
   91.61 +        } PACKED bvt;
   91.62 +
   91.63 +        struct atropos_adjdom
   91.64 +        {
   91.65 +            u64 nat_period; /* 16 */
   91.66 +            u64 nat_slice;  /* 24 */
   91.67 +            u64 latency;    /* 32 */
   91.68 +            u32 xtratime;   /* 36 */
   91.69 +        } PACKED atropos;
   91.70 +    } PACKED u;
   91.71 +} PACKED; /* 40 bytes */
   91.72 +
   91.73 +#endif /* __XEN_PUBLIC_SCHED_CTL_H__ */
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/xen/include/public/trace.h	Sun Oct 31 09:56:36 2004 +0000
    92.3 @@ -0,0 +1,31 @@
    92.4 +/******************************************************************************
    92.5 + * trace.h
    92.6 + */
    92.7 +
    92.8 +#ifndef __XEN_PUBLIC_TRACE_H__
    92.9 +#define __XEN_PUBLIC_TRACE_H__
   92.10 +
   92.11 +/* This structure represents a single trace buffer record. */
   92.12 +struct t_rec {
   92.13 +    u64 cycles;               /* 64 bit cycle counter timestamp */
   92.14 +    u32 event;                /* 32 bit event ID                */
   92.15 +    u32 d1, d2, d3, d4, d5;   /* event data items               */
   92.16 +};
   92.17 +
   92.18 +/*
   92.19 + * This structure contains the metadata for a single trace buffer.  The head
   92.20 + * field, indexes into an array of struct t_rec's.
   92.21 + */
   92.22 +struct t_buf {
   92.23 +    unsigned long data;      /* pointer to data area.  machine address
   92.24 +                              * for convenience in user space code           */
   92.25 +
   92.26 +    unsigned long size;      /* size of the data area, in t_recs             */
   92.27 +    unsigned long head;      /* array index of the most recent record        */
   92.28 +
   92.29 +    /* Xen-private elements follow... */
   92.30 +    struct t_rec *head_ptr; /* pointer to the head record                    */
   92.31 +    struct t_rec *vdata;    /* virtual address pointer to data               */
   92.32 +};
   92.33 +
   92.34 +#endif /* __XEN_PUBLIC_TRACE_H__ */
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/xen/include/public/xen.h	Sun Oct 31 09:56:36 2004 +0000
    93.3 @@ -0,0 +1,425 @@
    93.4 +/******************************************************************************
    93.5 + * xen.h
    93.6 + * 
    93.7 + * Guest OS interface to Xen.
    93.8 + * 
    93.9 + * Copyright (c) 2004, K A Fraser
   93.10 + */
   93.11 +
   93.12 +#ifndef __XEN_PUBLIC_XEN_H__
   93.13 +#define __XEN_PUBLIC_XEN_H__
   93.14 +
   93.15 +/* GCC-specific way to pack structure definitions (no implicit padding). */
   93.16 +#define PACKED __attribute__ ((packed))
   93.17 +
   93.18 +#if defined(__i386__)
   93.19 +#include "arch-x86_32.h"
   93.20 +#elif defined(__x86_64__)
   93.21 +#include "arch-x86_64.h"
   93.22 +#else
   93.23 +#error "Unsupported architecture"
   93.24 +#endif
   93.25 +
   93.26 +/*
   93.27 + * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
   93.28 + */
   93.29 +
   93.30 +/* EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5. */
   93.31 +#define __HYPERVISOR_set_trap_table        0
   93.32 +#define __HYPERVISOR_mmu_update            1
   93.33 +#define __HYPERVISOR_set_gdt               2
   93.34 +#define __HYPERVISOR_stack_switch          3
   93.35 +#define __HYPERVISOR_set_callbacks         4
   93.36 +#define __HYPERVISOR_fpu_taskswitch        5
   93.37 +#define __HYPERVISOR_sched_op              6
   93.38 +#define __HYPERVISOR_dom0_op               7
   93.39 +#define __HYPERVISOR_set_debugreg          8
   93.40 +#define __HYPERVISOR_get_debugreg          9
   93.41 +#define __HYPERVISOR_update_descriptor    10
   93.42 +#define __HYPERVISOR_set_fast_trap        11
   93.43 +#define __HYPERVISOR_dom_mem_op           12
   93.44 +#define __HYPERVISOR_multicall            13
   93.45 +#define __HYPERVISOR_update_va_mapping    14
   93.46 +#define __HYPERVISOR_set_timer_op         15
   93.47 +#define __HYPERVISOR_event_channel_op     16
   93.48 +#define __HYPERVISOR_xen_version          17
   93.49 +#define __HYPERVISOR_console_io           18
   93.50 +#define __HYPERVISOR_physdev_op           19
   93.51 +#define __HYPERVISOR_grant_table_op       20
   93.52 +#define __HYPERVISOR_vm_assist            21
   93.53 +#define __HYPERVISOR_update_va_mapping_otherdomain 22
   93.54 +
   93.55 +/*
   93.56 + * MULTICALLS
   93.57 + * 
   93.58 + * Multicalls are listed in an array, with each element being a fixed size 
   93.59 + * (BYTES_PER_MULTICALL_ENTRY). Each is of the form (op, arg1, ..., argN)
   93.60 + * where each element of the tuple is a machine word. 
   93.61 + */
   93.62 +#define ARGS_PER_MULTICALL_ENTRY 8
   93.63 +
   93.64 +
   93.65 +/* 
   93.66 + * VIRTUAL INTERRUPTS
   93.67 + * 
   93.68 + * Virtual interrupts that a guest OS may receive from Xen.
   93.69 + */
   93.70 +#define VIRQ_MISDIRECT  0  /* Catch-all interrupt for unbound VIRQs.      */
   93.71 +#define VIRQ_TIMER      1  /* Timebase update, and/or requested timeout.  */
   93.72 +#define VIRQ_DEBUG      2  /* Request guest to dump debug info.           */
   93.73 +#define VIRQ_CONSOLE    3  /* (DOM0) bytes received on emergency console. */
   93.74 +#define VIRQ_DOM_EXC    4  /* (DOM0) Exceptional event for some domain.   */
   93.75 +#define VIRQ_PARITY_ERR 5  /* (DOM0) NMI parity error.                    */
   93.76 +#define VIRQ_IO_ERR     6  /* (DOM0) NMI I/O error.                       */
   93.77 +#define NR_VIRQS        7
   93.78 +
   93.79 +/*
   93.80 + * MMU-UPDATE REQUESTS
   93.81 + * 
   93.82 + * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
   93.83 + * ptr[1:0] specifies the appropriate MMU_* command.
   93.84 + * 
   93.85 + * FOREIGN DOMAIN (FD)
   93.86 + * -------------------
   93.87 + *  Some commands recognise an explicitly-declared foreign domain,
   93.88 + *  in which case they will operate with respect to the foreigner rather than
   93.89 + *  the calling domain. Where the FD has some effect, it is described below.
   93.90 + * 
   93.91 + * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
   93.92 + * Updates an entry in a page table. If updating an L1 table, and the new
   93.93 + * table entry is valid/present, the mapped frame must belong to the FD, if
   93.94 + * an FD has been specified. If attempting to map an I/O page then the
   93.95 + * caller assumes the privilege of the FD.
   93.96 + * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
   93.97 + * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
   93.98 + * ptr[:2]  -- Machine address of the page-table entry to modify.
   93.99 + * val      -- Value to write.
  93.100 + * 
  93.101 + * ptr[1:0] == MMU_MACHPHYS_UPDATE:
  93.102 + * Updates an entry in the machine->pseudo-physical mapping table.
  93.103 + * ptr[:2]  -- Machine address within the frame whose mapping to modify.
  93.104 + *             The frame must belong to the FD, if one is specified.
  93.105 + * val      -- Value to write into the mapping entry.
  93.106 + *  
  93.107 + * ptr[1:0] == MMU_EXTENDED_COMMAND:
  93.108 + * val[7:0] -- MMUEXT_* command.
  93.109 + * 
  93.110 + *   val[7:0] == MMUEXT_(UN)PIN_*_TABLE:
  93.111 + *   ptr[:2]  -- Machine address of frame to be (un)pinned as a p.t. page.
  93.112 + *               The frame must belong to the FD, if one is specified.
  93.113 + * 
  93.114 + *   val[7:0] == MMUEXT_NEW_BASEPTR:
  93.115 + *   ptr[:2]  -- Machine address of new page-table base to install in MMU.
  93.116 + * 
  93.117 + *   val[7:0] == MMUEXT_TLB_FLUSH:
  93.118 + *   No additional arguments.
  93.119 + * 
  93.120 + *   val[7:0] == MMUEXT_INVLPG:
  93.121 + *   ptr[:2]  -- Linear address to be flushed from the TLB.
  93.122 + * 
  93.123 + *   val[7:0] == MMUEXT_FLUSH_CACHE:
  93.124 + *   No additional arguments. Writes back and flushes cache contents.
  93.125 + * 
  93.126 + *   val[7:0] == MMUEXT_SET_LDT:
  93.127 + *   ptr[:2]  -- Linear address of LDT base (NB. must be page-aligned).
  93.128 + *   val[:8]  -- Number of entries in LDT.
  93.129 + * 
  93.130 + *   val[7:0] == MMUEXT_TRANSFER_PAGE:
  93.131 + *   val[31:16] -- Domain to whom page is to be transferred.
  93.132 + *   (val[15:8],ptr[9:2]) -- 16-bit reference into transferee's grant table.
  93.133 + *   ptr[:12]  -- Page frame to be reassigned to the FD.
  93.134 + *                (NB. The frame must currently belong to the calling domain).
  93.135 + * 
  93.136 + *   val[7:0] == MMUEXT_SET_FOREIGNDOM:
  93.137 + *   val[31:16] -- Domain to set as the Foreign Domain (FD).
  93.138 + *                 (NB. DOMID_SELF is not recognised)
  93.139 + *                 If FD != DOMID_IO then the caller must be privileged.
  93.140 + * 
  93.141 + *   val[7:0] == MMUEXT_CLEAR_FOREIGNDOM:
  93.142 + *   Clears the FD.
  93.143 + * 
  93.144 + *   val[7:0] == MMUEXT_REASSIGN_PAGE:
  93.145 + *   ptr[:2]  -- A machine address within the page to be reassigned to the FD.
  93.146 + *               (NB. page must currently belong to the calling domain).
  93.147 + */
  93.148 +#define MMU_NORMAL_PT_UPDATE     0 /* checked '*ptr = val'. ptr is MA.       */
  93.149 +#define MMU_MACHPHYS_UPDATE      2 /* ptr = MA of frame to modify entry for  */
  93.150 +#define MMU_EXTENDED_COMMAND     3 /* least 8 bits of val demux further      */
  93.151 +#define MMUEXT_PIN_L1_TABLE      0 /* ptr = MA of frame to pin               */
  93.152 +#define MMUEXT_PIN_L2_TABLE      1 /* ptr = MA of frame to pin               */
  93.153 +#define MMUEXT_PIN_L3_TABLE      2 /* ptr = MA of frame to pin               */
  93.154 +#define MMUEXT_PIN_L4_TABLE      3 /* ptr = MA of frame to pin               */
  93.155 +#define MMUEXT_UNPIN_TABLE       4 /* ptr = MA of frame to unpin             */
  93.156 +#define MMUEXT_NEW_BASEPTR       5 /* ptr = MA of new pagetable base         */
  93.157 +#define MMUEXT_TLB_FLUSH         6 /* ptr = NULL                             */
  93.158 +#define MMUEXT_INVLPG            7 /* ptr = VA to invalidate                 */
  93.159 +#define MMUEXT_FLUSH_CACHE       8
  93.160 +#define MMUEXT_SET_LDT           9 /* ptr = VA of table; val = # entries     */
  93.161 +#define MMUEXT_SET_FOREIGNDOM   10 /* val[31:16] = dom                       */
  93.162 +#define MMUEXT_CLEAR_FOREIGNDOM 11
  93.163 +#define MMUEXT_TRANSFER_PAGE    12 /* ptr = MA of frame; val[31:16] = dom    */
  93.164 +#define MMUEXT_REASSIGN_PAGE    13
  93.165 +#define MMUEXT_CMD_MASK        255
  93.166 +#define MMUEXT_CMD_SHIFT         8
  93.167 +
  93.168 +/* These are passed as 'flags' to update_va_mapping. They can be ORed. */
  93.169 +#define UVMF_FLUSH_TLB          1 /* Flush entire TLB. */
  93.170 +#define UVMF_INVLPG             2 /* Flush the VA mapping being updated. */
  93.171 +
  93.172 +
  93.173 +/*
  93.174 + * Commands to HYPERVISOR_sched_op().
  93.175 + */
  93.176 +#define SCHEDOP_yield           0   /* Give up the CPU voluntarily.       */
  93.177 +#define SCHEDOP_block           1   /* Block until an event is received.  */
  93.178 +#define SCHEDOP_shutdown        2   /* Stop executing this domain.        */
  93.179 +#define SCHEDOP_cmdmask       255   /* 8-bit command. */
  93.180 +#define SCHEDOP_reasonshift     8   /* 8-bit reason code. (SCHEDOP_shutdown) */
  93.181 +
  93.182 +/*
  93.183 + * Commands to HYPERVISOR_console_io().
  93.184 + */
  93.185 +#define CONSOLEIO_write         0
  93.186 +#define CONSOLEIO_read          1
  93.187 +
  93.188 +/*
  93.189 + * Commands to HYPERVISOR_dom_mem_op().
  93.190 + */
  93.191 +#define MEMOP_increase_reservation 0
  93.192 +#define MEMOP_decrease_reservation 1
  93.193 +
  93.194 +/*
  93.195 + * Commands to HYPERVISOR_vm_assist().
  93.196 + */
  93.197 +#define VMASST_CMD_enable                0
  93.198 +#define VMASST_CMD_disable               1
  93.199 +#define VMASST_TYPE_4gb_segments         0
  93.200 +#define VMASST_TYPE_4gb_segments_notify  1
  93.201 +#define VMASST_TYPE_writable_pagetables  2
  93.202 +#define MAX_VMASST_TYPE 2
  93.203 +
  93.204 +#ifndef __ASSEMBLY__
  93.205 +
  93.206 +typedef u16 domid_t;
  93.207 +
  93.208 +/* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
  93.209 +#define DOMID_FIRST_RESERVED (0x7FF0U)
  93.210 +
  93.211 +/* DOMID_SELF is used in certain contexts to refer to oneself. */
  93.212 +#define DOMID_SELF (0x7FF0U)
  93.213 +
  93.214 +/*
  93.215 + * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
  93.216 + * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
  93.217 + * is useful to ensure that no mappings to the OS's own heap are accidentally
  93.218 + * installed. (e.g., in Linux this could cause havoc as reference counts
  93.219 + * aren't adjusted on the I/O-mapping code path).
  93.220 + * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
  93.221 + * be specified by any calling domain.
  93.222 + */
  93.223 +#define DOMID_IO   (0x7FF1U)
  93.224 +
  93.225 +/*
  93.226 + * DOMID_XEN is used to allow privileged domains to map restricted parts of
  93.227 + * Xen's heap space (e.g., the machine_to_phys table).
  93.228 + * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
  93.229 + * the caller is privileged.
  93.230 + */
  93.231 +#define DOMID_XEN  (0x7FF2U)
  93.232 +
  93.233 +/*
  93.234 + * Send an array of these to HYPERVISOR_mmu_update().
  93.235 + * NB. The fields are natural pointer/address size for this architecture.
  93.236 + */
  93.237 +typedef struct
  93.238 +{
  93.239 +    memory_t ptr;    /* Machine address of PTE. */
  93.240 +    memory_t val;    /* New contents of PTE.    */
  93.241 +} PACKED mmu_update_t;
  93.242 +
  93.243 +/*
  93.244 + * Send an array of these to HYPERVISOR_multicall().
  93.245 + * NB. The fields are natural register size for this architecture.
  93.246 + */
  93.247 +typedef struct
  93.248 +{
  93.249 +    cpureg_t op;
  93.250 +    cpureg_t args[7];
  93.251 +} PACKED multicall_entry_t;
  93.252 +
  93.253 +/* Event channel endpoints per domain. */
  93.254 +#define NR_EVENT_CHANNELS 1024
  93.255 +
  93.256 +/* No support for multi-processor guests. */
  93.257 +#define MAX_VIRT_CPUS 1
  93.258 +
  93.259 +/*
  93.260 + * Xen/guestos shared data -- pointer provided in start_info.
  93.261 + * NB. We expect that this struct is smaller than a page.
  93.262 + */
  93.263 +typedef struct shared_info_st
  93.264 +{
  93.265 +    /*
  93.266 +     * Per-VCPU information goes here. This will be cleaned up more when Xen 
  93.267 +     * actually supports multi-VCPU guests.
  93.268 +     */
  93.269 +    struct {
  93.270 +        /*
  93.271 +         * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
  93.272 +         * a pending notification for a particular VCPU. It is then cleared 
  93.273 +         * by the guest OS /before/ checking for pending work, thus avoiding
  93.274 +         * a set-and-check race. Note that the mask is only accessed by Xen
  93.275 +         * on the CPU that is currently hosting the VCPU. This means that the
  93.276 +         * pending and mask flags can be updated by the guest without special
  93.277 +         * synchronisation (i.e., no need for the x86 LOCK prefix).
  93.278 +         * This may seem suboptimal because if the pending flag is set by
  93.279 +         * a different CPU then an IPI may be scheduled even when the mask
  93.280 +         * is set. However, note:
  93.281 +         *  1. The task of 'interrupt holdoff' is covered by the per-event-
  93.282 +         *     channel mask bits. A 'noisy' event that is continually being
  93.283 +         *     triggered can be masked at source at this very precise
  93.284 +         *     granularity.
  93.285 +         *  2. The main purpose of the per-VCPU mask is therefore to restrict
  93.286 +         *     reentrant execution: whether for concurrency control, or to
  93.287 +         *     prevent unbounded stack usage. Whatever the purpose, we expect
  93.288 +         *     that the mask will be asserted only for short periods at a time,
  93.289 +         *     and so the likelihood of a 'spurious' IPI is suitably small.
  93.290 +         * The mask is read before making an event upcall to the guest: a
  93.291 +         * non-zero mask therefore guarantees that the VCPU will not receive
  93.292 +         * an upcall activation. The mask is cleared when the VCPU requests
  93.293 +         * to block: this avoids wakeup-waiting races.
  93.294 +         */
  93.295 +        u8 evtchn_upcall_pending;
  93.296 +        u8 evtchn_upcall_mask;
  93.297 +        u8 pad0, pad1;
  93.298 +    } PACKED vcpu_data[MAX_VIRT_CPUS];  /*   0 */
  93.299 +
  93.300 +    /*
  93.301 +     * A domain can have up to 1024 "event channels" on which it can send
  93.302 +     * and receive asynchronous event notifications. There are three classes
  93.303 +     * of event that are delivered by this mechanism:
  93.304 +     *  1. Bi-directional inter- and intra-domain connections. Domains must
  93.305 +     *     arrange out-of-band to set up a connection (usually the setup
  93.306 +     *     is initiated and organised by a privileged third party such as
  93.307 +     *     software running in domain 0).
  93.308 +     *  2. Physical interrupts. A domain with suitable hardware-access
  93.309 +     *     privileges can bind an event-channel port to a physical interrupt
  93.310 +     *     source.
  93.311 +     *  3. Virtual interrupts ('events'). A domain can bind an event-channel
  93.312 +     *     port to a virtual interrupt source, such as the virtual-timer
  93.313 +     *     device or the emergency console.
  93.314 +     * 
  93.315 +     * Event channels are addressed by a "port index" between 0 and 1023.
  93.316 +     * Each channel is associated with two bits of information:
  93.317 +     *  1. PENDING -- notifies the domain that there is a pending notification
  93.318 +     *     to be processed. This bit is cleared by the guest.
  93.319 +     *  2. MASK -- if this bit is clear then a 0->1 transition of PENDING
  93.320 +     *     will cause an asynchronous upcall to be scheduled. This bit is only
  93.321 +     *     updated by the guest. It is read-only within Xen. If a channel
  93.322 +     *     becomes pending while the channel is masked then the 'edge' is lost
  93.323 +     *     (i.e., when the channel is unmasked, the guest must manually handle
  93.324 +     *     pending notifications as no upcall will be scheduled by Xen).
  93.325 +     * 
  93.326 +     * To expedite scanning of pending notifications, any 0->1 pending
  93.327 +     * transition on an unmasked channel causes a corresponding bit in a
  93.328 +     * 32-bit selector to be set. Each bit in the selector covers a 32-bit
  93.329 +     * word in the PENDING bitfield array.
  93.330 +     */
  93.331 +    u32 evtchn_pending[32];             /*   4 */
  93.332 +    u32 evtchn_pending_sel;             /* 132 */
  93.333 +    u32 evtchn_mask[32];                /* 136 */
  93.334 +
  93.335 +    /*
  93.336 +     * Time: The following abstractions are exposed: System Time, Clock Time,
  93.337 +     * Domain Virtual Time. Domains can access Cycle counter time directly.
  93.338 +     */
  93.339 +    u64                cpu_freq;        /* 264: CPU frequency (Hz).          */
  93.340 +
  93.341 +    /*
  93.342 +     * The following values are updated periodically (and not necessarily
  93.343 +     * atomically!). The guest OS detects this because 'time_version1' is
  93.344 +     * incremented just before updating these values, and 'time_version2' is
  93.345 +     * incremented immediately after. See the Xen-specific Linux code for an
  93.346 +     * example of how to read these values safely (arch/xen/kernel/time.c).
  93.347 +     */
  93.348 +    u32                time_version1;   /* 272 */
  93.349 +    u32                time_version2;   /* 276 */
  93.350 +    tsc_timestamp_t    tsc_timestamp;   /* TSC at last update of time vals.  */
  93.351 +    u64                system_time;     /* Time, in nanosecs, since boot.    */
  93.352 +    u32                wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
  93.353 +    u32                wc_usec;         /* Usecs 00:00:00 UTC, Jan 1, 1970.  */
  93.354 +    u64                domain_time;     /* Domain virtual time, in nanosecs. */
  93.355 +
  93.356 +    /*
  93.357 +     * Timeout values:
  93.358 +     * Allow a domain to specify a timeout value in system time and 
  93.359 +     * domain virtual time.
  93.360 +     */
  93.361 +    u64                wall_timeout;    /* 312 */
  93.362 +    u64                domain_timeout;  /* 320 */
  93.363 +
  93.364 +    arch_shared_info_t arch;
  93.365 +
  93.366 +} PACKED shared_info_t;
  93.367 +
  93.368 +/*
  93.369 + * Start-of-day memory layout for the initial domain (DOM0):
  93.370 + *  1. The domain is started within contiguous virtual-memory region.
  93.371 + *  2. The contiguous region begins and ends on an aligned 4MB boundary.
  93.372 + *  3. The region start corresponds to the load address of the OS image.
  93.373 + *     If the load address is not 4MB aligned then the address is rounded down.
  93.374 + *  4. This the order of bootstrap elements in the initial virtual region:
  93.375 + *      a. relocated kernel image
  93.376 + *      b. initial ram disk              [mod_start, mod_len]
  93.377 + *      c. list of allocated page frames [mfn_list, nr_pages]
  93.378 + *      d. bootstrap page tables         [pt_base, CR3 (x86)]
  93.379 + *      e. start_info_t structure        [register ESI (x86)]
  93.380 + *      f. bootstrap stack               [register ESP (x86)]
  93.381 + *  5. Bootstrap elements are packed together, but each is 4kB-aligned.
  93.382 + *  6. The initial ram disk may be omitted.
  93.383 + *  7. The list of page frames forms a contiguous 'pseudo-physical' memory
  93.384 + *     layout for the domain. In particular, the bootstrap virtual-memory
  93.385 + *     region is a 1:1 mapping to the first section of the pseudo-physical map.
  93.386 + *  8. All bootstrap elements are mapped read-writable for the guest OS. The
  93.387 + *     only exception is the bootstrap page table, which is mapped read-only.
  93.388 + *  9. There is guaranteed to be at least 512kB padding after the final
  93.389 + *     bootstrap element. If necessary, the bootstrap virtual region is
  93.390 + *     extended by an extra 4MB to ensure this.
  93.391 + */
  93.392 +
  93.393 +#define MAX_CMDLINE 256
  93.394 +typedef struct {
  93.395 +    /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.     */
  93.396 +    memory_t nr_pages;        /*  0: Total pages allocated to this domain. */
  93.397 +    _MEMORY_PADDING(A);
  93.398 +    memory_t shared_info;     /*  8: MACHINE address of shared info struct.*/
  93.399 +    _MEMORY_PADDING(B);
  93.400 +    u32      flags;           /* 16: SIF_xxx flags.                        */
  93.401 +    u16      domain_controller_evtchn; /* 20 */
  93.402 +    u16      __pad;
  93.403 +    /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME).      */
  93.404 +    memory_t pt_base;         /* 24: VIRTUAL address of page directory.    */
  93.405 +    _MEMORY_PADDING(C);
  93.406 +    memory_t nr_pt_frames;    /* 32: Number of bootstrap p.t. frames.      */
  93.407 +    _MEMORY_PADDING(D);
  93.408 +    memory_t mfn_list;        /* 40: VIRTUAL address of page-frame list.   */
  93.409 +    _MEMORY_PADDING(E);
  93.410 +    memory_t mod_start;       /* 48: VIRTUAL address of pre-loaded module. */
  93.411 +    _MEMORY_PADDING(F);
  93.412 +    memory_t mod_len;         /* 56: Size (bytes) of pre-loaded module.    */
  93.413 +    _MEMORY_PADDING(G);
  93.414 +    u8 cmd_line[MAX_CMDLINE]; /* 64 */
  93.415 +} PACKED start_info_t; /* 320 bytes */
  93.416 +
  93.417 +/* These flags are passed in the 'flags' field of start_info_t. */
  93.418 +#define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
  93.419 +#define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
  93.420 +#define SIF_BLK_BE_DOMAIN (1<<4)  /* Is this a block backend domain? */
  93.421 +#define SIF_NET_BE_DOMAIN (1<<5)  /* Is this a net backend domain? */
  93.422 +
  93.423 +/* For use in guest OSes. */
  93.424 +extern shared_info_t *HYPERVISOR_shared_info;
  93.425 +
  93.426 +#endif /* !__ASSEMBLY__ */
  93.427 +
  93.428 +#endif /* __XEN_PUBLIC_XEN_H__ */
    94.1 --- a/xen/include/xen/grant_table.h	Sun Oct 31 08:22:21 2004 +0000
    94.2 +++ b/xen/include/xen/grant_table.h	Sun Oct 31 09:56:36 2004 +0000
    94.3 @@ -26,7 +26,7 @@
    94.4  
    94.5  #include <xen/config.h>
    94.6  #include <xen/mm.h>
    94.7 -#include <hypervisor-ifs/grant_table.h>
    94.8 +#include <public/grant_table.h>
    94.9  
   94.10  /* Active grant entry - used for shadowing GTF_permit_access grants. */
   94.11  typedef struct {
   94.12 @@ -68,7 +68,7 @@ typedef struct {
   94.13  
   94.14  /* Per-domain grant information. */
   94.15  typedef struct {
   94.16 -    /* Shared grant table (see include/hypervisor-ifs/grant_table.h). */
   94.17 +    /* Shared grant table (see include/public/grant_table.h). */
   94.18      grant_entry_t        *shared;
   94.19      /* Active grant table. */
   94.20      active_grant_entry_t *active;
    95.1 --- a/xen/include/xen/sched.h	Sun Oct 31 08:22:21 2004 +0000
    95.2 +++ b/xen/include/xen/sched.h	Sun Oct 31 09:56:36 2004 +0000
    95.3 @@ -10,8 +10,8 @@
    95.4  #include <xen/smp.h>
    95.5  #include <asm/page.h>
    95.6  #include <asm/processor.h>
    95.7 -#include <hypervisor-ifs/hypervisor-if.h>
    95.8 -#include <hypervisor-ifs/dom0_ops.h>
    95.9 +#include <public/xen.h>
   95.10 +#include <public/dom0_ops.h>
   95.11  #include <xen/list.h>
   95.12  #include <xen/time.h>
   95.13  #include <xen/ac_timer.h>
    96.1 --- a/xen/include/xen/time.h	Sun Oct 31 08:22:21 2004 +0000
    96.2 +++ b/xen/include/xen/time.h	Sun Oct 31 09:56:36 2004 +0000
    96.3 @@ -28,7 +28,7 @@
    96.4  #define __XEN_TIME_H__
    96.5  
    96.6  #include <xen/types.h>
    96.7 -#include <hypervisor-ifs/hypervisor-if.h>
    96.8 +#include <public/xen.h>
    96.9  
   96.10  extern int init_xen_time();
   96.11  
    97.1 --- a/xen/include/xen/trace.h	Sun Oct 31 08:22:21 2004 +0000
    97.2 +++ b/xen/include/xen/trace.h	Sun Oct 31 09:56:36 2004 +0000
    97.3 @@ -15,13 +15,13 @@
    97.4   * Access to the trace buffers is via a dom0 hypervisor op and analysis of
    97.5   * trace buffer contents can then be performed using a userland tool.
    97.6   *
    97.7 - * See also common/trace.c and the dom0 op in include/hypervisor-ifs/dom0_ops.h
    97.8 + * See also common/trace.c and the dom0 op in include/public/dom0_ops.h
    97.9   */
   97.10  
   97.11  #ifndef __XEN_TRACE_H__
   97.12  #define __XEN_TRACE_H__
   97.13  
   97.14 -#include <hypervisor-ifs/trace.h>
   97.15 +#include <public/trace.h>
   97.16  
   97.17  #ifdef TRACE_BUFFER
   97.18  
   97.19 @@ -32,7 +32,7 @@
   97.20  #include <asm/atomic.h>
   97.21  #include <asm/current.h>
   97.22  #include <asm/msr.h>
   97.23 -#include <hypervisor-ifs/dom0_ops.h>
   97.24 +#include <public/dom0_ops.h>
   97.25  
   97.26  /* Used to initialise trace buffer functionality */
   97.27  void init_trace_bufs(void);