mach_kpm.h revision fedab560fb18c85777c255ea9f445ffaf6830d30
/*
* 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 _MACH_KPM_H
#define _MACH_KPM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* kpm prototypes : routines defined in uts/sfmmu/vm/hat_sfmmu.c file */
extern void sfmmu_page_exit(kmutex_t *);
extern void sfmmu_cache_flush(pfn_t, int);
extern int fnd_mapping_sz(page_t *);
extern int sfmmu_page_spl_held(struct page *);
/* kpm prototypes : routines defined in uts/sun4[uv]/vm/mach_kpm.c file */
extern void sfmmu_kpm_pageunload(page_t *);
extern void sfmmu_kpm_hme_unload(page_t *);
extern void sfmmu_kpm_page_cache(page_t *, int, int);
/* flags for hat_pagecachectl */
#define HAT_CACHE 0x1
#define HAT_UNCACHE 0x2
#define HAT_TMPNC 0x4
/*
* kstat data
*/
struct sfmmu_global_stat sfmmu_global_stat;
/* kpm globals */
#ifdef DEBUG
/*
* Flush the TLB on kpm mapout. Note: Xcalls are used (again) for the
* required TLB shootdowns in this case, so handle w/ care. Off by default.
*/
int kpm_tlb_flush;
#endif /* DEBUG */
/*
* kpm_page lock hash.
* All slots should be used equally and 2 adjacent kpm_page_t's
* shouldn't have their mutexes in the same cache line.
*/
#ifdef DEBUG
int kpmp_hash_debug;
& (kpmp_table_sz - 1)])
#else /* !DEBUG */
& (kpmp_table_sz - 1)]
#endif /* DEBUG */
#ifdef DEBUG
& (kpmp_stable_sz - 1)])
#else /* !DEBUG */
& (kpmp_stable_sz - 1)]
#endif /* DEBUG */
/*
* kpm virtual address to physical address
*/
#ifdef VAC
uintptr_t r, v; \
\
if (r != 0) { \
(paddr) -= r << kpm_size_shift; \
if (r > v) \
(paddr) += (r - v) << MMU_PAGESHIFT; \
else \
(paddr) -= r << MMU_PAGESHIFT; \
} \
}
#else /* VAC */
}
#endif /* VAC */
#ifdef __cplusplus
}
#endif
#endif /* _MACH_KPM_H */