1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
/* $NetBSD: isa_machdep.c,v 1.2 1995/08/03 01:23:08 cgd Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/conf.h>
#include <sys/malloc.h>
#include <sys/device.h>
#include <machine/autoconf.h>
#include <machine/pio.h>
#include <machine/rpb.h>
#include <machine/vmparam.h>
#include <machine/pte.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
#include <dev/isa/isadmavar.h>
#include <alpha/isa/isa_intr.h>
#include <alpha/isa/isa_dma.h>
int isamatch __P((struct device *, void *, void *));
void isaattach __P((struct device *, struct device *, void *));
struct cfdriver isacd = {
NULL, "isa", isamatch, isaattach, DV_DULL, sizeof(struct isa_softc), 1
};
int
isamatch(parent, cfdata, aux)
struct device *parent;
void *cfdata, *aux;
{
struct cfdata *cf = cfdata;
struct confargs *ca = aux;
#if 0 /* XXX -- Assume that it's valid if unit number OK */
/* It can only occur on the mainbus. */
if (ca->ca_bus->ab_type != BUS_MAIN)
return (0);
/* Make sure that we're looking for this type of device. */
if (!BUS_MATCHNAME(ca, "isa"))
return (0);
#endif /* XXX */
/* See if the unit number is valid. */
switch (hwrpb->rpb_type) {
#if defined(DEC_2100_A50)
case ST_DEC_2100_A50:
if (cf->cf_unit > 0)
return (0);
break;
#endif
default:
return (0);
}
return (1);
}
void
isaattach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
struct isa_softc *sc = (struct isa_softc *)self;
printf("\n");
TAILQ_INIT(&sc->sc_subdevs);
/* XXX set up ISA DMA controllers? */
config_scan(isascan, self);
}
void *
isa_intr_establish(irq, type, level, ih_fun, ih_arg)
int irq;
isa_intrtype type;
isa_intrlevel level;
int (*ih_fun)(void *);
void *ih_arg;
{
return (*isa_intr_fcns->isa_intr_establish)(irq, type, level,
ih_fun, ih_arg);
}
void
isa_intr_disestablish(handler)
void *handler;
{
(*isa_intr_fcns->isa_intr_disestablish)(handler);
}
int
isadma_map(addr, size, mappings, flags)
caddr_t addr;
vm_size_t size;
vm_offset_t *mappings;
int flags;
{
(*isadma_fcns->isadma_map)(addr, size, mappings, flags);
}
void
isadma_unmap(addr, size, nmappings, mappings)
caddr_t addr;
vm_size_t size;
int nmappings;
vm_offset_t *mappings;
{
(*isadma_fcns->isadma_unmap)(addr, size, nmappings, mappings);
}
void
isadma_copytobuf(addr, size, nmappings, mappings)
caddr_t addr;
vm_size_t size;
int nmappings;
vm_offset_t *mappings;
{
(*isadma_fcns->isadma_copytobuf)(addr, size, nmappings, mappings);
}
void
isadma_copyfrombuf(addr, size, nmappings, mappings)
caddr_t addr;
vm_size_t size;
int nmappings;
vm_offset_t *mappings;
{
(*isadma_fcns->isadma_copyfrombuf)(addr, size, nmappings, mappings);
}
|