| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: uturn.c,v 1.10 2010/06/21 09:06:03 skrll Exp $ */ | | 1 | /* $NetBSD: uturn.c,v 1.11 2010/06/21 11:04:27 skrll Exp $ */ |
2 | | | 2 | |
3 | /* $OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $ */ | | 3 | /* $OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $ */ |
4 | | | 4 | |
5 | /* | | 5 | /* |
6 | * Copyright (c) 2004 Michael Shalayeff | | 6 | * Copyright (c) 2004 Michael Shalayeff |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -257,44 +257,38 @@ uturn_dmamap_destroy(void *v, bus_dmamap | | | @@ -257,44 +257,38 @@ uturn_dmamap_destroy(void *v, bus_dmamap |
257 | DPRINTF(("%s: map %p\n", __func__, map)); | | 257 | DPRINTF(("%s: map %p\n", __func__, map)); |
258 | | | 258 | |
259 | bus_dmamap_destroy(sc->sc_dmat, map); | | 259 | bus_dmamap_destroy(sc->sc_dmat, map); |
260 | } | | 260 | } |
261 | | | 261 | |
262 | | | 262 | |
263 | int | | 263 | int |
264 | uturn_dmamap_load(void *v, bus_dmamap_t map, void *addr, bus_size_t size, | | 264 | uturn_dmamap_load(void *v, bus_dmamap_t map, void *addr, bus_size_t size, |
265 | struct proc *p, int flags) | | 265 | struct proc *p, int flags) |
266 | { | | 266 | { |
267 | struct uturn_softc *sc = v; | | 267 | struct uturn_softc *sc = v; |
268 | int err; | | 268 | int err; |
269 | int i; | | 269 | int i; |
270 | int d = 0; | | | |
271 | | | 270 | |
272 | DPRINTF(("%s: map %p addr %p size %lx proc %p flags %x\n", __func__, | | 271 | DPRINTF(("%s: map %p addr %p size %lx proc %p flags %x\n", __func__, |
273 | map, addr, size, p, flags)); | | 272 | map, addr, size, p, flags)); |
274 | | | 273 | |
275 | err = bus_dmamap_load(sc->sc_dmat, map, addr, size, p, flags); | | 274 | err = bus_dmamap_load(sc->sc_dmat, map, addr, size, p, flags); |
276 | | | 275 | |
277 | DPRINTF(("%s: nsegs %2d dm_mapsize %lx\n", __func__, map->dm_nsegs, | | 276 | DPRINTF(("%s: nsegs %2d dm_mapsize %lx\n", __func__, map->dm_nsegs, |
278 | map->dm_mapsize)); | | 277 | map->dm_mapsize)); |
279 | for (i = 0; i < map->dm_nsegs; i++) { | | 278 | for (i = 0; i < map->dm_nsegs; i++) { |
280 | DPRINTF(("%s: seg %2d ds_addr %lx _ds_va %lx\n", __func__, i, | | 279 | DPRINTF(("%s: seg %2d ds_addr %lx _ds_va %lx\n", __func__, i, |
281 | map->dm_segs[i].ds_addr, map->dm_segs[i]._ds_va)); | | 280 | map->dm_segs[i].ds_addr, map->dm_segs[i]._ds_va)); |
282 | if (map->dm_segs[i].ds_addr != map->dm_segs[i]._ds_va) | | | |
283 | d = 1; | | | |
284 | } | | 281 | } |
285 | DPRINTF(("%s:\n", __func__)); | | | |
286 | if (uturndebug && d) | | | |
287 | Debugger(); | | | |
288 | | | 282 | |
289 | return err; | | 283 | return err; |
290 | } | | 284 | } |
291 | | | 285 | |
292 | | | 286 | |
293 | int | | 287 | int |
294 | uturn_dmamap_load_mbuf(void *v, bus_dmamap_t map, struct mbuf *m, int flags) | | 288 | uturn_dmamap_load_mbuf(void *v, bus_dmamap_t map, struct mbuf *m, int flags) |
295 | { | | 289 | { |
296 | struct uturn_softc *sc = v; | | 290 | struct uturn_softc *sc = v; |
297 | int err; | | 291 | int err; |
298 | int i; | | 292 | int i; |
299 | | | 293 | |
300 | DPRINTF(("%s: map %p mbuf %p flags %x\n", __func__, map, m, flags)); | | 294 | DPRINTF(("%s: map %p mbuf %p flags %x\n", __func__, map, m, flags)); |