1 #ifndef _IPXE_XENGRANT_H 2 #define _IPXE_XENGRANT_H 19 #define XENGRANT_FAIL_RATE 0 62 struct gnttab_get_version *
version ) {
89 static inline __attribute__ (( always_inline ))
struct grant_entry_header *
104 xengrant_v1 (
struct grant_entry_header *
hdr ) {
115 static inline __attribute__ (( always_inline ))
union grant_entry_v2 *
116 xengrant_v2 (
struct grant_entry_header *
hdr ) {
128 struct grant_entry_header *
hdr ) {
130 unsigned int i = ( (
sizeof ( xen->
grant.
table[0] ) /
sizeof ( *
dword ))
145 struct grant_entry_header *
hdr = xengrant_header ( xen,
ref );
176 struct grant_entry_header *
hdr = xengrant_header ( xen,
ref );
178 union grant_entry_v2 *
v2 = xengrant_v2 (
hdr );
201 if (
frame > 0xffffffffUL )
229 unsigned int count );
231 unsigned int count );
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void xengrant_free(struct xen_hypervisor *xen, grant_ref_t *refs, unsigned int count)
Free grant references.
struct golan_inbox_hdr hdr
Message header.
uint16_t readw(volatile uint16_t *io_addr)
Read 16-bit word from memory-mapped device.
unsigned long long uint64_t
static grant_ref_t domid_t unsigned int physaddr_t addr
#define PAGE_SIZE
Page size.
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
#define XENGRANT_FAIL_RATE
Induced failure rate (for testing)
static struct gnttab_set_version * version
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define container_of(ptr, type, field)
Get containing structure.
static __attribute__((always_inline)) int xengrant_query_size(struct xen_hypervisor *xen
Query grant table size.
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
uint16_t count
Number of entries.
struct grant_entry_v1 * table
Grant table entries.
static grant_ref_t domid_t unsigned int subflags
#define __HYPERVISOR_grant_table_op
#define ERANGE
Result too large.
static const char grant_ref_t unsigned int struct io_buffer grant_ref_t * refs
static grant_ref_t domid_t domid
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
#define EAGAIN
Resource temporarily unavailable.
#define GNTTABOP_query_size
union grant_entry_v2 * v2
unsigned int shift
Entry size shift (for later version tables)
struct xen_grant grant
Grant table.
static struct gnttab_query_size * size
size_t len
Total grant table length.
int xengrant_init(struct xen_hypervisor *xen)
Initialise grant table.
int xengrant_alloc(struct xen_hypervisor *xen, grant_ref_t *refs, unsigned int count)
Allocate grant references.
#define GTF_permit_access
static void xengrant_zero(struct xen_hypervisor *xen, struct grant_entry_header *hdr)
Zero grant table entry.
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.
struct xen_hypervisor * xen
Xen hypervisor.