xref: /openbsd/sys/arch/sparc64/dev/viommuvar.h (revision d415bd75)
1 /*	$OpenBSD: viommuvar.h,v 1.2 2009/01/02 20:01:45 kettenis Exp $	*/
2 /*
3  * Copyright (c) 2008 Mark Kettenis
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 #ifndef _SPARC64_DEV_VIOMMUVAR_H_
19 #define _SPARC64_DEV_VIOMMUVAR_H_
20 
21 #include <sparc64/dev/iommuvar.h>
22 
23 /* interfaces for PCI code */
24 void	viommu_init(char *, struct iommu_state *, int, u_int32_t);
25 
26 /* bus_dma_tag_t implementation functions */
27 int	viommu_dvmamap_create(bus_dma_tag_t, bus_dma_tag_t,
28 	    struct iommu_state *, bus_size_t, int, bus_size_t, bus_size_t,
29 	    int, bus_dmamap_t *);
30 void	viommu_dvmamap_destroy(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
31 int	viommu_dvmamap_load(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, void *,
32 	    bus_size_t, struct proc *, int);
33 void	viommu_dvmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
34 int	viommu_dvmamap_load_raw(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
35 	    bus_dma_segment_t *, int, bus_size_t, int);
36 void	viommu_dvmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
37 	    bus_addr_t, bus_size_t, int);
38 int	viommu_dvmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, bus_size_t,
39 	    bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int);
40 void	viommu_dvmamem_free(bus_dma_tag_t, bus_dma_tag_t, bus_dma_segment_t *,
41 	    int);
42 
43 #endif
44