| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: empb_bsm.c,v 1.3 2012/06/04 12:56:48 rkujawa Exp $ */ | | 1 | /* $NetBSD: empb_bsm.c,v 1.4 2012/06/04 19:45:50 rkujawa Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2012 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 Radoslaw Kujawa. | | 8 | * by Radoslaw Kujawa. |
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. |
| @@ -75,40 +75,40 @@ static bsw(empb_bsw2_swap, u_int16_t); | | | @@ -75,40 +75,40 @@ static bsw(empb_bsw2_swap, u_int16_t); |
75 | static bsr(empb_bsr2, u_int16_t); | | 75 | static bsr(empb_bsr2, u_int16_t); |
76 | static bsw(empb_bsw2, u_int16_t); | | 76 | static bsw(empb_bsw2, u_int16_t); |
77 | static bsrm(empb_bsrm2_swap, u_int16_t); | | 77 | static bsrm(empb_bsrm2_swap, u_int16_t); |
78 | static bswm(empb_bswm2_swap, u_int16_t); | | 78 | static bswm(empb_bswm2_swap, u_int16_t); |
79 | static bsrm(empb_bsrm2, u_int16_t); | | 79 | static bsrm(empb_bsrm2, u_int16_t); |
80 | static bswm(empb_bswm2, u_int16_t); | | 80 | static bswm(empb_bswm2, u_int16_t); |
81 | static bsrm(empb_bsrr2_swap, u_int16_t); | | 81 | static bsrm(empb_bsrr2_swap, u_int16_t); |
82 | static bswm(empb_bswr2_swap, u_int16_t); | | 82 | static bswm(empb_bswr2_swap, u_int16_t); |
83 | static bsrm(empb_bsrr2, u_int16_t); | | 83 | static bsrm(empb_bsrr2, u_int16_t); |
84 | static bswm(empb_bswr2, u_int16_t); | | 84 | static bswm(empb_bswr2, u_int16_t); |
85 | static bssr(empb_bssr2_swap, u_int16_t); | | 85 | static bssr(empb_bssr2_swap, u_int16_t); |
86 | static bscr(empb_bscr2, u_int16_t); | | 86 | static bscr(empb_bscr2, u_int16_t); |
87 | | | 87 | |
88 | /*static bsr(empb_bsr4_swap, u_int32_t); | | 88 | static bsr(empb_bsr4_swap, u_int32_t); |
89 | static bsw(empb_bsw4_swap, u_int32_t); | | 89 | static bsw(empb_bsw4_swap, u_int32_t); |
90 | static bsr(empb_bsr4, u_int32_t); | | 90 | static bsr(empb_bsr4, u_int32_t); |
91 | static bsw(empb_bsw4, u_int32_t); | | 91 | static bsw(empb_bsw4, u_int32_t); |
92 | static bsrm(empb_bsrm4_swap, u_int32_t); | | 92 | static bsrm(empb_bsrm4_swap, u_int32_t); |
93 | static bswm(empb_bswm4_swap, u_int32_t); | | 93 | static bswm(empb_bswm4_swap, u_int32_t); |
94 | static bsrm(empb_bsrm4, u_int32_t); | | 94 | static bsrm(empb_bsrm4, u_int32_t); |
95 | static bswm(empb_bswm4, u_int32_t); | | 95 | static bswm(empb_bswm4, u_int32_t); |
96 | static bsrm(empb_bsrr4_swap, u_int32_t); | | 96 | static bsrm(empb_bsrr4_swap, u_int32_t); |
97 | static bswm(empb_bswr4_swap, u_int32_t); | | 97 | static bswm(empb_bswr4_swap, u_int32_t); |
98 | static bsrm(empb_bsrr4, u_int32_t); | | 98 | static bsrm(empb_bsrr4, u_int32_t); |
99 | static bswm(empb_bswr4, u_int32_t); | | 99 | static bswm(empb_bswr4, u_int32_t); |
100 | static bssr(empb_bssr4_swap, u_int32_t); | | 100 | static bssr(empb_bssr4_swap, u_int32_t); |
101 | static bscr(empb_bscr4, u_int32_t);*/ | | 101 | static bscr(empb_bscr4, u_int32_t); |
102 | /* | | 102 | /* |
103 | * Hold pointer to bridge driver here. We need to access it to switch | | 103 | * Hold pointer to bridge driver here. We need to access it to switch |
104 | * window position. Perhaps it should be stored in bus_space_tag instead... | | 104 | * window position. Perhaps it should be stored in bus_space_tag instead... |
105 | */ | | 105 | */ |
106 | static struct empb_softc *empb_sc = NULL; | | 106 | static struct empb_softc *empb_sc = NULL; |
107 | | | 107 | |
108 | static bool | | 108 | static bool |
109 | empb_bsm_init(void) | | 109 | empb_bsm_init(void) |
110 | { | | 110 | { |
111 | device_t dev; | | 111 | device_t dev; |
112 | | | 112 | |
113 | /* We can't have more than one Mediator anyway. */ | | 113 | /* We can't have more than one Mediator anyway. */ |
114 | if (!(dev = device_find_by_xname("empb0"))) { | | 114 | if (!(dev = device_find_by_xname("empb0"))) { |
| @@ -179,127 +179,127 @@ empb_bsr1(bus_space_handle_t handle, bus | | | @@ -179,127 +179,127 @@ empb_bsr1(bus_space_handle_t handle, bus |
179 | uint8_t *p; | | 179 | uint8_t *p; |
180 | uint8_t x; | | 180 | uint8_t x; |
181 | bus_addr_t wp; /* window position */ | | 181 | bus_addr_t wp; /* window position */ |
182 | | | 182 | |
183 | wp = empb_switch_window(empb_sc, handle); | | 183 | wp = empb_switch_window(empb_sc, handle); |
184 | | | 184 | |
185 | /* window address + (PCI mem address - window position) */ | | 185 | /* window address + (PCI mem address - window position) */ |
186 | p = (uint8_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 186 | p = (uint8_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
187 | x = *p; | | 187 | x = *p; |
188 | | | 188 | |
189 | return x; | | 189 | return x; |
190 | } | | 190 | } |
191 | | | 191 | |
192 | void | | 192 | static void |
193 | empb_bsw1(bus_space_handle_t handle, bus_size_t offset, unsigned value) | | 193 | empb_bsw1(bus_space_handle_t handle, bus_size_t offset, unsigned value) |
194 | { | | 194 | { |
195 | uint8_t *p; | | 195 | uint8_t *p; |
196 | bus_addr_t wp; | | 196 | bus_addr_t wp; |
197 | | | 197 | |
198 | wp = empb_switch_window(empb_sc, handle); | | 198 | wp = empb_switch_window(empb_sc, handle); |
199 | p = (uint8_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 199 | p = (uint8_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
200 | *p = value; | | 200 | *p = value; |
201 | } | | 201 | } |
202 | | | 202 | |
203 | void | | 203 | static void |
204 | empb_bsrm1(bus_space_handle_t handle, bus_size_t offset, u_int8_t *pointer, | | 204 | empb_bsrm1(bus_space_handle_t handle, bus_size_t offset, u_int8_t *pointer, |
205 | bus_size_t count) | | 205 | bus_size_t count) |
206 | { | | 206 | { |
207 | volatile uint8_t *p; | | 207 | volatile uint8_t *p; |
208 | bus_addr_t wp; | | 208 | bus_addr_t wp; |
209 | | | 209 | |
210 | wp = empb_switch_window(empb_sc, handle); | | 210 | wp = empb_switch_window(empb_sc, handle); |
211 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 211 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
212 | | | 212 | |
213 | while (count > 0) { | | 213 | while (count > 0) { |
214 | *pointer++ = *p; | | 214 | *pointer++ = *p; |
215 | amiga_bus_reorder_protect(); | | 215 | amiga_bus_reorder_protect(); |
216 | --count; | | 216 | --count; |
217 | } | | 217 | } |
218 | } | | 218 | } |
219 | | | 219 | |
220 | void | | 220 | static void |
221 | empb_bswm1(bus_space_handle_t handle, bus_size_t offset, | | 221 | empb_bswm1(bus_space_handle_t handle, bus_size_t offset, |
222 | const u_int8_t *pointer, bus_size_t count) | | 222 | const u_int8_t *pointer, bus_size_t count) |
223 | { | | 223 | { |
224 | volatile uint8_t *p; | | 224 | volatile uint8_t *p; |
225 | bus_addr_t wp; | | 225 | bus_addr_t wp; |
226 | | | 226 | |
227 | wp = empb_switch_window(empb_sc, handle); | | 227 | wp = empb_switch_window(empb_sc, handle); |
228 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 228 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
229 | | | 229 | |
230 | while (count > 0) { | | 230 | while (count > 0) { |
231 | *p = *pointer++; | | 231 | *p = *pointer++; |
232 | amiga_bus_reorder_protect(); | | 232 | amiga_bus_reorder_protect(); |
233 | --count; | | 233 | --count; |
234 | } | | 234 | } |
235 | } | | 235 | } |
236 | | | 236 | |
237 | void | | 237 | static void |
238 | empb_bsrr1(bus_space_handle_t handle, bus_size_t offset, u_int8_t *pointer, | | 238 | empb_bsrr1(bus_space_handle_t handle, bus_size_t offset, u_int8_t *pointer, |
239 | bus_size_t count) | | 239 | bus_size_t count) |
240 | { | | 240 | { |
241 | volatile uint8_t *p; | | 241 | volatile uint8_t *p; |
242 | bus_addr_t wp; | | 242 | bus_addr_t wp; |
243 | | | 243 | |
244 | wp = empb_switch_window(empb_sc, handle); | | 244 | wp = empb_switch_window(empb_sc, handle); |
245 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 245 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
246 | | | 246 | |
247 | while (count > 0) { | | 247 | while (count > 0) { |
248 | *pointer++ = *p; | | 248 | *pointer++ = *p; |
249 | amiga_bus_reorder_protect(); | | 249 | amiga_bus_reorder_protect(); |
250 | p++; | | 250 | p++; |
251 | --count; | | 251 | --count; |
252 | } | | 252 | } |
253 | } | | 253 | } |
254 | | | 254 | |
255 | void | | 255 | static void |
256 | empb_bswr1(bus_space_handle_t handle, bus_size_t offset, | | 256 | empb_bswr1(bus_space_handle_t handle, bus_size_t offset, |
257 | const u_int8_t *pointer, bus_size_t count) | | 257 | const u_int8_t *pointer, bus_size_t count) |
258 | { | | 258 | { |
259 | volatile uint8_t *p; | | 259 | volatile uint8_t *p; |
260 | bus_addr_t wp; | | 260 | bus_addr_t wp; |
261 | | | 261 | |
262 | wp = empb_switch_window(empb_sc, handle); | | 262 | wp = empb_switch_window(empb_sc, handle); |
263 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 263 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
264 | | | 264 | |
265 | while (count > 0) { | | 265 | while (count > 0) { |
266 | *p = *pointer++; | | 266 | *p = *pointer++; |
267 | amiga_bus_reorder_protect(); | | 267 | amiga_bus_reorder_protect(); |
268 | p++; | | 268 | p++; |
269 | --count; | | 269 | --count; |
270 | } | | 270 | } |
271 | } | | 271 | } |
272 | | | 272 | |
273 | void | | 273 | static void |
274 | empb_bssr1(bus_space_handle_t handle, bus_size_t offset, unsigned value, | | 274 | empb_bssr1(bus_space_handle_t handle, bus_size_t offset, unsigned value, |
275 | bus_size_t count) | | 275 | bus_size_t count) |
276 | { | | 276 | { |
277 | volatile uint8_t *p; | | 277 | volatile uint8_t *p; |
278 | bus_addr_t wp; | | 278 | bus_addr_t wp; |
279 | | | 279 | |
280 | wp = empb_switch_window(empb_sc, handle); | | 280 | wp = empb_switch_window(empb_sc, handle); |
281 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 281 | p = (volatile u_int8_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
282 | | | 282 | |
283 | while (count > 0) { | | 283 | while (count > 0) { |
284 | *p = value; | | 284 | *p = value; |
285 | amiga_bus_reorder_protect(); | | 285 | amiga_bus_reorder_protect(); |
286 | p++; | | 286 | p++; |
287 | --count; | | 287 | --count; |
288 | } | | 288 | } |
289 | } | | 289 | } |
290 | | | 290 | |
291 | /* XXX: this is broken, rewrite */ | | 291 | /* XXX: this is broken, rewrite */ |
292 | void | | 292 | static void |
293 | empb_bscr1(bus_space_handle_t handlefrom, bus_size_t from, | | 293 | empb_bscr1(bus_space_handle_t handlefrom, bus_size_t from, |
294 | bus_space_handle_t handleto, bus_size_t to, bus_size_t count) | | 294 | bus_space_handle_t handleto, bus_size_t to, bus_size_t count) |
295 | { | | 295 | { |
296 | volatile uint8_t *p, *q; | | 296 | volatile uint8_t *p, *q; |
297 | bus_addr_t wp; | | 297 | bus_addr_t wp; |
298 | | | 298 | |
299 | wp = empb_switch_window(empb_sc, handlefrom); | | 299 | wp = empb_switch_window(empb_sc, handlefrom); |
300 | | | 300 | |
301 | p = (volatile u_int8_t *) | | 301 | p = (volatile u_int8_t *) |
302 | ( ((empb_sc->pci_mem_win_t->base)+(handlefrom - wp)) + from ); | | 302 | ( ((empb_sc->pci_mem_win_t->base)+(handlefrom - wp)) + from ); |
303 | q = (volatile u_int8_t *) | | 303 | q = (volatile u_int8_t *) |
304 | ( ((empb_sc->pci_mem_win_t->base)+(handleto - wp)) + to ); | | 304 | ( ((empb_sc->pci_mem_win_t->base)+(handleto - wp)) + to ); |
305 | | | 305 | |
| @@ -334,236 +334,236 @@ empb_bsr2_swap(bus_space_handle_t handle | | | @@ -334,236 +334,236 @@ empb_bsr2_swap(bus_space_handle_t handle |
334 | uint16_t *p; | | 334 | uint16_t *p; |
335 | uint16_t x; | | 335 | uint16_t x; |
336 | bus_addr_t wp; | | 336 | bus_addr_t wp; |
337 | | | 337 | |
338 | wp = empb_switch_window(empb_sc, handle); | | 338 | wp = empb_switch_window(empb_sc, handle); |
339 | | | 339 | |
340 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 340 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
341 | x = *p; | | 341 | x = *p; |
342 | | | 342 | |
343 | return bswap16(x); | | 343 | return bswap16(x); |
344 | } | | 344 | } |
345 | | | 345 | |
346 | | | 346 | |
347 | void | | 347 | static void |
348 | empb_bsw2(bus_space_handle_t handle, bus_size_t offset, unsigned value) | | 348 | empb_bsw2(bus_space_handle_t handle, bus_size_t offset, unsigned value) |
349 | { | | 349 | { |
350 | uint16_t *p; | | 350 | uint16_t *p; |
351 | bus_addr_t wp; | | 351 | bus_addr_t wp; |
352 | | | 352 | |
353 | wp = empb_switch_window(empb_sc, handle); | | 353 | wp = empb_switch_window(empb_sc, handle); |
354 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 354 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
355 | *p = value; | | 355 | *p = value; |
356 | } | | 356 | } |
357 | | | 357 | |
358 | void | | 358 | static void |
359 | empb_bsw2_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value) | | 359 | empb_bsw2_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value) |
360 | { | | 360 | { |
361 | uint16_t *p; | | 361 | uint16_t *p; |
362 | bus_addr_t wp; | | 362 | bus_addr_t wp; |
363 | | | 363 | |
364 | wp = empb_switch_window(empb_sc, handle); | | 364 | wp = empb_switch_window(empb_sc, handle); |
365 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 365 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
366 | *p = bswap16(value); | | 366 | *p = bswap16(value); |
367 | } | | 367 | } |
368 | | | 368 | |
369 | void | | 369 | static void |
370 | empb_bsrm2(bus_space_handle_t handle, bus_size_t offset, u_int16_t *pointer, | | 370 | empb_bsrm2(bus_space_handle_t handle, bus_size_t offset, u_int16_t *pointer, |
371 | bus_size_t count) | | 371 | bus_size_t count) |
372 | { | | 372 | { |
373 | volatile uint16_t *p; | | 373 | volatile uint16_t *p; |
374 | bus_addr_t wp; | | 374 | bus_addr_t wp; |
375 | | | 375 | |
376 | wp = empb_switch_window(empb_sc, handle); | | 376 | wp = empb_switch_window(empb_sc, handle); |
377 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 377 | p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + |
378 | (handle - wp)); | | 378 | (handle - wp)); |
379 | | | 379 | |
380 | while (count > 0) { | | 380 | while (count > 0) { |
381 | *pointer++ = *p; | | 381 | *pointer++ = *p; |
382 | amiga_bus_reorder_protect(); | | 382 | amiga_bus_reorder_protect(); |
383 | --count; | | 383 | --count; |
384 | } | | 384 | } |
385 | } | | 385 | } |
386 | | | 386 | |
387 | void | | 387 | static void |
388 | empb_bsrm2_swap(bus_space_handle_t handle, bus_size_t offset, | | 388 | empb_bsrm2_swap(bus_space_handle_t handle, bus_size_t offset, |
389 | u_int16_t *pointer, bus_size_t count) | | 389 | u_int16_t *pointer, bus_size_t count) |
390 | { | | 390 | { |
391 | volatile uint16_t *p; | | 391 | volatile uint16_t *p; |
392 | bus_addr_t wp; | | 392 | bus_addr_t wp; |
393 | | | 393 | |
394 | wp = empb_switch_window(empb_sc, handle); | | 394 | wp = empb_switch_window(empb_sc, handle); |
395 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 395 | p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + |
396 | (handle - wp)); | | 396 | (handle - wp)); |
397 | | | 397 | |
398 | while (count > 0) { | | 398 | while (count > 0) { |
399 | *pointer++ = bswap16(*p); | | 399 | *pointer++ = bswap16(*p); |
400 | amiga_bus_reorder_protect(); | | 400 | amiga_bus_reorder_protect(); |
401 | --count; | | 401 | --count; |
402 | } | | 402 | } |
403 | } | | 403 | } |
404 | | | 404 | |
405 | void | | 405 | static void |
406 | empb_bswm2(bus_space_handle_t handle, bus_size_t offset, | | 406 | empb_bswm2(bus_space_handle_t handle, bus_size_t offset, |
407 | const u_int16_t *pointer, bus_size_t count) | | 407 | const u_int16_t *pointer, bus_size_t count) |
408 | { | | 408 | { |
409 | volatile uint16_t *p; | | 409 | volatile uint16_t *p; |
410 | bus_addr_t wp; | | 410 | bus_addr_t wp; |
411 | | | 411 | |
412 | wp = empb_switch_window(empb_sc, handle); | | 412 | wp = empb_switch_window(empb_sc, handle); |
413 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 413 | p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + |
414 | (handle - wp)); | | 414 | (handle - wp)); |
415 | | | 415 | |
416 | while (count > 0) { | | 416 | while (count > 0) { |
417 | *p = *pointer++; | | 417 | *p = *pointer++; |
418 | amiga_bus_reorder_protect(); | | 418 | amiga_bus_reorder_protect(); |
419 | --count; | | 419 | --count; |
420 | } | | 420 | } |
421 | } | | 421 | } |
422 | | | 422 | |
423 | void | | 423 | static void |
424 | empb_bswm2_swap(bus_space_handle_t handle, bus_size_t offset, | | 424 | empb_bswm2_swap(bus_space_handle_t handle, bus_size_t offset, |
425 | const u_int16_t *pointer, bus_size_t count) | | 425 | const u_int16_t *pointer, bus_size_t count) |
426 | { | | 426 | { |
427 | volatile uint16_t *p; | | 427 | volatile uint16_t *p; |
428 | bus_addr_t wp; | | 428 | bus_addr_t wp; |
429 | | | 429 | |
430 | wp = empb_switch_window(empb_sc, handle); | | 430 | wp = empb_switch_window(empb_sc, handle); |
431 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 431 | p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + |
432 | (handle - wp)); | | 432 | (handle - wp)); |
433 | | | 433 | |
434 | while (count > 0) { | | 434 | while (count > 0) { |
435 | *p = bswap16(*pointer++); | | 435 | *p = bswap16(*pointer++); |
436 | amiga_bus_reorder_protect(); | | 436 | amiga_bus_reorder_protect(); |
437 | --count; | | 437 | --count; |
438 | } | | 438 | } |
439 | } | | 439 | } |
440 | | | 440 | |
441 | void | | 441 | static void |
442 | empb_bsrr2(bus_space_handle_t handle, bus_size_t offset, u_int16_t *pointer, | | 442 | empb_bsrr2(bus_space_handle_t handle, bus_size_t offset, u_int16_t *pointer, |
443 | bus_size_t count) | | 443 | bus_size_t count) |
444 | { | | 444 | { |
445 | volatile uint16_t *p; | | 445 | volatile uint16_t *p; |
446 | bus_addr_t wp; | | 446 | bus_addr_t wp; |
447 | | | 447 | |
448 | wp = empb_switch_window(empb_sc, handle); | | 448 | wp = empb_switch_window(empb_sc, handle); |
449 | p = (volatile uint16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 449 | p = (volatile uint16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
450 | | | 450 | |
451 | while (count > 0) { | | 451 | while (count > 0) { |
452 | *pointer++ = *p; | | 452 | *pointer++ = *p; |
453 | amiga_bus_reorder_protect(); | | 453 | amiga_bus_reorder_protect(); |
454 | p++; | | 454 | p++; |
455 | --count; | | 455 | --count; |
456 | } | | 456 | } |
457 | } | | 457 | } |
458 | | | 458 | |
459 | void | | 459 | static void |
460 | empb_bsrr2_swap(bus_space_handle_t handle, bus_size_t offset, | | 460 | empb_bsrr2_swap(bus_space_handle_t handle, bus_size_t offset, |
461 | u_int16_t *pointer, bus_size_t count) | | 461 | u_int16_t *pointer, bus_size_t count) |
462 | { | | 462 | { |
463 | volatile uint16_t *p; | | 463 | volatile uint16_t *p; |
464 | bus_addr_t wp; | | 464 | bus_addr_t wp; |
465 | | | 465 | |
466 | wp = empb_switch_window(empb_sc, handle); | | 466 | wp = empb_switch_window(empb_sc, handle); |
467 | p = (volatile uint16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 467 | p = (volatile uint16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
468 | | | 468 | |
469 | while (count > 0) { | | 469 | while (count > 0) { |
470 | *pointer++ = bswap16(*p); | | 470 | *pointer++ = bswap16(*p); |
471 | amiga_bus_reorder_protect(); | | 471 | amiga_bus_reorder_protect(); |
472 | p++; | | 472 | p++; |
473 | --count; | | 473 | --count; |
474 | } | | 474 | } |
475 | } | | 475 | } |
476 | | | 476 | |
477 | void | | 477 | static void |
478 | empb_bssr2_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value, | | 478 | empb_bssr2_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value, |
479 | bus_size_t count) | | 479 | bus_size_t count) |
480 | { | | 480 | { |
481 | volatile uint16_t *p; | | 481 | volatile uint16_t *p; |
482 | bus_addr_t wp; | | 482 | bus_addr_t wp; |
483 | | | 483 | |
484 | wp = empb_switch_window(empb_sc, handle); | | 484 | wp = empb_switch_window(empb_sc, handle); |
485 | p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + | | 485 | p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + |
486 | (handle - wp)); | | 486 | (handle - wp)); |
487 | | | 487 | |
488 | while (count > 0) { | | 488 | while (count > 0) { |
489 | *p = bswap16(value); | | 489 | *p = bswap16(value); |
490 | amiga_bus_reorder_protect(); | | 490 | amiga_bus_reorder_protect(); |
491 | p++; | | 491 | p++; |
492 | --count; | | 492 | --count; |
493 | } | | 493 | } |
494 | } | | 494 | } |
495 | | | 495 | |
496 | void | | 496 | static void |
497 | empb_bswr2(bus_space_handle_t handle, bus_size_t offset, | | 497 | empb_bswr2(bus_space_handle_t handle, bus_size_t offset, |
498 | const u_int16_t *pointer, bus_size_t count) | | 498 | const u_int16_t *pointer, bus_size_t count) |
499 | { | | 499 | { |
500 | volatile uint16_t *p; | | 500 | volatile uint16_t *p; |
501 | bus_addr_t wp; | | 501 | bus_addr_t wp; |
502 | | | 502 | |
503 | wp = empb_switch_window(empb_sc, handle); | | 503 | wp = empb_switch_window(empb_sc, handle); |
504 | p = (volatile u_int16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 504 | p = (volatile u_int16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
505 | | | 505 | |
506 | while (count > 0) { | | 506 | while (count > 0) { |
507 | *p = *pointer++; | | 507 | *p = *pointer++; |
508 | amiga_bus_reorder_protect(); | | 508 | amiga_bus_reorder_protect(); |
509 | p++; | | 509 | p++; |
510 | --count; | | 510 | --count; |
511 | } | | 511 | } |
512 | } | | 512 | } |
513 | | | 513 | |
514 | void | | 514 | static void |
515 | empb_bswr2_swap(bus_space_handle_t handle, bus_size_t offset, | | 515 | empb_bswr2_swap(bus_space_handle_t handle, bus_size_t offset, |
516 | const u_int16_t *pointer, bus_size_t count) | | 516 | const u_int16_t *pointer, bus_size_t count) |
517 | { | | 517 | { |
518 | volatile uint16_t *p; | | 518 | volatile uint16_t *p; |
519 | bus_addr_t wp; | | 519 | bus_addr_t wp; |
520 | | | 520 | |
521 | wp = empb_switch_window(empb_sc, handle); | | 521 | wp = empb_switch_window(empb_sc, handle); |
522 | p = (volatile u_int16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 522 | p = (volatile u_int16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
523 | | | 523 | |
524 | while (count > 0) { | | 524 | while (count > 0) { |
525 | *p = bswap16(*pointer++); | | 525 | *p = bswap16(*pointer++); |
526 | amiga_bus_reorder_protect(); | | 526 | amiga_bus_reorder_protect(); |
527 | p++; | | 527 | p++; |
528 | --count; | | 528 | --count; |
529 | } | | 529 | } |
530 | } | | 530 | } |
531 | | | 531 | |
532 | /* XXX: this is broken, rewrite, XXX 2: should we swap here? */ | | 532 | /* XXX: this is broken, rewrite, XXX 2: should we swap here? */ |
533 | void | | 533 | static void |
534 | empb_bscr2(bus_space_handle_t handlefrom, bus_size_t from, | | 534 | empb_bscr2(bus_space_handle_t handlefrom, bus_size_t from, |
535 | bus_space_handle_t handleto, bus_size_t to, bus_size_t count) | | 535 | bus_space_handle_t handleto, bus_size_t to, bus_size_t count) |
536 | { | | 536 | { |
537 | volatile uint16_t *p, *q; | | 537 | volatile uint16_t *p, *q; |
538 | bus_addr_t wp; | | 538 | bus_addr_t wp; |
539 | | | 539 | |
540 | wp = empb_switch_window(empb_sc, handlefrom); | | 540 | wp = empb_switch_window(empb_sc, handlefrom); |
541 | | | 541 | |
542 | p = (volatile uint16_t *) | | 542 | p = (volatile uint16_t *) |
543 | ( ((empb_sc->pci_mem_win_t->base)+(handlefrom - wp)) + from ); | | 543 | ( ((empb_sc->pci_mem_win_t->base)+(handlefrom - wp)) + from ); |
544 | q = (volatile uint16_t *) | | 544 | q = (volatile uint16_t *) |
545 | ( ((empb_sc->pci_mem_win_t->base)+(handleto - wp)) + to ); | | 545 | ( ((empb_sc->pci_mem_win_t->base)+(handleto - wp)) + to ); |
546 | | | 546 | |
547 | while (count > 0) { | | 547 | while (count > 0) { |
548 | *q = *p; | | 548 | *q = *p; |
549 | amiga_bus_reorder_protect(); | | 549 | amiga_bus_reorder_protect(); |
550 | p++; q++; | | 550 | p++; q++; |
551 | --count; | | 551 | --count; |
552 | } | | 552 | } |
553 | } | | 553 | } |
554 | | | 554 | |
555 | /* === 32-bit methods === */ | | 555 | /* === 32-bit methods === */ |
556 | /* | | 556 | |
557 | static uint32_t | | 557 | static uint32_t |
558 | empb_bsr4(bus_space_handle_t handle, bus_size_t offset) | | 558 | empb_bsr4(bus_space_handle_t handle, bus_size_t offset) |
559 | { | | 559 | { |
560 | uint32_t *p; | | 560 | uint32_t *p; |
561 | uint32_t x; | | 561 | uint32_t x; |
562 | bus_addr_t wp; | | 562 | bus_addr_t wp; |
563 | | | 563 | |
564 | wp = empb_switch_window(empb_sc, handle); | | 564 | wp = empb_switch_window(empb_sc, handle); |
565 | | | 565 | |
566 | p = (uint32_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 566 | p = (uint32_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
567 | x = *p; | | 567 | x = *p; |
568 | | | 568 | |
569 | return x; | | 569 | return x; |
| @@ -575,233 +575,233 @@ empb_bsr4_swap(bus_space_handle_t handle | | | @@ -575,233 +575,233 @@ empb_bsr4_swap(bus_space_handle_t handle |
575 | uint32_t *p; | | 575 | uint32_t *p; |
576 | uint32_t x; | | 576 | uint32_t x; |
577 | bus_addr_t wp; | | 577 | bus_addr_t wp; |
578 | | | 578 | |
579 | wp = empb_switch_window(empb_sc, handle); | | 579 | wp = empb_switch_window(empb_sc, handle); |
580 | | | 580 | |
581 | p = (uint32_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 581 | p = (uint32_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
582 | x = *p; | | 582 | x = *p; |
583 | | | 583 | |
584 | return bswap32(x); | | 584 | return bswap32(x); |
585 | } | | 585 | } |
586 | | | 586 | |
587 | | | 587 | |
588 | void | | 588 | static void |
589 | empb_bsw4(bus_space_handle_t handle, bus_size_t offset, unsigned value) | | 589 | empb_bsw4(bus_space_handle_t handle, bus_size_t offset, unsigned value) |
590 | { | | 590 | { |
591 | uint32_t *p; | | 591 | uint32_t *p; |
592 | bus_addr_t wp; | | 592 | bus_addr_t wp; |
593 | | | 593 | |
594 | wp = empb_switch_window(empb_sc, handle); | | 594 | wp = empb_switch_window(empb_sc, handle); |
595 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 595 | p = (uint32_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
596 | *p = value; | | 596 | *p = value; |
597 | } | | 597 | } |
598 | | | 598 | |
599 | void | | 599 | static void |
600 | empb_bsw2_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value) | | 600 | empb_bsw4_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value) |
601 | { | | 601 | { |
602 | uint16_t *p; | | 602 | uint32_t *p; |
603 | bus_addr_t wp; | | 603 | bus_addr_t wp; |
604 | | | 604 | |
605 | wp = empb_switch_window(empb_sc, handle); | | 605 | wp = empb_switch_window(empb_sc, handle); |
606 | p = (uint16_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); | | 606 | p = (uint32_t*)((empb_sc->pci_mem_win_t->base) + (handle - wp)); |
607 | *p = bswap16(value); | | 607 | *p = bswap32(value); |
608 | } | | 608 | } |
609 | | | 609 | |
610 | void | | 610 | static void |
611 | empb_bsrm2(bus_space_handle_t handle, bus_size_t offset, u_int16_t *pointer, | | 611 | empb_bsrm4(bus_space_handle_t handle, bus_size_t offset, u_int32_t *pointer, |
612 | bus_size_t count) | | 612 | bus_size_t count) |
613 | { | | 613 | { |
614 | volatile uint16_t *p; | | 614 | volatile uint32_t *p; |
615 | bus_addr_t wp; | | 615 | bus_addr_t wp; |
616 | | | 616 | |
617 | wp = empb_switch_window(empb_sc, handle); | | 617 | wp = empb_switch_window(empb_sc, handle); |
618 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 618 | p = (volatile uint32_t *) ((empb_sc->pci_mem_win_t->base) + |
619 | (handle - wp)); | | 619 | (handle - wp)); |
620 | | | 620 | |
621 | while (count > 0) { | | 621 | while (count > 0) { |
622 | *pointer++ = *p; | | 622 | *pointer++ = *p; |
623 | amiga_bus_reorder_protect(); | | 623 | amiga_bus_reorder_protect(); |
624 | --count; | | 624 | --count; |
625 | } | | 625 | } |
626 | } | | 626 | } |
627 | | | 627 | |
628 | void | | 628 | static void |
629 | empb_bsrm2_swap(bus_space_handle_t handle, bus_size_t offset, | | 629 | empb_bsrm4_swap(bus_space_handle_t handle, bus_size_t offset, |
630 | u_int16_t *pointer, bus_size_t count) | | 630 | u_int32_t *pointer, bus_size_t count) |
631 | { | | 631 | { |
632 | volatile uint16_t *p; | | 632 | volatile uint32_t *p; |
633 | bus_addr_t wp; | | 633 | bus_addr_t wp; |
634 | | | 634 | |
635 | wp = empb_switch_window(empb_sc, handle); | | 635 | wp = empb_switch_window(empb_sc, handle); |
636 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 636 | p = (volatile uint32_t *) ((empb_sc->pci_mem_win_t->base) + |
637 | (handle - wp)); | | 637 | (handle - wp)); |
638 | | | 638 | |
639 | while (count > 0) { | | 639 | while (count > 0) { |
640 | *pointer++ = bswap16(*p); | | 640 | *pointer++ = bswap32(*p); |
641 | amiga_bus_reorder_protect(); | | 641 | amiga_bus_reorder_protect(); |
642 | --count; | | 642 | --count; |
643 | } | | 643 | } |
644 | } | | 644 | } |
645 | | | 645 | |
646 | void | | 646 | static void |
647 | empb_bswm2(bus_space_handle_t handle, bus_size_t offset, | | 647 | empb_bswm4(bus_space_handle_t handle, bus_size_t offset, |
648 | const u_int16_t *pointer, bus_size_t count) | | 648 | const u_int32_t *pointer, bus_size_t count) |
649 | { | | 649 | { |
650 | volatile uint16_t *p; | | 650 | volatile uint32_t *p; |
651 | bus_addr_t wp; | | 651 | bus_addr_t wp; |
652 | | | 652 | |
653 | wp = empb_switch_window(empb_sc, handle); | | 653 | wp = empb_switch_window(empb_sc, handle); |
654 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 654 | p = (volatile uint32_t *) ((empb_sc->pci_mem_win_t->base) + |
655 | (handle - wp)); | | 655 | (handle - wp)); |
656 | | | 656 | |
657 | while (count > 0) { | | 657 | while (count > 0) { |
658 | *p = *pointer++; | | 658 | *p = *pointer++; |
659 | amiga_bus_reorder_protect(); | | 659 | amiga_bus_reorder_protect(); |
660 | --count; | | 660 | --count; |
661 | } | | 661 | } |
662 | } | | 662 | } |
663 | | | 663 | |
664 | void | | 664 | static void |
665 | empb_bswm2_swap(bus_space_handle_t handle, bus_size_t offset, | | 665 | empb_bswm4_swap(bus_space_handle_t handle, bus_size_t offset, |
666 | const u_int16_t *pointer, bus_size_t count) | | 666 | const u_int32_t *pointer, bus_size_t count) |
667 | { | | 667 | { |
668 | volatile uint16_t *p; | | 668 | volatile uint32_t *p; |
669 | bus_addr_t wp; | | 669 | bus_addr_t wp; |
670 | | | 670 | |
671 | wp = empb_switch_window(empb_sc, handle); | | 671 | wp = empb_switch_window(empb_sc, handle); |
672 | p = (volatile u_int16_t *) ((empb_sc->pci_mem_win_t->base) + | | 672 | p = (volatile uint32_t *) ((empb_sc->pci_mem_win_t->base) + |
673 | (handle - wp)); | | 673 | (handle - wp)); |
674 | | | 674 | |
675 | while (count > 0) { | | 675 | while (count > 0) { |
676 | *p = bswap16(*pointer++); | | 676 | *p = bswap32(*pointer++); |
677 | amiga_bus_reorder_protect(); | | 677 | amiga_bus_reorder_protect(); |
678 | --count; | | 678 | --count; |
679 | } | | 679 | } |
680 | } | | 680 | } |
681 | | | 681 | |
682 | void | | 682 | static void |
683 | empb_bsrr2(bus_space_handle_t handle, bus_size_t offset, u_int16_t *pointer, | | 683 | empb_bsrr4(bus_space_handle_t handle, bus_size_t offset, u_int32_t *pointer, |
684 | bus_size_t count) | | 684 | bus_size_t count) |
685 | { | | 685 | { |
686 | volatile uint16_t *p; | | 686 | volatile uint32_t *p; |
687 | bus_addr_t wp; | | 687 | bus_addr_t wp; |
688 | | | 688 | |
689 | wp = empb_switch_window(empb_sc, handle); | | 689 | wp = empb_switch_window(empb_sc, handle); |
690 | p = (volatile uint16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 690 | p = (volatile uint32_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
691 | | | 691 | |
692 | while (count > 0) { | | 692 | while (count > 0) { |
693 | *pointer++ = *p; | | 693 | *pointer++ = *p; |
694 | amiga_bus_reorder_protect(); | | 694 | amiga_bus_reorder_protect(); |
695 | p++; | | 695 | p++; |
696 | --count; | | 696 | --count; |
697 | } | | 697 | } |
698 | } | | 698 | } |
699 | | | 699 | |
700 | void | | 700 | static void |
701 | empb_bsrr2_swap(bus_space_handle_t handle, bus_size_t offset, | | 701 | empb_bsrr4_swap(bus_space_handle_t handle, bus_size_t offset, |
702 | u_int16_t *pointer, bus_size_t count) | | 702 | u_int32_t *pointer, bus_size_t count) |
703 | { | | 703 | { |
704 | volatile uint16_t *p; | | 704 | volatile uint32_t *p; |
705 | bus_addr_t wp; | | 705 | bus_addr_t wp; |
706 | | | 706 | |
707 | wp = empb_switch_window(empb_sc, handle); | | 707 | wp = empb_switch_window(empb_sc, handle); |
708 | p = (volatile uint16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 708 | p = (volatile uint32_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
709 | | | 709 | |
710 | while (count > 0) { | | 710 | while (count > 0) { |
711 | *pointer++ = bswap16(*p); | | 711 | *pointer++ = bswap32(*p); |
712 | amiga_bus_reorder_protect(); | | 712 | amiga_bus_reorder_protect(); |
713 | p++; | | 713 | p++; |
714 | --count; | | 714 | --count; |
715 | } | | 715 | } |
716 | } | | 716 | } |
717 | | | 717 | |
718 | void | | 718 | static void |
719 | empb_bssr2_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value, | | 719 | empb_bssr4_swap(bus_space_handle_t handle, bus_size_t offset, unsigned value, |
720 | bus_size_t count) | | 720 | bus_size_t count) |
721 | { | | 721 | { |
722 | volatile uint16_t *p; | | 722 | volatile uint32_t *p; |
723 | bus_addr_t wp; | | 723 | bus_addr_t wp; |
724 | | | 724 | |
725 | wp = empb_switch_window(empb_sc, handle); | | 725 | wp = empb_switch_window(empb_sc, handle); |
726 | p = (volatile uint16_t *) ((empb_sc->pci_mem_win_t->base) + | | 726 | p = (volatile uint32_t *) ((empb_sc->pci_mem_win_t->base) + |
727 | (handle - wp)); | | 727 | (handle - wp)); |
728 | | | 728 | |
729 | while (count > 0) { | | 729 | while (count > 0) { |
730 | *p = bswap16(value); | | 730 | *p = bswap32(value); |
731 | amiga_bus_reorder_protect(); | | 731 | amiga_bus_reorder_protect(); |
732 | p++; | | 732 | p++; |
733 | --count; | | 733 | --count; |
734 | } | | 734 | } |
735 | } | | 735 | } |
736 | | | 736 | |
737 | void | | 737 | static void |
738 | empb_bswr2(bus_space_handle_t handle, bus_size_t offset, | | 738 | empb_bswr4(bus_space_handle_t handle, bus_size_t offset, |
739 | const u_int16_t *pointer, bus_size_t count) | | 739 | const u_int32_t *pointer, bus_size_t count) |
740 | { | | 740 | { |
741 | volatile uint16_t *p; | | 741 | volatile uint32_t *p; |
742 | bus_addr_t wp; | | 742 | bus_addr_t wp; |
743 | | | 743 | |
744 | wp = empb_switch_window(empb_sc, handle); | | 744 | wp = empb_switch_window(empb_sc, handle); |
745 | p = (volatile u_int16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 745 | p = (volatile uint32_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
746 | | | 746 | |
747 | while (count > 0) { | | 747 | while (count > 0) { |
748 | *p = *pointer++; | | 748 | *p = *pointer++; |
749 | amiga_bus_reorder_protect(); | | 749 | amiga_bus_reorder_protect(); |
750 | p++; | | 750 | p++; |
751 | --count; | | 751 | --count; |
752 | } | | 752 | } |
753 | } | | 753 | } |
754 | | | 754 | |
755 | void | | 755 | static void |
756 | empb_bswr2_swap(bus_space_handle_t handle, bus_size_t offset, | | 756 | empb_bswr4_swap(bus_space_handle_t handle, bus_size_t offset, |
757 | const u_int16_t *pointer, bus_size_t count) | | 757 | const u_int32_t *pointer, bus_size_t count) |
758 | { | | 758 | { |
759 | volatile uint16_t *p; | | 759 | volatile uint32_t *p; |
760 | bus_addr_t wp; | | 760 | bus_addr_t wp; |
761 | | | 761 | |
762 | wp = empb_switch_window(empb_sc, handle); | | 762 | wp = empb_switch_window(empb_sc, handle); |
763 | p = (volatile u_int16_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); | | 763 | p = (volatile uint32_t *)((empb_sc->pci_mem_win_t->base)+(handle - wp)); |
764 | | | 764 | |
765 | while (count > 0) { | | 765 | while (count > 0) { |
766 | *p = bswap16(*pointer++); | | 766 | *p = bswap32(*pointer++); |
767 | amiga_bus_reorder_protect(); | | 767 | amiga_bus_reorder_protect(); |
768 | p++; | | 768 | p++; |
769 | --count; | | 769 | --count; |
770 | } | | 770 | } |
771 | } | | 771 | } |
772 | | | 772 | |
773 | // XXX: this is broken, rewrite, XXX 2: should we swap here? | | 773 | /* XXX: this is broken, rewrite, XXX 2: should we swap here? */ |
774 | void | | 774 | void |
775 | empb_bscr2(bus_space_handle_t handlefrom, bus_size_t from, | | 775 | empb_bscr4(bus_space_handle_t handlefrom, bus_size_t from, |
776 | bus_space_handle_t handleto, bus_size_t to, bus_size_t count) | | 776 | bus_space_handle_t handleto, bus_size_t to, bus_size_t count) |
777 | { | | 777 | { |
778 | volatile uint16_t *p, *q; | | 778 | volatile uint32_t *p, *q; |
779 | bus_addr_t wp; | | 779 | bus_addr_t wp; |
780 | | | 780 | |
781 | wp = empb_switch_window(empb_sc, handlefrom); | | 781 | wp = empb_switch_window(empb_sc, handlefrom); |
782 | | | 782 | |
783 | p = (volatile uint16_t *) | | 783 | p = (volatile uint32_t *) |
784 | ( ((empb_sc->pci_mem_win_t->base)+(handlefrom - wp)) + from ); | | 784 | ( ((empb_sc->pci_mem_win_t->base)+(handlefrom - wp)) + from ); |
785 | q = (volatile uint16_t *) | | 785 | q = (volatile uint32_t *) |
786 | ( ((empb_sc->pci_mem_win_t->base)+(handleto - wp)) + to ); | | 786 | ( ((empb_sc->pci_mem_win_t->base)+(handleto - wp)) + to ); |
787 | | | 787 | |
788 | while (count > 0) { | | 788 | while (count > 0) { |
789 | *q = *p; | | 789 | *q = *p; |
790 | amiga_bus_reorder_protect(); | | 790 | amiga_bus_reorder_protect(); |
791 | p++; q++; | | 791 | p++; q++; |
792 | --count; | | 792 | --count; |
793 | } | | 793 | } |
794 | } */ | | 794 | } |
795 | /* === end of implementation === */ | | 795 | /* === end of implementation === */ |
796 | | | 796 | |
797 | const struct amiga_bus_space_methods empb_bus_swap = { | | 797 | const struct amiga_bus_space_methods empb_bus_swap = { |
798 | | | 798 | |
799 | .bsm = empb_bsm, | | 799 | .bsm = empb_bsm, |
800 | .bsms = empb_bsms, | | 800 | .bsms = empb_bsms, |
801 | .bsu = empb_bsu, | | 801 | .bsu = empb_bsu, |
802 | .bsa = NULL, | | 802 | .bsa = NULL, |
803 | .bsf = NULL, | | 803 | .bsf = NULL, |
804 | | | 804 | |
805 | /* 8-bit methods */ | | 805 | /* 8-bit methods */ |
806 | .bsr1 = empb_bsr1, | | 806 | .bsr1 = empb_bsr1, |
807 | .bsw1 = empb_bsw1, | | 807 | .bsw1 = empb_bsw1, |
| @@ -816,33 +816,33 @@ const struct amiga_bus_space_methods emp | | | @@ -816,33 +816,33 @@ const struct amiga_bus_space_methods emp |
816 | .bsr2 = empb_bsr2_swap, | | 816 | .bsr2 = empb_bsr2_swap, |
817 | .bsw2 = empb_bsw2_swap, | | 817 | .bsw2 = empb_bsw2_swap, |
818 | .bsrs2 = empb_bsr2, | | 818 | .bsrs2 = empb_bsr2, |
819 | .bsws2 = empb_bsw2, | | 819 | .bsws2 = empb_bsw2, |
820 | .bsrm2 = empb_bsrm2_swap, | | 820 | .bsrm2 = empb_bsrm2_swap, |
821 | .bswm2 = empb_bswm2_swap, | | 821 | .bswm2 = empb_bswm2_swap, |
822 | .bsrms2 = empb_bsrm2, | | 822 | .bsrms2 = empb_bsrm2, |
823 | .bswms2 = empb_bswm2, | | 823 | .bswms2 = empb_bswm2, |
824 | .bsrr2 = empb_bsrr2_swap, | | 824 | .bsrr2 = empb_bsrr2_swap, |
825 | .bswr2 = empb_bswr2_swap, | | 825 | .bswr2 = empb_bswr2_swap, |
826 | .bsrrs2 = empb_bsrr2, | | 826 | .bsrrs2 = empb_bsrr2, |
827 | .bswrs2 = empb_bswr2, | | 827 | .bswrs2 = empb_bswr2, |
828 | .bssr2 = empb_bssr2_swap, | | 828 | .bssr2 = empb_bssr2_swap, |
829 | .bscr2 = empb_bscr2 /* | | 829 | .bscr2 = empb_bscr2, /* swap? */ |
830 | | | 830 | |
831 | //32-bit methods | | 831 | /* 32-bit methods */ |
832 | .bsr4 = empb_bsr4_swap, | | 832 | .bsr4 = empb_bsr4_swap, |
833 | .bsw4 = empb_bsw4_swap, | | 833 | .bsw4 = empb_bsw4_swap, |
834 | .bsrs4 = empb_bsr4, | | 834 | .bsrs4 = empb_bsr4, |
835 | .bsws4 = empb_bsw4, | | 835 | .bsws4 = empb_bsw4, |
836 | .bsrm4 = empb_bsrm4_swap, | | 836 | .bsrm4 = empb_bsrm4_swap, |
837 | .bswm4 = empb_bswm4_swap, | | 837 | .bswm4 = empb_bswm4_swap, |
838 | .bsrms4 = empb_bsrm4, | | 838 | .bsrms4 = empb_bsrm4, |
839 | .bswms4 = empb_bswm4, | | 839 | .bswms4 = empb_bswm4, |
840 | .bsrr4 = empb_bsrr4_swap, | | 840 | .bsrr4 = empb_bsrr4_swap, |
841 | .bswr4 = empb_bswr4_swap, | | 841 | .bswr4 = empb_bswr4_swap, |
842 | .bsrrs4 = empb_bsrr4, | | 842 | .bsrrs4 = empb_bsrr4, |
843 | .bswrs4 = empb_bswr4, | | 843 | .bswrs4 = empb_bswr4, |
844 | .bssr4 = empb_bssr4_swap, | | 844 | .bssr4 = empb_bssr4_swap, |
845 | .bscr4 = empb_bscr4_swap */ | | 845 | .bscr4 = empb_bscr4 /* swap? */ |
846 | }; | | 846 | }; |
847 | | | 847 | |
848 | | | 848 | |