/*
* 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
*/
/*
*/
#ifndef _SYS_DDIDEVMAP_H
#define _SYS_DDIDEVMAP_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
struct devmap_info {
/*
* describes order in which the CPU will reference data.
*/
};
typedef void * ddi_umem_cookie_t;
/*
* umem callback function vector for drivers
*
* NOTE: IMPORTANT! When umem_lockmemory is called with a valid
* umem_callback_ops and DDI_UMEMLOCK_LONGTERM set, the 'cleanup'
* callback function may be called AFTER a call to ddi_umem_lock.
* It is the users responsibility to make sure that ddi_umem_lock is
* called ONLY once for each ddi_umem_lock/umem_lockmemory cookie.
*/
struct umem_callback_ops {
};
struct ddi_umem_cookie {
/* KMEM - kvaddr returned from ddi_umem_alloc() */
/* For LOCKEDUMEM - user address of backing store */
/* For TRASH_UMEM - unused */
/*
* Following 4 members are used for UMEM_LOCKED cookie type
*/
/*
* locked indicates underlying memory locked for KMEM_PAGEABLE
* locked is a count of for how many pages this has been locked
*/
/*
* cook_refcnt used in UMEM_LOCKED type
*/
};
/*
* type of umem_cookie:
* pageable memory allocated from segkp segment driver
* non-pageable memory allocated from kmem_getpages()
* locked umem allocated from ddi_umem_lock
* trash umem maps all user virtual addresses to a common trash page
*/
typedef void *devmap_cookie_t;
struct devmap_callback_ctl {
void **new_pvtp2);
};
struct devmap_softlock {
};
struct devmap_ctx {
};
/*
* Fault information passed to the driver fault handling routine.
* The DEVMAP_LOCK and DEVMAP_UNLOCK are used by software
* to lock and unlock pages for physical I/O.
*/
enum devmap_fault_type {
};
/*
* seg_rw gives the access type for a fault operation
*/
enum devmap_rw {
};
typedef struct devmap_handle {
/*
* physical offset at the beginning of mapping.
*/
/*
* user offset at the beginning of mapping.
*/
/*
* Lock protects fields that can change during remap
* dh_roff, dh_cookie, dh_flags, dh_mmulevel, dh_maxprot,
* dh_pfn, dh_hat_attr
*/
/*
* to sync. faults for remap and unlocked kvaddr.
*/
/*
* protection flag possible for attempted mapping.
*/
/*
* Current maximum protection flag for attempted mapping.
* This controls how dh_prot can be changed in segdev_setprot
* See dh_orig_maxprot below also
*/
/*
* mmu level corresponds to the Max page size can be use for
* the mapping.
*/
/*
* orig_maxprot is what the original mmap set maxprot to.
* This is never modified once it is setup during mmap(2)
* This is different from the current dh_maxprot which can
*/
#endif /* _KERNEL */
/*
* define for devmap_rev
*/
/*
* defines for devmap_*_setup flag, called by drivers
*/
/* flags used by drivers */
#define DEVMAP_SETUP_FLAGS \
/*
* defines for dh_flags, these are used internally in devmap
*/
/*
* Flags to pass to ddi_umem_alloc and ddi_umem_iosetup
*/
/*
* Flags to pass to ddi_umem_lock to indicate expected access pattern
* DDI_UMEMLOCK_READ implies the memory being locked will be read
* (e.g., data read from memory is written out to the disk or network)
* DDI_UMEMLOCK_WRITE implies the memory being locked will be written
* (e.g., data from the disk or network is written to memory)
* Both flags may be set in the call to ddi_umem_lock,
* and also correspond to the prots set in devmap
* meaning. Be careful when using it both for I/O and devmap
*
*
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DDIDEVMAP_H */