aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/include
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-07-24 14:14:27 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-07-24 14:14:27 +0100
commit7d0b678231c097279f86221eed0138df8badb3a4 (patch)
tree604e5077f1244c24bd113261ee8761db65a89894 /extras/mini-os/include
parentb5d7ddffa7bf654dcb094d9a66ce614657be06f2 (diff)
downloadxen-7d0b678231c097279f86221eed0138df8badb3a4.tar.gz
xen-7d0b678231c097279f86221eed0138df8badb3a4.tar.bz2
xen-7d0b678231c097279f86221eed0138df8badb3a4.zip
minios: grant table map (gntdev) for minios
I've implemented a grant map for mini-os to support the xc_gnttab_*() functions, the equivalent of gntdev in linux. This is useful for my work in putting xenstored in a stub domain. Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Diffstat (limited to 'extras/mini-os/include')
-rw-r--r--extras/mini-os/include/gntmap.h35
-rw-r--r--extras/mini-os/include/lib.h3
2 files changed, 38 insertions, 0 deletions
diff --git a/extras/mini-os/include/gntmap.h b/extras/mini-os/include/gntmap.h
new file mode 100644
index 0000000000..fde53f39b1
--- /dev/null
+++ b/extras/mini-os/include/gntmap.h
@@ -0,0 +1,35 @@
+#ifndef __GNTMAP_H__
+#define __GNTMAP_H__
+
+#include <os.h>
+
+/*
+ * Please consider struct gntmap opaque. If instead you choose to disregard
+ * this message, I insist that you keep an eye out for raptors.
+ */
+struct gntmap {
+ int nentries;
+ struct gntmap_entry *entries;
+};
+
+int
+gntmap_set_max_grants(struct gntmap *map, int count);
+
+int
+gntmap_munmap(struct gntmap *map, unsigned long start_address, int count);
+
+void*
+gntmap_map_grant_refs(struct gntmap *map,
+ uint32_t count,
+ uint32_t *domids,
+ int domids_stride,
+ uint32_t *refs,
+ int writable);
+
+void
+gntmap_init(struct gntmap *map);
+
+void
+gntmap_fini(struct gntmap *map);
+
+#endif /* !__GNTMAP_H__ */
diff --git a/extras/mini-os/include/lib.h b/extras/mini-os/include/lib.h
index b508c38f51..8822dd14a7 100644
--- a/extras/mini-os/include/lib.h
+++ b/extras/mini-os/include/lib.h
@@ -59,6 +59,7 @@
#include <stddef.h>
#include <xen/xen.h>
#include <xen/event_channel.h>
+#include "gntmap.h"
#ifdef HAVE_LIBC
#include <stdio.h>
@@ -138,6 +139,7 @@ enum fd_type {
FTYPE_XENBUS,
FTYPE_XC,
FTYPE_EVTCHN,
+ FTYPE_GNTMAP,
FTYPE_SOCKET,
FTYPE_TAP,
FTYPE_BLK,
@@ -168,6 +170,7 @@ extern struct file {
int bound;
} ports[MAX_EVTCHN_PORTS];
} evtchn;
+ struct gntmap gntmap;
struct {
struct netfront_dev *dev;
} tap;