Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/common Since the SGMAP buffer load subroutine...



details:   https://anonhg.NetBSD.org/src/rev/66fcc428f2e4
branches:  trunk
changeset: 512950:66fcc428f2e4
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Jul 19 18:20:20 2001 +0000

description:
Since the SGMAP buffer load subroutine doesn't need to modify
the segment index, don't pass it by reference.

diffstat:

 sys/arch/alpha/common/sgmap_typedep.c |  26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diffs (92 lines):

diff -r 2715f7e1cae7 -r 66fcc428f2e4 sys/arch/alpha/common/sgmap_typedep.c
--- a/sys/arch/alpha/common/sgmap_typedep.c     Thu Jul 19 18:18:30 2001 +0000
+++ b/sys/arch/alpha/common/sgmap_typedep.c     Thu Jul 19 18:20:20 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap_typedep.c,v 1.21 2001/07/19 18:08:54 thorpej Exp $ */
+/* $NetBSD: sgmap_typedep.c,v 1.22 2001/07/19 18:20:20 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-__KERNEL_RCSID(0, "$NetBSD: sgmap_typedep.c,v 1.21 2001/07/19 18:08:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgmap_typedep.c,v 1.22 2001/07/19 18:20:20 thorpej Exp $");
 
 #include "opt_ddb.h"
 
@@ -49,8 +49,7 @@
 
 int                    __C(SGMAP_TYPE,_load_buffer)(bus_dma_tag_t,
                            bus_dmamap_t, void *buf, size_t buflen,
-                           struct proc *, int, int *,
-                           struct alpha_sgmap *);
+                           struct proc *, int, int, struct alpha_sgmap *);
 
 void
 __C(SGMAP_TYPE,_init_spill_page_pte)(void)
@@ -63,7 +62,7 @@
 
 int
 __C(SGMAP_TYPE,_load_buffer)(bus_dma_tag_t t, bus_dmamap_t map, void *buf,
-    size_t buflen, struct proc *p, int flags, int *segp,
+    size_t buflen, struct proc *p, int flags, int seg,
     struct alpha_sgmap *sgmap)
 {
        vaddr_t endva, va = (vaddr_t)buf;
@@ -155,22 +154,21 @@
 #endif
 
        /* Generate the DMA address. */
-       map->dm_segs[*segp].ds_addr = sgmap->aps_wbase | sgva | dmaoffset;
-       map->dm_segs[*segp].ds_len = buflen;
+       map->dm_segs[seg].ds_addr = sgmap->aps_wbase | sgva | dmaoffset;
+       map->dm_segs[seg].ds_len = buflen;
 
 #ifdef SGMAP_DEBUG
        if (__C(SGMAP_TYPE,_debug))
                printf("sgmap_load: wbase = 0x%lx, vpage = 0x%x, "
                    "dma addr = 0x%lx\n", sgmap->aps_wbase, sgva,
-                   map->dm_segs[0].ds_addr);
+                   map->dm_segs[seg].ds_addr);
 #endif
 
        for (; va < endva; va += NBPG, pteidx++,
-           pte = &page_table[pteidx * SGMAP_PTE_SPACING]) {
+            pte = &page_table[pteidx * SGMAP_PTE_SPACING]) {
                /* Get the physical address for this segment. */
                if (p != NULL)
-                       (void) pmap_extract(p->p_vmspace->vm_map.pmap, va,
-                           &pa);
+                       (void) pmap_extract(p->p_vmspace->vm_map.pmap, va, &pa);
                else
                        pa = vtophys(va);
 
@@ -221,7 +219,7 @@
 
        seg = 0;
        error = __C(SGMAP_TYPE,_load_buffer)(t, map, buf, buflen, p,
-           flags, &seg, sgmap);
+           flags, seg, sgmap);
 
        alpha_mb();
 
@@ -274,7 +272,7 @@
        error = 0;
        for (m = m0; m != NULL && error == 0; m = m->m_next, seg++)
                error = __C(SGMAP_TYPE,_load_buffer)(t, map,
-                   m->m_data, m->m_len, NULL, flags, &seg, sgmap);
+                   m->m_data, m->m_len, NULL, flags, seg, sgmap);
 
        alpha_mb();
 
@@ -346,7 +344,7 @@
                addr = (caddr_t)iov[i].iov_base;
 
                error = __C(SGMAP_TYPE,_load_buffer)(t, map,
-                   addr, minlen, p, flags, &seg, sgmap);
+                   addr, minlen, p, flags, seg, sgmap);
 
                resid -= minlen;
        }



Home | Main Index | Thread Index | Old Index