Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sun2/sun2 In _bus_dmamap_load, now check the return...



details:   https://anonhg.NetBSD.org/src/rev/3b54e7f37171
branches:  trunk
changeset: 514606:3b54e7f37171
user:      fredette <fredette%NetBSD.org@localhost>
date:      Thu Sep 06 21:38:40 2001 +0000

description:
In _bus_dmamap_load, now check the return value of pmap_extract
under DIAGNOSTIC, and fixed a bug where we weren't putting the
right size into a newly valid map.

diffstat:

 sys/arch/sun2/sun2/machdep.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 07c8c70f40a6 -r 3b54e7f37171 sys/arch/sun2/sun2/machdep.c
--- a/sys/arch/sun2/sun2/machdep.c      Thu Sep 06 21:30:15 2001 +0000
+++ b/sys/arch/sun2/sun2/machdep.c      Thu Sep 06 21:38:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.9 2001/06/27 03:16:02 fredette Exp $     */
+/*     $NetBSD: machdep.c,v 1.10 2001/09/06 21:38:40 fredette Exp $    */
 
 /*
  * Copyright (c) 2001 Matthew Fredette.
@@ -982,6 +982,7 @@
        int pagesz = PAGE_SIZE;
        bus_addr_t dva;
        pmap_t pmap;
+       int rv;
 
        /*
         * Make sure that on error condition we return "no valid mappings".
@@ -1042,7 +1043,11 @@
                /*
                 * Get the physical address for this page.
                 */
-               (void) pmap_extract(pmap, va, &pa);
+               rv = pmap_extract(pmap, va, &pa);
+#ifdef DIAGNOSTIC
+               if (!rv)
+                       panic("_bus_dmamap_load: no page");
+#endif /* DIAGNOSTIC */
 
                /*
                 * Compute the segment size, and adjust counts.
@@ -1063,7 +1068,7 @@
 
        /* Make the map truly valid. */
        map->dm_nsegs = 1;
-       map->dm_mapsize = buflen;
+       map->dm_mapsize = map->dm_segs[0].ds_len;
 
        return (0);
 }



Home | Main Index | Thread Index | Old Index