mmu.h revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_MMU_H
#define _SYS_MMU_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
#endif
#include <sys/hypervisor_api.h>
/*
* Definitions for the SOFT MMU
*/
#define FAST_IMMU_MISS_TT 0x64
#define FAST_DMMU_MISS_TT 0x68
#define FAST_PROT_TT 0x6c
/*
* Constants defining alternate spaces
* and register layouts within them,
* and a few other interesting assembly constants.
*/
/*
* vaddr offsets of various registers
*/
/*
* Pseudo Synchronous Fault Status Register Layout
*
* IMMU and DMMU maintain their own pseudo SFSR Register
*
* +------------------------------------------------+
* | Reserved | Context | FT |
* +----------------------|-------------------------+
* 63 32 31 16 15 0
*
*/
/*
* Definition of FT (Fault Type) bit field of sfsr.
*/
#define FT_NONE 0x00
#define SFSR_FT_SHIFT 0 /* amt. to shift right to get flt type */
/*
* MMU TAG TARGET register Layout
*
* +-----+---------+------+-------------------------+
* | 000 | context | -- | virtual address [63:22] |
* +-----+---------+------+-------------------------+
* 63 61 60 48 47 42 41 0
*/
#define TTARGET_CTX_SHIFT 48
#define TTARGET_VA_SHIFT 22
/*
* MMU TAG ACCESS register Layout
*
* +-------------------------+------------------+
* | virtual address [63:13] | context [12:0] |
* +-------------------------+------------------+
* 63 13 12 0
*/
#define TAGACC_CTX_MASK 0x1FFF
#define TAGACC_SHIFT 13
#define TAGACC_VADDR_MASK (~TAGACC_CTX_MASK)
/*
*/
#define CTXREG_CTX_MASK 0x1FFF
/*
* The kernel always runs in KCONTEXT, and no user mappings
* are ever valid in it (so any user access pagefaults).
*/
#define KCONTEXT 0
/*
* FLUSH_ADDR is used in the flush instruction to guarantee stores to mmu
* registers complete. It is selected so it won't miss in the tlb.
*/
#define MIN_NCTXS_BITS 2
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MMU_H */