1 /* $NetBSD: npx_hv.c,v 1.7 2008/10/24 18:02:58 jym Exp $ */
5 * Copyright (c) 2004 Christian Limpach.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
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>
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
);
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)
62 npx_hv_attach(device_t parent
, device_t self
, void *aux
)
64 struct npx_softc
*sc
= device_private(self
);
67 sc
->sc_type
= NPX_EXCEPTION
;
69 aprint_normal(": using exception 16\n");