diff options
Diffstat (limited to 'linux-headers/include/xen')
-rw-r--r-- | linux-headers/include/xen/..install.cmd | 2 | ||||
-rw-r--r-- | linux-headers/include/xen/evtchn.h | 1 | ||||
-rw-r--r-- | linux-headers/include/xen/gntdev.h | 107 | ||||
-rw-r--r-- | linux-headers/include/xen/privcmd.h | 12 |
4 files changed, 121 insertions, 1 deletions
diff --git a/linux-headers/include/xen/..install.cmd b/linux-headers/include/xen/..install.cmd index f5a5f39..05f4ae7 100644 --- a/linux-headers/include/xen/..install.cmd +++ b/linux-headers/include/xen/..install.cmd @@ -1 +1 @@ -cmd_/scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/xen/.install := /bin/sh scripts/headers_install.sh /scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/xen ./include/uapi/xen privcmd.h gntalloc.h gntdev.h evtchn.h; /bin/sh scripts/headers_install.sh /scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/xen ./include/generated/uapi/xen ; touch /scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/xen/.install +cmd_/home/users/kito/riscv-gnu-toolchain-workspace/riscv-gnu-toolchain/linux/install_hdr/include/xen/.install := /bin/sh scripts/headers_install.sh /home/users/kito/riscv-gnu-toolchain-workspace/riscv-gnu-toolchain/linux/install_hdr/include/xen ./include/uapi/xen privcmd.h gntalloc.h gntdev.h evtchn.h; /bin/sh scripts/headers_install.sh /home/users/kito/riscv-gnu-toolchain-workspace/riscv-gnu-toolchain/linux/install_hdr/include/xen ./include/generated/uapi/xen ; touch /home/users/kito/riscv-gnu-toolchain-workspace/riscv-gnu-toolchain/linux/install_hdr/include/xen/.install diff --git a/linux-headers/include/xen/evtchn.h b/linux-headers/include/xen/evtchn.h index cb4aa4b..7fbf732 100644 --- a/linux-headers/include/xen/evtchn.h +++ b/linux-headers/include/xen/evtchn.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */ /****************************************************************************** * evtchn.h * diff --git a/linux-headers/include/xen/gntdev.h b/linux-headers/include/xen/gntdev.h index 361c9e0..2b79b49 100644 --- a/linux-headers/include/xen/gntdev.h +++ b/linux-headers/include/xen/gntdev.h @@ -1,9 +1,11 @@ +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */ /****************************************************************************** * gntdev.h * * Interface to /dev/xen/gntdev. * * Copyright (c) 2007, D G Murray + * Copyright (c) 2018, Oleksandr Andrushchenko, EPAM Systems Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 @@ -199,4 +201,109 @@ struct ioctl_gntdev_grant_copy { /* Send an interrupt on the indicated event channel */ #define UNMAP_NOTIFY_SEND_EVENT 0x2 +/* + * Flags to be used while requesting memory mapping's backing storage + * to be allocated with DMA API. + */ + +/* + * The buffer is backed with memory allocated with dma_alloc_wc. + */ +#define GNTDEV_DMA_FLAG_WC (1 << 0) + +/* + * The buffer is backed with memory allocated with dma_alloc_coherent. + */ +#define GNTDEV_DMA_FLAG_COHERENT (1 << 1) + +/* + * Create a dma-buf [1] from grant references @refs of count @count provided + * by the foreign domain @domid with flags @flags. + * + * By default dma-buf is backed by system memory pages, but by providing + * one of the GNTDEV_DMA_FLAG_XXX flags it can also be created as + * a DMA write-combine or coherent buffer, e.g. allocated with dma_alloc_wc/ + * dma_alloc_coherent. + * + * Returns 0 if dma-buf was successfully created and the corresponding + * dma-buf's file descriptor is returned in @fd. + * + * [1] Documentation/driver-api/dma-buf.rst + */ + +#define IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS \ + _IOC(_IOC_NONE, 'G', 9, \ + sizeof(struct ioctl_gntdev_dmabuf_exp_from_refs)) +struct ioctl_gntdev_dmabuf_exp_from_refs { + /* IN parameters. */ + /* Specific options for this dma-buf: see GNTDEV_DMA_FLAG_XXX. */ + __u32 flags; + /* Number of grant references in @refs array. */ + __u32 count; + /* OUT parameters. */ + /* File descriptor of the dma-buf. */ + __u32 fd; + /* The domain ID of the grant references to be mapped. */ + __u32 domid; + /* Variable IN parameter. */ + /* Array of grant references of size @count. */ + __u32 refs[1]; +}; + +/* + * This will block until the dma-buf with the file descriptor @fd is + * released. This is only valid for buffers created with + * IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS. + * + * If within @wait_to_ms milliseconds the buffer is not released + * then -ETIMEDOUT error is returned. + * If the buffer with the file descriptor @fd does not exist or has already + * been released, then -ENOENT is returned. For valid file descriptors + * this must not be treated as error. + */ +#define IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED \ + _IOC(_IOC_NONE, 'G', 10, \ + sizeof(struct ioctl_gntdev_dmabuf_exp_wait_released)) +struct ioctl_gntdev_dmabuf_exp_wait_released { + /* IN parameters */ + __u32 fd; + __u32 wait_to_ms; +}; + +/* + * Import a dma-buf with file descriptor @fd and export granted references + * to the pages of that dma-buf into array @refs of size @count. + */ +#define IOCTL_GNTDEV_DMABUF_IMP_TO_REFS \ + _IOC(_IOC_NONE, 'G', 11, \ + sizeof(struct ioctl_gntdev_dmabuf_imp_to_refs)) +struct ioctl_gntdev_dmabuf_imp_to_refs { + /* IN parameters. */ + /* File descriptor of the dma-buf. */ + __u32 fd; + /* Number of grant references in @refs array. */ + __u32 count; + /* The domain ID for which references to be granted. */ + __u32 domid; + /* Reserved - must be zero. */ + __u32 reserved; + /* OUT parameters. */ + /* Array of grant references of size @count. */ + __u32 refs[1]; +}; + +/* + * This will close all references to the imported buffer with file descriptor + * @fd, so it can be released by the owner. This is only valid for buffers + * created with IOCTL_GNTDEV_DMABUF_IMP_TO_REFS. + */ +#define IOCTL_GNTDEV_DMABUF_IMP_RELEASE \ + _IOC(_IOC_NONE, 'G', 12, \ + sizeof(struct ioctl_gntdev_dmabuf_imp_release)) +struct ioctl_gntdev_dmabuf_imp_release { + /* IN parameters */ + __u32 fd; + __u32 reserved; +}; + #endif /* __LINUX_PUBLIC_GNTDEV_H__ */ diff --git a/linux-headers/include/xen/privcmd.h b/linux-headers/include/xen/privcmd.h index 97214ac..b1024f1 100644 --- a/linux-headers/include/xen/privcmd.h +++ b/linux-headers/include/xen/privcmd.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */ /****************************************************************************** * privcmd.h * @@ -88,6 +89,15 @@ struct privcmd_dm_op { const struct privcmd_dm_op_buf *ubufs; }; +struct privcmd_mmap_resource { + domid_t dom; + __u32 type; + __u32 id; + __u32 idx; + __u64 num; + __u64 addr; +}; + /* * @cmd: IOCTL_PRIVCMD_HYPERCALL * @arg: &privcmd_hypercall_t @@ -113,5 +123,7 @@ struct privcmd_dm_op { _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op)) #define IOCTL_PRIVCMD_RESTRICT \ _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t)) +#define IOCTL_PRIVCMD_MMAP_RESOURCE \ + _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource)) #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ |