iommulib.h revision 256141046d195629e2d487169658f509aec955cd
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IOMMULIB_H
#define _SYS_IOMMULIB_H
#pragma ident "@(#)iommulib.h 1.3 08/08/31 SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/ddi_impldefs.h>
#ifdef _KERNEL
typedef enum {
INVALID_VENDOR = 0,
typedef enum {
#define IOMMU_OPS_VERSION IOMMU_OPS_VERSION_1
typedef struct iommulib_ops {
char *ilops_id;
void *ilops_data;
/* Obsolete DMA routines */
/*
* IOMMU_USED() checks if there is an IOMMU controlling the dip's DMA
*/
typedef enum {
typedef struct iommulib_nexops {
char *nops_id;
void *nops_data;
struct iommulib_nex;
typedef struct iommulib_nex *iommulib_nexhandle_t;
/*
* struct iommu_dip_private
* private iommu structure hook on dev_info
*/
typedef struct iommu_private {
/* pci seg, bus, dev, func */
int idp_seg;
int idp_bus;
int idp_devfn;
/* ppb information */
int idp_bbp_type;
int idp_sec;
int idp_sub;
/* identifier for special devices */
/* domain ptr */
void *idp_intel_domain;
#define INTEL_IOMMU_PRIVATE(i) (dmar_domain_state_t *)(i)
typedef struct gfx_entry {
int g_ref;
} gfx_entry_t;
/*
* Interfaces for nexus drivers - typically rootnex
*/
/*
* Interfaces for IOMMU drivers provided by IOMMULIB
*/
/* Interfaces for IOMMU drivers provided by NEXUS drivers (typically rootnex) */
/*
* For SMBIOS access from IOMMU drivers
*/
extern smbios_hdl_t *iommulib_smbios;
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IOMMULIB_H */