px_dma.h revision 1de45cd9943ec41b32ebb75faceb3e938af93f68
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_PX_DMA_H
#define _SYS_PX_DMA_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
typedef pfn_t px_iopfn_t;
{ \
(cp)->dmac_notused = 0; \
}
#define PX_HAS_REDZONE(mp) \
#define PX_MAP_BUFZONE(mp) \
typedef struct px_dma_hdl {
} px_dma_hdl_t;
struct px_dma_impl { /* forthdebug only, keep in sync with ddi_dma_impl_t */
void *dmai_pfnlst;
void *dmai_winlst;
int dmai_fault;
};
/* Included in case other px-specific flags are added later. */
/*
* flags for overloading dmai_inuse field of the dma request
* structure:
*/
#define dmai_flags dmai_inuse
#define dmai_tte dmai_nexus_private
#define dmai_fdvma dmai_nexus_private
#define dmai_pfnlst dmai_iopte
#define dmai_winlst dmai_minfo
#define dmai_roffset dmai_pool
(p)->dma_attr_addr_lo = (lo); \
(p)->dma_attr_addr_hi = (hi); \
(p)->dma_attr_seg = (nocross); \
(p)->dma_attr_count_max = (cntmax);
#define SET_DMAALIGN(p, align) \
(p)->dma_attr_align = (align);
#define PX_DMAI_FLAGS_INUSE 0x1
#define PX_DMAI_FLAGS_BYPASSREQ 0x2
#define PX_DMAI_FLAGS_PEER_ONLY 0x4
#define PX_DMAI_FLAGS_NOCTX 0x8
#define PX_DMAI_FLAGS_DVMA 0x10
#define PX_DMAI_FLAGS_BYPASS 0x20
#define PX_DMAI_FLAGS_PTP 0x40
#define PX_DMAI_FLAGS_CONTEXT 0x100
#define PX_DMAI_FLAGS_FASTTRACK 0x200
#define PX_DMAI_FLAGS_VMEMCACHE 0x400
#define PX_DMAI_FLAGS_PGPFN 0x800
#define PX_DMAI_FLAGS_NOSYSLIMIT 0x1000
#define PX_DMAI_FLAGS_NOFASTLIMIT 0x2000
#define PX_DMAI_FLAGS_NOSYNC 0x4000
#define PX_DMAI_FLAGS_PTP32 0x10000
#define PX_DMAI_FLAGS_PTP64 0x20000
#define PX_DMAI_FLAGS_MAP_BUFZONE 0x40000
#define PX_DMAI_FLAGS_REDZONE 0x80000
#define PX_DMAI_FLAGS_PRESERVE (PX_DMAI_FLAGS_PEER_ONLY | \
((align_pg) <= px_dvma_page_cache_clustsz))
#define PX_DMA_CURWIN(mp) \
#ifdef PX_DMA_PROF
/* collect fast track failure statistics */
#define PX_DVMA_FASTTRAK_PROF(mp) { \
px_dvmaft_npages++; \
else if (!PX_HAS_NOFASTLIMIT(mp)) \
px_dvmaft_limit++; \
}
#else /* !PX_DMA_PROF */
#define PX_DVMA_FASTTRAK_PROF(mp)
#endif /* PX_DMA_PROF */
typedef struct px_dma_win {
struct px_dma_win *win_next;
/* cookie table: sizeof (ddi_dma_cookie_t) * win_ncookies */
} px_dma_win_t;
/* dvma debug records */
struct px_dvma_rec {
char *dvma_addr;
struct px_dvma_rec *next;
};
ddi_dma_impl_t *mp);
#define PX_GET_MP_TTE(tte) \
} else \
(px_iopfn_t)(pfn); \
}
}
#if defined(DEBUG)
ddi_dma_impl_t *hp);
#else
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PX_DMA_H */