Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / sh3 / include / vmparam.h
blobd445a43eb7aad58cb720721d7ae9e37c56173f6a
1 /* $NetBSD: vmparam.h,v 1.18 2008/04/28 20:23:35 martin Exp $ */
3 /*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by UCHIYAMA Yasushi.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _SH3_VMPARAM_H_
33 #define _SH3_VMPARAM_H_
34 #include <sys/queue.h>
37 * We use 4K pages on the sh3/sh4. Override the PAGE_* definitions
38 * to be compile-time constants.
40 #define PAGE_SHIFT 12
41 #define PAGE_SIZE (1 << PAGE_SHIFT)
42 #define PAGE_MASK (PAGE_SIZE - 1)
44 /* Virtual address map. */
45 #define VM_MIN_ADDRESS ((vaddr_t)0)
46 #define VM_MAXUSER_ADDRESS ((vaddr_t)0x7ffff000)
47 #define VM_MAX_ADDRESS ((vaddr_t)0x7ffff000)
48 #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000)
49 #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xe0000000)
51 /* top of stack */
52 #define USRSTACK VM_MAXUSER_ADDRESS
54 /* Virtual memory resoruce limit. */
55 #define MAXTSIZ (64 * 1024 * 1024) /* max text size */
56 #ifndef MAXDSIZ
57 #define MAXDSIZ (512 * 1024 * 1024) /* max data size */
58 #endif
59 #ifndef MAXSSIZ
60 #define MAXSSIZ (32 * 1024 * 1024) /* max stack size */
61 #endif
63 /* initial data size limit */
64 #ifndef DFLDSIZ
65 #define DFLDSIZ (128 * 1024 * 1024)
66 #endif
67 /* initial stack size limit */
68 #ifndef DFLSSIZ
69 #define DFLSSIZ (2 * 1024 * 1024)
70 #endif
72 /* Size of user raw I/O map */
73 #ifndef USRIOSIZE
74 #define USRIOSIZE (MAXBSIZE / PAGE_SIZE * 8)
75 #endif
77 #define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE)
79 /* Physical memory segments */
80 #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
81 #define VM_PHYSSEG_NOADD
83 #define sh3_round_page(x) ((((uint32_t)(x)) + PGOFSET) & ~PGOFSET)
84 #define sh3_trunc_page(x) ((uint32_t)(x) & ~PGOFSET)
85 #define sh3_btop(x) ((uint32_t)(x) >> PGSHIFT)
86 #define sh3_ptob(x) ((uint32_t)(x) << PGSHIFT)
88 /* pmap-specific data store in the vm_page structure. */
89 #define __HAVE_VM_PAGE_MD
90 #define PVH_REFERENCED 1
91 #define PVH_MODIFIED 2
93 #ifndef _LOCORE
94 struct pv_entry;
95 struct vm_page_md {
96 SLIST_HEAD(, pv_entry) pvh_head;
97 int pvh_flags;
100 #define VM_MDPAGE_INIT(pg) \
101 do { \
102 struct vm_page_md *pvh = &(pg)->mdpage; \
103 SLIST_INIT(&pvh->pvh_head); \
104 pvh->pvh_flags = 0; \
105 } while (/*CONSTCOND*/0)
106 #endif /* _LOCORE */
107 #endif /* !_SH3_VMPARAM_H_ */