Module Name: src
Committed By: matt
Date: Sun Jul 5 02:03:36 UTC 2015
Modified Files:
src/sys/arch/vax/include: bus.h sgmap.h
src/sys/arch/vax/vax: sgmap.c
Log Message:
Hooks needed for QVSS support
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/vax/include/bus.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/vax/include/sgmap.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/vax/vax/sgmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/vax/include/bus.h
diff -u src/sys/arch/vax/include/bus.h:1.31 src/sys/arch/vax/include/bus.h:1.32
--- src/sys/arch/vax/include/bus.h:1.31 Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/include/bus.h Sun Jul 5 02:03:36 2015
@@ -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 @@ struct vax_bus_space {
#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.
*/
Index: src/sys/arch/vax/include/sgmap.h
diff -u src/sys/arch/vax/include/sgmap.h:1.6 src/sys/arch/vax/include/sgmap.h:1.7
--- src/sys/arch/vax/include/sgmap.h:1.6 Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/include/sgmap.h Sun Jul 5 02:03:36 2015
@@ -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 @@ void vax_sgmap_init(bus_dma_tag_t, struc
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 *);
Index: src/sys/arch/vax/vax/sgmap.c
diff -u src/sys/arch/vax/vax/sgmap.c:1.17 src/sys/arch/vax/vax/sgmap.c:1.18
--- src/sys/arch/vax/vax/sgmap.c:1.17 Fri Jan 27 18:53:06 2012
+++ src/sys/arch/vax/vax/sgmap.c Sun Jul 5 02:03:36 2015
@@ -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 @@ vax_sgmap_alloc(bus_dmamap_t map, bus_si
}
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 @@ vax_sgmap_free(bus_dmamap_t map, struct
}
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)
{