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