Subversion Repositories Kolibri OS

Rev

Rev 1521 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1521 Rev 1529
Line 33... Line 33...
33
	LAST_IO = 0
33
	LAST_IO = 0
Line 34... Line 34...
34
 
34
 
Line 35... Line 35...
35
macro set_io addr {
35
macro set_io addr {
36
 
-
 
37
	if	addr = 0
36
 
38
 
-
 
39
	mov	edx, [device.io_addr]
37
	if	addr = 0
40
 
-
 
41
	else if addr = LAST_IO
38
	mov	edx, [device.io_addr]
42
 
-
 
43
	else
39
	else if addr = LAST_IO
44
 
-
 
45
	add	edx, addr - LAST_IO
40
	else
Line 46... Line 41...
46
 
41
	add	edx, addr - LAST_IO
47
	end if
42
	end if
Line 48... Line -...
48
 
-
 
49
	LAST_IO = addr
-
 
50
}
43
 
Line 51... Line 44...
51
 
44
	LAST_IO = addr
52
 
45
}
53
 
46
 
Line 81... Line 74...
81
	xor	eax, eax
74
	xor	eax, eax
82
	rep	stosd
75
	rep	stosd
Line 83... Line 76...
83
 
76
 
Line 84... Line -...
84
}
-
 
85
 
-
 
86
 
77
}
Line 87... Line 78...
87
 
78
 
Line 88... Line 79...
88
macro find_io bus, dev, io {
79
macro find_io bus, dev, io {
Line 124... Line 115...
124
	mov	irq, al
115
	mov	irq, al
125
	pop	ecx edx eax
116
	pop	ecx edx eax
Line 126... Line 117...
126
 
117
 
Line 127... Line -...
127
}
-
 
128
 
118
}
Line 129... Line 119...
129
 
119
 
130
macro find_rev bus, dev, rev {
120
macro find_rev bus, dev, rev {
131
 
121
 
Line 136... Line 126...
136
	mov	rev, al
126
	mov	rev, al
137
	pop	ecx edx eax
127
	pop	ecx edx eax
Line 138... Line 128...
138
 
128
 
Line 139... Line -...
139
}
-
 
140
 
-
 
141
 
129
}
Line 142... Line 130...
142
 
130
 
143
macro make_bus_master bus, dev {
131
macro make_bus_master bus, dev {
144
 
132
 
Line 166... Line 154...
166
virtual at edx
154
virtual at edx
167
  IOCTL IOCTL
155
  IOCTL IOCTL
168
end virtual
156
end virtual
Line 169... Line -...
169
 
-
 
170
 
-
 
171
 
157
 
172
 
-
 
173
if used null_op
158
 
174
 
159
if used null_op
175
align 4
160
align 4
176
null_op:
161
null_op:
Line 177... Line 162...
177
	or	eax, -1
162
	or	eax, -1
Line 178... Line 163...
178
	ret
163
	ret
Line 179... Line 164...
179
 
164
 
180
end if
-
 
181
 
165
end if
-
 
166
 
182
 
167
 
183
macro virt_to_dma { ; input is eax
168
macro GetRealAddr { ; input is eax
184
 
169
 
Line 185... Line 170...
185
	push	ax
170
	push	ax
Line 207... Line 192...
207
	.packets_rx	dd ?	;
192
	.packets_rx	dd ?	;
Line 208... Line 193...
208
 
193
 
209
	.end:
194
	.end:
Line 210... Line -...
210
}
-
 
-
 
195
}
211
 
196
 
212
;struc ETH_DEVICE {
197
 
Line 213... Line 198...
213
macro ETH_DEVICE {
198
macro ETH_DEVICE {
214
      NET_DEVICE
199
      NET_DEVICE
Line 234... Line 219...
234
	.get_mode	dd ?
219
	.get_mode	dd ?
Line 235... Line 220...
235
 
220
 
Line 236... Line 221...
236
	.mode		dd ?
221
	.mode		dd ?
237
 
-
 
238
}
-
 
239
 
-
 
240
macro GetRealAddr {
-
 
241
 
-
 
242
	push	eax
-
 
243
	call	GetPgAddr
-
 
244
	and	dword [esp], (PAGESIZE - 1)
-
 
245
	or	eax, dword [esp]
-
 
246
	add	esp, 4
-
 
247
 
-
 
248
}
-