Home | History | Annotate | Line # | Download | only in include
pte.h revision 1.4.8.2
      1  1.4.8.2  jdolecek /*	$NetBSD: pte.h,v 1.4.8.2 2002/06/23 17:40:43 jdolecek Exp $	*/
      2      1.1    itojun 
      3      1.1    itojun /*-
      4  1.4.8.2  jdolecek  * Copyright (c) 2002 The NetBSD Foundation, Inc.
      5      1.1    itojun  * All rights reserved.
      6      1.1    itojun  *
      7  1.4.8.2  jdolecek  * This code is derived from software contributed to The NetBSD Foundation
      8  1.4.8.2  jdolecek  * by UCHIYAMA Yasushi.
      9      1.1    itojun  *
     10      1.1    itojun  * Redistribution and use in source and binary forms, with or without
     11      1.1    itojun  * modification, are permitted provided that the following conditions
     12      1.1    itojun  * are met:
     13      1.1    itojun  * 1. Redistributions of source code must retain the above copyright
     14      1.1    itojun  *    notice, this list of conditions and the following disclaimer.
     15      1.1    itojun  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1    itojun  *    notice, this list of conditions and the following disclaimer in the
     17      1.1    itojun  *    documentation and/or other materials provided with the distribution.
     18      1.1    itojun  * 3. All advertising materials mentioning features or use of this software
     19      1.1    itojun  *    must display the following acknowledgement:
     20  1.4.8.2  jdolecek  *        This product includes software developed by the NetBSD
     21  1.4.8.2  jdolecek  *        Foundation, Inc. and its contributors.
     22  1.4.8.2  jdolecek  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.4.8.2  jdolecek  *    contributors may be used to endorse or promote products derived
     24  1.4.8.2  jdolecek  *    from this software without specific prior written permission.
     25  1.4.8.2  jdolecek  *
     26  1.4.8.2  jdolecek  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.4.8.2  jdolecek  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.4.8.2  jdolecek  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.4.8.2  jdolecek  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.4.8.2  jdolecek  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.4.8.2  jdolecek  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.4.8.2  jdolecek  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.4.8.2  jdolecek  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.4.8.2  jdolecek  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.4.8.2  jdolecek  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.4.8.2  jdolecek  * POSSIBILITY OF SUCH DAMAGE.
     37      1.1    itojun  */
     38      1.1    itojun 
     39      1.1    itojun #ifndef _SH3_PTE_H_
     40  1.4.8.2  jdolecek #define	_SH3_PTE_H_
     41      1.1    itojun 
     42  1.4.8.1  jdolecek /*
     43  1.4.8.1  jdolecek  * NetBSD/sh3 PTE format.
     44  1.4.8.1  jdolecek  *
     45  1.4.8.2  jdolecek  * [Hardware bit]
     46  1.4.8.1  jdolecek  * SH3
     47  1.4.8.2  jdolecek  *	  PPN   V   PR  SZ C  D  SH
     48  1.4.8.2  jdolecek  *	[28:10][8][6:5][4][3][2][1]
     49  1.4.8.1  jdolecek  *
     50  1.4.8.1  jdolecek  * SH4
     51  1.4.8.2  jdolecek  *	        V  SZ  PR  SZ C  D  SH WT
     52  1.4.8.2  jdolecek  *	[28:10][8][7][6:5][4][3][2][1][0]
     53  1.4.8.1  jdolecek  *
     54  1.4.8.2  jdolecek  * [Software bit]
     55  1.4.8.2  jdolecek  *   [31]   - PMAP_WIRED bit (not hardware wired entry)
     56  1.4.8.1  jdolecek  *   [11:9] - SH4 PCMCIA Assistant bit. (space attribute bit only)
     57  1.4.8.1  jdolecek  */
     58      1.1    itojun 
     59  1.4.8.1  jdolecek /*
     60  1.4.8.1  jdolecek  * Hardware bits
     61  1.4.8.1  jdolecek  */
     62  1.4.8.2  jdolecek #define	PG_PPN			0x1ffff000	/* Phisical page number mask */
     63  1.4.8.2  jdolecek #define	PG_V			0x00000100	/* Valid */
     64  1.4.8.2  jdolecek #define	PG_PR_MASK		0x00000060	/* Page protection mask */
     65  1.4.8.2  jdolecek #define	PG_PR_URW		0x00000060	/* kernel/user read/write */
     66  1.4.8.2  jdolecek #define	PG_PR_URO		0x00000040	/* kernel/user read only */
     67  1.4.8.2  jdolecek #define	PG_PR_KRW		0x00000020	/* kernel read/write */
     68  1.4.8.2  jdolecek #define	PG_PR_KRO		0x00000000	/* kernel read only */
     69  1.4.8.1  jdolecek #define	PG_4K			0x00000010	/* page size 4KB */
     70  1.4.8.2  jdolecek #define	PG_C			0x00000008	/* Cacheable */
     71  1.4.8.2  jdolecek #define	PG_D			0x00000004	/* Dirty */
     72  1.4.8.2  jdolecek #define	PG_SH			0x00000002	/* Share status */
     73  1.4.8.2  jdolecek #define	PG_WT			0x00000001	/* Write-through (SH4 only) */
     74      1.1    itojun 
     75  1.4.8.2  jdolecek #define	PG_HW_BITS		0x1ffff17e	/* [28:12][8][6:1] */
     76      1.1    itojun 
     77  1.4.8.1  jdolecek /*
     78  1.4.8.1  jdolecek  * Software bits
     79  1.4.8.1  jdolecek  */
     80  1.4.8.2  jdolecek #define	_PG_WIRED		0x80000000
     81  1.4.8.2  jdolecek 
     82  1.4.8.1  jdolecek /* SH4 PCMCIA MMU support bits */
     83  1.4.8.1  jdolecek /* PTEA SA (Space Attribute bit) */
     84  1.4.8.2  jdolecek #define	_PG_PCMCIA		0x00000e00	/* [11:9] */
     85  1.4.8.2  jdolecek #define	_PG_PCMCIA_SHIFT	9
     86  1.4.8.2  jdolecek #define	_PG_PCMCIA_NONE		0x00000000	/* Non PCMCIA space */
     87  1.4.8.2  jdolecek #define	_PG_PCMCIA_IO		0x00000200	/* IOIS16 signal */
     88  1.4.8.2  jdolecek #define	_PG_PCMCIA_IO8		0x00000400	/* 8 bit I/O  */
     89  1.4.8.2  jdolecek #define	_PG_PCMCIA_IO16		0x00000600	/* 16 bit I/O  */
     90  1.4.8.2  jdolecek #define	_PG_PCMCIA_MEM8		0x00000800	/* 8 bit common memory */
     91  1.4.8.2  jdolecek #define	_PG_PCMCIA_MEM16	0x00000a00	/* 16 bit common memory */
     92  1.4.8.2  jdolecek #define	_PG_PCMCIA_ATTR8	0x00000c00	/* 8 bit attribute */
     93  1.4.8.2  jdolecek #define	_PG_PCMCIA_ATTR16	0x00000e00	/* 16 bit attribute */
     94      1.1    itojun 
     95  1.4.8.2  jdolecek #ifndef _LOCORE
     96  1.4.8.2  jdolecek typedef u_int32_t pt_entry_t;
     97  1.4.8.2  jdolecek #endif /* _LOCORE */
     98      1.1    itojun #endif /* !_SH3_PTE_H_ */
     99