| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ld_thunkbus.c,v 1.19 2011/11/27 21:22:28 reinoud Exp $ */ | | 1 | /* $NetBSD: ld_thunkbus.c,v 1.20 2011/12/09 17:21:45 reinoud Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca> | | 4 | * Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca> |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -17,50 +17,50 @@ | | | @@ -17,50 +17,50 @@ |
17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 | * POSSIBILITY OF SUCH DAMAGE. | | 26 | * POSSIBILITY OF SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: ld_thunkbus.c,v 1.19 2011/11/27 21:22:28 reinoud Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: ld_thunkbus.c,v 1.20 2011/12/09 17:21:45 reinoud Exp $"); |
31 | | | 31 | |
32 | #include <sys/param.h> | | 32 | #include <sys/param.h> |
33 | #include <sys/proc.h> | | 33 | #include <sys/proc.h> |
34 | #include <sys/systm.h> | | 34 | #include <sys/systm.h> |
35 | #include <sys/device.h> | | 35 | #include <sys/device.h> |
36 | #include <sys/buf.h> | | 36 | #include <sys/buf.h> |
37 | #include <sys/disk.h> | | 37 | #include <sys/disk.h> |
38 | #include <sys/kmem.h> | | 38 | #include <sys/kmem.h> |
39 | | | 39 | |
40 | #include <dev/ldvar.h> | | 40 | #include <dev/ldvar.h> |
41 | | | 41 | |
42 | #include <machine/mainbus.h> | | 42 | #include <machine/mainbus.h> |
43 | #include <machine/thunk.h> | | 43 | #include <machine/thunk.h> |
44 | #include <machine/intr.h> | | 44 | #include <machine/intr.h> |
45 | | | 45 | |
46 | static int ld_thunkbus_match(device_t, cfdata_t, void *); | | 46 | static int ld_thunkbus_match(device_t, cfdata_t, void *); |
47 | static void ld_thunkbus_attach(device_t, device_t, void *); | | 47 | static void ld_thunkbus_attach(device_t, device_t, void *); |
48 | | | 48 | |
49 | static int ld_thunkbus_ldstart(struct ld_softc *, struct buf *); | | 49 | static int ld_thunkbus_ldstart(struct ld_softc *, struct buf *); |
50 | static int ld_thunkbus_lddump(struct ld_softc *, void *, int, int); | | 50 | static int ld_thunkbus_lddump(struct ld_softc *, void *, int, int); |
51 | static int ld_thunkbus_ldflush(struct ld_softc *, int); | | 51 | static int ld_thunkbus_ldflush(struct ld_softc *, int); |
52 | | | 52 | |
53 | #define LD_USE_AIO | | 53 | //#define LD_USE_AIO |
54 | | | 54 | |
55 | #ifdef LD_USE_AIO | | 55 | #ifdef LD_USE_AIO |
56 | static void ld_thunkbus_sig(int, siginfo_t *, void *); | | 56 | static void ld_thunkbus_sig(int, siginfo_t *, void *); |
57 | #endif | | 57 | #endif |
58 | static void ld_thunkbus_complete(void *arg); | | 58 | static void ld_thunkbus_complete(void *arg); |
59 | | | 59 | |
60 | struct ld_thunkbus_softc; | | 60 | struct ld_thunkbus_softc; |
61 | | | 61 | |
62 | struct ld_thunkbus_transfer { | | 62 | struct ld_thunkbus_transfer { |
63 | struct ld_thunkbus_softc *tt_sc; | | 63 | struct ld_thunkbus_softc *tt_sc; |
64 | struct aiocb tt_aio; | | 64 | struct aiocb tt_aio; |
65 | struct buf *tt_bp; | | 65 | struct buf *tt_bp; |
66 | }; | | 66 | }; |