diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/sg_dma.c | 14 | ||||
-rw-r--r-- | sys/arch/amd64/include/bus.h | 3 | ||||
-rw-r--r-- | sys/arch/amd64/pci/agp_machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/sg_dma.c | 14 | ||||
-rw-r--r-- | sys/arch/i386/include/bus.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/pci/agp_machdep.c | 8 |
6 files changed, 44 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/sg_dma.c b/sys/arch/amd64/amd64/sg_dma.c index 67d6eee4659..7f5f33e4a73 100644 --- a/sys/arch/amd64/amd64/sg_dma.c +++ b/sys/arch/amd64/amd64/sg_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sg_dma.c,v 1.10 2011/04/07 15:30:13 miod Exp $ */ +/* $OpenBSD: sg_dma.c,v 1.11 2013/03/17 21:49:00 kettenis Exp $ */ /* * Copyright (c) 2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -786,6 +786,18 @@ sg_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t map) _bus_dmamap_unload(t, map); } +/* + * Reload a dvmamap. + */ +void +sg_dmamap_reload(bus_dma_tag_t t, bus_dmamap_t map, int flags) +{ + struct sg_cookie *is = t->_cookie; + struct sg_page_map *spm = map->_dm_cookie; + + sg_iomap_load_map(is, spm, spm->spm_start, flags); +} + /* * Alloc dma safe memory, telling the backend that we're scatter gather * to ease pressure on the vm. diff --git a/sys/arch/amd64/include/bus.h b/sys/arch/amd64/include/bus.h index 4cd23ba63ad..4ae57e5c31b 100644 --- a/sys/arch/amd64/include/bus.h +++ b/sys/arch/amd64/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.28 2013/01/29 01:15:57 dlg Exp $ */ +/* $OpenBSD: bus.h,v 1.29 2013/03/17 21:49:00 kettenis Exp $ */ /* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */ /*- @@ -753,6 +753,7 @@ int sg_dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int, int *, int); int sg_dmamap_load_physarray(bus_dma_tag_t, bus_dmamap_t, paddr_t *, int, int, int *, int); +void sg_dmamap_reload(bus_dma_tag_t, bus_dmamap_t, int); int sg_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int); diff --git a/sys/arch/amd64/pci/agp_machdep.c b/sys/arch/amd64/pci/agp_machdep.c index 94a94d5fdb7..b59377e28f2 100644 --- a/sys/arch/amd64/pci/agp_machdep.c +++ b/sys/arch/amd64/pci/agp_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_machdep.c,v 1.6 2010/05/10 22:06:04 oga Exp $ */ +/* $OpenBSD: agp_machdep.c,v 1.7 2013/03/17 21:49:00 kettenis Exp $ */ /* * Copyright (c) 2008 - 2009 Owain G. Ainsworth <oga@openbsd.org> @@ -174,6 +174,12 @@ agp_bus_dma_set_alignment(bus_dma_tag_t tag, bus_dmamap_t dmam, sg_dmamap_set_alignment(tag, dmam, alignment); } +void +agp_bus_dma_rebind(bus_dma_tag_t tag, bus_dmamap_t dmam, int flags) +{ + sg_dmamap_reload(tag, dmam, flags); +} + struct agp_map { bus_space_tag_t bst; bus_space_handle_t bsh; diff --git a/sys/arch/i386/i386/sg_dma.c b/sys/arch/i386/i386/sg_dma.c index 1f45bf21c83..afbfb0aa0ad 100644 --- a/sys/arch/i386/i386/sg_dma.c +++ b/sys/arch/i386/i386/sg_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sg_dma.c,v 1.7 2011/04/07 15:30:15 miod Exp $ */ +/* $OpenBSD: sg_dma.c,v 1.8 2013/03/17 21:49:00 kettenis Exp $ */ /* * Copyright (c) 2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -786,6 +786,18 @@ sg_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t map) _bus_dmamap_unload(t, map); } +/* + * Reload a dvmamap. + */ +void +sg_dmamap_reload(bus_dma_tag_t t, bus_dmamap_t map, int flags) +{ + struct sg_cookie *is = t->_cookie; + struct sg_page_map *spm = map->_dm_cookie; + + sg_iomap_load_map(is, spm, spm->spm_start, flags); +} + /* * Alloc dma safe memory, telling the backend that we're scatter gather * to ease pressure on the vm. diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h index a6b79e9333a..a0bfb337f98 100644 --- a/sys/arch/i386/include/bus.h +++ b/sys/arch/i386/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.57 2013/01/29 01:15:57 dlg Exp $ */ +/* $OpenBSD: bus.h,v 1.58 2013/03/17 21:49:00 kettenis Exp $ */ /* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */ /*- @@ -693,8 +693,8 @@ int sg_dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int, int *, int); int sg_dmamap_load_physarray(bus_dma_tag_t, bus_dmamap_t, paddr_t *, int, int, int *, int); +void sg_dmamap_reload(bus_dma_tag_t, bus_dmamap_t, int); int sg_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int); - #endif /* _MACHINE_BUS_H_ */ diff --git a/sys/arch/i386/pci/agp_machdep.c b/sys/arch/i386/pci/agp_machdep.c index e6eaa41a00c..c6634a99dc4 100644 --- a/sys/arch/i386/pci/agp_machdep.c +++ b/sys/arch/i386/pci/agp_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_machdep.c,v 1.12 2010/05/10 22:06:04 oga Exp $ */ +/* $OpenBSD: agp_machdep.c,v 1.13 2013/03/17 21:49:00 kettenis Exp $ */ /* * Copyright (c) 2008 - 2009 Owain G. Ainsworth <oga@openbsd.org> @@ -174,6 +174,12 @@ agp_bus_dma_set_alignment(bus_dma_tag_t tag, bus_dmamap_t dmam, sg_dmamap_set_alignment(tag, dmam, alignment); } +void +agp_bus_dma_rebind(bus_dma_tag_t tag, bus_dmamap_t dmam, int flags) +{ + sg_dmamap_reload(tag, dmam, flags); +} + struct agp_map { bus_space_tag_t bst; bus_addr_t addr; |