No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / xen / i386 / npx_hv.c
blobba9dd5bc72e6c3b29180b39d42286013ecc93742
1 /* $NetBSD: npx_hv.c,v 1.7 2008/10/24 18:02:58 jym Exp $ */
3 /*
5 * Copyright (c) 2004 Christian Limpach.
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
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
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
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include <sys/cdefs.h>
31 __KERNEL_RCSID(0, "$NetBSD: npx_hv.c,v 1.7 2008/10/24 18:02:58 jym Exp $");
33 #include <sys/param.h>
34 #include <sys/systm.h>
35 #include <sys/device.h>
37 #include <machine/bus.h>
38 #include <machine/stdarg.h>
40 #include <xen/xen.h>
41 #include <xen/hypervisor.h>
43 #include <i386/isa/npxvar.h>
45 int npx_hv_probe(device_t, cfdata_t, void *);
46 void npx_hv_attach(device_t, device_t, void *);
48 CFATTACH_DECL_NEW(npx_hv, sizeof(struct npx_softc),
49 npx_hv_probe, npx_hv_attach, NULL, NULL);
51 int
52 npx_hv_probe(device_t parent, cfdata_t match, void *aux)
54 struct xen_npx_attach_args *xa = (struct xen_npx_attach_args *)aux;
56 if (strcmp(xa->xa_device, "npx") == 0)
57 return 1;
58 return 0;
61 void
62 npx_hv_attach(device_t parent, device_t self, void *aux)
64 struct npx_softc *sc = device_private(self);
66 sc->sc_dev = self;
67 sc->sc_type = NPX_EXCEPTION;
69 aprint_normal(": using exception 16\n");
71 npxattach(sc);