Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/iommu/busdma_dmar.h
Show All 28 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef __X86_IOMMU_BUSDMA_DMAR_H | #ifndef __X86_IOMMU_BUSDMA_DMAR_H | ||||
#define __X86_IOMMU_BUSDMA_DMAR_H | #define __X86_IOMMU_BUSDMA_DMAR_H | ||||
struct dmar_map_entry; | #include <sys/iommu.h> | ||||
TAILQ_HEAD(dmar_map_entries_tailq, dmar_map_entry); | |||||
struct bus_dma_tag_dmar { | struct bus_dma_tag_iommu { | ||||
struct bus_dma_tag_common common; | struct bus_dma_tag_common common; | ||||
struct dmar_ctx *ctx; | struct iommu_ctx *ctx; | ||||
device_t owner; | device_t owner; | ||||
int map_count; | int map_count; | ||||
bus_dma_segment_t *segments; | bus_dma_segment_t *segments; | ||||
}; | }; | ||||
struct bus_dmamap_dmar { | struct bus_dmamap_iommu { | ||||
struct bus_dma_tag_dmar *tag; | struct bus_dma_tag_iommu *tag; | ||||
struct memdesc mem; | struct memdesc mem; | ||||
bus_dmamap_callback_t *callback; | bus_dmamap_callback_t *callback; | ||||
void *callback_arg; | void *callback_arg; | ||||
struct dmar_map_entries_tailq map_entries; | struct iommu_map_entries_tailq map_entries; | ||||
TAILQ_ENTRY(bus_dmamap_dmar) delay_link; | TAILQ_ENTRY(bus_dmamap_iommu) delay_link; | ||||
bool locked; | bool locked; | ||||
bool cansleep; | bool cansleep; | ||||
int flags; | int flags; | ||||
}; | }; | ||||
#define BUS_DMAMAP_DMAR_MALLOC 0x0001 | #define BUS_DMAMAP_IOMMU_MALLOC 0x0001 | ||||
#define BUS_DMAMAP_DMAR_KMEM_ALLOC 0x0002 | #define BUS_DMAMAP_IOMMU_KMEM_ALLOC 0x0002 | ||||
extern struct bus_dma_impl bus_dma_dmar_impl; | extern struct bus_dma_impl bus_dma_iommu_impl; | ||||
bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); | bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); | ||||
#endif | #endif |