Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax Hooks needed for QVSS support



details:   https://anonhg.NetBSD.org/src/rev/38bd1406b727
branches:  trunk
changeset: 339208:38bd1406b727
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Jul 05 02:03:36 2015 +0000

description:
Hooks needed for QVSS support

diffstat:

 sys/arch/vax/include/bus.h   |   8 ++++++--
 sys/arch/vax/include/sgmap.h |   4 +++-
 sys/arch/vax/vax/sgmap.c     |  20 ++++++++++++++------
 3 files changed, 23 insertions(+), 9 deletions(-)

diffs (94 lines):

diff -r d0ffb42b201b -r 38bd1406b727 sys/arch/vax/include/bus.h
--- a/sys/arch/vax/include/bus.h        Sat Jul 04 22:45:08 2015 +0000
+++ b/sys/arch/vax/include/bus.h        Sun Jul 05 02:03:36 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.31 2008/04/28 20:23:39 martin Exp $  */
+/*     $NetBSD: bus.h,v 1.32 2015/07/05 02:03:36 matt Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -184,7 +184,11 @@
 
 #define bus_space_free(t, h, s)                                                \
        (*(t)->vbs_free)((t)->vbs_cookie, (h), (s))
-
+/*
+ * Get kernel virtual address for ranges mapped BUS_SPACE_MAP_LINEAR.
+ */
+#define bus_space_vaddr(t, h)                                          \
+       ((void *) (h))
 /*
  * Mmap bus space for a user application.
  */
diff -r d0ffb42b201b -r 38bd1406b727 sys/arch/vax/include/sgmap.h
--- a/sys/arch/vax/include/sgmap.h      Sat Jul 04 22:45:08 2015 +0000
+++ b/sys/arch/vax/include/sgmap.h      Sun Jul 05 02:03:36 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap.h,v 1.6 2008/04/28 20:23:39 martin Exp $ */
+/* $NetBSD: sgmap.h,v 1.7 2015/07/05 02:03:36 matt Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -63,6 +63,8 @@
 int    vax_sgmap_alloc(bus_dmamap_t, bus_size_t, struct vax_sgmap *, int);
 void   vax_sgmap_free(bus_dmamap_t, struct vax_sgmap *);
 
+int    vax_sgmap_reserve(bus_addr_t, bus_size_t, struct vax_sgmap *);
+
 int     vax_sgmap_load(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t,
            struct proc *, int, struct vax_sgmap *);
 
diff -r d0ffb42b201b -r 38bd1406b727 sys/arch/vax/vax/sgmap.c
--- a/sys/arch/vax/vax/sgmap.c  Sat Jul 04 22:45:08 2015 +0000
+++ b/sys/arch/vax/vax/sgmap.c  Sun Jul 05 02:03:36 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap.c,v 1.17 2012/01/27 18:53:06 para Exp $ */
+/* $NetBSD: sgmap.c,v 1.18 2015/07/05 02:03:36 matt Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sgmap.c,v 1.17 2012/01/27 18:53:06 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgmap.c,v 1.18 2015/07/05 02:03:36 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,16 +124,18 @@
        }
 
        map->_dm_sgvalen = vax_round_page(len);
-#if 0
+#define DEBUG_SGMAP 0
+#if DEBUG_SGMAP
        printf("len %x -> %x, _dm_sgvalen %x _dm_boundary %x boundary %x -> ",
-           origlen, len, map->_dm_sgvalen, map->_dm_boundary, boundary);
+           //origlen, len, map->_dm_sgvalen, map->_dm_boundary, boundary);
+           (unsigned int)origlen, (unsigned int)len, (unsigned int)map->_dm_sgvalen, (unsigned int)map->_dm_boundary, 1);
 #endif
 
        error = extent_alloc(sgmap->aps_ex, map->_dm_sgvalen, VAX_NBPG,
            0, (flags & BUS_DMA_NOWAIT) ? EX_NOWAIT : EX_WAITOK,
            &map->_dm_sgva);
-#if 0
-       printf("error %d _dm_sgva %x\n", error, map->_dm_sgva);
+#if DEBUG_SGMAP
+       printf("error %d _dm_sgva %lx\n", error, map->_dm_sgva);
 #endif
 
        if (error == 0)
@@ -161,6 +163,12 @@
 }
 
 int
+vax_sgmap_reserve(bus_addr_t ba, bus_size_t len, struct vax_sgmap *sgmap)
+{
+       return extent_alloc_region(sgmap->aps_ex, ba, len, EX_NOWAIT); 
+}
+
+int
 vax_sgmap_load(bus_dma_tag_t t, bus_dmamap_t map, void *buf, bus_size_t buflen,
        struct proc *p, int flags, struct vax_sgmap *sgmap)
 {



Home | Main Index | Thread Index | Old Index