/*
* 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 2008 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
/*
* Definitions for the SOFT MMU
*/
/*
* Constants defining alternate spaces
* and register layouts within them,
* and a few other interesting assembly constants.
*/
/*
* vaddr offsets of various registers
*/
/*
* Synchronous Fault Status Register Layout
*
* IMMU and DMMU maintain their own SFSR Register
* ______________________________________________________________________
* | Reserved | ASI | Reserved | FT | E | Cntx | PRIV | W | OW | FV|
* |--------------|------|----------|----|---|------|------|---|----|---|
* 63 24 23 16 15 14 13 7 6 5 4 3 2 1 0
*
*/
/*
* Definition of FT (Fault Type) bit field of sfsr.
*/
/*
* Defines for CT (ConText id) bit field of sfsr.
*/
/*
* MMU TAG TARGET register Layout
*
* +-----+---------+------+-------------------------+
* | 000 | context | -- | virtual address [63:22] |
* +-----+---------+------+-------------------------+
* 63 61 60 48 47 42 41 0
*/
/*
* MMU TAG ACCESS register Layout
*
* +-------------------------+------------------+
* | virtual address [63:13] | context [12:0] |
* +-------------------------+------------------+
* 63 13 12 0
*/
/*
* MMU DEMAP Register Layout
*
* +-------------------------+------+------+---------+-----+
* | virtual address [63:13] | rsvd | type | context | 0 |
* +-------------------------+------+------+---------+-----+
* 63 13 12 8 7 6 5 4 3 0
*/
/*
* TLB DATA ACCESS Address Layout
*
* +-------------+---------------+---+
* + Not used | tlb entry | 0 |
* +-------------+---------------+---+
* 63 9 8 3 2 0
*/
/*
* TSB Register Layout
*
* split will always be 0. It will not be supported by software.
*
* +----------------------+-------+-----+-------+
* + tsb_base va [63:13] | split | - | size |
* +----------------------+-------+-----+-------+
* 63 13 12 11 3 2 0
*/
/*
* MMU TAG READ register Layout
*
* +-------------------------+------------------+
* | virtual address [63:13] | context [12:0] |
* +-------------------------+------------------+
* 63 13 12 0
*/
/*
* MMU TAG ACCESS EXTENSION register Layout
*
* DTLB only
* +-----+-------+-------+-----+
* | - | pgsz1 | pgsz0 | - |
* +-----+-------+-------+-----+
* 63 21 19 18 16 15 0
*/
/*
* SPARC64-VII tsb prefetch register layout and VAs
*
* +-------------------------+-+---------+-+--+------+
* | virtual address [63:13] | | page_sz |V| |TSB_sz|
* +-------------------------+-+---------+-+--+------+
* 63 13 11 9 8 5 0
*/
/*
*/
/*
* SPARC64-VII MMU SHARED CONTEXT register Layout
*
* +-----+----+-----+--------------------+-----+----+----+-------------------+
* | --- | IV | -- | Ishared ctx[44:32] | --- | DV | -- | Dshared ctx[12:0] |
* +-----+----+-----+--------------------+-----+----+----+-------------------+
* 63 48 47 46 45 44 32 31 16 15 14 13 12 0
*/
/*
* 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.
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MMU_H */