Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 In bus_dma_tag_create(9), copy important pr...
details: https://anonhg.NetBSD.org/src/rev/f00f5ce84dad
branches: trunk
changeset: 769960:f00f5ce84dad
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Sep 28 01:35:58 2011 +0000
description:
In bus_dma_tag_create(9), copy important properties (e.g., bounce
parameters) from the parent tag.
In bus_dma_tag_create(), increase the reference count on a parent
bus_dma_tag_t (if applicable), and decrease the reference count in
bus_dma_tag_destroy().
Don't let bus_dmatag_destroy(9) destroy an overridden bus_dma_tag_t.
diffstat:
sys/arch/x86/x86/bus_dma.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r ec6a24a69224 -r f00f5ce84dad sys/arch/x86/x86/bus_dma.c
--- a/sys/arch/x86/x86/bus_dma.c Wed Sep 28 01:33:26 2011 +0000
+++ b/sys/arch/x86/x86/bus_dma.c Wed Sep 28 01:35:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.64 2011/09/28 01:33:26 dyoung Exp $ */
+/* $NetBSD: bus_dma.c,v 1.65 2011/09/28 01:35:58 dyoung Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.64 2011/09/28 01:33:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.65 2011/09/28 01:35:58 dyoung Exp $");
/*
* The following is included because _bus_dma_uiomove is derived from
@@ -1623,6 +1623,8 @@
void
bus_dma_tag_destroy(bus_dma_tag_t bdt)
{
+ if (bdt->bdt_super != NULL)
+ bus_dmatag_destroy(bdt->bdt_super);
kmem_free(bdt, sizeof(struct x86_bus_dma_tag));
}
@@ -1642,6 +1644,10 @@
if (bdt == NULL)
return ENOMEM;
+ *bdt = *obdt;
+ /* don't let bus_dmatag_destroy free these */
+ bdt->_tag_needs_free = 0;
+
bdt->bdt_super = obdt;
for (bits = present; bits != 0; bits = nbits) {
@@ -1661,6 +1667,8 @@
bdt->bdt_ctx = ctx;
*bdtp = bdt;
+ if (obdt->_tag_needs_free)
+ obdt->_tag_needs_free++;
return 0;
einval:
Home |
Main Index |
Thread Index |
Old Index