1*ce099b40Smartin /* $NetBSD: pte.h,v 1.12 2008/04/28 20:23:35 martin Exp $ */ 265363da2Sitojun 365363da2Sitojun /*- 45cf2727aSuch * Copyright (c) 2002 The NetBSD Foundation, Inc. 565363da2Sitojun * All rights reserved. 665363da2Sitojun * 75cf2727aSuch * This code is derived from software contributed to The NetBSD Foundation 85cf2727aSuch * by UCHIYAMA Yasushi. 965363da2Sitojun * 1065363da2Sitojun * Redistribution and use in source and binary forms, with or without 1165363da2Sitojun * modification, are permitted provided that the following conditions 1265363da2Sitojun * are met: 1365363da2Sitojun * 1. Redistributions of source code must retain the above copyright 1465363da2Sitojun * notice, this list of conditions and the following disclaimer. 1565363da2Sitojun * 2. Redistributions in binary form must reproduce the above copyright 1665363da2Sitojun * notice, this list of conditions and the following disclaimer in the 1765363da2Sitojun * documentation and/or other materials provided with the distribution. 1865363da2Sitojun * 195cf2727aSuch * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 205cf2727aSuch * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 215cf2727aSuch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 225cf2727aSuch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 235cf2727aSuch * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 245cf2727aSuch * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 255cf2727aSuch * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 265cf2727aSuch * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 275cf2727aSuch * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 285cf2727aSuch * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 295cf2727aSuch * POSSIBILITY OF SUCH DAMAGE. 3065363da2Sitojun */ 3165363da2Sitojun 3265363da2Sitojun #ifndef _SH3_PTE_H_ 3365363da2Sitojun #define _SH3_PTE_H_ 3465363da2Sitojun 359487e1d7Such /* 369487e1d7Such * NetBSD/sh3 PTE format. 379487e1d7Such * 385cf2727aSuch * [Hardware bit] 399487e1d7Such * SH3 409487e1d7Such * PPN V PR SZ C D SH 419487e1d7Such * [28:10][8][6:5][4][3][2][1] 429487e1d7Such * 439487e1d7Such * SH4 449487e1d7Such * V SZ PR SZ C D SH WT 459487e1d7Such * [28:10][8][7][6:5][4][3][2][1][0] 469487e1d7Such * 475cf2727aSuch * [Software bit] 485cf2727aSuch * [31] - PMAP_WIRED bit (not hardware wired entry) 499487e1d7Such * [11:9] - SH4 PCMCIA Assistant bit. (space attribute bit only) 509487e1d7Such */ 519487e1d7Such 529487e1d7Such /* 539487e1d7Such * Hardware bits 549487e1d7Such */ 5578a835abSchs #define PG_PPN 0x1ffff000 /* Physical page number mask */ 565cf2727aSuch #define PG_V 0x00000100 /* Valid */ 575cf2727aSuch #define PG_PR_MASK 0x00000060 /* Page protection mask */ 585cf2727aSuch #define PG_PR_URW 0x00000060 /* kernel/user read/write */ 595cf2727aSuch #define PG_PR_URO 0x00000040 /* kernel/user read only */ 605cf2727aSuch #define PG_PR_KRW 0x00000020 /* kernel read/write */ 615cf2727aSuch #define PG_PR_KRO 0x00000000 /* kernel read only */ 629487e1d7Such #define PG_4K 0x00000010 /* page size 4KB */ 635cf2727aSuch #define PG_C 0x00000008 /* Cacheable */ 645cf2727aSuch #define PG_D 0x00000004 /* Dirty */ 655cf2727aSuch #define PG_SH 0x00000002 /* Share status */ 665cf2727aSuch #define PG_WT 0x00000001 /* Write-through (SH4 only) */ 6765363da2Sitojun 689487e1d7Such #define PG_HW_BITS 0x1ffff17e /* [28:12][8][6:1] */ 699487e1d7Such 709487e1d7Such /* 719487e1d7Such * Software bits 729487e1d7Such */ 735cf2727aSuch #define _PG_WIRED 0x80000000 745cf2727aSuch 759487e1d7Such /* SH4 PCMCIA MMU support bits */ 769487e1d7Such /* PTEA SA (Space Attribute bit) */ 775cf2727aSuch #define _PG_PCMCIA 0x00000e00 /* [11:9] */ 789487e1d7Such #define _PG_PCMCIA_SHIFT 9 799487e1d7Such #define _PG_PCMCIA_NONE 0x00000000 /* Non PCMCIA space */ 809487e1d7Such #define _PG_PCMCIA_IO 0x00000200 /* IOIS16 signal */ 819487e1d7Such #define _PG_PCMCIA_IO8 0x00000400 /* 8 bit I/O */ 829487e1d7Such #define _PG_PCMCIA_IO16 0x00000600 /* 16 bit I/O */ 839487e1d7Such #define _PG_PCMCIA_MEM8 0x00000800 /* 8 bit common memory */ 849487e1d7Such #define _PG_PCMCIA_MEM16 0x00000a00 /* 16 bit common memory */ 859487e1d7Such #define _PG_PCMCIA_ATTR8 0x00000c00 /* 8 bit attribute */ 869487e1d7Such #define _PG_PCMCIA_ATTR16 0x00000e00 /* 16 bit attribute */ 8769fcc260Smsaitoh 885cf2727aSuch #ifndef _LOCORE 89970e24eeSuwe typedef uint32_t pt_entry_t; 905cf2727aSuch #endif /* _LOCORE */ 9165363da2Sitojun #endif /* !_SH3_PTE_H_ */ 92