ansify function definitionsdiff -r1.17 -r1.18 src/sys/arch/xen/xen/isa_machdep.c
(cegger)
--- src/sys/arch/xen/xen/Attic/isa_machdep.c 2009/03/14 21:04:17 1.17
+++ src/sys/arch/xen/xen/Attic/isa_machdep.c 2009/03/16 06:18:32 1.18
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: isa_machdep.c,v 1.17 2009/03/14 21:04:17 dsl Exp $ */ | 1 | /* $NetBSD: isa_machdep.c,v 1.18 2009/03/16 06:18:32 cegger Exp $ */ | |
2 | /* NetBSD isa_machdep.c,v 1.11 2004/06/20 18:04:08 thorpej Exp */ | 2 | /* NetBSD isa_machdep.c,v 1.11 2004/06/20 18:04:08 thorpej Exp */ | |
3 | 3 | |||
4 | /*- | 4 | /*- | |
5 | * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. | 5 | * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to The NetBSD Foundation | 8 | * This code is derived from software contributed to The NetBSD Foundation | |
9 | * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace | 9 | * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace | |
10 | * Simulation Facility, NASA Ames Research Center. | 10 | * Simulation Facility, NASA Ames Research Center. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -56,27 +56,27 @@ | @@ -56,27 +56,27 @@ | |||
56 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 56 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
63 | * SUCH DAMAGE. | 63 | * SUCH DAMAGE. | |
64 | * | 64 | * | |
65 | * @(#)isa.c 7.2 (Berkeley) 5/13/91 | 65 | * @(#)isa.c 7.2 (Berkeley) 5/13/91 | |
66 | */ | 66 | */ | |
67 | 67 | |||
68 | #include <sys/cdefs.h> | 68 | #include <sys/cdefs.h> | |
69 | __KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.17 2009/03/14 21:04:17 dsl Exp $"); | 69 | __KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.18 2009/03/16 06:18:32 cegger Exp $"); | |
70 | 70 | |||
71 | #include <sys/param.h> | 71 | #include <sys/param.h> | |
72 | #include <sys/systm.h> | 72 | #include <sys/systm.h> | |
73 | #include <sys/kernel.h> | 73 | #include <sys/kernel.h> | |
74 | #include <sys/syslog.h> | 74 | #include <sys/syslog.h> | |
75 | #include <sys/device.h> | 75 | #include <sys/device.h> | |
76 | #include <sys/proc.h> | 76 | #include <sys/proc.h> | |
77 | #include <sys/mbuf.h> | 77 | #include <sys/mbuf.h> | |
78 | 78 | |||
79 | #include <machine/bus.h> | 79 | #include <machine/bus.h> | |
80 | #include <machine/bus_private.h> | 80 | #include <machine/bus_private.h> | |
81 | 81 | |||
82 | #include <machine/pio.h> | 82 | #include <machine/pio.h> | |
@@ -133,33 +133,28 @@ isa_intr_alloc(isa_chipset_tag_t ic, int | @@ -133,33 +133,28 @@ isa_intr_alloc(isa_chipset_tag_t ic, int | |||
133 | panic("isa_intr_alloc: notyet"); | 133 | panic("isa_intr_alloc: notyet"); | |
134 | return (0); | 134 | return (0); | |
135 | } | 135 | } | |
136 | 136 | |||
137 | const struct evcnt * | 137 | const struct evcnt * | |
138 | isa_intr_evcnt(isa_chipset_tag_t ic, int irq) | 138 | isa_intr_evcnt(isa_chipset_tag_t ic, int irq) | |
139 | { | 139 | { | |
140 | 140 | |||
141 | /* XXX for now, no evcnt parent reported */ | 141 | /* XXX for now, no evcnt parent reported */ | |
142 | return NULL; | 142 | return NULL; | |
143 | } | 143 | } | |
144 | 144 | |||
145 | void * | 145 | void * | |
146 | isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg) | 146 | isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, | |
147 | isa_chipset_tag_t ic; | 147 | int (*ih_fun)(void *), void *ih_arg) | |
148 | int irq; | |||
149 | int type; | |||
150 | int level; | |||
151 | int (*ih_fun)(void *); | |||
152 | void *ih_arg; | |||
153 | { | 148 | { | |
154 | int evtch; | 149 | int evtch; | |
155 | char evname[8]; | 150 | char evname[8]; | |
156 | struct xen_intr_handle ih; | 151 | struct xen_intr_handle ih; | |
157 | #if NIOAPIC > 0 | 152 | #if NIOAPIC > 0 | |
158 | struct ioapic_softc *pic = NULL; | 153 | struct ioapic_softc *pic = NULL; | |
159 | #endif | 154 | #endif | |
160 | 155 | |||
161 | ih.pirq = 0; | 156 | ih.pirq = 0; | |
162 | 157 | |||
163 | #if NIOAPIC > 0 | 158 | #if NIOAPIC > 0 | |
164 | if (mp_busses != NULL) { | 159 | if (mp_busses != NULL) { | |
165 | if (intr_find_mpmapping(mp_isa_bus, irq, &ih) == 0 || | 160 | if (intr_find_mpmapping(mp_isa_bus, irq, &ih) == 0 || |
--- src/sys/arch/xen/xen/Attic/pciide_machdep.c 2009/03/14 14:46:08 1.13
+++ src/sys/arch/xen/xen/Attic/pciide_machdep.c 2009/03/16 06:18:32 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: pciide_machdep.c,v 1.13 2009/03/14 14:46:08 dsl Exp $ */ | 1 | /* $NetBSD: pciide_machdep.c,v 1.14 2009/03/16 06:18:32 cegger Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1998 Christopher G. Demetriou. All rights reserved. | 4 | * Copyright (c) 1998 Christopher G. Demetriou. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
@@ -31,55 +31,52 @@ | @@ -31,55 +31,52 @@ | |||
31 | */ | 31 | */ | |
32 | 32 | |||
33 | /* | 33 | /* | |
34 | * PCI IDE controller driver (i386 machine-dependent portion). | 34 | * PCI IDE controller driver (i386 machine-dependent portion). | |
35 | * | 35 | * | |
36 | * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD | 36 | * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD | |
37 | * sys/dev/pci/ppb.c, revision 1.16). | 37 | * sys/dev/pci/ppb.c, revision 1.16). | |
38 | * | 38 | * | |
39 | * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the | 39 | * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the | |
40 | * PCI SIG. | 40 | * PCI SIG. | |
41 | */ | 41 | */ | |
42 | 42 | |||
43 | #include <sys/cdefs.h> | 43 | #include <sys/cdefs.h> | |
44 | __KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.13 2009/03/14 14:46:08 dsl Exp $"); | 44 | __KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.14 2009/03/16 06:18:32 cegger Exp $"); | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/systm.h> | 47 | #include <sys/systm.h> | |
48 | #include <sys/device.h> | 48 | #include <sys/device.h> | |
49 | 49 | |||
50 | #include <dev/pci/pcireg.h> | 50 | #include <dev/pci/pcireg.h> | |
51 | #include <dev/pci/pcivar.h> | 51 | #include <dev/pci/pcivar.h> | |
52 | #include <dev/pci/pciidereg.h> | 52 | #include <dev/pci/pciidereg.h> | |
53 | #include <dev/pci/pciidevar.h> | 53 | #include <dev/pci/pciidevar.h> | |
54 | 54 | |||
55 | #include <xen/evtchn.h> | 55 | #include <xen/evtchn.h> | |
56 | 56 | |||
57 | #ifdef XEN3 | 57 | #ifdef XEN3 | |
58 | #include "ioapic.h" | 58 | #include "ioapic.h" | |
59 | #endif | 59 | #endif | |
60 | 60 | |||
61 | #if NIOAPIC > 0 | 61 | #if NIOAPIC > 0 | |
62 | #include <machine/i82093var.h> | 62 | #include <machine/i82093var.h> | |
63 | #include <machine/mpbiosvar.h> | 63 | #include <machine/mpbiosvar.h> | |
64 | #endif | 64 | #endif | |
65 | 65 | |||
66 | void * | 66 | void * | |
67 | pciide_machdep_compat_intr_establish(dev, pa, chan, func, arg) | 67 | pciide_machdep_compat_intr_establish(struct device *dev, | |
68 | struct device *dev; | 68 | struct pci_attach_args *pa, int chan, | |
69 | struct pci_attach_args *pa; | 69 | int (*func)(void *), void *arg) | |
70 | int chan; | |||
71 | int (*func)(void *); | |||
72 | void *arg; | |||
73 | { | 70 | { | |
74 | struct pintrhand *ih; | 71 | struct pintrhand *ih; | |
75 | char evname[8]; | 72 | char evname[8]; | |
76 | struct xen_intr_handle xenih; | 73 | struct xen_intr_handle xenih; | |
77 | #if NIOAPIC > 0 | 74 | #if NIOAPIC > 0 | |
78 | struct ioapic_softc *pic = NULL; | 75 | struct ioapic_softc *pic = NULL; | |
79 | #endif | 76 | #endif | |
80 | int evtch; | 77 | int evtch; | |
81 | 78 | |||
82 | #ifndef XEN3 | 79 | #ifndef XEN3 | |
83 | physdev_op_t physdev_op; | 80 | physdev_op_t physdev_op; | |
84 | 81 | |||
85 | physdev_op.cmd = PHYSDEVOP_PCI_INITIALISE_DEVICE; | 82 | physdev_op.cmd = PHYSDEVOP_PCI_INITIALISE_DEVICE; |
--- src/sys/arch/xen/xen/xengnt.c 2009/01/19 18:27:02 1.13
+++ src/sys/arch/xen/xen/xengnt.c 2009/03/16 06:18:32 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: xengnt.c,v 1.13 2009/01/19 18:27:02 jym Exp $ */ | 1 | /* $NetBSD: xengnt.c,v 1.14 2009/03/16 06:18:32 cegger Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2006 Manuel Bouyer. | 4 | * Copyright (c) 2006 Manuel Bouyer. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
22 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 22 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
23 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 23 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
25 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
29 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
30 | * | 30 | * | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.13 2009/01/19 18:27:02 jym Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.14 2009/03/16 06:18:32 cegger Exp $"); | |
35 | 35 | |||
36 | #include <sys/types.h> | 36 | #include <sys/types.h> | |
37 | #include <sys/param.h> | 37 | #include <sys/param.h> | |
38 | #include <sys/systm.h> | 38 | #include <sys/systm.h> | |
39 | #include <sys/malloc.h> | 39 | #include <sys/malloc.h> | |
40 | #include <sys/queue.h> | 40 | #include <sys/queue.h> | |
41 | #include <sys/extent.h> | 41 | #include <sys/extent.h> | |
42 | #include <sys/kernel.h> | 42 | #include <sys/kernel.h> | |
43 | #include <uvm/uvm.h> | 43 | #include <uvm/uvm.h> | |
44 | 44 | |||
45 | #include <xen/hypervisor.h> | 45 | #include <xen/hypervisor.h> | |
46 | #include <xen/xen.h> | 46 | #include <xen/xen.h> | |
47 | #include <xen/granttables.h> | 47 | #include <xen/granttables.h> | |
@@ -66,27 +66,27 @@ grant_ref_t *gnt_entries; | @@ -66,27 +66,27 @@ grant_ref_t *gnt_entries; | |||
66 | int last_gnt_entry; | 66 | int last_gnt_entry; | |
67 | /* empty entry in the list */ | 67 | /* empty entry in the list */ | |
68 | #define XENGNT_NO_ENTRY 0xffffffff | 68 | #define XENGNT_NO_ENTRY 0xffffffff | |
69 | 69 | |||
70 | /* VM address of the grant table */ | 70 | /* VM address of the grant table */ | |
71 | grant_entry_t *grant_table; | 71 | grant_entry_t *grant_table; | |
72 | 72 | |||
73 | static grant_ref_t xengnt_get_entry(void); | 73 | static grant_ref_t xengnt_get_entry(void); | |
74 | static void xengnt_free_entry(grant_ref_t); | 74 | static void xengnt_free_entry(grant_ref_t); | |
75 | static void xengnt_resume(void); | 75 | static void xengnt_resume(void); | |
76 | static int xengnt_more_entries(void); | 76 | static int xengnt_more_entries(void); | |
77 | 77 | |||
78 | void | 78 | void | |
79 | xengnt_init() | 79 | xengnt_init(void) | |
80 | { | 80 | { | |
81 | struct gnttab_query_size query; | 81 | struct gnttab_query_size query; | |
82 | int rc; | 82 | int rc; | |
83 | int nr_grant_entries; | 83 | int nr_grant_entries; | |
84 | int i; | 84 | int i; | |
85 | 85 | |||
86 | query.dom = DOMID_SELF; | 86 | query.dom = DOMID_SELF; | |
87 | rc = HYPERVISOR_grant_table_op(GNTTABOP_query_size, &query, 1); | 87 | rc = HYPERVISOR_grant_table_op(GNTTABOP_query_size, &query, 1); | |
88 | if ((rc < 0) || (query.status != GNTST_okay)) | 88 | if ((rc < 0) || (query.status != GNTST_okay)) | |
89 | gnt_max_grant_frames = 4; /* Legacy max number of frames */ | 89 | gnt_max_grant_frames = 4; /* Legacy max number of frames */ | |
90 | else | 90 | else | |
91 | gnt_max_grant_frames = query.max_nr_frames; | 91 | gnt_max_grant_frames = query.max_nr_frames; | |
92 | gnt_nr_grant_frames = 0; | 92 | gnt_nr_grant_frames = 0; | |
@@ -104,27 +104,27 @@ xengnt_init() | @@ -104,27 +104,27 @@ xengnt_init() | |||
104 | panic("xengnt_init() no space for bitmask"); | 104 | panic("xengnt_init() no space for bitmask"); | |
105 | for (i = 0; i <= nr_grant_entries; i++) | 105 | for (i = 0; i <= nr_grant_entries; i++) | |
106 | gnt_entries[i] = XENGNT_NO_ENTRY; | 106 | gnt_entries[i] = XENGNT_NO_ENTRY; | |
107 | 107 | |||
108 | last_gnt_entry = 0; | 108 | last_gnt_entry = 0; | |
109 | xengnt_resume(); | 109 | xengnt_resume(); | |
110 | 110 | |||
111 | } | 111 | } | |
112 | 112 | |||
113 | /* | 113 | /* | |
114 | * Resume grant table state | 114 | * Resume grant table state | |
115 | */ | 115 | */ | |
116 | static void | 116 | static void | |
117 | xengnt_resume() | 117 | xengnt_resume(void) | |
118 | { | 118 | { | |
119 | int previous_nr_grant_frames = gnt_nr_grant_frames; | 119 | int previous_nr_grant_frames = gnt_nr_grant_frames; | |
120 | gnt_nr_grant_frames = 0; | 120 | gnt_nr_grant_frames = 0; | |
121 | while (gnt_nr_grant_frames < previous_nr_grant_frames) { | 121 | while (gnt_nr_grant_frames < previous_nr_grant_frames) { | |
122 | if (xengnt_more_entries() != 0) | 122 | if (xengnt_more_entries() != 0) | |
123 | panic("xengnt_resume: can't restore grant frames"); | 123 | panic("xengnt_resume: can't restore grant frames"); | |
124 | } | 124 | } | |
125 | } | 125 | } | |
126 | 126 | |||
127 | /* | 127 | /* | |
128 | * Add another page to the grant table | 128 | * Add another page to the grant table | |
129 | * Returns 0 on success, ENOMEM on failure | 129 | * Returns 0 on success, ENOMEM on failure | |
130 | */ | 130 | */ | |
@@ -182,27 +182,27 @@ xengnt_more_entries(void) | @@ -182,27 +182,27 @@ xengnt_more_entries(void) | |||
182 | KASSERT(gnt_entries[last_gnt_entry] == XENGNT_NO_ENTRY); | 182 | KASSERT(gnt_entries[last_gnt_entry] == XENGNT_NO_ENTRY); | |
183 | gnt_entries[last_gnt_entry] = i; | 183 | gnt_entries[last_gnt_entry] = i; | |
184 | last_gnt_entry++; | 184 | last_gnt_entry++; | |
185 | } | 185 | } | |
186 | gnt_nr_grant_frames = nframes_new; | 186 | gnt_nr_grant_frames = nframes_new; | |
187 | free(pages, M_DEVBUF); | 187 | free(pages, M_DEVBUF); | |
188 | return 0; | 188 | return 0; | |
189 | } | 189 | } | |
190 | 190 | |||
191 | /* | 191 | /* | |
192 | * Returns a reference to the first free entry in grant table | 192 | * Returns a reference to the first free entry in grant table | |
193 | */ | 193 | */ | |
194 | static grant_ref_t | 194 | static grant_ref_t | |
195 | xengnt_get_entry() | 195 | xengnt_get_entry(void) | |
196 | { | 196 | { | |
197 | grant_ref_t entry; | 197 | grant_ref_t entry; | |
198 | int s = splvm(); | 198 | int s = splvm(); | |
199 | static struct timeval xengnt_nonmemtime; | 199 | static struct timeval xengnt_nonmemtime; | |
200 | static const struct timeval xengnt_nonmemintvl = {5,0}; | 200 | static const struct timeval xengnt_nonmemintvl = {5,0}; | |
201 | 201 | |||
202 | if (last_gnt_entry == 0) { | 202 | if (last_gnt_entry == 0) { | |
203 | if (xengnt_more_entries()) { | 203 | if (xengnt_more_entries()) { | |
204 | splx(s); | 204 | splx(s); | |
205 | if (ratecheck(&xengnt_nonmemtime, &xengnt_nonmemintvl)) | 205 | if (ratecheck(&xengnt_nonmemtime, &xengnt_nonmemintvl)) | |
206 | printf("xengnt_get_entry: out of grant " | 206 | printf("xengnt_get_entry: out of grant " | |
207 | "table entries\n"); | 207 | "table entries\n"); | |
208 | return XENGNT_NO_ENTRY; | 208 | return XENGNT_NO_ENTRY; |
--- src/sys/arch/xen/xen/privcmd.c 2009/03/04 10:32:36 1.36
+++ src/sys/arch/xen/xen/privcmd.c 2009/03/16 06:18:32 1.37
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: privcmd.c,v 1.36 2009/03/04 10:32:36 jym Exp $ */ | 1 | /* $NetBSD: privcmd.c,v 1.37 2009/03/16 06:18:32 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2004 Christian Limpach. | 4 | * Copyright (c) 2004 Christian Limpach. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -22,27 +22,27 @@ | @@ -22,27 +22,27 @@ | |||
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 26 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | 33 | |||
34 | #include <sys/cdefs.h> | 34 | #include <sys/cdefs.h> | |
35 | __KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.36 2009/03/04 10:32:36 jym Exp $"); | 35 | __KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.37 2009/03/16 06:18:32 cegger Exp $"); | |
36 | 36 | |||
37 | #include <sys/param.h> | 37 | #include <sys/param.h> | |
38 | #include <sys/systm.h> | 38 | #include <sys/systm.h> | |
39 | #include <sys/vnode.h> | 39 | #include <sys/vnode.h> | |
40 | #include <sys/malloc.h> | 40 | #include <sys/malloc.h> | |
41 | #include <sys/dirent.h> | 41 | #include <sys/dirent.h> | |
42 | #include <sys/stat.h> | 42 | #include <sys/stat.h> | |
43 | #include <sys/proc.h> | 43 | #include <sys/proc.h> | |
44 | 44 | |||
45 | #include <miscfs/specfs/specdev.h> | 45 | #include <miscfs/specfs/specdev.h> | |
46 | #include <miscfs/kernfs/kernfs.h> | 46 | #include <miscfs/kernfs/kernfs.h> | |
47 | 47 | |||
48 | #include <uvm/uvm.h> | 48 | #include <uvm/uvm.h> | |
@@ -608,27 +608,27 @@ privcmd_map_obj(struct vm_map *map, vadd | @@ -608,27 +608,27 @@ privcmd_map_obj(struct vm_map *map, vadd | |||
608 | } | 608 | } | |
609 | if (newstart != start) { | 609 | if (newstart != start) { | |
610 | printf("uvm_map didn't give us back our vm space\n"); | 610 | printf("uvm_map didn't give us back our vm space\n"); | |
611 | return EINVAL; | 611 | return EINVAL; | |
612 | } | 612 | } | |
613 | return 0; | 613 | return 0; | |
614 | } | 614 | } | |
615 | 615 | |||
616 | static const struct kernfs_fileop privcmd_fileops[] = { | 616 | static const struct kernfs_fileop privcmd_fileops[] = { | |
617 | { .kf_fileop = KERNFS_FILEOP_IOCTL, .kf_vop = privcmd_ioctl }, | 617 | { .kf_fileop = KERNFS_FILEOP_IOCTL, .kf_vop = privcmd_ioctl }, | |
618 | }; | 618 | }; | |
619 | 619 | |||
620 | void | 620 | void | |
621 | xenprivcmd_init() | 621 | xenprivcmd_init(void) | |
622 | { | 622 | { | |
623 | kernfs_entry_t *dkt; | 623 | kernfs_entry_t *dkt; | |
624 | kfstype kfst; | 624 | kfstype kfst; | |
625 | 625 | |||
626 | if (!xendomain_is_privileged()) | 626 | if (!xendomain_is_privileged()) | |
627 | return; | 627 | return; | |
628 | 628 | |||
629 | kfst = KERNFS_ALLOCTYPE(privcmd_fileops); | 629 | kfst = KERNFS_ALLOCTYPE(privcmd_fileops); | |
630 | 630 | |||
631 | KERNFS_ALLOCENTRY(dkt, M_TEMP, M_WAITOK); | 631 | KERNFS_ALLOCENTRY(dkt, M_TEMP, M_WAITOK); | |
632 | KERNFS_INITENTRY(dkt, DT_REG, "privcmd", NULL, kfst, VREG, | 632 | KERNFS_INITENTRY(dkt, DT_REG, "privcmd", NULL, kfst, VREG, | |
633 | PRIVCMD_MODE); | 633 | PRIVCMD_MODE); | |
634 | kernfs_addentry(kernxen_pkt, dkt); | 634 | kernfs_addentry(kernxen_pkt, dkt); |