Annotation of /trunk/kernel26-xen/patches-2.6.25-r1/1011-2.6.25-xen-Add-empty-xenctrl-module.patch
Parent Directory | Revision Log
Revision 606 -
(hide annotations)
(download)
Thu May 22 23:13:13 2008 UTC (16 years ago) by niro
File size: 4015 byte(s)
Thu May 22 23:13:13 2008 UTC (16 years ago) by niro
File size: 4015 byte(s)
-ver bump to 2.6.25-magellan-r1: - linux-2.6.25.4 - fbcondecor-0.9.4 - squashfs-3.3 - unionfs-2.3.3 - tuxonice-3.0-rc7 - linux-phc-0.3.0 - acpi-dstd-0.9a - reiser4 - xen-3.2.0 . ipw3945-1.2.2
1 | niro | 606 | From 037e96d5c044d17904362e03f59ce7617e7ad0e1 Mon Sep 17 00:00:00 2001 |
2 | From: Mark McLoughlin <markmc@redhat.com> | ||
3 | Date: Mon, 4 Feb 2008 08:30:37 +0000 | ||
4 | Subject: [PATCH] xen: Add empty xenctrl module | ||
5 | |||
6 | Add the basic infrastructure for a xenctrl module | ||
7 | which will contain the various kernel interfaces | ||
8 | used by (mainly Dom0) Xen userspace. | ||
9 | |||
10 | Signed-off-by: Mark McLoughlin <markmc@redhat.com> | ||
11 | --- | ||
12 | arch/x86/xen/Kconfig | 7 +++++ | ||
13 | drivers/xen/Makefile | 2 + | ||
14 | drivers/xen/xenctrl/Makefile | 4 +++ | ||
15 | drivers/xen/xenctrl/main.c | 62 ++++++++++++++++++++++++++++++++++++++++++ | ||
16 | 4 files changed, 75 insertions(+), 0 deletions(-) | ||
17 | create mode 100644 drivers/xen/xenctrl/Makefile | ||
18 | create mode 100644 drivers/xen/xenctrl/main.c | ||
19 | |||
20 | diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig | ||
21 | index 4d5f264..4723bc1 100644 | ||
22 | --- a/arch/x86/xen/Kconfig | ||
23 | +++ b/arch/x86/xen/Kconfig | ||
24 | @@ -11,3 +11,10 @@ config XEN | ||
25 | This is the Linux Xen port. Enabling this will allow the | ||
26 | kernel to boot in a paravirtualized environment under the | ||
27 | Xen hypervisor. | ||
28 | + | ||
29 | +config XENCTRL | ||
30 | + tristate "Xen's user space control interfaces" | ||
31 | + depends on XEN && PROC_FS | ||
32 | + default y if XEN | ||
33 | + help | ||
34 | + This is the /proc/xen interface used by Xen's libxc. | ||
35 | diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile | ||
36 | index 56592f0..6737463 100644 | ||
37 | --- a/drivers/xen/Makefile | ||
38 | +++ b/drivers/xen/Makefile | ||
39 | @@ -1,2 +1,4 @@ | ||
40 | obj-y += grant-table.o | ||
41 | obj-y += xenbus/ | ||
42 | + | ||
43 | +obj-$(CONFIG_XENCTRL) += xenctrl/ | ||
44 | diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile | ||
45 | new file mode 100644 | ||
46 | index 0000000..1f43a43 | ||
47 | --- /dev/null | ||
48 | +++ b/drivers/xen/xenctrl/Makefile | ||
49 | @@ -0,0 +1,4 @@ | ||
50 | +obj-$(CONFIG_XENCTRL) += xenctrl.o | ||
51 | + | ||
52 | +xenctrl-objs = | ||
53 | +xenctrl-objs += main.o | ||
54 | diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c | ||
55 | new file mode 100644 | ||
56 | index 0000000..2965ceb | ||
57 | --- /dev/null | ||
58 | +++ b/drivers/xen/xenctrl/main.c | ||
59 | @@ -0,0 +1,62 @@ | ||
60 | +/****************************************************************************** | ||
61 | + * | ||
62 | + * main.c | ||
63 | + * | ||
64 | + * Xen userspace control interfaces | ||
65 | + * | ||
66 | + * Copyright (c) 2002-2004, K A Fraser, B Dragovic | ||
67 | + * | ||
68 | + * This program is free software; you can redistribute it and/or | ||
69 | + * modify it under the terms of the GNU General Public License version 2 | ||
70 | + * as published by the Free Software Foundation; or, when distributed | ||
71 | + * separately from the Linux kernel or incorporated into other | ||
72 | + * software packages, subject to the following license: | ||
73 | + * | ||
74 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
75 | + * of this source file (the "Software"), to deal in the Software without | ||
76 | + * restriction, including without limitation the rights to use, copy, modify, | ||
77 | + * merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
78 | + * and to permit persons to whom the Software is furnished to do so, subject to | ||
79 | + * the following conditions: | ||
80 | + * | ||
81 | + * The above copyright notice and this permission notice shall be included in | ||
82 | + * all copies or substantial portions of the Software. | ||
83 | + * | ||
84 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
85 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
86 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
87 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
88 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
89 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
90 | + * IN THE SOFTWARE. | ||
91 | + */ | ||
92 | + | ||
93 | +#include <linux/proc_fs.h> | ||
94 | +#include <linux/module.h> | ||
95 | +#include <asm/xen/hypervisor.h> | ||
96 | + | ||
97 | +static int __init xenctrl_init(void) | ||
98 | +{ | ||
99 | + struct proc_dir_entry *dir; | ||
100 | + | ||
101 | + if (!is_running_on_xen()) | ||
102 | + return -ENODEV; | ||
103 | + | ||
104 | + dir = proc_mkdir("xen", NULL); | ||
105 | + if (!dir) | ||
106 | + return -ENOMEM; | ||
107 | + | ||
108 | + dir->owner = THIS_MODULE; | ||
109 | + | ||
110 | + return 0; | ||
111 | +} | ||
112 | + | ||
113 | +static void __exit xenctrl_exit(void) | ||
114 | +{ | ||
115 | + remove_proc_entry("xen", NULL); | ||
116 | +} | ||
117 | + | ||
118 | +module_init(xenctrl_init); | ||
119 | +module_exit(xenctrl_exit); | ||
120 | + | ||
121 | +MODULE_LICENSE("Dual BSD/GPL"); | ||
122 | -- | ||
123 | 1.5.4.1 | ||
124 |