aboutsummaryrefslogtreecommitdiffstats
path: root/linux-2.6.11-xen-sparse
diff options
context:
space:
mode:
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-06-17 08:47:00 +0000
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-06-17 08:47:00 +0000
commit128fb33d1bdf485fc1641e81deb6d87b589a7f7a (patch)
tree410d92c0997063648db3acff458aaa3dfe3e0850 /linux-2.6.11-xen-sparse
parente7399d6ff4d5783837d1e83792cba7a2be41ece0 (diff)
downloadxen-128fb33d1bdf485fc1641e81deb6d87b589a7f7a.tar.gz
xen-128fb33d1bdf485fc1641e81deb6d87b589a7f7a.tar.bz2
xen-128fb33d1bdf485fc1641e81deb6d87b589a7f7a.zip
bitkeeper revision 1.1713.3.1 (42b28e04xelbNlMIz5vWQQ5_M71w0A)
privcmd.h, privcmd.c: Add IOCTL_PRIVCMD_INITDOMAIN_STORE to setup dom0 xenstore page and event channel. From: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'linux-2.6.11-xen-sparse')
-rw-r--r--linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c30
-rw-r--r--linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h2
2 files changed, 32 insertions, 0 deletions
diff --git a/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c
index 2f9d5fde38..9eea1835b5 100644
--- a/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c
+++ b/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c
@@ -196,6 +196,36 @@ static int privcmd_ioctl(struct inode *inode, struct file *file,
}
break;
+ case IOCTL_PRIVCMD_INITDOMAIN_STORE:
+ {
+ extern int do_xenbus_probe(void*);
+
+ if (xen_start_info.store_evtchn != 0) {
+ ret = -EINVAL;
+ break;
+ }
+
+ /* Allocate page. */
+ xen_start_info.store_page = get_zeroed_page(GFP_KERNEL);
+ if (!xen_start_info.store_page) {
+ ret = -ENOMEM;
+ break;
+ }
+
+ /* We don't refcnt properly, so set reserved on page.
+ * (this allocation is permanent) */
+ SetPageReserved(virt_to_page(xen_start_info.store_page));
+
+ /* Initial connect. Setup channel and page. */
+ xen_start_info.store_evtchn = data;
+ ret = pfn_to_mfn(virt_to_phys((void *)xen_start_info.store_page) >>
+ PAGE_SHIFT);
+
+ /* We'll return then this will wait for daemon to answer */
+ // kthread_run(do_xenbus_probe, NULL, "xenbus_probe");
+ }
+ break;
+
default:
ret = -EINVAL;
break;
diff --git a/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h b/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h
index 9142c6b35d..51d1ce5acf 100644
--- a/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h
+++ b/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h
@@ -84,5 +84,7 @@ typedef struct privcmd_blkmsg
_IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t))
#define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \
_IOC(_IOC_READ, 'P', 4, sizeof(unsigned long))
+#define IOCTL_PRIVCMD_INITDOMAIN_STORE \
+ _IOC(_IOC_READ, 'P', 5, 0)
#endif /* __PRIVCMD_H__ */