xref: /titanic_50/usr/src/uts/common/vm/seg_map.h (revision a5652762e5f7bf683d19f18542e5e39df63bad79)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*a5652762Spraks  * Common Development and Distribution License (the "License").
6*a5652762Spraks  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*a5652762Spraks  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
277c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
317c478bd9Sstevel@tonic-gate  * The Regents of the University of California
327c478bd9Sstevel@tonic-gate  * All Rights Reserved
337c478bd9Sstevel@tonic-gate  *
347c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
357c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
367c478bd9Sstevel@tonic-gate  * contributors.
377c478bd9Sstevel@tonic-gate  */
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #ifndef	_VM_SEG_MAP_H
407c478bd9Sstevel@tonic-gate #define	_VM_SEG_MAP_H
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
457c478bd9Sstevel@tonic-gate extern "C" {
467c478bd9Sstevel@tonic-gate #endif
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate /*
497c478bd9Sstevel@tonic-gate  * When segmap is created it is possible to program its behavior,
507c478bd9Sstevel@tonic-gate  *	using the create args [needed for performance reasons].
517c478bd9Sstevel@tonic-gate  * Segmap creates n lists of pages.
527c478bd9Sstevel@tonic-gate  *	For VAC machines, there will be at least one free list
537c478bd9Sstevel@tonic-gate  *	per color. If more than one free list per color is needed,
547c478bd9Sstevel@tonic-gate  *	set nfreelist as needed.
557c478bd9Sstevel@tonic-gate  *
567c478bd9Sstevel@tonic-gate  *	For PAC machines, it will be treated as VAC with only one
577c478bd9Sstevel@tonic-gate  *	color- every page is of the same color. Again, set nfreelist
587c478bd9Sstevel@tonic-gate  *	to get more than one free list.
597c478bd9Sstevel@tonic-gate  */
607c478bd9Sstevel@tonic-gate struct segmap_crargs {
617c478bd9Sstevel@tonic-gate 	uint_t	prot;
627c478bd9Sstevel@tonic-gate 	uint_t	shmsize;	/* shm_alignment for VAC, 0 for PAC. */
637c478bd9Sstevel@tonic-gate 	uint_t	nfreelist;	/* number of freelist per color, >= 1 */
647c478bd9Sstevel@tonic-gate };
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #include <vm/kpm.h>
67*a5652762Spraks #include <vm/vpm.h>
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate /*
707c478bd9Sstevel@tonic-gate  * Each smap struct represents a MAXBSIZE sized mapping to the
717c478bd9Sstevel@tonic-gate  * <sm_vp, sm_off> given in the structure.  The location of the
727c478bd9Sstevel@tonic-gate  * the structure in the array gives the virtual address of the
737c478bd9Sstevel@tonic-gate  * mapping. Structure rearranged for 64bit sm_off.
747c478bd9Sstevel@tonic-gate  */
757c478bd9Sstevel@tonic-gate struct	smap {
767c478bd9Sstevel@tonic-gate 	kmutex_t	sm_mtx;		/* protect non-list fields */
777c478bd9Sstevel@tonic-gate 	struct	vnode	*sm_vp;		/* vnode pointer (if mapped) */
787c478bd9Sstevel@tonic-gate 	struct	smap	*sm_hash;	/* hash pointer */
797c478bd9Sstevel@tonic-gate 	struct	smap	*sm_next;	/* next pointer */
807c478bd9Sstevel@tonic-gate 	struct	smap	*sm_prev;	/* previous pointer */
817c478bd9Sstevel@tonic-gate 	u_offset_t	sm_off;		/* file offset for mapping */
827c478bd9Sstevel@tonic-gate 	ushort_t	sm_bitmap;	/* bit map for locked translations */
837c478bd9Sstevel@tonic-gate 	ushort_t	sm_refcnt;	/* reference count for uses */
847c478bd9Sstevel@tonic-gate 	ushort_t	sm_flags;	/* smap flags */
857c478bd9Sstevel@tonic-gate 	ushort_t	sm_free_ndx;	/* freelist */
867c478bd9Sstevel@tonic-gate #ifdef	SEGKPM_SUPPORT
877c478bd9Sstevel@tonic-gate 	struct kpme	sm_kpme;	/* segkpm */
887c478bd9Sstevel@tonic-gate #endif
897c478bd9Sstevel@tonic-gate };
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate #ifdef	SEGKPM_SUPPORT
927c478bd9Sstevel@tonic-gate #define	GET_KPME(smp)	(&(smp)->sm_kpme)
937c478bd9Sstevel@tonic-gate #define	sm_kpme_next	sm_kpme.kpe_next
947c478bd9Sstevel@tonic-gate #define	sm_kpme_prev	sm_kpme.kpe_prev
957c478bd9Sstevel@tonic-gate #define	sm_kpme_page	sm_kpme.kpe_page
967c478bd9Sstevel@tonic-gate #else
977c478bd9Sstevel@tonic-gate #define	GET_KPME(smp)	((struct kpme *)NULL)
987c478bd9Sstevel@tonic-gate #endif
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate /* sm_flags */
1017c478bd9Sstevel@tonic-gate #define	SM_KPM_NEWPAGE	   0x00000001	/* page created in segmap_getmapft */
1027c478bd9Sstevel@tonic-gate #define	SM_NOTKPM_RELEASED 0x00000002	/* released smap not in segkpm mode */
1037c478bd9Sstevel@tonic-gate #define	SM_QNDX_ZERO	   0x00000004	/* on the index 0 freelist */
1047c478bd9Sstevel@tonic-gate #define	SM_READ_DATA	   0x00000010	/* page created for read */
1057c478bd9Sstevel@tonic-gate #define	SM_WRITE_DATA	   0x00000020	/* page created for write */
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate /*
1087c478bd9Sstevel@tonic-gate  * Multiple smap free lists are maintained so that allocations
1097c478bd9Sstevel@tonic-gate  * will scale with cpu count. Each free list is made up of 2 queues
1107c478bd9Sstevel@tonic-gate  * so that allocations and deallocations can proceed concurrently.
1117c478bd9Sstevel@tonic-gate  * Each queue structure is padded to 64 bytes to avoid false sharing.
1127c478bd9Sstevel@tonic-gate  */
1137c478bd9Sstevel@tonic-gate #define	SM_FREEQ_PAD (64 - sizeof (struct smap *) - sizeof (kmutex_t))
1147c478bd9Sstevel@tonic-gate struct 	sm_freeq {
1157c478bd9Sstevel@tonic-gate 	struct smap	*smq_free;	/* points into freelist */
1167c478bd9Sstevel@tonic-gate 	kmutex_t	smq_mtx;	/* protects smq_free */
1177c478bd9Sstevel@tonic-gate 	char		smq_pad[SM_FREEQ_PAD];
1187c478bd9Sstevel@tonic-gate };
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate struct	smfree {
1217c478bd9Sstevel@tonic-gate 	struct sm_freeq	sm_freeq[2];	/* alloc and release queues */
1227c478bd9Sstevel@tonic-gate 	struct sm_freeq	*sm_allocq;	/* current allocq */
1237c478bd9Sstevel@tonic-gate 	struct sm_freeq	*sm_releq;	/* current releq */
1247c478bd9Sstevel@tonic-gate 	kcondvar_t	sm_free_cv;
1257c478bd9Sstevel@tonic-gate 	ushort_t	sm_want;	/* someone wants a slot of this color */
1267c478bd9Sstevel@tonic-gate };
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate /*
1297c478bd9Sstevel@tonic-gate  * Cached smaps are kept on hash chains to enable fast reclaim lookups.
1307c478bd9Sstevel@tonic-gate  */
1317c478bd9Sstevel@tonic-gate struct  smaphash {
1327c478bd9Sstevel@tonic-gate 	kmutex_t	sh_mtx;		/* protects this hash chain */
1337c478bd9Sstevel@tonic-gate 	struct  smap	*sh_hash_list;  /* start of hash chain */
1347c478bd9Sstevel@tonic-gate };
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate /*
1377c478bd9Sstevel@tonic-gate  * (Semi) private data maintained by the segmap driver per SEGMENT mapping
1387c478bd9Sstevel@tonic-gate  * All fields in segmap_data are read-only after the segment is created.
1397c478bd9Sstevel@tonic-gate  *
1407c478bd9Sstevel@tonic-gate  */
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate struct	segmap_data {
1437c478bd9Sstevel@tonic-gate 	struct	smap	*smd_sm;	/* array of smap structures */
1447c478bd9Sstevel@tonic-gate 	long		smd_npages;	/* size of smap array */
1457c478bd9Sstevel@tonic-gate 	struct smfree	*smd_free;	/* ptr to freelist header array */
1467c478bd9Sstevel@tonic-gate 	struct smaphash *smd_hash;	/* ptr to hash header array */
1477c478bd9Sstevel@tonic-gate 	int		smd_nfree;	/* number of free lists */
1487c478bd9Sstevel@tonic-gate 	uchar_t		smd_prot;	/* protections for all smap's */
1497c478bd9Sstevel@tonic-gate };
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate /*
1527c478bd9Sstevel@tonic-gate  * Statistics for segmap operations.
1537c478bd9Sstevel@tonic-gate  *
1547c478bd9Sstevel@tonic-gate  * No explicit locking to protect these stats.
1557c478bd9Sstevel@tonic-gate  */
1567c478bd9Sstevel@tonic-gate struct segmapcnt {
1577c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_fault;	/* number of segmap_faults */
1587c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_faulta;	/* number of segmap_faultas */
1597c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_getmap;	/* number of segmap_getmaps */
1607c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_get_use;	/* getmaps that reuse existing map */
1617c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_get_reclaim; /* getmaps that do a reclaim */
1627c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_get_reuse;	/* getmaps that reuse a slot */
1637c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_get_unused;	/* getmaps that reuse existing map */
1647c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_get_nofree;	/* getmaps with no free slots */
1657c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_rel_async;	/* releases that are async */
1667c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_rel_write;	/* releases that write */
1677c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_rel_free;	/* releases that free */
1687c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_rel_abort;	/* releases that abort */
1697c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_rel_dontneed; /* releases with dontneed set */
1707c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_release;	/* releases with no other action */
1717c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_pagecreate;	/* pagecreates */
1727c478bd9Sstevel@tonic-gate 	kstat_named_t   smp_free_notfree; /* pages not freed in */
1737c478bd9Sstevel@tonic-gate 					/* segmap_pagefree */
1747c478bd9Sstevel@tonic-gate 	kstat_named_t   smp_free_dirty; /* dirty pages freeed */
1757c478bd9Sstevel@tonic-gate 					/* in segmap_pagefree */
1767c478bd9Sstevel@tonic-gate 	kstat_named_t   smp_free;	/* clean pages freeed in */
1777c478bd9Sstevel@tonic-gate 					/* segmap_pagefree */
1787c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_stolen;	/* segmap_getmapflt() stole */
1797c478bd9Sstevel@tonic-gate 					/* from get_free_smp() */
1807c478bd9Sstevel@tonic-gate 	kstat_named_t	smp_get_nomtx;	/* free smaps but no mutex */
1817c478bd9Sstevel@tonic-gate };
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate /*
1847c478bd9Sstevel@tonic-gate  * These are flags used on release.  Some of these might get handled
1857c478bd9Sstevel@tonic-gate  * by segment operations needed for msync (when we figure them out).
1867c478bd9Sstevel@tonic-gate  * SM_ASYNC modifies SM_WRITE.  SM_DONTNEED modifies SM_FREE.  SM_FREE
1877c478bd9Sstevel@tonic-gate  * and SM_INVAL as well as SM_FREE and SM_DESTROY are mutually exclusive.
1887c478bd9Sstevel@tonic-gate  * SM_DESTROY behaves like SM_INVAL but also forces the pages to be
1897c478bd9Sstevel@tonic-gate  * destroyed -- this prevents them from being written to the backing
1907c478bd9Sstevel@tonic-gate  * store.
1917c478bd9Sstevel@tonic-gate  */
1927c478bd9Sstevel@tonic-gate #define	SM_WRITE	0x01		/* write back the pages upon release */
1937c478bd9Sstevel@tonic-gate #define	SM_ASYNC	0x02		/* do the write asynchronously */
1947c478bd9Sstevel@tonic-gate #define	SM_FREE		0x04		/* put pages back on free list */
1957c478bd9Sstevel@tonic-gate #define	SM_INVAL	0x08		/* invalidate page (no caching) */
1967c478bd9Sstevel@tonic-gate #define	SM_DONTNEED	0x10		/* less likely to be needed soon */
1977c478bd9Sstevel@tonic-gate #define	SM_DESTROY	0x20		/* invalidate page, don't write back */
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate /*
2007c478bd9Sstevel@tonic-gate  * These are the forcefault flags used on getmapflt.
2017c478bd9Sstevel@tonic-gate  *
2027c478bd9Sstevel@tonic-gate  * The orginal semantic was extended to allow using the segkpm mapping
2037c478bd9Sstevel@tonic-gate  * scheme w/o a major segmap interface change for MAXBSIZE == PAGESIZE
2047c478bd9Sstevel@tonic-gate  * (which is required to enable segkpm for MAXBSIZE > PAGESIZE).
2057c478bd9Sstevel@tonic-gate  * Most segmap consumers needn't to be changed at all or only need to
2067c478bd9Sstevel@tonic-gate  * be changed slightly to take advantage of segkpm. Because the segkpm
2077c478bd9Sstevel@tonic-gate  * virtual address is based on the physical address of a page, a page is
2087c478bd9Sstevel@tonic-gate  * required to determine the virtual address (return value). Pages mapped
2097c478bd9Sstevel@tonic-gate  * with segkpm are always at least read locked and are hence protected
2107c478bd9Sstevel@tonic-gate  * from pageout or fsflush from segmap_getmap until segmap_release. This
2117c478bd9Sstevel@tonic-gate  * implies, that the segkpm mappings are locked within this period too.
2127c478bd9Sstevel@tonic-gate  * No trap driven segmap_fault's are possible in segkpm mode.
2137c478bd9Sstevel@tonic-gate  *
2147c478bd9Sstevel@tonic-gate  * The following combinations of "forcefault" and "rw" allow segkpm mode.
2157c478bd9Sstevel@tonic-gate  * (1) SM_FAULT, S_READ
2167c478bd9Sstevel@tonic-gate  * (2) SM_FAULT, S_WRITE
2177c478bd9Sstevel@tonic-gate  * (3) SM_PAGECREATE, S_WRITE
2187c478bd9Sstevel@tonic-gate  * (4) SM_LOCKPROTO, {S_READ, S_WRITE, S_OTHER}
2197c478bd9Sstevel@tonic-gate  *
2207c478bd9Sstevel@tonic-gate  * The regular additional operations (come in pairs in most of the cases):
2217c478bd9Sstevel@tonic-gate  * . segmap_pagecreate/segmap_pageunlock
2227c478bd9Sstevel@tonic-gate  * . segmap_fault(F_SOFTLOCK)/segmap_fault(F_SOFTUNLOCK)
2237c478bd9Sstevel@tonic-gate  *
2247c478bd9Sstevel@tonic-gate  * are mostly a no-op in segkpm mode with the following exceptions:
2257c478bd9Sstevel@tonic-gate  * . The "newpage" return value of segmap_pagecreate is still supported
2267c478bd9Sstevel@tonic-gate  *   for zeroout operations needed on newly created pages.
2277c478bd9Sstevel@tonic-gate  *
2287c478bd9Sstevel@tonic-gate  * . segmap_fault() must follow when a error could be expected in
2297c478bd9Sstevel@tonic-gate  *   the VOP_GETPAGE. In segkpm mode this error is recognized in
2307c478bd9Sstevel@tonic-gate  *   segmap_getmapflt and returned from the following segmap_fault()
2317c478bd9Sstevel@tonic-gate  *   call. The "hole" optimization (read only after first VOP_GETPAGE
2327c478bd9Sstevel@tonic-gate  *   mapping in segmap_getmapflt followed by a trap driven protection
2337c478bd9Sstevel@tonic-gate  *   fault and a second VOP_GETPAGE via segmap_fault) cannot be used.
2347c478bd9Sstevel@tonic-gate  *
2357c478bd9Sstevel@tonic-gate  * . segmap_fault(F_SOFTUNLOCK) must follow when segmap_getmapflt was
2367c478bd9Sstevel@tonic-gate  *   called w/ (SM_LOCKPROTO, S_OTHER). S_WRITE has to be applied, when
2377c478bd9Sstevel@tonic-gate  *   the page should be marked "dirty". Otherwise the page is not
2387c478bd9Sstevel@tonic-gate  *   written to the backing store later (as mentioned above, no page
2397c478bd9Sstevel@tonic-gate  *   or protection faults are possible in segkpm mode). Caller cannot
2407c478bd9Sstevel@tonic-gate  *   use only S_OTHER and rely on a protection fault to force the page
2417c478bd9Sstevel@tonic-gate  *   to become dirty.
2427c478bd9Sstevel@tonic-gate  *
2437c478bd9Sstevel@tonic-gate  * . The segmap_pagecreate parameter softlock is ignored, pages and
2447c478bd9Sstevel@tonic-gate  *   mappings are locked anyway.
2457c478bd9Sstevel@tonic-gate  *
2467c478bd9Sstevel@tonic-gate  * SM_LOCKPROTO is used in the fbio layer and some special segmap consumers.
2477c478bd9Sstevel@tonic-gate  */
2487c478bd9Sstevel@tonic-gate #define	SM_PAGECREATE	0x00		/* create page in segkpm mode, no I/O */
2497c478bd9Sstevel@tonic-gate #define	SM_FAULT	0x01		/* fault in page if necessary */
2507c478bd9Sstevel@tonic-gate #define	SM_LOCKPROTO	0x02		/* lock/unlock protocol used */
2517c478bd9Sstevel@tonic-gate 
2527c478bd9Sstevel@tonic-gate #define	MAXBSHIFT	13		/* log2(MAXBSIZE) */
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate #define	MAXBOFFSET	(MAXBSIZE - 1)
2557c478bd9Sstevel@tonic-gate #define	MAXBMASK	(~MAXBOFFSET)
2567c478bd9Sstevel@tonic-gate 
2577c478bd9Sstevel@tonic-gate /*
2587c478bd9Sstevel@tonic-gate  * SMAP_HASHAVELEN is the average length desired for this chain, from
2597c478bd9Sstevel@tonic-gate  * which the size of the smd_hash table is derived at segment create time.
2607c478bd9Sstevel@tonic-gate  * SMAP_HASHVPSHIFT is defined so that 1 << SMAP_HASHVPSHIFT is the
2617c478bd9Sstevel@tonic-gate  * approximate size of a vnode struct.
2627c478bd9Sstevel@tonic-gate  */
2637c478bd9Sstevel@tonic-gate #define	SMAP_HASHAVELEN		4
2647c478bd9Sstevel@tonic-gate #define	SMAP_HASHVPSHIFT	6
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate 
2677c478bd9Sstevel@tonic-gate #ifdef _KERNEL
2687c478bd9Sstevel@tonic-gate /*
2697c478bd9Sstevel@tonic-gate  * The kernel generic mapping segment.
2707c478bd9Sstevel@tonic-gate  */
2717c478bd9Sstevel@tonic-gate extern struct seg *segkmap;
2727c478bd9Sstevel@tonic-gate 
2737c478bd9Sstevel@tonic-gate /*
2747c478bd9Sstevel@tonic-gate  * Public seg_map segment operations.
2757c478bd9Sstevel@tonic-gate  */
2767c478bd9Sstevel@tonic-gate extern int	segmap_create(struct seg *, void *);
2777c478bd9Sstevel@tonic-gate extern int	segmap_pagecreate(struct seg *, caddr_t, size_t, int);
2787c478bd9Sstevel@tonic-gate extern void	segmap_pageunlock(struct seg *, caddr_t, size_t, enum seg_rw);
2797c478bd9Sstevel@tonic-gate extern faultcode_t segmap_fault(struct hat *, struct seg *, caddr_t, size_t,
2807c478bd9Sstevel@tonic-gate 		enum fault_type, enum seg_rw);
2817c478bd9Sstevel@tonic-gate extern caddr_t	segmap_getmap(struct seg *, struct vnode *, u_offset_t);
2827c478bd9Sstevel@tonic-gate extern caddr_t	segmap_getmapflt(struct seg *, struct vnode *, u_offset_t,
2837c478bd9Sstevel@tonic-gate 		size_t, int, enum seg_rw);
2847c478bd9Sstevel@tonic-gate extern int	segmap_release(struct seg *, caddr_t, uint_t);
2857c478bd9Sstevel@tonic-gate extern void	segmap_flush(struct seg *, struct vnode *);
2867c478bd9Sstevel@tonic-gate extern void	segmap_inval(struct seg *, struct vnode *, u_offset_t);
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
2897c478bd9Sstevel@tonic-gate 
2907c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2917c478bd9Sstevel@tonic-gate }
2927c478bd9Sstevel@tonic-gate #endif
2937c478bd9Sstevel@tonic-gate 
2947c478bd9Sstevel@tonic-gate #endif	/* _VM_SEG_MAP_H */
295