Deleted Added
full compact
iommuvar.h (110030) iommuvar.h (113238)
1/*
2 * Copyright (c) 1999 Matthew R. Green
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from: NetBSD: iommuvar.h,v 1.9 2001/07/20 00:07:13 eeh Exp
29 *
1/*
2 * Copyright (c) 1999 Matthew R. Green
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from: NetBSD: iommuvar.h,v 1.9 2001/07/20 00:07:13 eeh Exp
29 *
30 * $FreeBSD: head/sys/sparc64/include/iommuvar.h 110030 2003-01-29 07:25:27Z scottl $
30 * $FreeBSD: head/sys/sparc64/include/iommuvar.h 113238 2003-04-08 06:35:09Z jake $
31 */
32
33#ifndef _MACHINE_IOMMUVAR_H_
34#define _MACHINE_IOMMUVAR_H_
35
36#define IO_PAGE_SIZE PAGE_SIZE_8K
37#define IO_PAGE_MASK PAGE_MASK_8K
38#define IO_PAGE_SHIFT PAGE_SHIFT_8K
39#define round_io_page(x) round_page(x)
40#define trunc_io_page(x) trunc_page(x)
41
42/*
43 * per-IOMMU state
44 */
45struct iommu_state {
46 int is_tsbsize; /* 0 = 8K, ... */
47 u_int64_t is_dvmabase;
48 int64_t is_cr; /* IOMMU control register value */
49
31 */
32
33#ifndef _MACHINE_IOMMUVAR_H_
34#define _MACHINE_IOMMUVAR_H_
35
36#define IO_PAGE_SIZE PAGE_SIZE_8K
37#define IO_PAGE_MASK PAGE_MASK_8K
38#define IO_PAGE_SHIFT PAGE_SHIFT_8K
39#define round_io_page(x) round_page(x)
40#define trunc_io_page(x) trunc_page(x)
41
42/*
43 * per-IOMMU state
44 */
45struct iommu_state {
46 int is_tsbsize; /* 0 = 8K, ... */
47 u_int64_t is_dvmabase;
48 int64_t is_cr; /* IOMMU control register value */
49
50 vm_offset_t is_flushpa[2];
50 vm_paddr_t is_flushpa[2];
51 volatile int64_t *is_flushva[2];
52 /*
53 * When a flush is completed, 64 bytes will be stored at the given
54 * location, the first double word being 1, to indicate completion.
55 * The lower 6 address bits are ignored, so the addresses need to be
56 * suitably aligned; over-allocate a large enough margin to be able
57 * to adjust it.
58 * Two such buffers are needed.

--- 13 unchanged lines hidden (view full) ---

72 bus_addr_t is_dtcmp; /* tag compare diag. access */
73
74 STAILQ_ENTRY(iommu_state) is_link;
75};
76
77/* interfaces for PCI/SBUS code */
78void iommu_init(char *, struct iommu_state *, int, u_int32_t, int);
79void iommu_reset(struct iommu_state *);
51 volatile int64_t *is_flushva[2];
52 /*
53 * When a flush is completed, 64 bytes will be stored at the given
54 * location, the first double word being 1, to indicate completion.
55 * The lower 6 address bits are ignored, so the addresses need to be
56 * suitably aligned; over-allocate a large enough margin to be able
57 * to adjust it.
58 * Two such buffers are needed.

--- 13 unchanged lines hidden (view full) ---

72 bus_addr_t is_dtcmp; /* tag compare diag. access */
73
74 STAILQ_ENTRY(iommu_state) is_link;
75};
76
77/* interfaces for PCI/SBUS code */
78void iommu_init(char *, struct iommu_state *, int, u_int32_t, int);
79void iommu_reset(struct iommu_state *);
80void iommu_enter(struct iommu_state *, vm_offset_t, vm_offset_t, int);
80void iommu_enter(struct iommu_state *, vm_offset_t, vm_paddr_t, int);
81void iommu_remove(struct iommu_state *, vm_offset_t, size_t);
82void iommu_decode_fault(struct iommu_state *, vm_offset_t);
83
84int iommu_dvmamap_create(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
85 int, bus_dmamap_t *);
86int iommu_dvmamap_destroy(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
87 bus_dmamap_t);
88int iommu_dvmamap_load(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,

--- 19 unchanged lines hidden ---
81void iommu_remove(struct iommu_state *, vm_offset_t, size_t);
82void iommu_decode_fault(struct iommu_state *, vm_offset_t);
83
84int iommu_dvmamap_create(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
85 int, bus_dmamap_t *);
86int iommu_dvmamap_destroy(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
87 bus_dmamap_t);
88int iommu_dvmamap_load(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,

--- 19 unchanged lines hidden ---