Wed Dec 7 15:47:43 2011 UTC ()
switch from xen3-public to xen-public.


(cegger)
diff -r1.48 -r1.49 src/sys/arch/amd64/amd64/genassym.cf
diff -r1.90 -r1.91 src/sys/arch/i386/i386/genassym.cf
diff -r1.43 -r1.44 src/sys/arch/x86/include/cpu.h
diff -r1.143 -r1.144 src/sys/arch/x86/x86/pmap.c
diff -r1.8 -r1.9 src/sys/arch/xen/include/granttables.h
diff -r1.35 -r1.36 src/sys/arch/xen/include/hypervisor.h
diff -r1.12 -r1.13 src/sys/arch/xen/include/xenbus.h
diff -r1.6 -r1.7 src/sys/arch/xen/include/amd64/hypercalls.h
diff -r1.12 -r1.13 src/sys/arch/xen/include/i386/hypercalls.h
diff -r1.70 -r1.71 src/sys/arch/xen/x86/cpu.c
diff -r1.6 -r1.7 src/sys/arch/xen/x86/xen_ipi.c
diff -r1.10 -r1.11 src/sys/arch/xen/x86/xen_pmap.c
diff -r1.57 -r1.58 src/sys/arch/xen/xen/clock.c
diff -r1.58 -r1.59 src/sys/arch/xen/xen/evtchn.c
diff -r1.58 -r1.59 src/sys/arch/xen/xen/hypervisor.c
diff -r1.55 -r1.56 src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -r1.5 -r1.6 src/sys/arch/xen/xen/pciback.c
diff -r1.49 -r1.50 src/sys/arch/xen/xen/xbd_xenbus.c
diff -r1.54 -r1.55 src/sys/arch/xen/xen/xbdback_xenbus.c
diff -r1.38 -r1.39 src/sys/arch/xen/xen/xencons.c
diff -r1.8 -r1.9 src/sys/arch/xen/xen/xpci_xenbus.c

cvs diff -r1.48 -r1.49 src/sys/arch/amd64/amd64/genassym.cf (expand / switch to unified diff)

