xref: /freebsd/sys/dev/iommu/iommu_msi.h (revision e707c8be4e8d5f4d542a1344dc6d96bcc08d0b4f)
1*e707c8beSRuslan Bukin /*-
2*e707c8beSRuslan Bukin  * SPDX-License-Identifier: BSD-2-Clause
3*e707c8beSRuslan Bukin  *
4*e707c8beSRuslan Bukin  * Copyright (c) 2020 Andrew Turner
5*e707c8beSRuslan Bukin  *
6*e707c8beSRuslan Bukin  * This work was supported by Innovate UK project 105694, "Digital Security
7*e707c8beSRuslan Bukin  * by Design (DSbD) Technology Platform Prototype".
8*e707c8beSRuslan Bukin  *
9*e707c8beSRuslan Bukin  * Redistribution and use in source and binary forms, with or without
10*e707c8beSRuslan Bukin  * modification, are permitted provided that the following conditions
11*e707c8beSRuslan Bukin  * are met:
12*e707c8beSRuslan Bukin  * 1. Redistributions of source code must retain the above copyright
13*e707c8beSRuslan Bukin  *    notice, this list of conditions and the following disclaimer.
14*e707c8beSRuslan Bukin  * 2. Redistributions in binary form must reproduce the above copyright
15*e707c8beSRuslan Bukin  *    notice, this list of conditions and the following disclaimer in the
16*e707c8beSRuslan Bukin  *    documentation and/or other materials provided with the distribution.
17*e707c8beSRuslan Bukin  *
18*e707c8beSRuslan Bukin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19*e707c8beSRuslan Bukin  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*e707c8beSRuslan Bukin  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*e707c8beSRuslan Bukin  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22*e707c8beSRuslan Bukin  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*e707c8beSRuslan Bukin  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*e707c8beSRuslan Bukin  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*e707c8beSRuslan Bukin  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*e707c8beSRuslan Bukin  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*e707c8beSRuslan Bukin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*e707c8beSRuslan Bukin  * SUCH DAMAGE.
29*e707c8beSRuslan Bukin  *
30*e707c8beSRuslan Bukin  * $FreeBSD$
31*e707c8beSRuslan Bukin  */
32*e707c8beSRuslan Bukin 
33*e707c8beSRuslan Bukin #ifndef _DEV_IOMMU_IOMMU_MSI_H_
34*e707c8beSRuslan Bukin #define _DEV_IOMMU_IOMMU_MSI_H_
35*e707c8beSRuslan Bukin 
36*e707c8beSRuslan Bukin #include <dev/iommu/iommu_types.h>
37*e707c8beSRuslan Bukin 
38*e707c8beSRuslan Bukin struct iommu_unit;
39*e707c8beSRuslan Bukin struct iommu_domain;
40*e707c8beSRuslan Bukin struct iommu_ctx;
41*e707c8beSRuslan Bukin 
42*e707c8beSRuslan Bukin void iommu_translate_msi(struct iommu_domain *domain, uint64_t *addr);
43*e707c8beSRuslan Bukin int iommu_map_msi(struct iommu_ctx *ctx, iommu_gaddr_t size, int offset,
44*e707c8beSRuslan Bukin     u_int eflags, u_int flags, vm_page_t *ma);
45*e707c8beSRuslan Bukin 
46*e707c8beSRuslan Bukin #endif /* !_DEV_IOMMU_IOMMU_MSI_H_ */
47