Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/xen
File: gntdev.h
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */
[0] Fix | Delete
/******************************************************************************
[1] Fix | Delete
* gntdev.h
[2] Fix | Delete
*
[3] Fix | Delete
* Interface to /dev/xen/gntdev.
[4] Fix | Delete
*
[5] Fix | Delete
* Copyright (c) 2007, D G Murray
[6] Fix | Delete
*
[7] Fix | Delete
* This program is free software; you can redistribute it and/or
[8] Fix | Delete
* modify it under the terms of the GNU General Public License version 2
[9] Fix | Delete
* as published by the Free Software Foundation; or, when distributed
[10] Fix | Delete
* separately from the Linux kernel or incorporated into other
[11] Fix | Delete
* software packages, subject to the following license:
[12] Fix | Delete
*
[13] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining a copy
[14] Fix | Delete
* of this source file (the "Software"), to deal in the Software without
[15] Fix | Delete
* restriction, including without limitation the rights to use, copy, modify,
[16] Fix | Delete
* merge, publish, distribute, sublicense, and/or sell copies of the Software,
[17] Fix | Delete
* and to permit persons to whom the Software is furnished to do so, subject to
[18] Fix | Delete
* the following conditions:
[19] Fix | Delete
*
[20] Fix | Delete
* The above copyright notice and this permission notice shall be included in
[21] Fix | Delete
* all copies or substantial portions of the Software.
[22] Fix | Delete
*
[23] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[24] Fix | Delete
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[25] Fix | Delete
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[26] Fix | Delete
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
[27] Fix | Delete
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
[28] Fix | Delete
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
[29] Fix | Delete
* IN THE SOFTWARE.
[30] Fix | Delete
*/
[31] Fix | Delete
[32] Fix | Delete
#ifndef __LINUX_PUBLIC_GNTDEV_H__
[33] Fix | Delete
#define __LINUX_PUBLIC_GNTDEV_H__
[34] Fix | Delete
[35] Fix | Delete
#include <linux/types.h>
[36] Fix | Delete
[37] Fix | Delete
struct ioctl_gntdev_grant_ref {
[38] Fix | Delete
/* The domain ID of the grant to be mapped. */
[39] Fix | Delete
__u32 domid;
[40] Fix | Delete
/* The grant reference of the grant to be mapped. */
[41] Fix | Delete
__u32 ref;
[42] Fix | Delete
};
[43] Fix | Delete
[44] Fix | Delete
/*
[45] Fix | Delete
* Inserts the grant references into the mapping table of an instance
[46] Fix | Delete
* of gntdev. N.B. This does not perform the mapping, which is deferred
[47] Fix | Delete
* until mmap() is called with @index as the offset.
[48] Fix | Delete
*/
[49] Fix | Delete
#define IOCTL_GNTDEV_MAP_GRANT_REF \
[50] Fix | Delete
_IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
[51] Fix | Delete
struct ioctl_gntdev_map_grant_ref {
[52] Fix | Delete
/* IN parameters */
[53] Fix | Delete
/* The number of grants to be mapped. */
[54] Fix | Delete
__u32 count;
[55] Fix | Delete
__u32 pad;
[56] Fix | Delete
/* OUT parameters */
[57] Fix | Delete
/* The offset to be used on a subsequent call to mmap(). */
[58] Fix | Delete
__u64 index;
[59] Fix | Delete
/* Variable IN parameter. */
[60] Fix | Delete
/* Array of grant references, of size @count. */
[61] Fix | Delete
struct ioctl_gntdev_grant_ref refs[1];
[62] Fix | Delete
};
[63] Fix | Delete
[64] Fix | Delete
/*
[65] Fix | Delete
* Removes the grant references from the mapping table of an instance of
[66] Fix | Delete
* of gntdev. N.B. munmap() must be called on the relevant virtual address(es)
[67] Fix | Delete
* before this ioctl is called, or an error will result.
[68] Fix | Delete
*/
[69] Fix | Delete
#define IOCTL_GNTDEV_UNMAP_GRANT_REF \
[70] Fix | Delete
_IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))
[71] Fix | Delete
struct ioctl_gntdev_unmap_grant_ref {
[72] Fix | Delete
/* IN parameters */
[73] Fix | Delete
/* The offset was returned by the corresponding map operation. */
[74] Fix | Delete
__u64 index;
[75] Fix | Delete
/* The number of pages to be unmapped. */
[76] Fix | Delete
__u32 count;
[77] Fix | Delete
__u32 pad;
[78] Fix | Delete
};
[79] Fix | Delete
[80] Fix | Delete
/*
[81] Fix | Delete
* Returns the offset in the driver's address space that corresponds
[82] Fix | Delete
* to @vaddr. This can be used to perform a munmap(), followed by an
[83] Fix | Delete
* UNMAP_GRANT_REF ioctl, where no state about the offset is retained by
[84] Fix | Delete
* the caller. The number of pages that were allocated at the same time as
[85] Fix | Delete
* @vaddr is returned in @count.
[86] Fix | Delete
*
[87] Fix | Delete
* N.B. Where more than one page has been mapped into a contiguous range, the
[88] Fix | Delete
* supplied @vaddr must correspond to the start of the range; otherwise
[89] Fix | Delete
* an error will result. It is only possible to munmap() the entire
[90] Fix | Delete
* contiguously-allocated range at once, and not any subrange thereof.
[91] Fix | Delete
*/
[92] Fix | Delete
#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \
[93] Fix | Delete
_IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
[94] Fix | Delete
struct ioctl_gntdev_get_offset_for_vaddr {
[95] Fix | Delete
/* IN parameters */
[96] Fix | Delete
/* The virtual address of the first mapped page in a range. */
[97] Fix | Delete
__u64 vaddr;
[98] Fix | Delete
/* OUT parameters */
[99] Fix | Delete
/* The offset that was used in the initial mmap() operation. */
[100] Fix | Delete
__u64 offset;
[101] Fix | Delete
/* The number of pages mapped in the VM area that begins at @vaddr. */
[102] Fix | Delete
__u32 count;
[103] Fix | Delete
__u32 pad;
[104] Fix | Delete
};
[105] Fix | Delete
[106] Fix | Delete
/*
[107] Fix | Delete
* Sets the maximum number of grants that may mapped at once by this gntdev
[108] Fix | Delete
* instance.
[109] Fix | Delete
*
[110] Fix | Delete
* N.B. This must be called before any other ioctl is performed on the device.
[111] Fix | Delete
*/
[112] Fix | Delete
#define IOCTL_GNTDEV_SET_MAX_GRANTS \
[113] Fix | Delete
_IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants))
[114] Fix | Delete
struct ioctl_gntdev_set_max_grants {
[115] Fix | Delete
/* IN parameter */
[116] Fix | Delete
/* The maximum number of grants that may be mapped at once. */
[117] Fix | Delete
__u32 count;
[118] Fix | Delete
};
[119] Fix | Delete
[120] Fix | Delete
/*
[121] Fix | Delete
* Sets up an unmap notification within the page, so that the other side can do
[122] Fix | Delete
* cleanup if this side crashes. Required to implement cross-domain robust
[123] Fix | Delete
* mutexes or close notification on communication channels.
[124] Fix | Delete
*
[125] Fix | Delete
* Each mapped page only supports one notification; multiple calls referring to
[126] Fix | Delete
* the same page overwrite the previous notification. You must clear the
[127] Fix | Delete
* notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
[128] Fix | Delete
* to occur.
[129] Fix | Delete
*/
[130] Fix | Delete
#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \
[131] Fix | Delete
_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
[132] Fix | Delete
struct ioctl_gntdev_unmap_notify {
[133] Fix | Delete
/* IN parameters */
[134] Fix | Delete
/* Offset in the file descriptor for a byte within the page (same as
[135] Fix | Delete
* used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
[136] Fix | Delete
* be cleared. Otherwise, it can be any byte in the page whose
[137] Fix | Delete
* notification we are adjusting.
[138] Fix | Delete
*/
[139] Fix | Delete
__u64 index;
[140] Fix | Delete
/* Action(s) to take on unmap */
[141] Fix | Delete
__u32 action;
[142] Fix | Delete
/* Event channel to notify */
[143] Fix | Delete
__u32 event_channel_port;
[144] Fix | Delete
};
[145] Fix | Delete
[146] Fix | Delete
struct gntdev_grant_copy_segment {
[147] Fix | Delete
union {
[148] Fix | Delete
void *virt;
[149] Fix | Delete
struct {
[150] Fix | Delete
grant_ref_t ref;
[151] Fix | Delete
__u16 offset;
[152] Fix | Delete
domid_t domid;
[153] Fix | Delete
} foreign;
[154] Fix | Delete
} source, dest;
[155] Fix | Delete
__u16 len;
[156] Fix | Delete
[157] Fix | Delete
__u16 flags; /* GNTCOPY_* */
[158] Fix | Delete
__s16 status; /* GNTST_* */
[159] Fix | Delete
};
[160] Fix | Delete
[161] Fix | Delete
/*
[162] Fix | Delete
* Copy between grant references and local buffers.
[163] Fix | Delete
*
[164] Fix | Delete
* The copy is split into @count @segments, each of which can copy
[165] Fix | Delete
* to/from one grant reference.
[166] Fix | Delete
*
[167] Fix | Delete
* Each segment is similar to struct gnttab_copy in the hypervisor ABI
[168] Fix | Delete
* except the local buffer is specified using a virtual address
[169] Fix | Delete
* (instead of a GFN and offset).
[170] Fix | Delete
*
[171] Fix | Delete
* The local buffer may cross a Xen page boundary -- the driver will
[172] Fix | Delete
* split segments into multiple ops if required.
[173] Fix | Delete
*
[174] Fix | Delete
* Returns 0 if all segments have been processed and @status in each
[175] Fix | Delete
* segment is valid. Note that one or more segments may have failed
[176] Fix | Delete
* (status != GNTST_okay).
[177] Fix | Delete
*
[178] Fix | Delete
* If the driver had to split a segment into two or more ops, @status
[179] Fix | Delete
* includes the status of the first failed op for that segment (or
[180] Fix | Delete
* GNTST_okay if all ops were successful).
[181] Fix | Delete
*
[182] Fix | Delete
* If -1 is returned, the status of all segments is undefined.
[183] Fix | Delete
*
[184] Fix | Delete
* EINVAL: A segment has local buffers for both source and
[185] Fix | Delete
* destination.
[186] Fix | Delete
* EINVAL: A segment crosses the boundary of a foreign page.
[187] Fix | Delete
* EFAULT: A segment's local buffer is not accessible.
[188] Fix | Delete
*/
[189] Fix | Delete
#define IOCTL_GNTDEV_GRANT_COPY \
[190] Fix | Delete
_IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy))
[191] Fix | Delete
struct ioctl_gntdev_grant_copy {
[192] Fix | Delete
unsigned int count;
[193] Fix | Delete
struct gntdev_grant_copy_segment *segments;
[194] Fix | Delete
};
[195] Fix | Delete
[196] Fix | Delete
/* Clear (set to zero) the byte specified by index */
[197] Fix | Delete
#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
[198] Fix | Delete
/* Send an interrupt on the indicated event channel */
[199] Fix | Delete
#define UNMAP_NOTIFY_SEND_EVENT 0x2
[200] Fix | Delete
[201] Fix | Delete
#endif /* __LINUX_PUBLIC_GNTDEV_H__ */
[202] Fix | Delete
[203] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function