| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: emuxki.c,v 1.67.2.4 2019/05/01 06:34:46 isaki Exp $ */ | | 1 | /* $NetBSD: emuxki.c,v 1.67.2.5 2019/05/01 09:41:50 isaki Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001, 2007 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 Yannick Montulet, and by Andrew Doran. | | 8 | * by Yannick Montulet, 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. |
| @@ -28,27 +28,27 @@ | | | @@ -28,27 +28,27 @@ |
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 | /* | | 32 | /* |
33 | * EMU10K1 single voice driver | | 33 | * EMU10K1 single voice driver |
34 | * o. only 1 voice playback, 1 recording | | 34 | * o. only 1 voice playback, 1 recording |
35 | * o. only s16le 2ch 48k | | 35 | * o. only s16le 2ch 48k |
36 | * This makes it simple to control buffers and interrupts | | 36 | * This makes it simple to control buffers and interrupts |
37 | * while satisfying playback and recording quality. | | 37 | * while satisfying playback and recording quality. |
38 | */ | | 38 | */ |
39 | | | 39 | |
40 | #include <sys/cdefs.h> | | 40 | #include <sys/cdefs.h> |
41 | __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.67.2.4 2019/05/01 06:34:46 isaki Exp $"); | | 41 | __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.67.2.5 2019/05/01 09:41:50 isaki Exp $"); |
42 | | | 42 | |
43 | #include <sys/param.h> | | 43 | #include <sys/param.h> |
44 | #include <sys/device.h> | | 44 | #include <sys/device.h> |
45 | #include <sys/errno.h> | | 45 | #include <sys/errno.h> |
46 | #include <sys/systm.h> | | 46 | #include <sys/systm.h> |
47 | #include <sys/audioio.h> | | 47 | #include <sys/audioio.h> |
48 | #include <sys/mutex.h> | | 48 | #include <sys/mutex.h> |
49 | #include <sys/kmem.h> | | 49 | #include <sys/kmem.h> |
50 | #include <sys/malloc.h> | | 50 | #include <sys/malloc.h> |
51 | #include <sys/fcntl.h> | | 51 | #include <sys/fcntl.h> |
52 | | | 52 | |
53 | #include <sys/bus.h> | | 53 | #include <sys/bus.h> |
54 | #include <sys/intr.h> | | 54 | #include <sys/intr.h> |
| @@ -61,28 +61,28 @@ __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1 | | | @@ -61,28 +61,28 @@ __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1 |
61 | | | 61 | |
62 | #include <dev/pci/pcidevs.h> | | 62 | #include <dev/pci/pcidevs.h> |
63 | #include <dev/pci/pcireg.h> | | 63 | #include <dev/pci/pcireg.h> |
64 | #include <dev/pci/pcivar.h> | | 64 | #include <dev/pci/pcivar.h> |
65 | | | 65 | |
66 | #include <dev/pci/emuxkireg.h> | | 66 | #include <dev/pci/emuxkireg.h> |
67 | | | 67 | |
68 | /* #define EMUXKI_DEBUG 1 */ | | 68 | /* #define EMUXKI_DEBUG 1 */ |
69 | #ifdef EMUXKI_DEBUG | | 69 | #ifdef EMUXKI_DEBUG |
70 | #define emudebug EMUXKI_DEBUG | | 70 | #define emudebug EMUXKI_DEBUG |
71 | # define DPRINTF(fmt...) do { if (emudebug) printf(fmt); } while (0) | | 71 | # define DPRINTF(fmt...) do { if (emudebug) printf(fmt); } while (0) |
72 | # define DPRINTFN(n,fmt...) do { if (emudebug>=(n)) printf(fmt); } while (0) | | 72 | # define DPRINTFN(n,fmt...) do { if (emudebug>=(n)) printf(fmt); } while (0) |
73 | #else | | 73 | #else |
74 | # define DPRINTF(fmt...) do { } while (0) | | 74 | # define DPRINTF(fmt...) __nothing |
75 | # define DPRINTFN(n,fmt...) do { } while (0) | | 75 | # define DPRINTFN(n,fmt...) __nothing |
76 | #endif | | 76 | #endif |
77 | | | 77 | |
78 | /* | | 78 | /* |
79 | * PCI | | 79 | * PCI |
80 | * Note: emuxki's page table entry uses only 31bit addressing. | | 80 | * Note: emuxki's page table entry uses only 31bit addressing. |
81 | * (Maybe, later chip has 32bit mode, but it isn't used now.) | | 81 | * (Maybe, later chip has 32bit mode, but it isn't used now.) |
82 | */ | | 82 | */ |
83 | | | 83 | |
84 | #define EMU_PCI_CBIO (0x10) | | 84 | #define EMU_PCI_CBIO (0x10) |
85 | #define EMU_SUBSYS_APS (0x40011102) | | 85 | #define EMU_SUBSYS_APS (0x40011102) |
86 | | | 86 | |
87 | #define EMU_PTESIZE (4096) | | 87 | #define EMU_PTESIZE (4096) |
88 | #define EMU_MINPTE (3) | | 88 | #define EMU_MINPTE (3) |