Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Dec 2012 05:59:10 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244851 - in projects/altix2/sys: kern sys
Message-ID:  <201212300559.qBU5xARQ037274@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Dec 30 05:59:10 2012
New Revision: 244851
URL: http://svnweb.freebsd.org/changeset/base/244851

Log:
  o   Add busdma_md_get_tag()
  o   Add busdma_tag_get_maxaddr()

Modified:
  projects/altix2/sys/kern/subr_busdma.c
  projects/altix2/sys/sys/busdma.h

Modified: projects/altix2/sys/kern/subr_busdma.c
==============================================================================
--- projects/altix2/sys/kern/subr_busdma.c	Sun Dec 30 04:22:34 2012	(r244850)
+++ projects/altix2/sys/kern/subr_busdma.c	Sun Dec 30 05:59:10 2012	(r244851)
@@ -161,8 +161,6 @@ SYSINIT(busdma_kmem, SI_SUB_KMEM, SI_ORD
 
 /* Section 3.2: Debugging & tracing. */
 
-#define	BUSDMA_DEBUG	1
-
 static void
 _busdma_mtag_dump(const char *func, device_t dev, struct busdma_mtag *mtag)
 {
@@ -544,6 +542,15 @@ busdma_tag_destroy(struct busdma_tag *ta
 	return (0);
 }
 
+bus_addr_t
+busdma_tag_get_maxaddr(struct busdma_tag *tag)
+{
+
+	CTR2(KTR_BUSDMA, "%s: tag=%p", __func__, tag);
+
+	return ((tag != NULL) ? tag->dt_maxaddr : 0UL);
+}
+
 int
 busdma_md_create(struct busdma_tag *tag, u_int flags, struct busdma_md **md_p)
 {
@@ -632,6 +639,15 @@ busdma_md_get_size(struct busdma_md *md,
 	return (size);
 }
 
+struct busdma_tag *
+busdma_md_get_tag(struct busdma_md *md)
+{
+
+	CTR2(KTR_BUSDMA, "%s: md=%p", __func__, md);
+
+	return ((md != NULL) ? md->md_tag : NULL);
+}
+
 vm_offset_t
 busdma_md_get_vaddr(struct busdma_md *md, u_int idx)
 {

Modified: projects/altix2/sys/sys/busdma.h
==============================================================================
--- projects/altix2/sys/sys/busdma.h	Sun Dec 30 04:22:34 2012	(r244850)
+++ projects/altix2/sys/sys/busdma.h	Sun Dec 30 05:59:10 2012	(r244851)
@@ -92,6 +92,8 @@ int busdma_tag_derive(busdma_tag_t tag, 
  */
 int busdma_tag_destroy(busdma_tag_t tag);
 
+bus_addr_t busdma_tag_get_maxaddr(busdma_tag_t tag);
+
 /*
  *
  */
@@ -112,6 +114,7 @@ int busdma_md_load_uio(busdma_md_t md, s
     busdma_callback_f cb, void *arg, u_int flags);
 int busdma_md_unload(busdma_md_t md);
 u_int busdma_md_get_nsegs(busdma_md_t md);
+busdma_tag_t busdma_md_get_tag(busdma_md_t md);
 bus_addr_t busdma_md_get_busaddr(busdma_md_t md, u_int idx);
 vm_paddr_t busdma_md_get_paddr(busdma_md_t md, u_int idx);
 vm_offset_t busdma_md_get_vaddr(busdma_md_t md, u_int idx);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212300559.qBU5xARQ037274>