direct-io.hg

changeset 15260:de47ca8be7fe

Include Solaris kernel headers

Add the Solaris kernel headers used be the userspace tools to the
distribution. The same setup as used by Linux is taken. We modify the
Linux kernel headers to also install in /usr/include/xen/sys/ -
without a kernel-neutral path, it can make using the headers very
difficult, and encourages errors.

Signed-off-by: John Levon <john.levon@sun.com>
author kfraser@localhost.localdomain
date Mon Jun 11 15:50:35 2007 +0100 (2007-06-11)
parents 35e38c9048c8
children 112703751b19 154878b6ec4b
files tools/Rules.mk tools/guest-headers/Makefile tools/include/SunOS/evtchn.h tools/include/SunOS/privcmd.h tools/include/SunOS/xenbus.h
line diff
     1.1 --- a/tools/Rules.mk	Mon Jun 11 15:44:48 2007 +0100
     1.2 +++ b/tools/Rules.mk	Mon Jun 11 15:50:35 2007 +0100
     1.3 @@ -37,18 +37,12 @@ check-$(CONFIG_X86) = $(call cc-ver-chec
     1.4  %.o: %.cc
     1.5  	$(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
     1.6  
     1.7 -.PHONY: mk-symlinks mk-symlinks-xen mk-symlinks-$(XEN_OS)
     1.8 -
     1.9 -mk-symlinks-SunOS:
    1.10 +.PHONY: mk-symlinks
    1.11  
    1.12 -mk-symlinks-Linux: LINUX_ROOT=$(XEN_ROOT)/tools/include/Linux
    1.13 -mk-symlinks-Linux:
    1.14 -	mkdir -p xen/linux
    1.15 -	( cd xen/linux && \
    1.16 -	  ln -sf ../../$(LINUX_ROOT)/*.h . )
    1.17 -	( cd xen && rm -f sys && ln -sf linux sys )
    1.18 -
    1.19 -mk-symlinks-xen:
    1.20 +mk-symlinks:
    1.21 +	mkdir -p xen/sys
    1.22 +	( cd xen/sys && \
    1.23 +	  ln -sf ../../$(XEN_ROOT)/tools/include/$(XEN_OS)/*.h . )
    1.24  	mkdir -p xen
    1.25  	( cd xen && ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
    1.26  	mkdir -p xen/hvm
    1.27 @@ -62,5 +56,3 @@ mk-symlinks-xen:
    1.28  	( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/reference.size . )
    1.29  	( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/*.py . )
    1.30  	$(MAKE) -C xen/foreign
    1.31 -
    1.32 -mk-symlinks: mk-symlinks-xen mk-symlinks-$(XEN_OS)
     2.1 --- a/tools/guest-headers/Makefile	Mon Jun 11 15:44:48 2007 +0100
     2.2 +++ b/tools/guest-headers/Makefile	Mon Jun 11 15:50:35 2007 +0100
     2.3 @@ -7,15 +7,11 @@ all:
     2.4  .PHONY: check
     2.5  check:
     2.6  
     2.7 -.PHONY: install install-Linux install-SunOS
     2.8 +.PHONY: install
     2.9  
    2.10 -install-Linux:
    2.11 -	mkdir -p $(DESTDIR)/usr/include/xen/linux
    2.12 -	$(INSTALL_DATA) $(XEN_ROOT)/tools/include/Linux/*.h $(DESTDIR)/usr/include/xen/linux
    2.13 -
    2.14 -install-SunOS:
    2.15 -
    2.16 -install: install-$(XEN_OS)
    2.17 +install:
    2.18 +	mkdir -p $(DESTDIR)/usr/include/xen/sys
    2.19 +	$(INSTALL_DATA) $(XEN_ROOT)/tools/include/$(XEN_OS)/*.h $(DESTDIR)/usr/include/xen/sys
    2.20  
    2.21  .PHONY: clean
    2.22  clean:
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/include/SunOS/evtchn.h	Mon Jun 11 15:50:35 2007 +0100
     3.3 @@ -0,0 +1,94 @@
     3.4 +/******************************************************************************
     3.5 + * evtchn.h
     3.6 + * 
     3.7 + * Interface to /dev/xen/evtchn.
     3.8 + * 
     3.9 + * Copyright (c) 2003-2005, K A Fraser
    3.10 + * 
    3.11 + * This file may be distributed separately from the Linux kernel, or
    3.12 + * incorporated into other software packages, subject to the following license:
    3.13 + * 
    3.14 + * Permission is hereby granted, free of charge, to any person obtaining a copy
    3.15 + * of this source file (the "Software"), to deal in the Software without
    3.16 + * restriction, including without limitation the rights to use, copy, modify,
    3.17 + * merge, publish, distribute, sublicense, and/or sell copies of the Software,
    3.18 + * and to permit persons to whom the Software is furnished to do so, subject to
    3.19 + * the following conditions:
    3.20 + * 
    3.21 + * The above copyright notice and this permission notice shall be included in
    3.22 + * all copies or substantial portions of the Software.
    3.23 + * 
    3.24 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    3.25 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    3.26 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    3.27 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    3.28 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    3.29 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    3.30 + * IN THE SOFTWARE.
    3.31 + */
    3.32 +
    3.33 +#ifndef _XEN_SYS_EVTCHN_H
    3.34 +#define _XEN_SYS_EVTCHN_H
    3.35 +
    3.36 +#define	_IOC_NONE	0
    3.37 +#define	_IOC(flag, letter, inum, size)	((letter) << 8 | (inum))
    3.38 +
    3.39 +/*
    3.40 + * Bind a fresh port to VIRQ @virq.
    3.41 + * Return allocated port.
    3.42 + */
    3.43 +#define IOCTL_EVTCHN_BIND_VIRQ				\
    3.44 +	_IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq))
    3.45 +struct ioctl_evtchn_bind_virq {
    3.46 +	unsigned int virq;
    3.47 +};
    3.48 +
    3.49 +/*
    3.50 + * Bind a fresh port to remote <@remote_domain, @remote_port>.
    3.51 + * Return allocated port.
    3.52 + */
    3.53 +#define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
    3.54 +	_IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain))
    3.55 +struct ioctl_evtchn_bind_interdomain {
    3.56 +	unsigned int remote_domain, remote_port;
    3.57 +};
    3.58 +
    3.59 +/*
    3.60 + * Allocate a fresh port for binding to @remote_domain.
    3.61 + * Return allocated port.
    3.62 + */
    3.63 +#define IOCTL_EVTCHN_BIND_UNBOUND_PORT                  \
    3.64 +        _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port))
    3.65 +struct ioctl_evtchn_bind_unbound_port {
    3.66 +        unsigned int remote_domain;
    3.67 +};
    3.68 +
    3.69 +/*
    3.70 + * Unbind previously allocated @port.
    3.71 + */
    3.72 +#define IOCTL_EVTCHN_UNBIND				\
    3.73 +	_IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind))
    3.74 +struct ioctl_evtchn_unbind {
    3.75 +	unsigned int port;
    3.76 +};
    3.77 +
    3.78 +/*
    3.79 + * Notify the given @port.
    3.80 + */
    3.81 +#define IOCTL_EVTCHN_NOTIFY				\
    3.82 +	_IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify))
    3.83 +struct ioctl_evtchn_notify {
    3.84 +	unsigned int port;
    3.85 +};
    3.86 +
    3.87 +#endif /* _XEN_SYS_EVTCHN_H */
    3.88 +
    3.89 +/*
    3.90 + * Local variables:
    3.91 + *  c-file-style: "solaris"
    3.92 + *  indent-tabs-mode: t
    3.93 + *  c-indent-level: 8
    3.94 + *  c-basic-offset: 8
    3.95 + *  tab-width: 8
    3.96 + * End:
    3.97 + */
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/include/SunOS/privcmd.h	Mon Jun 11 15:50:35 2007 +0100
     4.3 @@ -0,0 +1,85 @@
     4.4 +/*
     4.5 + * Copyright (c) 2003-2005, K A Fraser
     4.6 + *
     4.7 + * This file may be distributed separately from the Linux kernel, or
     4.8 + * incorporated into other software packages, subject to the following license:
     4.9 + *
    4.10 + * Permission is hereby granted, free of charge, to any person obtaining a copy
    4.11 + * of this source file (the "Software"), to deal in the Software without
    4.12 + * restriction, including without limitation the rights to use, copy, modify,
    4.13 + * merge, publish, distribute, sublicense, and/or sell copies of the Software,
    4.14 + * and to permit persons to whom the Software is furnished to do so, subject to
    4.15 + * the following conditions:
    4.16 + *
    4.17 + * The above copyright notice and this permission notice shall be included in
    4.18 + * all copies or substantial portions of the Software.
    4.19 + *
    4.20 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    4.21 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    4.22 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    4.23 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    4.24 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    4.25 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    4.26 + * IN THE SOFTWARE.
    4.27 + */
    4.28 +
    4.29 +/*
    4.30 + * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    4.31 + * Use is subject to license terms.
    4.32 + */
    4.33 +
    4.34 +#ifndef	_XEN_SYS_PRIVCMD_H
    4.35 +#define	_XEN_SYS_PRIVCMD_H
    4.36 +
    4.37 +/*
    4.38 + * WARNING:
    4.39 + *	These numbers and structure are built into the ON privcmd
    4.40 + *	driver, as well as the low-level tools and libraries in
    4.41 + *	the Xen consolidation.
    4.42 + */
    4.43 +
    4.44 +#include <sys/types.h>
    4.45 +
    4.46 +#ifdef __cplusplus
    4.47 +extern "C" {
    4.48 +#endif
    4.49 +
    4.50 +/*
    4.51 + * ioctl numbers and corresponding data structures
    4.52 + */
    4.53 +
    4.54 +#define	__PRIVCMD_IOC			(('p'<<24)|('r'<<16)|('v'<<8))
    4.55 +
    4.56 +#define	IOCTL_PRIVCMD_HYPERCALL		(__PRIVCMD_IOC|0)
    4.57 +#define	IOCTL_PRIVCMD_MMAP		(__PRIVCMD_IOC|1)
    4.58 +#define	IOCTL_PRIVCMD_MMAPBATCH		(__PRIVCMD_IOC|2)
    4.59 +
    4.60 +typedef struct __privcmd_hypercall {
    4.61 +	unsigned long op;
    4.62 +	unsigned long arg[5];
    4.63 +} privcmd_hypercall_t;
    4.64 +
    4.65 +typedef struct __privcmd_mmap_entry {
    4.66 +	unsigned long va;
    4.67 +	unsigned long mfn;
    4.68 +	unsigned long npages;
    4.69 +} privcmd_mmap_entry_t;
    4.70 +
    4.71 +typedef struct __privcmd_mmap {
    4.72 +	int num;
    4.73 +	domid_t dom;	/* target domain */
    4.74 +	privcmd_mmap_entry_t *entry;
    4.75 +} privcmd_mmap_t;
    4.76 +
    4.77 +typedef struct __privcmd_mmapbatch {
    4.78 +	int num;	/* number of pages to populate */
    4.79 +	domid_t dom;	/* target domain */
    4.80 +	unsigned long addr;	  /* virtual address */
    4.81 +	unsigned long *arr;	  /* array of mfns - top nibble set on err */
    4.82 +} privcmd_mmapbatch_t;
    4.83 +
    4.84 +#ifdef __cplusplus
    4.85 +}
    4.86 +#endif
    4.87 +
    4.88 +#endif /* _XEN_SYS_PRIVCMD_H */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/include/SunOS/xenbus.h	Mon Jun 11 15:50:35 2007 +0100
     5.3 @@ -0,0 +1,42 @@
     5.4 +/*
     5.5 + * This file may be distributed separately from the Linux kernel, or
     5.6 + * incorporated into other software packages, subject to the following license:
     5.7 + * 
     5.8 + * Permission is hereby granted, free of charge, to any person obtaining a copy
     5.9 + * of this source file (the "Software"), to deal in the Software without
    5.10 + * restriction, including without limitation the rights to use, copy, modify,
    5.11 + * merge, publish, distribute, sublicense, and/or sell copies of the Software,
    5.12 + * and to permit persons to whom the Software is furnished to do so, subject to
    5.13 + * the following conditions:
    5.14 + * 
    5.15 + * The above copyright notice and this permission notice shall be included in
    5.16 + * all copies or substantial portions of the Software.
    5.17 + * 
    5.18 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    5.19 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    5.20 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    5.21 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    5.22 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    5.23 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    5.24 + * IN THE SOFTWARE.
    5.25 + */
    5.26 +
    5.27 +/*
    5.28 + * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    5.29 + * Use is subject to license terms.
    5.30 + */
    5.31 +
    5.32 +#ifndef _XEN_SYS_XENBUS_H
    5.33 +#define _XEN_SYS_XENBUS_H
    5.34 +
    5.35 +/*
    5.36 + * Return the xenstore event channel.
    5.37 + */
    5.38 +#define	IOCTL_XENBUS_XENSTORE_EVTCHN ('X' << 8)
    5.39 +
    5.40 +/*
    5.41 + * Notify the kernel that the xenstore is up and running
    5.42 + */
    5.43 +#define	IOCTL_XENBUS_NOTIFY_UP ('U' << 8)
    5.44 +
    5.45 +#endif /* _XEN_SYS_XENBUS_H */