-/* $OpenBSD: bus_dma.c,v 1.35 2014/11/16 12:30:56 deraadt Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.36 2018/01/11 15:49:34 visa Exp $ */
/* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */
/*-
bus_dma_tag_t t;
bus_dmamap_t map;
{
+ size_t mapsize;
- free(map, M_DEVBUF, 0);
+ mapsize = sizeof(struct alpha_bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
/*
-/* $OpenBSD: bus_dma.c,v 1.37 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.38 2018/01/11 15:49:34 visa Exp $ */
/* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */
/*-
void
_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
+ size_t mapsize;
#ifdef DEBUG_DMA
printf("dmamap_destroy: t=%p map=%p\n", t, map);
#endif /* DEBUG_DMA */
- free(map, M_DEVBUF, 0);
+ mapsize = sizeof(struct arm32_bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
/*
-/* $OpenBSD: bus_dma.c,v 1.9 2017/08/11 22:01:09 kettenis Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.10 2018/01/11 15:49:34 visa Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
void
_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
- free(map, M_DEVBUF, 0);
+ size_t mapsize;
+
+ mapsize = sizeof(struct machine_bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
/*
-/* $OpenBSD: bus_dma.c,v 1.13 2015/01/25 11:36:41 dlg Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.14 2018/01/11 15:49:34 visa Exp $ */
/* $NetBSD: bus_dma.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*
void
_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
+ size_t mapsize;
DPRINTF(("bus_dmamap_destroy: t = %p, map = %p\n", t, map));
- free(map, M_DEVBUF, 0);
+ mapsize = sizeof(struct _bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
int
-/* $OpenBSD: bus_dma.c,v 1.19 2015/08/15 22:31:38 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.20 2018/01/11 15:49:34 visa Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
void
_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
- free(map, M_DEVBUF, 0);
+ size_t mapsize;
+
+ mapsize = sizeof(struct machine_bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
/*
-/* $OpenBSD: bus_dma.c,v 1.15 2017/04/15 04:38:27 visa Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.16 2018/01/11 15:49:34 visa Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
void
_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
- free(map, M_DEVBUF, 0);
+ size_t mapsize;
+
+ mapsize = sizeof(struct machine_bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
/*
-/* $OpenBSD: bus_dma.c,v 1.4 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.5 2018/01/11 15:49:34 visa Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
void
_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
+ size_t mapsize;
- free(map, M_DEVBUF, 0);
+ mapsize = sizeof(struct powerpc_bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
-/* $OpenBSD: bus_dma.c,v 1.41 2017/05/11 15:47:45 visa Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.42 2018/01/11 15:49:34 visa Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
void
_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
- free(map, M_DEVBUF, 0);
+ size_t mapsize;
+
+ mapsize = sizeof(struct machine_bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
/*