--- src/sys/arch/amd64/amd64/genassym.cf 2011/07/01 19:24:14 1.48
+++ src/sys/arch/amd64/amd64/genassym.cf 2011/12/07 15:47:41 1.49
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: genassym.cf,v 1.48 2011/07/01 19:24:14 dyoung Exp $ 1# $NetBSD: genassym.cf,v 1.49 2011/12/07 15:47:41 cegger Exp $
2 2
3# 3#
4# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc. 4# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
5# All rights reserved. 5# All rights reserved.
6# 6#
7# This code is derived from software contributed to The NetBSD Foundation 7# This code is derived from software contributed to The NetBSD Foundation
8# by Charles M. Hannum, and by Andrew Doran. 8# by Charles M. Hannum, and by Andrew Doran.
9# 9#
10# Redistribution and use in source and binary forms, with or without 10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions 11# modification, are permitted provided that the following conditions
12# are met: 12# are met:
13# 1. Redistributions of source code must retain the above copyright 13# 1. Redistributions of source code must retain the above copyright
14# notice, this list of conditions and the following disclaimer. 14# notice, this list of conditions and the following disclaimer.
@@ -109,27 +109,27 @@ if defined(_KERNEL) && defined(_KERNEL_O @@ -109,27 +109,27 @@ if defined(_KERNEL) && defined(_KERNEL_O
109include "isa.h" 109include "isa.h"
110include "ioapic.h" 110include "ioapic.h"
111endif 111endif
112if NISA > 0 112if NISA > 0
113include <machine/isa_machdep.h> 113include <machine/isa_machdep.h>
114endif 114endif
115 115
116if NIOAPIC > 0 116if NIOAPIC > 0
117include <machine/i82093reg.h> 117include <machine/i82093reg.h>
118include <machine/i82093var.h> 118include <machine/i82093var.h>
119endif 119endif
120 120
121ifdef XEN 121ifdef XEN
122include <xen/xen3-public/xen.h> 122include <xen/xen-public/xen.h>
123endif  123endif
124 124
125include <sys/bus.h> 125include <sys/bus.h>
126 126
127define LSRUN LSRUN 127define LSRUN LSRUN
128define LSONPROC LSONPROC 128define LSONPROC LSONPROC
129 129
130define UPAGES UPAGES 130define UPAGES UPAGES
131define USPACE USPACE 131define USPACE USPACE
132 132
133define KERNBASE_LO KERNBASE_LO 133define KERNBASE_LO KERNBASE_LO
134define KERNBASE_HI KERNBASE_HI 134define KERNBASE_HI KERNBASE_HI
135define KERNBASE KERNBASE 135define KERNBASE KERNBASE

cvs diff -r1.90 -r1.91 src/sys/arch/i386/i386/genassym.cf (expand / switch to unified diff)

--- src/sys/arch/i386/i386/genassym.cf 2011/07/01 18:14:15 1.90
+++ src/sys/arch/i386/i386/genassym.cf 2011/12/07 15:47:42 1.91
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: genassym.cf,v 1.90 2011/07/01 18:14:15 dyoung Exp $ 1# $NetBSD: genassym.cf,v 1.91 2011/12/07 15:47:42 cegger Exp $
2 2
3# 3#
4# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc. 4# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
5# All rights reserved. 5# All rights reserved.
6# 6#
7# This code is derived from software contributed to The NetBSD Foundation 7# This code is derived from software contributed to The NetBSD Foundation
8# by Charles M. Hannum, and by Andrew Doran. 8# by Charles M. Hannum, and by Andrew Doran.
9# 9#
10# Redistribution and use in source and binary forms, with or without 10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions 11# modification, are permitted provided that the following conditions
12# are met: 12# are met:
13# 1. Redistributions of source code must retain the above copyright 13# 1. Redistributions of source code must retain the above copyright
14# notice, this list of conditions and the following disclaimer. 14# notice, this list of conditions and the following disclaimer.
@@ -89,27 +89,27 @@ include  @@ -89,27 +89,27 @@ include
89include <netinet/ip6.h> 89include <netinet/ip6.h>
90include <netinet/ip_var.h> 90include <netinet/ip_var.h>
91 91
92include <uvm/uvm.h> 92include <uvm/uvm.h>
93 93
94include <machine/trap.h> 94include <machine/trap.h>
95include <machine/pmap.h> 95include <machine/pmap.h>
96include <machine/vmparam.h> 96include <machine/vmparam.h>
97include <machine/intr.h> 97include <machine/intr.h>
98include <machine/types.h> 98include <machine/types.h>
99include <machine/segments.h> 99include <machine/segments.h>
100 100
101ifdef XEN 101ifdef XEN
102include <xen/xen3-public/sched.h> 102include <xen/xen-public/sched.h>
103endif 103endif
104 104
105if defined(_KERNEL) && defined(_KERNEL_OPT) 105if defined(_KERNEL) && defined(_KERNEL_OPT)
106include "ioapic.h" 106include "ioapic.h"
107ifndef XEN 107ifndef XEN
108include "apmbios.h" 108include "apmbios.h"
109endif 109endif
110endif 110endif
111if NAPMBIOS > 0 111if NAPMBIOS > 0
112include <machine/bioscall.h> 112include <machine/bioscall.h>
113include <machine/apmvar.h> 113include <machine/apmvar.h>
114endif 114endif
115 115

cvs diff -r1.43 -r1.44 src/sys/arch/x86/include/cpu.h (expand / switch to unified diff)

--- src/sys/arch/x86/include/cpu.h 2011/11/19 17:13:39 1.43
+++ src/sys/arch/x86/include/cpu.h 2011/12/07 15:47:42 1.44
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.h,v 1.43 2011/11/19 17:13:39 cherry Exp $ */ 1/* $NetBSD: cpu.h,v 1.44 2011/12/07 15:47:42 cegger Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * William Jolitz. 8 * William Jolitz.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -58,28 +58,28 @@ @@ -58,28 +58,28 @@
58#include <machine/frame.h> 58#include <machine/frame.h>
59#include <machine/pte.h> 59#include <machine/pte.h>
60#include <machine/segments.h> 60#include <machine/segments.h>
61#include <machine/tss.h> 61#include <machine/tss.h>
62#include <machine/intrdefs.h> 62#include <machine/intrdefs.h>
63 63
64#include <x86/cacheinfo.h> 64#include <x86/cacheinfo.h>
65 65
66#include <sys/cpu_data.h> 66#include <sys/cpu_data.h>
67#include <sys/evcnt.h> 67#include <sys/evcnt.h>
68#include <sys/device_if.h> /* for device_t */ 68#include <sys/device_if.h> /* for device_t */
69 69
70#ifdef XEN 70#ifdef XEN
71#include <xen/xen3-public/xen.h> 71#include <xen/xen-public/xen.h>
72#include <xen/xen3-public/event_channel.h> 72#include <xen/xen-public/event_channel.h>
73#endif /* XEN */ 73#endif /* XEN */
74 74
75struct intrsource; 75struct intrsource;
76struct pmap; 76struct pmap;
77struct device; 77struct device;
78 78
79#ifdef __x86_64__ 79#ifdef __x86_64__
80#define i386tss x86_64_tss 80#define i386tss x86_64_tss
81#endif 81#endif
82 82
83#define NIOPORTS 1024 /* # of ports we allow to be mapped */ 83#define NIOPORTS 1024 /* # of ports we allow to be mapped */
84#define IOMAPSIZE (NIOPORTS / 8) /* I/O bitmap size in bytes */ 84#define IOMAPSIZE (NIOPORTS / 8) /* I/O bitmap size in bytes */
85 85

cvs diff -r1.143 -r1.144 src/sys/arch/x86/x86/pmap.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/pmap.c 2011/12/04 16:24:13 1.143
+++ src/sys/arch/x86/x86/pmap.c 2011/12/07 15:47:42 1.144
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmap.c,v 1.143 2011/12/04 16:24:13 chs Exp $ */ 1/* $NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -161,27 +161,27 @@ @@ -161,27 +161,27 @@
161 * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson 161 * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson
162 * and David Greenman. 162 * and David Greenman.
163 * 163 *
164 * [3] the Mach pmap. this pmap, from CMU, seems to have migrated 164 * [3] the Mach pmap. this pmap, from CMU, seems to have migrated
165 * between several processors. the VAX version was done by 165 * between several processors. the VAX version was done by
166 * Avadis Tevanian, Jr., and Michael Wayne Young. the i386 166 * Avadis Tevanian, Jr., and Michael Wayne Young. the i386
167 * version was done by Lance Berc, Mike Kupfer, Bob Baron, 167 * version was done by Lance Berc, Mike Kupfer, Bob Baron,
168 * David Golub, and Richard Draves. the alpha version was 168 * David Golub, and Richard Draves. the alpha version was
169 * done by Alessandro Forin (CMU/Mach) and Chris Demetriou 169 * done by Alessandro Forin (CMU/Mach) and Chris Demetriou
170 * (NetBSD/alpha). 170 * (NetBSD/alpha).
171 */ 171 */
172 172
173#include <sys/cdefs.h> 173#include <sys/cdefs.h>
174__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.143 2011/12/04 16:24:13 chs Exp $"); 174__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger Exp $");
175 175
176#include "opt_user_ldt.h" 176#include "opt_user_ldt.h"
177#include "opt_lockdebug.h" 177#include "opt_lockdebug.h"
178#include "opt_multiprocessor.h" 178#include "opt_multiprocessor.h"
179#include "opt_xen.h" 179#include "opt_xen.h"
180#if !defined(__x86_64__) 180#if !defined(__x86_64__)
181#include "opt_kstack_dr0.h" 181#include "opt_kstack_dr0.h"
182#endif /* !defined(__x86_64__) */ 182#endif /* !defined(__x86_64__) */
183 183
184#include <sys/param.h> 184#include <sys/param.h>
185#include <sys/systm.h> 185#include <sys/systm.h>
186#include <sys/proc.h> 186#include <sys/proc.h>
187#include <sys/pool.h> 187#include <sys/pool.h>
@@ -199,27 +199,27 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1 @@ -199,27 +199,27 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1
199#include <machine/specialreg.h> 199#include <machine/specialreg.h>
200#include <machine/gdt.h> 200#include <machine/gdt.h>
201#include <machine/isa_machdep.h> 201#include <machine/isa_machdep.h>
202#include <machine/cpuvar.h> 202#include <machine/cpuvar.h>
203#include <machine/cputypes.h> 203#include <machine/cputypes.h>
204 204
205#include <x86/pmap.h> 205#include <x86/pmap.h>
206#include <x86/pmap_pv.h> 206#include <x86/pmap_pv.h>
207 207
208#include <x86/i82489reg.h> 208#include <x86/i82489reg.h>
209#include <x86/i82489var.h> 209#include <x86/i82489var.h>
210 210
211#ifdef XEN 211#ifdef XEN
212#include <xen/xen3-public/xen.h> 212#include <xen/xen-public/xen.h>
213#include <xen/hypervisor.h> 213#include <xen/hypervisor.h>
214#endif 214#endif
215 215
216/* 216/*
217 * general info: 217 * general info:
218 * 218 *
219 * - for an explanation of how the i386 MMU hardware works see 219 * - for an explanation of how the i386 MMU hardware works see
220 * the comments in <machine/pte.h>. 220 * the comments in <machine/pte.h>.
221 * 221 *
222 * - for an explanation of the general memory structure used by 222 * - for an explanation of the general memory structure used by
223 * this pmap (including the recursive mapping), see the comments 223 * this pmap (including the recursive mapping), see the comments
224 * in <machine/pmap.h>. 224 * in <machine/pmap.h>.
225 * 225 *

cvs diff -r1.8 -r1.9 src/sys/arch/xen/include/granttables.h (expand / switch to unified diff)

--- src/sys/arch/xen/include/granttables.h 2011/09/20 00:12:23 1.8
+++ src/sys/arch/xen/include/granttables.h 2011/12/07 15:47:42 1.9
@@ -1,42 +1,42 @@ @@ -1,42 +1,42 @@
1/* $NetBSD: granttables.h,v 1.8 2011/09/20 00:12:23 jym Exp $ */ 1/* $NetBSD: granttables.h,v 1.9 2011/12/07 15:47:42 cegger Exp $ */
2/* 2/*
3 * Copyright (c) 2006 Manuel Bouyer. 3 * Copyright (c) 2006 Manuel Bouyer.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 * 24 *
25 */ 25 */
26 26
27/* Interface to the Xen Grant tables */ 27/* Interface to the Xen Grant tables */
28#include <xen/xen3-public/xen.h> 28#include <xen/xen-public/xen.h>
29#include <xen/xen3-public/grant_table.h> 29#include <xen/xen-public/grant_table.h>
30 30
31void xengnt_init(void); 31void xengnt_init(void);
32 32
33/* suspend/resume grant table, for save/restore operations */ 33/* suspend/resume grant table, for save/restore operations */
34bool xengnt_suspend(void); 34bool xengnt_suspend(void);
35bool xengnt_resume(void); 35bool xengnt_resume(void);
36 36
37/* 37/*
38 * grant access to a remote domain. Returns a handle on the allocated grant 38 * grant access to a remote domain. Returns a handle on the allocated grant
39 * entry in table in grant_ref_t *. 39 * entry in table in grant_ref_t *.
40 */ 40 */
41int xengnt_grant_access(domid_t, paddr_t, int, grant_ref_t *); 41int xengnt_grant_access(domid_t, paddr_t, int, grant_ref_t *);
42 42

cvs diff -r1.35 -r1.36 src/sys/arch/xen/include/hypervisor.h (expand / switch to unified diff)

--- src/sys/arch/xen/include/hypervisor.h 2011/11/19 17:13:39 1.35
+++ src/sys/arch/xen/include/hypervisor.h 2011/12/07 15:47:42 1.36
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: hypervisor.h,v 1.35 2011/11/19 17:13:39 cherry Exp $ */ 1/* $NetBSD: hypervisor.h,v 1.36 2011/12/07 15:47:42 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 * 14 *
@@ -69,37 +69,37 @@ struct xen_npx_attach_args { @@ -69,37 +69,37 @@ struct xen_npx_attach_args {
69 const char *xa_device; 69 const char *xa_device;
70}; 70};
71 71
72 72
73#define u8 uint8_t 73#define u8 uint8_t
74#define u16 uint16_t 74#define u16 uint16_t
75#define u32 uint32_t 75#define u32 uint32_t
76#define u64 uint64_t 76#define u64 uint64_t
77#define s8 int8_t 77#define s8 int8_t
78#define s16 int16_t 78#define s16 int16_t
79#define s32 int32_t 79#define s32 int32_t
80#define s64 int64_t 80#define s64 int64_t
81 81
82#include <xen/xen3-public/xen.h> 82#include <xen/xen-public/xen.h>
83#include <xen/xen3-public/sched.h> 83#include <xen/xen-public/sched.h>
84#include <xen/xen3-public/platform.h> 84#include <xen/xen-public/platform.h>
85#if __XEN_INTERFACE_VERSION__ < 0x00030204 85#if __XEN_INTERFACE_VERSION__ < 0x00030204
86#include <xen/xen3-public/dom0_ops.h> 86#include <xen/xen-public/dom0_ops.h>
87#endif 87#endif
88#include <xen/xen3-public/event_channel.h> 88#include <xen/xen-public/event_channel.h>
89#include <xen/xen3-public/physdev.h> 89#include <xen/xen-public/physdev.h>
90#include <xen/xen3-public/memory.h> 90#include <xen/xen-public/memory.h>
91#include <xen/xen3-public/io/netif.h> 91#include <xen/xen-public/io/netif.h>
92#include <xen/xen3-public/io/blkif.h> 92#include <xen/xen-public/io/blkif.h>
93 93
94#include <machine/cpu.h> 94#include <machine/cpu.h>
95#include <machine/hypercalls.h> 95#include <machine/hypercalls.h>
96 96
97#undef u8 97#undef u8
98#undef u16 98#undef u16
99#undef u32 99#undef u32
100#undef u64 100#undef u64
101#undef s8 101#undef s8
102#undef s16 102#undef s16
103#undef s32 103#undef s32
104#undef s64 104#undef s64
105 105

cvs diff -r1.12 -r1.13 src/sys/arch/xen/include/xenbus.h (expand / switch to unified diff)

--- src/sys/arch/xen/include/xenbus.h 2011/09/20 00:12:24 1.12
+++ src/sys/arch/xen/include/xenbus.h 2011/12/07 15:47:42 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xenbus.h,v 1.12 2011/09/20 00:12:24 jym Exp $ */ 1/* $NetBSD: xenbus.h,v 1.13 2011/12/07 15:47:42 cegger Exp $ */
2/****************************************************************************** 2/******************************************************************************
3 * xenbus.h 3 * xenbus.h
4 * 4 *
5 * Talks to Xen Store to figure out what devices we have. 5 * Talks to Xen Store to figure out what devices we have.
6 * 6 *
7 * Copyright (C) 2005 Rusty Russell, IBM Corporation 7 * Copyright (C) 2005 Rusty Russell, IBM Corporation
8 * Copyright (C) 2005 XenSource Ltd. 8 * Copyright (C) 2005 XenSource Ltd.
9 *  9 *
10 * This file may be distributed separately from the Linux kernel, or 10 * This file may be distributed separately from the Linux kernel, or
11 * incorporated into other software packages, subject to the following license: 11 * incorporated into other software packages, subject to the following license:
12 *  12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a copy 13 * Permission is hereby granted, free of charge, to any person obtaining a copy
14 * of this source file (the "Software"), to deal in the Software without 14 * of this source file (the "Software"), to deal in the Software without
@@ -24,30 +24,30 @@ @@ -24,30 +24,30 @@
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29 * IN THE SOFTWARE. 29 * IN THE SOFTWARE.
30 */ 30 */
31 31
32#ifndef _ASM_XEN_XENBUS_H 32#ifndef _ASM_XEN_XENBUS_H
33#define _ASM_XEN_XENBUS_H 33#define _ASM_XEN_XENBUS_H
34 34
35#include <sys/device.h> 35#include <sys/device.h>
36#include <sys/queue.h> 36#include <sys/queue.h>
37#include <xen/xen3-public/xen.h> 37#include <xen/xen-public/xen.h>
38#include <xen/xen3-public/io/xenbus.h> 38#include <xen/xen-public/io/xenbus.h>
39#include <xen/xen3-public/io/xs_wire.h> 39#include <xen/xen-public/io/xs_wire.h>
40#include <xen/xen3-public/grant_table.h> /* for grant_ref_t */ 40#include <xen/xen-public/grant_table.h> /* for grant_ref_t */
41 41
42/* xenbus to hypervisor attach */ 42/* xenbus to hypervisor attach */
43struct xenbus_attach_args { 43struct xenbus_attach_args {
44 const char *xa_device; 44 const char *xa_device;
45 int xa_handle; 45 int xa_handle;
46}; 46};
47 47
48/* devices to xenbus attach */ 48/* devices to xenbus attach */
49struct xenbusdev_attach_args { 49struct xenbusdev_attach_args {
50 const char *xa_type; 50 const char *xa_type;
51 int xa_id; 51 int xa_id;
52 struct xenbus_device *xa_xbusd; 52 struct xenbus_device *xa_xbusd;
53}; 53};

cvs diff -r1.6 -r1.7 src/sys/arch/xen/include/amd64/Attic/hypercalls.h (expand / switch to unified diff)

--- src/sys/arch/xen/include/amd64/Attic/hypercalls.h 2011/03/30 22:57:24 1.6
+++ src/sys/arch/xen/include/amd64/Attic/hypercalls.h 2011/12/07 15:47:42 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: hypercalls.h,v 1.6 2011/03/30 22:57:24 jym Exp $ */ 1/* $NetBSD: hypercalls.h,v 1.7 2011/12/07 15:47:42 cegger Exp $ */
2/****************************************************************************** 2/******************************************************************************
3 * hypercall.h 3 * hypercall.h
4 *  4 *
5 * Linux-specific hypervisor handling. 5 * Linux-specific hypervisor handling.
6 *  6 *
7 * Copyright (c) 2002-2004, K A Fraser 7 * Copyright (c) 2002-2004, K A Fraser
8 *  8 *
9 * 64-bit updates: 9 * 64-bit updates:
10 * Benjamin Liu <benjamin.liu@intel.com> 10 * Benjamin Liu <benjamin.liu@intel.com>
11 * Jun Nakajima <jun.nakajima@intel.com> 11 * Jun Nakajima <jun.nakajima@intel.com>
12 *  12 *
13 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License version 2 14 * modify it under the terms of the GNU General Public License version 2
@@ -389,26 +389,28 @@ HYPERVISOR_kexec_op( @@ -389,26 +389,28 @@ HYPERVISOR_kexec_op(
389 return _hypercall2(int, kexec_op, op, args); 389 return _hypercall2(int, kexec_op, op, args);
390} 390}
391 391
392#if __XEN_INTERFACE_VERSION__ < 0x00030204 392#if __XEN_INTERFACE_VERSION__ < 0x00030204
393static inline int 393static inline int
394HYPERVISOR_dom0_op( 394HYPERVISOR_dom0_op(
395 dom0_op_t *dom0_op) 395 dom0_op_t *dom0_op)
396{ 396{
397 dom0_op->interface_version = DOM0_INTERFACE_VERSION; 397 dom0_op->interface_version = DOM0_INTERFACE_VERSION;
398 return _hypercall1(int, dom0_op, dom0_op); 398 return _hypercall1(int, dom0_op, dom0_op);
399} 399}
400#endif /* __XEN_INTERFACE_VERSION__ */ 400#endif /* __XEN_INTERFACE_VERSION__ */
401 401
 402#include <xen/xen3-public/arch-x86/xen-mca.h>
 403
402static inline int 404static inline int
403HYPERVISOR_machine_check(struct xen_mc *mc) 405HYPERVISOR_machine_check(struct xen_mc *mc)
404{ 406{
405 mc->interface_version = XEN_MCA_INTERFACE_VERSION; 407 mc->interface_version = XEN_MCA_INTERFACE_VERSION;
406 return _hypercall1(int, mca, mc); 408 return _hypercall1(int, mca, mc);
407} 409}
408 410
409static inline int 411static inline int
410HYPERVISOR_sysctl(void *sysctl) 412HYPERVISOR_sysctl(void *sysctl)
411{ 413{
412 return _hypercall1(int, sysctl, sysctl); 414 return _hypercall1(int, sysctl, sysctl);
413} 415}
414 416

cvs diff -r1.12 -r1.13 src/sys/arch/xen/include/i386/Attic/hypercalls.h (expand / switch to unified diff)

--- src/sys/arch/xen/include/i386/Attic/hypercalls.h 2011/06/07 14:53:03 1.12
+++ src/sys/arch/xen/include/i386/Attic/hypercalls.h 2011/12/07 15:47:42 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: hypercalls.h,v 1.12 2011/06/07 14:53:03 bouyer Exp $ */ 1/* $NetBSD: hypercalls.h,v 1.13 2011/12/07 15:47:42 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 * 14 *
@@ -163,26 +163,28 @@ HYPERVISOR_set_debugreg(int reg, unsigne @@ -163,26 +163,28 @@ HYPERVISOR_set_debugreg(int reg, unsigne
163 163
164static __inline unsigned long 164static __inline unsigned long
165HYPERVISOR_get_debugreg(int reg) 165HYPERVISOR_get_debugreg(int reg)
166{ 166{
167 unsigned long ret; 167 unsigned long ret;
168 unsigned long ign1; 168 unsigned long ign1;
169 169
170 _hypercall(__HYPERVISOR_get_debugreg, _harg("1" (reg)), 170 _hypercall(__HYPERVISOR_get_debugreg, _harg("1" (reg)),
171 _harg("=a" (ret), "=b" (ign1))); 171 _harg("=a" (ret), "=b" (ign1)));
172 172
173 return ret; 173 return ret;
174} 174}
175 175
 176#include <xen/xen3-public/arch-x86/xen-mca.h>
 177
176static __inline int 178static __inline int
177HYPERVISOR_machine_check(struct xen_mc *mc) 179HYPERVISOR_machine_check(struct xen_mc *mc)
178{ 180{
179 int ret; 181 int ret;
180 unsigned long ign1; 182 unsigned long ign1;
181  183
182 mc->interface_version = XEN_MCA_INTERFACE_VERSION; 184 mc->interface_version = XEN_MCA_INTERFACE_VERSION;
183 _hypercall(__HYPERVISOR_mca, _harg("1" (mc)), 185 _hypercall(__HYPERVISOR_mca, _harg("1" (mc)),
184 _harg("=a" (ret), "=b" (ign1))); 186 _harg("=a" (ret), "=b" (ign1)));
185  187
186 return ret; 188 return ret;
187} 189}
188 190

cvs diff -r1.70 -r1.71 src/sys/arch/xen/x86/cpu.c (expand / switch to unified diff)

--- src/sys/arch/xen/x86/cpu.c 2011/11/06 15:18:19 1.70
+++ src/sys/arch/xen/x86/cpu.c 2011/12/07 15:47:43 1.71
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.70 2011/11/06 15:18:19 cherry Exp $ */ 1/* $NetBSD: cpu.c,v 1.71 2011/12/07 15:47:43 cegger Exp $ */
2/* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ 2/* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */
3 3
4/*- 4/*-
5 * Copyright (c) 2000 The NetBSD Foundation, Inc. 5 * Copyright (c) 2000 The NetBSD Foundation, Inc.
6 * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, 6 * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * This code is derived from software contributed to The NetBSD Foundation 9 * This code is derived from software contributed to The NetBSD Foundation
10 * by RedBack Networks Inc. 10 * by RedBack Networks Inc.
11 * 11 *
12 * Author: Bill Sommerfeld 12 * Author: Bill Sommerfeld
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 56 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 57 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
58 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE 58 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE
59 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 59 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
60 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 60 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
61 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 61 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 62 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
63 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 63 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
64 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 64 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65 * SUCH DAMAGE. 65 * SUCH DAMAGE.
66 */ 66 */
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.70 2011/11/06 15:18:19 cherry Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.71 2011/12/07 15:47:43 cegger Exp $");
70 70
71#include "opt_ddb.h" 71#include "opt_ddb.h"
72#include "opt_multiprocessor.h" 72#include "opt_multiprocessor.h"
73#include "opt_mpbios.h" /* for MPDEBUG */ 73#include "opt_mpbios.h" /* for MPDEBUG */
74#include "opt_mtrr.h" 74#include "opt_mtrr.h"
75#include "opt_xen.h" 75#include "opt_xen.h"
76 76
77#include "lapic.h" 77#include "lapic.h"
78#include "ioapic.h" 78#include "ioapic.h"
79 79
80#include <sys/param.h> 80#include <sys/param.h>
81#include <sys/proc.h> 81#include <sys/proc.h>
82#include <sys/systm.h> 82#include <sys/systm.h>
@@ -99,27 +99,27 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.70 @@ -99,27 +99,27 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.70
99#include <machine/specialreg.h> 99#include <machine/specialreg.h>
100#include <machine/segments.h> 100#include <machine/segments.h>
101#include <machine/gdt.h> 101#include <machine/gdt.h>
102#include <machine/mtrr.h> 102#include <machine/mtrr.h>
103#include <machine/pio.h> 103#include <machine/pio.h>
104 104
105#ifdef i386 105#ifdef i386
106#include <machine/npx.h> 106#include <machine/npx.h>
107#else 107#else
108#include <machine/fpu.h> 108#include <machine/fpu.h>
109#endif 109#endif
110 110
111#include <xen/xen.h> 111#include <xen/xen.h>
112#include <xen/xen3-public/vcpu.h> 112#include <xen/xen-public/vcpu.h>
113#include <xen/vcpuvar.h> 113#include <xen/vcpuvar.h>
114 114
115#if NLAPIC > 0 115#if NLAPIC > 0
116#include <machine/apicvar.h> 116#include <machine/apicvar.h>
117#include <machine/i82489reg.h> 117#include <machine/i82489reg.h>
118#include <machine/i82489var.h> 118#include <machine/i82489var.h>
119#endif 119#endif
120 120
121#include <dev/ic/mc146818reg.h> 121#include <dev/ic/mc146818reg.h>
122#include <dev/isa/isareg.h> 122#include <dev/isa/isareg.h>
123 123
124#if MAXCPUS > 32 124#if MAXCPUS > 32
125#error cpu_info contains 32bit bitmasks 125#error cpu_info contains 32bit bitmasks

cvs diff -r1.6 -r1.7 src/sys/arch/xen/x86/xen_ipi.c (expand / switch to unified diff)

--- src/sys/arch/xen/x86/xen_ipi.c 2011/11/07 15:51:31 1.6
+++ src/sys/arch/xen/x86/xen_ipi.c 2011/12/07 15:47:43 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xen_ipi.c,v 1.6 2011/11/07 15:51:31 cherry Exp $ */ 1/* $NetBSD: xen_ipi.c,v 1.7 2011/12/07 15:47:43 cegger Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2011 The NetBSD Foundation, Inc. 4 * Copyright (c) 2011 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Cherry G. Mathew <cherry@zyx.in> 8 * by Cherry G. Mathew <cherry@zyx.in>
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -23,54 +23,54 @@ @@ -23,54 +23,54 @@
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> /* RCS ID macro */ 32#include <sys/cdefs.h> /* RCS ID macro */
33 33
34/*  34/*
35 * Based on: x86/ipi.c 35 * Based on: x86/ipi.c
36 * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.6 2011/11/07 15:51:31 cherry Exp $");  36 * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.7 2011/12/07 15:47:43 cegger Exp $");
37 */ 37 */
38 38
39__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.6 2011/11/07 15:51:31 cherry Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.7 2011/12/07 15:47:43 cegger Exp $");
40 40
41#include <sys/types.h> 41#include <sys/types.h>
42 42
43#include <sys/atomic.h> 43#include <sys/atomic.h>
44#include <sys/mutex.h> 44#include <sys/mutex.h>
45#include <sys/cpu.h> 45#include <sys/cpu.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/xcall.h> 47#include <sys/xcall.h>
48#include <sys/errno.h> 48#include <sys/errno.h>
49#include <sys/systm.h> 49#include <sys/systm.h>
50 50
51#include <machine/cpu.h> 51#include <machine/cpu.h>
52#ifdef __x86_64__ 52#ifdef __x86_64__
53#include <machine/fpu.h> 53#include <machine/fpu.h>
54#else 54#else
55#include <machine/npx.h> 55#include <machine/npx.h>
56#endif /* __x86_64__ */ 56#endif /* __x86_64__ */
57#include <machine/frame.h> 57#include <machine/frame.h>
58#include <machine/segments.h> 58#include <machine/segments.h>
59 59
60#include <xen/intr.h> 60#include <xen/intr.h>
61#include <xen/intrdefs.h> 61#include <xen/intrdefs.h>
62#include <xen/hypervisor.h> 62#include <xen/hypervisor.h>
63#include <xen/xen3-public/vcpu.h> 63#include <xen/xen-public/vcpu.h>
64 64
65#ifdef __x86_64__ 65#ifdef __x86_64__
66extern void ddb_ipi(struct trapframe); 66extern void ddb_ipi(struct trapframe);
67#else 67#else
68extern void ddb_ipi(int, struct trapframe); 68extern void ddb_ipi(int, struct trapframe);
69#endif /* __x86_64__ */ 69#endif /* __x86_64__ */
70 70
71static void xen_ipi_halt(struct cpu_info *, struct intrframe *); 71static void xen_ipi_halt(struct cpu_info *, struct intrframe *);
72static void xen_ipi_synch_fpu(struct cpu_info *, struct intrframe *); 72static void xen_ipi_synch_fpu(struct cpu_info *, struct intrframe *);
73static void xen_ipi_ddb(struct cpu_info *, struct intrframe *); 73static void xen_ipi_ddb(struct cpu_info *, struct intrframe *);
74static void xen_ipi_xcall(struct cpu_info *, struct intrframe *); 74static void xen_ipi_xcall(struct cpu_info *, struct intrframe *);
75static void xen_ipi_hvcb(struct cpu_info *, struct intrframe *); 75static void xen_ipi_hvcb(struct cpu_info *, struct intrframe *);
76 76
@@ -106,27 +106,27 @@ xen_ipi_handler(struct cpu_info *ci, str @@ -106,27 +106,27 @@ xen_ipi_handler(struct cpu_info *ci, str
106} 106}
107 107
108/* Must be called once for every cpu that expects to send/recv ipis */ 108/* Must be called once for every cpu that expects to send/recv ipis */
109void 109void
110xen_ipi_init(void) 110xen_ipi_init(void)
111{ 111{
112 cpuid_t vcpu; 112 cpuid_t vcpu;
113 evtchn_port_t evtchn; 113 evtchn_port_t evtchn;
114 struct cpu_info *ci; 114 struct cpu_info *ci;
115 115
116 ci = curcpu(); 116 ci = curcpu();
117 117
118 vcpu = ci->ci_cpuid; 118 vcpu = ci->ci_cpuid;
119 KASSERT(vcpu < MAX_VIRT_CPUS); 119 KASSERT(vcpu < XEN_LEGACY_MAX_VCPUS);
120 120
121 evtchn = bind_vcpu_to_evtch(vcpu); 121 evtchn = bind_vcpu_to_evtch(vcpu);
122 ci->ci_ipi_evtchn = evtchn; 122 ci->ci_ipi_evtchn = evtchn;
123 123
124 KASSERT(evtchn != -1 && evtchn < NR_EVENT_CHANNELS); 124 KASSERT(evtchn != -1 && evtchn < NR_EVENT_CHANNELS);
125 125
126 if (0 != event_set_handler(evtchn, (int (*)(void *))xen_ipi_handler, 126 if (0 != event_set_handler(evtchn, (int (*)(void *))xen_ipi_handler,
127 ci, IPL_HIGH, "ipi")) { 127 ci, IPL_HIGH, "ipi")) {
128 panic("event_set_handler(...) KPI violation\n"); 128 panic("event_set_handler(...) KPI violation\n");
129 /* NOTREACHED */ 129 /* NOTREACHED */
130 } 130 }
131 131
132 hypervisor_enable_event(evtchn); 132 hypervisor_enable_event(evtchn);

cvs diff -r1.10 -r1.11 src/sys/arch/xen/x86/xen_pmap.c (expand / switch to unified diff)

--- src/sys/arch/xen/x86/xen_pmap.c 2011/11/23 00:56:56 1.10
+++ src/sys/arch/xen/x86/xen_pmap.c 2011/12/07 15:47:43 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xen_pmap.c,v 1.10 2011/11/23 00:56:56 jym Exp $ */ 1/* $NetBSD: xen_pmap.c,v 1.11 2011/12/07 15:47:43 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Manuel Bouyer. 4 * Copyright (c) 2007 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 * 14 *
@@ -92,27 +92,27 @@ @@ -92,27 +92,27 @@
92 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 92 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
93 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 93 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
94 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 94 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
95 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 95 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
96 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 96 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
97 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 97 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
98 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 98 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
99 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 99 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
100 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 100 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
101 * POSSIBILITY OF SUCH DAMAGE. 101 * POSSIBILITY OF SUCH DAMAGE.
102 */ 102 */
103 103
104#include <sys/cdefs.h> 104#include <sys/cdefs.h>
105__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.10 2011/11/23 00:56:56 jym Exp $"); 105__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.11 2011/12/07 15:47:43 cegger Exp $");
106 106
107#include "opt_user_ldt.h" 107#include "opt_user_ldt.h"
108#include "opt_lockdebug.h" 108#include "opt_lockdebug.h"
109#include "opt_multiprocessor.h" 109#include "opt_multiprocessor.h"
110#include "opt_xen.h" 110#include "opt_xen.h"
111#if !defined(__x86_64__) 111#if !defined(__x86_64__)
112#include "opt_kstack_dr0.h" 112#include "opt_kstack_dr0.h"
113#endif /* !defined(__x86_64__) */ 113#endif /* !defined(__x86_64__) */
114 114
115#include <sys/param.h> 115#include <sys/param.h>
116#include <sys/systm.h> 116#include <sys/systm.h>
117#include <sys/proc.h> 117#include <sys/proc.h>
118#include <sys/pool.h> 118#include <sys/pool.h>
@@ -127,27 +127,27 @@ __KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v @@ -127,27 +127,27 @@ __KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v
127#include <dev/isa/isareg.h> 127#include <dev/isa/isareg.h>
128 128
129#include <machine/specialreg.h> 129#include <machine/specialreg.h>
130#include <machine/gdt.h> 130#include <machine/gdt.h>
131#include <machine/isa_machdep.h> 131#include <machine/isa_machdep.h>
132#include <machine/cpuvar.h> 132#include <machine/cpuvar.h>
133 133
134#include <x86/pmap.h> 134#include <x86/pmap.h>
135#include <x86/pmap_pv.h> 135#include <x86/pmap_pv.h>
136 136
137#include <x86/i82489reg.h> 137#include <x86/i82489reg.h>
138#include <x86/i82489var.h> 138#include <x86/i82489var.h>
139 139
140#include <xen/xen3-public/xen.h> 140#include <xen/xen-public/xen.h>
141#include <xen/hypervisor.h> 141#include <xen/hypervisor.h>
142#include <xen/xenpmap.h> 142#include <xen/xenpmap.h>
143 143
144#define COUNT(x) /* nothing */ 144#define COUNT(x) /* nothing */
145 145
146static pd_entry_t * const alternate_pdes[] = APDES_INITIALIZER; 146static pd_entry_t * const alternate_pdes[] = APDES_INITIALIZER;
147extern pd_entry_t * const normal_pdes[]; 147extern pd_entry_t * const normal_pdes[];
148 148
149extern paddr_t pmap_pa_start; /* PA of first physical page for this domain */ 149extern paddr_t pmap_pa_start; /* PA of first physical page for this domain */
150extern paddr_t pmap_pa_end; /* PA of last physical page for this domain */ 150extern paddr_t pmap_pa_end; /* PA of last physical page for this domain */
151 151
152void 152void
153pmap_apte_flush(struct pmap *pmap) 153pmap_apte_flush(struct pmap *pmap)

cvs diff -r1.57 -r1.58 src/sys/arch/xen/xen/Attic/clock.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/Attic/clock.c 2011/11/18 06:01:50 1.57
+++ src/sys/arch/xen/xen/Attic/clock.c 2011/12/07 15:47:43 1.58
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: clock.c,v 1.57 2011/11/18 06:01:50 cherry Exp $ */ 1/* $NetBSD: clock.c,v 1.58 2011/12/07 15:47:43 cegger Exp $ */
2 2
3/* 3/*
4 * 4 *
5 * Copyright (c) 2004 Christian Limpach. 5 * Copyright (c) 2004 Christian Limpach.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -19,41 +19,41 @@ @@ -19,41 +19,41 @@
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include "opt_xen.h" 29#include "opt_xen.h"
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.57 2011/11/18 06:01:50 cherry Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.58 2011/12/07 15:47:43 cegger Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/time.h> 36#include <sys/time.h>
37#include <sys/timetc.h> 37#include <sys/timetc.h>
38#include <sys/timevar.h> 38#include <sys/timevar.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/sysctl.h> 41#include <sys/sysctl.h>
42 42
43#include <xen/xen.h> 43#include <xen/xen.h>
44#include <xen/hypervisor.h> 44#include <xen/hypervisor.h>
45#include <xen/evtchn.h> 45#include <xen/evtchn.h>
46#include <xen/xen3-public/vcpu.h> 46#include <xen/xen-public/vcpu.h>
47#include <machine/cpu_counter.h> 47#include <machine/cpu_counter.h>
48 48
49#include <dev/clock_subr.h> 49#include <dev/clock_subr.h>
50#include <x86/rtc.h> 50#include <x86/rtc.h>
51 51
52static int xen_timer_handler(void *, struct intrframe *); 52static int xen_timer_handler(void *, struct intrframe *);
53 53
54/* A timecounter: Xen system_time extrapolated with a TSC. */ 54/* A timecounter: Xen system_time extrapolated with a TSC. */
55u_int xen_get_timecount(struct timecounter*); 55u_int xen_get_timecount(struct timecounter*);
56static struct timecounter xen_timecounter = { 56static struct timecounter xen_timecounter = {
57 .tc_get_timecount = xen_get_timecount, 57 .tc_get_timecount = xen_get_timecount,
58 .tc_poll_pps = NULL, 58 .tc_poll_pps = NULL,
59 .tc_counter_mask = ~0U, 59 .tc_counter_mask = ~0U,

cvs diff -r1.58 -r1.59 src/sys/arch/xen/xen/evtchn.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/evtchn.c 2011/12/07 13:49:04 1.58
+++ src/sys/arch/xen/xen/evtchn.c 2011/12/07 15:47:43 1.59
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: evtchn.c,v 1.58 2011/12/07 13:49:04 cegger Exp $ */ 1/* $NetBSD: evtchn.c,v 1.59 2011/12/07 15:47:43 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 * 14 *
@@ -44,27 +44,27 @@ @@ -44,27 +44,27 @@
44 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 44 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
45 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 45 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
46 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 46 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
47 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 47 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 48 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 49 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 50 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 51 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
52 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 52 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53 */ 53 */
54 54
55 55
56#include <sys/cdefs.h> 56#include <sys/cdefs.h>
57__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.58 2011/12/07 13:49:04 cegger Exp $"); 57__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.59 2011/12/07 15:47:43 cegger Exp $");
58 58
59#include "opt_xen.h" 59#include "opt_xen.h"
60#include "isa.h" 60#include "isa.h"
61#include "pci.h" 61#include "pci.h"
62 62
63#include <sys/param.h> 63#include <sys/param.h>
64#include <sys/cpu.h> 64#include <sys/cpu.h>
65#include <sys/kernel.h> 65#include <sys/kernel.h>
66#include <sys/systm.h> 66#include <sys/systm.h>
67#include <sys/device.h> 67#include <sys/device.h>
68#include <sys/proc.h> 68#include <sys/proc.h>
69#include <sys/malloc.h> 69#include <sys/malloc.h>
70#include <sys/kmem.h> 70#include <sys/kmem.h>
@@ -86,30 +86,30 @@ __KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1 @@ -86,30 +86,30 @@ __KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1
86 */ 86 */
87static kmutex_t evtchn_lock; 87static kmutex_t evtchn_lock;
88 88
89/* event handlers */ 89/* event handlers */
90struct evtsource *evtsource[NR_EVENT_CHANNELS]; 90struct evtsource *evtsource[NR_EVENT_CHANNELS];
91 91
92/* channel locks */ 92/* channel locks */
93static kmutex_t evtlock[NR_EVENT_CHANNELS]; 93static kmutex_t evtlock[NR_EVENT_CHANNELS];
94 94
95/* Reference counts for bindings to event channels XXX: redo for SMP */ 95/* Reference counts for bindings to event channels XXX: redo for SMP */
96static uint8_t evtch_bindcount[NR_EVENT_CHANNELS]; 96static uint8_t evtch_bindcount[NR_EVENT_CHANNELS];
97 97
98/* event-channel <-> VCPU mapping for IPIs. XXX: redo for SMP. */ 98/* event-channel <-> VCPU mapping for IPIs. XXX: redo for SMP. */
99static evtchn_port_t vcpu_ipi_to_evtch[MAX_VIRT_CPUS]; 99static evtchn_port_t vcpu_ipi_to_evtch[XEN_LEGACY_MAX_VCPUS];
100 100
101/* event-channel <-> VCPU mapping for VIRQ_TIMER. XXX: redo for SMP. */ 101/* event-channel <-> VCPU mapping for VIRQ_TIMER. XXX: redo for SMP. */
102static int virq_timer_to_evtch[MAX_VIRT_CPUS]; 102static int virq_timer_to_evtch[XEN_LEGACY_MAX_VCPUS];
103 103
104/* event-channel <-> VIRQ mapping. */ 104/* event-channel <-> VIRQ mapping. */
105static int virq_to_evtch[NR_VIRQS]; 105static int virq_to_evtch[NR_VIRQS];
106 106
107 107
108#if NPCI > 0 || NISA > 0 108#if NPCI > 0 || NISA > 0
109/* event-channel <-> PIRQ mapping */ 109/* event-channel <-> PIRQ mapping */
110static int pirq_to_evtch[NR_PIRQS]; 110static int pirq_to_evtch[NR_PIRQS];
111/* PIRQ needing notify */ 111/* PIRQ needing notify */
112static uint32_t pirq_needs_unmask_notify[NR_EVENT_CHANNELS / 32]; 112static uint32_t pirq_needs_unmask_notify[NR_EVENT_CHANNELS / 32];
113int pirq_interrupt(void *); 113int pirq_interrupt(void *);
114physdev_op_t physdev_op_notify = { 114physdev_op_t physdev_op_notify = {
115 .cmd = PHYSDEVOP_IRQ_UNMASK_NOTIFY, 115 .cmd = PHYSDEVOP_IRQ_UNMASK_NOTIFY,
@@ -139,31 +139,31 @@ intr_biglock_wrapper(void *vp) @@ -139,31 +139,31 @@ intr_biglock_wrapper(void *vp)
139 139
140 KERNEL_UNLOCK_ONE(NULL); 140 KERNEL_UNLOCK_ONE(NULL);
141 141
142 return ret; 142 return ret;
143} 143}
144#endif /* MULTIPROCESSOR */ 144#endif /* MULTIPROCESSOR */
145 145
146void 146void
147events_default_setup(void) 147events_default_setup(void)
148{ 148{
149 int i; 149 int i;
150 150
151 /* No VCPU -> event mappings. */ 151 /* No VCPU -> event mappings. */
152 for (i = 0; i < MAX_VIRT_CPUS; i++) 152 for (i = 0; i < XEN_LEGACY_MAX_VCPUS; i++)
153 vcpu_ipi_to_evtch[i] = -1; 153 vcpu_ipi_to_evtch[i] = -1;
154 154
155 /* No VIRQ_TIMER -> event mappings. */ 155 /* No VIRQ_TIMER -> event mappings. */
156 for (i = 0; i < MAX_VIRT_CPUS; i++) 156 for (i = 0; i < XEN_LEGACY_MAX_VCPUS; i++)
157 virq_timer_to_evtch[i] = -1; 157 virq_timer_to_evtch[i] = -1;
158 158
159 /* No VIRQ -> event mappings. */ 159 /* No VIRQ -> event mappings. */
160 for (i = 0; i < NR_VIRQS; i++) 160 for (i = 0; i < NR_VIRQS; i++)
161 virq_to_evtch[i] = -1; 161 virq_to_evtch[i] = -1;
162 162
163#if NPCI > 0 || NISA > 0 163#if NPCI > 0 || NISA > 0
164 /* No PIRQ -> event mappings. */ 164 /* No PIRQ -> event mappings. */
165 for (i = 0; i < NR_PIRQS; i++) 165 for (i = 0; i < NR_PIRQS; i++)
166 pirq_to_evtch[i] = -1; 166 pirq_to_evtch[i] = -1;
167 for (i = 0; i < NR_EVENT_CHANNELS / 32; i++) 167 for (i = 0; i < NR_EVENT_CHANNELS / 32; i++)
168 pirq_needs_unmask_notify[i] = 0; 168 pirq_needs_unmask_notify[i] = 0;
169#endif 169#endif

cvs diff -r1.58 -r1.59 src/sys/arch/xen/xen/hypervisor.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/hypervisor.c 2011/09/22 23:02:35 1.58
+++ src/sys/arch/xen/xen/hypervisor.c 2011/12/07 15:47:43 1.59
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: hypervisor.c,v 1.58 2011/09/22 23:02:35 jym Exp $ */ 1/* $NetBSD: hypervisor.c,v 1.59 2011/12/07 15:47:43 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2005 Manuel Bouyer. 4 * Copyright (c) 2005 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 * 14 *
@@ -43,51 +43,51 @@ @@ -43,51 +43,51 @@
43 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 43 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
44 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 44 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
45 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 45 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
46 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 47 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
48 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 48 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
49 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
50 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 50 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
51 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 */ 52 */
53 53
54 54
55#include <sys/cdefs.h> 55#include <sys/cdefs.h>
56__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.58 2011/09/22 23:02:35 jym Exp $"); 56__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.59 2011/12/07 15:47:43 cegger Exp $");
57 57
58#include <sys/param.h> 58#include <sys/param.h>
59#include <sys/systm.h> 59#include <sys/systm.h>
60#include <sys/device.h> 60#include <sys/device.h>
61#include <sys/malloc.h> 61#include <sys/malloc.h>
62 62
63#include "xenbus.h" 63#include "xenbus.h"
64#include "xencons.h" 64#include "xencons.h"
65#ifndef __x86_64__ 65#ifndef __x86_64__
66#include "npx.h" 66#include "npx.h"
67#else 67#else
68#define NNPX 0 68#define NNPX 0
69#endif /* __x86_64__ */ 69#endif /* __x86_64__ */
70#include "isa.h" 70#include "isa.h"
71#include "pci.h" 71#include "pci.h"
72#include "acpica.h" 72#include "acpica.h"
73 73
74#include "opt_xen.h" 74#include "opt_xen.h"
75#include "opt_mpbios.h" 75#include "opt_mpbios.h"
76 76
77#include <xen/xen.h> 77#include <xen/xen.h>
78#include <xen/hypervisor.h> 78#include <xen/hypervisor.h>
79#include <xen/evtchn.h> 79#include <xen/evtchn.h>
80#include <xen/xen3-public/version.h> 80#include <xen/xen-public/version.h>
81 81
82#include <sys/cpu.h> 82#include <sys/cpu.h>
83#include <sys/dirent.h> 83#include <sys/dirent.h>
84#include <sys/stat.h> 84#include <sys/stat.h>
85#include <sys/tree.h> 85#include <sys/tree.h>
86#include <sys/vnode.h> 86#include <sys/vnode.h>
87#include <miscfs/specfs/specdev.h> 87#include <miscfs/specfs/specdev.h>
88#include <miscfs/kernfs/kernfs.h> 88#include <miscfs/kernfs/kernfs.h>
89#include <xen/kernfs_machdep.h> 89#include <xen/kernfs_machdep.h>
90#include <dev/isa/isavar.h> 90#include <dev/isa/isavar.h>
91#include <xen/granttables.h> 91#include <xen/granttables.h>
92#include <xen/vcpuvar.h> 92#include <xen/vcpuvar.h>
93#if NPCI > 0 93#if NPCI > 0

cvs diff -r1.55 -r1.56 src/sys/arch/xen/xen/if_xennet_xenbus.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/if_xennet_xenbus.c 2011/12/04 15:15:41 1.55
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c 2011/12/07 15:47:43 1.56
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_xennet_xenbus.c,v 1.55 2011/12/04 15:15:41 cherry Exp $ */ 1/* $NetBSD: if_xennet_xenbus.c,v 1.56 2011/12/07 15:47:43 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 * 14 *
@@ -75,27 +75,27 @@ @@ -75,27 +75,27 @@
75 * Purpose is to process the packets received from the outside. RX buffers 75 * Purpose is to process the packets received from the outside. RX buffers
76 * are pre-allocated through xennet_alloc_rx_buffer(), during xennet autoconf 76 * are pre-allocated through xennet_alloc_rx_buffer(), during xennet autoconf
77 * attach. During pre-allocation, frontend pushes requests in the I/O ring, in 77 * attach. During pre-allocation, frontend pushes requests in the I/O ring, in
78 * preparation for incoming packets from backend. 78 * preparation for incoming packets from backend.
79 * When RX packets need to be processed, backend takes the requests previously 79 * When RX packets need to be processed, backend takes the requests previously
80 * offered by frontend and pushes the associated responses inside the I/O ring. 80 * offered by frontend and pushes the associated responses inside the I/O ring.
81 * When done, it notifies frontend through an event notification, which will 81 * When done, it notifies frontend through an event notification, which will
82 * asynchronously call xennet_handler() in frontend. 82 * asynchronously call xennet_handler() in frontend.
83 * xennet_handler() processes the responses, generates the associated mbuf, and 83 * xennet_handler() processes the responses, generates the associated mbuf, and
84 * passes it to the MI layer for further processing. 84 * passes it to the MI layer for further processing.
85 */ 85 */
86 86
87#include <sys/cdefs.h> 87#include <sys/cdefs.h>
88__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.55 2011/12/04 15:15:41 cherry Exp $"); 88__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.56 2011/12/07 15:47:43 cegger Exp $");
89 89
90#include "opt_xen.h" 90#include "opt_xen.h"
91#include "opt_nfs_boot.h" 91#include "opt_nfs_boot.h"
92#include "rnd.h" 92#include "rnd.h"
93 93
94#include <sys/param.h> 94#include <sys/param.h>
95#include <sys/device.h> 95#include <sys/device.h>
96#include <sys/conf.h> 96#include <sys/conf.h>
97#include <sys/kernel.h> 97#include <sys/kernel.h>
98#include <sys/proc.h> 98#include <sys/proc.h>
99#include <sys/systm.h> 99#include <sys/systm.h>
100#include <sys/intr.h> 100#include <sys/intr.h>
101#if NRND > 0 101#if NRND > 0
@@ -118,53 +118,53 @@ __KERNEL_RCSID(0, "$NetBSD: if_xennet_xe @@ -118,53 +118,53 @@ __KERNEL_RCSID(0, "$NetBSD: if_xennet_xe
118#include <nfs/nfs.h> 118#include <nfs/nfs.h>
119#include <nfs/nfsmount.h> 119#include <nfs/nfsmount.h>
120#include <nfs/nfsdiskless.h> 120#include <nfs/nfsdiskless.h>
121#include <xen/if_xennetvar.h> 121#include <xen/if_xennetvar.h>
122#endif /* defined(NFS_BOOT_BOOTSTATIC) */ 122#endif /* defined(NFS_BOOT_BOOTSTATIC) */
123 123
124#include <xen/xennet_checksum.h> 124#include <xen/xennet_checksum.h>
125 125
126#include <uvm/uvm.h> 126#include <uvm/uvm.h>
127 127
128#include <xen/hypervisor.h> 128#include <xen/hypervisor.h>
129#include <xen/evtchn.h> 129#include <xen/evtchn.h>
130#include <xen/granttables.h> 130#include <xen/granttables.h>
131#include <xen/xen3-public/io/netif.h> 131#include <xen/xen-public/io/netif.h>
132#include <xen/xenpmap.h> 132#include <xen/xenpmap.h>
133 133
134#include <xen/xenbus.h> 134#include <xen/xenbus.h>
135#include "locators.h" 135#include "locators.h"
136 136
137#undef XENNET_DEBUG_DUMP 137#undef XENNET_DEBUG_DUMP
138#undef XENNET_DEBUG 138#undef XENNET_DEBUG
139#ifdef XENNET_DEBUG 139#ifdef XENNET_DEBUG
140#define XEDB_FOLLOW 0x01 140#define XEDB_FOLLOW 0x01
141#define XEDB_INIT 0x02  141#define XEDB_INIT 0x02
142#define XEDB_EVENT 0x04 142#define XEDB_EVENT 0x04
143#define XEDB_MBUF 0x08 143#define XEDB_MBUF 0x08
144#define XEDB_MEM 0x10 144#define XEDB_MEM 0x10
145int xennet_debug = 0xff; 145int xennet_debug = 0xff;
146#define DPRINTF(x) if (xennet_debug) printf x; 146#define DPRINTF(x) if (xennet_debug) printf x;
147#define DPRINTFN(n,x) if (xennet_debug & (n)) printf x; 147#define DPRINTFN(n,x) if (xennet_debug & (n)) printf x;
148#else 148#else
149#define DPRINTF(x) 149#define DPRINTF(x)
150#define DPRINTFN(n,x) 150#define DPRINTFN(n,x)
151#endif 151#endif
152 152
153#define GRANT_INVALID_REF -1 /* entry is free */ 153#define GRANT_INVALID_REF -1 /* entry is free */
154#define GRANT_STACK_REF -2 /* entry owned by the network stack */ 154#define GRANT_STACK_REF -2 /* entry owned by the network stack */
155 155
156#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE) 156#define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGE_SIZE)
157#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE) 157#define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, PAGE_SIZE)
158 158
159struct xennet_txreq { 159struct xennet_txreq {
160 SLIST_ENTRY(xennet_txreq) txreq_next; 160 SLIST_ENTRY(xennet_txreq) txreq_next;
161 uint16_t txreq_id; /* ID passed to backend */ 161 uint16_t txreq_id; /* ID passed to backend */
162 grant_ref_t txreq_gntref; /* grant ref of this request */ 162 grant_ref_t txreq_gntref; /* grant ref of this request */
163 struct mbuf *txreq_m; /* mbuf being transmitted */ 163 struct mbuf *txreq_m; /* mbuf being transmitted */
164}; 164};
165 165
166struct xennet_rxreq { 166struct xennet_rxreq {
167 SLIST_ENTRY(xennet_rxreq) rxreq_next; 167 SLIST_ENTRY(xennet_rxreq) rxreq_next;
168 uint16_t rxreq_id; /* ID passed to backend */ 168 uint16_t rxreq_id; /* ID passed to backend */
169 grant_ref_t rxreq_gntref; /* grant ref of this request */ 169 grant_ref_t rxreq_gntref; /* grant ref of this request */
170/* va/pa for this receive buf. ma will be provided by backend */ 170/* va/pa for this receive buf. ma will be provided by backend */

cvs diff -r1.5 -r1.6 src/sys/arch/xen/xen/pciback.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/pciback.c 2009/10/19 18:41:11 1.5
+++ src/sys/arch/xen/xen/pciback.c 2011/12/07 15:47:43 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pciback.c,v 1.5 2009/10/19 18:41:11 bouyer Exp $ */ 1/* $NetBSD: pciback.c,v 1.6 2011/12/07 15:47:43 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2009 Manuel Bouyer. 4 * Copyright (c) 2009 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 * 14 *
@@ -16,50 +16,50 @@ @@ -16,50 +16,50 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.5 2009/10/19 18:41:11 bouyer Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.6 2011/12/07 15:47:43 cegger Exp $");
30 30
31#include "opt_xen.h" 31#include "opt_xen.h"
32#include "rnd.h" 32#include "rnd.h"
33 33
34#include <sys/types.h> 34#include <sys/types.h>
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/errno.h> 37#include <sys/errno.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41#include <sys/queue.h> 41#include <sys/queue.h>
42 42
43#include <uvm/uvm_extern.h> 43#include <uvm/uvm_extern.h>
44 44
45#include <machine/bus_private.h> 45#include <machine/bus_private.h>
46 46
47#include <dev/isa/isareg.h> 47#include <dev/isa/isareg.h>
48 48
49#include <xen/hypervisor.h> 49#include <xen/hypervisor.h>
50#include <xen/evtchn.h> 50#include <xen/evtchn.h>
51#include <xen/granttables.h> 51#include <xen/granttables.h>
52#include <xen/xen3-public/io/pciif.h> 52#include <xen/xen-public/io/pciif.h>
53#include <xen/xenbus.h> 53#include <xen/xenbus.h>
54 54
55#include <sys/stat.h> 55#include <sys/stat.h>
56#include <sys/dirent.h> 56#include <sys/dirent.h>
57#include <miscfs/specfs/specdev.h> 57#include <miscfs/specfs/specdev.h>
58#include <miscfs/kernfs/kernfs.h> 58#include <miscfs/kernfs/kernfs.h>
59#include <xen/kernfs_machdep.h> 59#include <xen/kernfs_machdep.h>
60 60
61#include "locators.h" 61#include "locators.h"
62 62
63#include <dev/pci/pcivar.h> 63#include <dev/pci/pcivar.h>
64#include <machine/i82093var.h> 64#include <machine/i82093var.h>
65 65

cvs diff -r1.49 -r1.50 src/sys/arch/xen/xen/xbd_xenbus.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/xbd_xenbus.c 2011/11/19 22:51:21 1.49
+++ src/sys/arch/xen/xen/xbd_xenbus.c 2011/12/07 15:47:43 1.50
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xbd_xenbus.c,v 1.49 2011/11/19 22:51:21 tls Exp $ */ 1/* $NetBSD: xbd_xenbus.c,v 1.50 2011/12/07 15:47:43 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 * 14 *
@@ -40,27 +40,27 @@ @@ -40,27 +40,27 @@
40 * - initiate request: xbdread/write/open/ioctl/.. 40 * - initiate request: xbdread/write/open/ioctl/..
41 * - depending on operation, it is handled directly by disk(9) subsystem or 41 * - depending on operation, it is handled directly by disk(9) subsystem or
42 * goes through physio(9) first. 42 * goes through physio(9) first.
43 * - the request is ultimately processed by xbdstart() that prepares the 43 * - the request is ultimately processed by xbdstart() that prepares the
44 * xbd requests, post them in the ring I/O queue, then signal the backend. 44 * xbd requests, post them in the ring I/O queue, then signal the backend.
45 * 45 *
46 * When a response is available in the queue, the backend signals the frontend 46 * When a response is available in the queue, the backend signals the frontend
47 * via its event channel. This triggers xbd_handler(), which will link back 47 * via its event channel. This triggers xbd_handler(), which will link back
48 * the response to its request through the request ID, and mark the I/O as 48 * the response to its request through the request ID, and mark the I/O as
49 * completed. 49 * completed.
50 */ 50 */
51 51
52#include <sys/cdefs.h> 52#include <sys/cdefs.h>
53__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.49 2011/11/19 22:51:21 tls Exp $"); 53__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.50 2011/12/07 15:47:43 cegger Exp $");
54 54
55#include "opt_xen.h" 55#include "opt_xen.h"
56#include "rnd.h" 56#include "rnd.h"
57 57
58#include <sys/param.h> 58#include <sys/param.h>
59#include <sys/buf.h> 59#include <sys/buf.h>
60#include <sys/bufq.h> 60#include <sys/bufq.h>
61#include <sys/device.h> 61#include <sys/device.h>
62#include <sys/disk.h> 62#include <sys/disk.h>
63#include <sys/disklabel.h> 63#include <sys/disklabel.h>
64#include <sys/conf.h> 64#include <sys/conf.h>
65#include <sys/fcntl.h> 65#include <sys/fcntl.h>
66#include <sys/kernel.h> 66#include <sys/kernel.h>
@@ -70,42 +70,42 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c @@ -70,42 +70,42 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c
70#include <sys/vnode.h> 70#include <sys/vnode.h>
71 71
72#include <dev/dkvar.h> 72#include <dev/dkvar.h>
73 73
74#include <uvm/uvm.h> 74#include <uvm/uvm.h>
75 75
76#if NRND > 0 76#if NRND > 0
77#include <sys/rnd.h> 77#include <sys/rnd.h>
78#endif 78#endif
79 79
80#include <xen/hypervisor.h> 80#include <xen/hypervisor.h>
81#include <xen/evtchn.h> 81#include <xen/evtchn.h>
82#include <xen/granttables.h> 82#include <xen/granttables.h>
83#include <xen/xen3-public/io/blkif.h> 83#include <xen/xen-public/io/blkif.h>
84#include <xen/xen3-public/io/protocols.h> 84#include <xen/xen-public/io/protocols.h>
85 85
86#include <xen/xenbus.h> 86#include <xen/xenbus.h>
87#include "locators.h" 87#include "locators.h"
88 88
89#undef XBD_DEBUG 89#undef XBD_DEBUG
90#ifdef XBD_DEBUG 90#ifdef XBD_DEBUG
91#define DPRINTF(x) printf x; 91#define DPRINTF(x) printf x;
92#else 92#else
93#define DPRINTF(x) 93#define DPRINTF(x)
94#endif 94#endif
95 95
96#define GRANT_INVALID_REF -1 96#define GRANT_INVALID_REF -1
97 97
98#define XBD_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE) 98#define XBD_RING_SIZE __CONST_RING_SIZE(blkif, PAGE_SIZE)
99 99
100#define XEN_BSHIFT 9 /* log2(XEN_BSIZE) */ 100#define XEN_BSHIFT 9 /* log2(XEN_BSIZE) */
101#define XEN_BSIZE (1 << XEN_BSHIFT)  101#define XEN_BSIZE (1 << XEN_BSHIFT)
102 102
103struct xbd_req { 103struct xbd_req {
104 SLIST_ENTRY(xbd_req) req_next; 104 SLIST_ENTRY(xbd_req) req_next;
105 uint16_t req_id; /* ID passed to backend */ 105 uint16_t req_id; /* ID passed to backend */
106 union { 106 union {
107 struct { 107 struct {
108 grant_ref_t req_gntref[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 108 grant_ref_t req_gntref[BLKIF_MAX_SEGMENTS_PER_REQUEST];
109 int req_nr_segments; /* number of segments in this request */ 109 int req_nr_segments; /* number of segments in this request */
110 struct buf *req_bp; /* buffer associated with this request */ 110 struct buf *req_bp; /* buffer associated with this request */
111 void *req_data; /* pointer to the data buffer */ 111 void *req_data; /* pointer to the data buffer */

cvs diff -r1.54 -r1.55 src/sys/arch/xen/xen/xbdback_xenbus.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/xbdback_xenbus.c 2011/12/03 22:36:28 1.54
+++ src/sys/arch/xen/xen/xbdback_xenbus.c 2011/12/07 15:47:43 1.55
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xbdback_xenbus.c,v 1.54 2011/12/03 22:36:28 bouyer Exp $ */ 1/* $NetBSD: xbdback_xenbus.c,v 1.55 2011/12/07 15:47:43 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 * 14 *
@@ -16,53 +16,53 @@ @@ -16,53 +16,53 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.54 2011/12/03 22:36:28 bouyer Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.55 2011/12/07 15:47:43 cegger Exp $");
30 30
31#include <sys/atomic.h> 31#include <sys/atomic.h>
32#include <sys/buf.h> 32#include <sys/buf.h>
33#include <sys/condvar.h> 33#include <sys/condvar.h>
34#include <sys/conf.h> 34#include <sys/conf.h>
35#include <sys/disk.h> 35#include <sys/disk.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/fcntl.h> 37#include <sys/fcntl.h>
38#include <sys/kauth.h> 38#include <sys/kauth.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/kmem.h> 40#include <sys/kmem.h>
41#include <sys/kthread.h> 41#include <sys/kthread.h>
42#include <sys/malloc.h> 42#include <sys/malloc.h>
43#include <sys/mutex.h> 43#include <sys/mutex.h>
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/queue.h> 45#include <sys/queue.h>
46#include <sys/systm.h> 46#include <sys/systm.h>
47#include <sys/time.h> 47#include <sys/time.h>
48#include <sys/types.h> 48#include <sys/types.h>
49#include <sys/vnode.h> 49#include <sys/vnode.h>
50 50
51#include <xen/xen.h> 51#include <xen/xen.h>
52#include <xen/xen_shm.h> 52#include <xen/xen_shm.h>
53#include <xen/evtchn.h> 53#include <xen/evtchn.h>
54#include <xen/xenbus.h> 54#include <xen/xenbus.h>
55#include <xen/xen3-public/io/protocols.h> 55#include <xen/xen-public/io/protocols.h>
56 56
57/* #define XENDEBUG_VBD */ 57/* #define XENDEBUG_VBD */
58#ifdef XENDEBUG_VBD 58#ifdef XENDEBUG_VBD
59#define XENPRINTF(x) printf x 59#define XENPRINTF(x) printf x
60#else 60#else
61#define XENPRINTF(x) 61#define XENPRINTF(x)
62#endif 62#endif
63 63
64#define BLKIF_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE) 64#define BLKIF_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE)
65 65
66/* 66/*
67 * Backend block device driver for Xen 67 * Backend block device driver for Xen
68 */ 68 */

cvs diff -r1.38 -r1.39 src/sys/arch/xen/xen/xencons.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/xencons.c 2011/09/20 00:12:24 1.38
+++ src/sys/arch/xen/xen/xencons.c 2011/12/07 15:47:43 1.39
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xencons.c,v 1.38 2011/09/20 00:12:24 jym Exp $ */ 1/* $NetBSD: xencons.c,v 1.39 2011/12/07 15:47:43 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 * 14 *
@@ -43,46 +43,46 @@ @@ -43,46 +43,46 @@
43 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 43 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
44 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 44 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
45 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 45 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
46 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 47 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
48 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 48 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
49 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
50 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 50 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
51 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 */ 52 */
53 53
54 54
55#include <sys/cdefs.h> 55#include <sys/cdefs.h>
56__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.38 2011/09/20 00:12:24 jym Exp $"); 56__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.39 2011/12/07 15:47:43 cegger Exp $");
57 57
58#include "opt_xen.h" 58#include "opt_xen.h"
59 59
60#include <sys/param.h> 60#include <sys/param.h>
61#include <sys/ioctl.h> 61#include <sys/ioctl.h>
62#include <sys/proc.h> 62#include <sys/proc.h>
63#include <sys/tty.h> 63#include <sys/tty.h>
64#include <sys/systm.h> 64#include <sys/systm.h>
65#include <sys/device.h> 65#include <sys/device.h>
66#include <sys/conf.h> 66#include <sys/conf.h>
67#include <sys/kauth.h> 67#include <sys/kauth.h>
68#include <sys/kernel.h> 68#include <sys/kernel.h>
69 69
70#include <xen/xen.h> 70#include <xen/xen.h>
71#include <xen/hypervisor.h> 71#include <xen/hypervisor.h>
72#include <xen/evtchn.h> 72#include <xen/evtchn.h>
73#include <uvm/uvm.h> 73#include <uvm/uvm.h>
74#include <machine/pmap.h> 74#include <machine/pmap.h>
75#include <xen/xen3-public/io/console.h> 75#include <xen/xen-public/io/console.h>
76 76
77#include <dev/cons.h> 77#include <dev/cons.h>
78 78
79#ifdef DDB 79#ifdef DDB
80#include <ddb/db_output.h> /* XXX for db_max_line */ 80#include <ddb/db_output.h> /* XXX for db_max_line */
81#endif 81#endif
82 82
83#undef XENDEBUG 83#undef XENDEBUG
84  84
85#ifdef XENDEBUG 85#ifdef XENDEBUG
86#define XENPRINTK(x) printk x 86#define XENPRINTK(x) printk x
87#else  87#else
88#define XENPRINTK(x) 88#define XENPRINTK(x)

cvs diff -r1.8 -r1.9 src/sys/arch/xen/xen/xpci_xenbus.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/xpci_xenbus.c 2011/09/01 15:10:31 1.8
+++ src/sys/arch/xen/xen/xpci_xenbus.c 2011/12/07 15:47:43 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xpci_xenbus.c,v 1.8 2011/09/01 15:10:31 christos Exp $ */ 1/* $NetBSD: xpci_xenbus.c,v 1.9 2011/12/07 15:47:43 cegger Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2009 Manuel Bouyer. 4 * Copyright (c) 2009 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 * 14 *
@@ -16,49 +16,49 @@ @@ -16,49 +16,49 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.8 2011/09/01 15:10:31 christos Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.9 2011/12/07 15:47:43 cegger Exp $");
30 30
31#include "opt_xen.h" 31#include "opt_xen.h"
32#include "rnd.h" 32#include "rnd.h"
33 33
34#include <sys/types.h> 34#include <sys/types.h>
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/errno.h> 37#include <sys/errno.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41 41
42#include <uvm/uvm_extern.h> 42#include <uvm/uvm_extern.h>
43 43
44#include <machine/bus_private.h> 44#include <machine/bus_private.h>
45 45
46#include <dev/isa/isareg.h> 46#include <dev/isa/isareg.h>
47 47
48#include <xen/hypervisor.h> 48#include <xen/hypervisor.h>
49#include <xen/evtchn.h> 49#include <xen/evtchn.h>
50#include <xen/granttables.h> 50#include <xen/granttables.h>
51#include <xen/xen3-public/io/pciif.h> 51#include <xen/xen-public/io/pciif.h>
52#include <xen/xenbus.h> 52#include <xen/xenbus.h>
53 53
54#include "locators.h" 54#include "locators.h"
55 55
56#include <dev/pci/pcivar.h> 56#include <dev/pci/pcivar.h>
57 57
58#undef XPCI_DEBUG 58#undef XPCI_DEBUG
59#ifdef XPCI_DEBUG 59#ifdef XPCI_DEBUG
60#define DPRINTF(x) printf x; 60#define DPRINTF(x) printf x;
61#else 61#else
62#define DPRINTF(x) 62#define DPRINTF(x)
63#endif 63#endif
64 64