pte.h revision 1.12 1 1.12 martin /* $NetBSD: pte.h,v 1.12 2008/04/28 20:23:35 martin Exp $ */
2 1.1 itojun
3 1.1 itojun /*-
4 1.8 uch * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 1.1 itojun * All rights reserved.
6 1.1 itojun *
7 1.8 uch * This code is derived from software contributed to The NetBSD Foundation
8 1.8 uch * 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.8 uch *
19 1.8 uch * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.8 uch * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.8 uch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.8 uch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.8 uch * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.8 uch * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.8 uch * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.8 uch * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.8 uch * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.8 uch * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.8 uch * POSSIBILITY OF SUCH DAMAGE.
30 1.1 itojun */
31 1.1 itojun
32 1.1 itojun #ifndef _SH3_PTE_H_
33 1.7 uch #define _SH3_PTE_H_
34 1.1 itojun
35 1.5 uch /*
36 1.5 uch * NetBSD/sh3 PTE format.
37 1.5 uch *
38 1.8 uch * [Hardware bit]
39 1.5 uch * SH3
40 1.8 uch * PPN V PR SZ C D SH
41 1.8 uch * [28:10][8][6:5][4][3][2][1]
42 1.5 uch *
43 1.5 uch * SH4
44 1.8 uch * V SZ PR SZ C D SH WT
45 1.8 uch * [28:10][8][7][6:5][4][3][2][1][0]
46 1.5 uch *
47 1.8 uch * [Software bit]
48 1.8 uch * [31] - PMAP_WIRED bit (not hardware wired entry)
49 1.5 uch * [11:9] - SH4 PCMCIA Assistant bit. (space attribute bit only)
50 1.5 uch */
51 1.1 itojun
52 1.5 uch /*
53 1.5 uch * Hardware bits
54 1.5 uch */
55 1.9 chs #define PG_PPN 0x1ffff000 /* Physical page number mask */
56 1.8 uch #define PG_V 0x00000100 /* Valid */
57 1.8 uch #define PG_PR_MASK 0x00000060 /* Page protection mask */
58 1.8 uch #define PG_PR_URW 0x00000060 /* kernel/user read/write */
59 1.8 uch #define PG_PR_URO 0x00000040 /* kernel/user read only */
60 1.8 uch #define PG_PR_KRW 0x00000020 /* kernel read/write */
61 1.8 uch #define PG_PR_KRO 0x00000000 /* kernel read only */
62 1.5 uch #define PG_4K 0x00000010 /* page size 4KB */
63 1.8 uch #define PG_C 0x00000008 /* Cacheable */
64 1.8 uch #define PG_D 0x00000004 /* Dirty */
65 1.8 uch #define PG_SH 0x00000002 /* Share status */
66 1.8 uch #define PG_WT 0x00000001 /* Write-through (SH4 only) */
67 1.1 itojun
68 1.7 uch #define PG_HW_BITS 0x1ffff17e /* [28:12][8][6:1] */
69 1.1 itojun
70 1.5 uch /*
71 1.5 uch * Software bits
72 1.5 uch */
73 1.8 uch #define _PG_WIRED 0x80000000
74 1.8 uch
75 1.5 uch /* SH4 PCMCIA MMU support bits */
76 1.5 uch /* PTEA SA (Space Attribute bit) */
77 1.8 uch #define _PG_PCMCIA 0x00000e00 /* [11:9] */
78 1.7 uch #define _PG_PCMCIA_SHIFT 9
79 1.7 uch #define _PG_PCMCIA_NONE 0x00000000 /* Non PCMCIA space */
80 1.7 uch #define _PG_PCMCIA_IO 0x00000200 /* IOIS16 signal */
81 1.7 uch #define _PG_PCMCIA_IO8 0x00000400 /* 8 bit I/O */
82 1.7 uch #define _PG_PCMCIA_IO16 0x00000600 /* 16 bit I/O */
83 1.7 uch #define _PG_PCMCIA_MEM8 0x00000800 /* 8 bit common memory */
84 1.7 uch #define _PG_PCMCIA_MEM16 0x00000a00 /* 16 bit common memory */
85 1.7 uch #define _PG_PCMCIA_ATTR8 0x00000c00 /* 8 bit attribute */
86 1.7 uch #define _PG_PCMCIA_ATTR16 0x00000e00 /* 16 bit attribute */
87 1.1 itojun
88 1.8 uch #ifndef _LOCORE
89 1.11 uwe typedef uint32_t pt_entry_t;
90 1.8 uch #endif /* _LOCORE */
91 1.1 itojun #endif /* !_SH3_PTE_H_ */
92