iommuvar.h revision 1.2.2.2 1 1.2.2.2 thorpej /* $NetBSD: iommuvar.h,v 1.2.2.2 1999/06/21 01:02:31 thorpej Exp $ */
2 1.2.2.2 thorpej
3 1.2.2.2 thorpej /*
4 1.2.2.2 thorpej * Copyright (c) 1999 Matthew R. Green
5 1.2.2.2 thorpej * All rights reserved.
6 1.2.2.2 thorpej *
7 1.2.2.2 thorpej * Redistribution and use in source and binary forms, with or without
8 1.2.2.2 thorpej * modification, are permitted provided that the following conditions
9 1.2.2.2 thorpej * are met:
10 1.2.2.2 thorpej * 1. Redistributions of source code must retain the above copyright
11 1.2.2.2 thorpej * notice, this list of conditions and the following disclaimer.
12 1.2.2.2 thorpej * 2. Redistributions in binary form must reproduce the above copyright
13 1.2.2.2 thorpej * notice, this list of conditions and the following disclaimer in the
14 1.2.2.2 thorpej * documentation and/or other materials provided with the distribution.
15 1.2.2.2 thorpej * 3. The name of the author may not be used to endorse or promote products
16 1.2.2.2 thorpej * derived from this software without specific prior written permission.
17 1.2.2.2 thorpej *
18 1.2.2.2 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.2.2.2 thorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.2.2.2 thorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.2.2.2 thorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.2.2.2 thorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 1.2.2.2 thorpej * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 1.2.2.2 thorpej * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 1.2.2.2 thorpej * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 1.2.2.2 thorpej * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 1.2.2.2 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 1.2.2.2 thorpej * SUCH DAMAGE.
29 1.2.2.2 thorpej */
30 1.2.2.2 thorpej
31 1.2.2.2 thorpej #ifndef _SPARC64_DEV_IOMMUVAR_H_
32 1.2.2.2 thorpej #define _SPARC64_DEV_IOMMUVAR_H_
33 1.2.2.2 thorpej
34 1.2.2.2 thorpej /*
35 1.2.2.2 thorpej * per-IOMMU state
36 1.2.2.2 thorpej */
37 1.2.2.2 thorpej struct iommu_state {
38 1.2.2.2 thorpej paddr_t is_ptsb; /* TSB physical address */
39 1.2.2.2 thorpej int64_t *is_tsb; /* TSB virtual address */
40 1.2.2.2 thorpej int is_tsbsize; /* 0 = 8K, ... */
41 1.2.2.2 thorpej u_int is_dvmabase;
42 1.2.2.2 thorpej int64_t is_cr; /* IOMMU control regiter value */
43 1.2.2.2 thorpej struct extent *is_dvmamap; /* DVMA map for this instance */
44 1.2.2.2 thorpej
45 1.2.2.2 thorpej paddr_t is_flushpa; /* used to flush the SBUS */
46 1.2.2.2 thorpej /* Needs to be volatile or egcs optimizes away loads */
47 1.2.2.2 thorpej volatile int64_t is_flush;
48 1.2.2.2 thorpej
49 1.2.2.2 thorpej /* copies of our parents state, to allow us to be self contained */
50 1.2.2.2 thorpej bus_space_tag_t is_bustag; /* our bus tag */
51 1.2.2.2 thorpej struct iommureg *is_iommu; /* IOMMU registers */
52 1.2.2.2 thorpej struct iommu_strbuf *is_sb; /* streaming buffer */
53 1.2.2.2 thorpej };
54 1.2.2.2 thorpej
55 1.2.2.2 thorpej /* interfaces for PCI/SBUS code */
56 1.2.2.2 thorpej void iommu_init __P((char *, struct iommu_state *, int));
57 1.2.2.2 thorpej void iommu_reset __P((struct iommu_state *));
58 1.2.2.2 thorpej void iommu_enter __P((struct iommu_state *, vaddr_t, int64_t, int));
59 1.2.2.2 thorpej void iommu_remove __P((struct iommu_state *, vaddr_t, size_t));
60 1.2.2.2 thorpej int iommu_flush __P((struct iommu_state *));
61 1.2.2.2 thorpej
62 1.2.2.2 thorpej #endif /* _SPARC64_DEV_IOMMUVAR_H_ */
63