[BACK]Return to vmparam.h CVS log [TXT][DIR] Up to [local] / sys / arch / m68k / include

Annotation of sys/arch/m68k/include/vmparam.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: vmparam.h,v 1.5 2005/12/08 23:50:54 miod Exp $        */
                      2:
                      3: /*
                      4:  * Copyright (c) 1988 University of Utah.
                      5:  * Copyright (c) 1982, 1990 The Regents of the University of California.
                      6:  * All rights reserved.
                      7:  *
                      8:  * This code is derived from software contributed to Berkeley by
                      9:  * the Systems Programming Group of the University of Utah Computer
                     10:  * Science Department.
                     11:  *
                     12:  * Redistribution and use in source and binary forms, with or without
                     13:  * modification, are permitted provided that the following conditions
                     14:  * are met:
                     15:  * 1. Redistributions of source code must retain the above copyright
                     16:  *    notice, this list of conditions and the following disclaimer.
                     17:  * 2. Redistributions in binary form must reproduce the above copyright
                     18:  *    notice, this list of conditions and the following disclaimer in the
                     19:  *    documentation and/or other materials provided with the distribution.
                     20:  * 3. Neither the name of the University nor the names of its contributors
                     21:  *    may be used to endorse or promote products derived from this software
                     22:  *    without specific prior written permission.
                     23:  *
                     24:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     25:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     26:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     27:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     28:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     29:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     30:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     31:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     32:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     33:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     34:  * SUCH DAMAGE.
                     35:  */
                     36:
                     37: /*
                     38:  * Machine dependent constants for m68k-based platforms.
                     39:  */
                     40: #ifndef        _M68K_VMPARAM_H_
                     41: #define        _M68K_VMPARAM_H_
                     42:
                     43: /*
                     44:  * USRTEXT is the start of the user text/data space, while USRSTACK
                     45:  * is the top (end) of the user stack.  LOWPAGES and HIGHPAGES are
                     46:  * the number of pages from the beginning of the P0 region to the
                     47:  * beginning of the text and from the beginning of the P1 region to the
                     48:  * beginning of the stack respectively.
                     49:  *
                     50:  * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3)
                     51:  * is for HPUX compatibility.  Why??  Because HPUX's debuggers
                     52:  * have the user's stack hard-wired at FFF00000 for post-mortems,
                     53:  * and we must be compatible...
                     54:  */
                     55: #define        USRTEXT         8192
                     56: #define        USRSTACK        (-HIGHPAGES*NBPG)       /* Start of user stack */
                     57: #define        LOWPAGES        0
                     58: #define        HIGHPAGES       (0x100000/NBPG)
                     59:
                     60: /*
                     61:  * Virtual memory related constants, all in bytes
                     62:  */
                     63: #ifndef MAXTSIZ
                     64: #define        MAXTSIZ         (8*1024*1024)           /* max text size */
                     65: #endif
                     66: #ifndef DFLDSIZ
                     67: #define        DFLDSIZ         (32*1024*1024)          /* initial data size limit */
                     68: #endif
                     69: #ifndef MAXDSIZ
                     70: #define        MAXDSIZ         (64*1024*1024)          /* max data size */
                     71: #endif
                     72: #ifndef        DFLSSIZ
                     73: #define        DFLSSIZ         (2*1024*1024)           /* initial stack size limit */
                     74: #endif
                     75: #ifndef        MAXSSIZ
                     76: #define        MAXSSIZ         MAXDSIZ                 /* max stack size */
                     77: #endif
                     78:
                     79: #define STACKGAP_RANDOM        256*1024
                     80:
                     81: /*
                     82:  * Sizes of the system and user portions of the system page table.
                     83:  */
                     84: #define        USRPTSIZE       (1 * NPTEPG)    /* 4mb */
                     85:
                     86: /*
                     87:  * PTEs for mapping user space into the kernel for phyio operations.
                     88:  * One page is enough to handle 4Mb of simultaneous raw IO operations.
                     89:  */
                     90: #ifndef USRIOSIZE
                     91: #define USRIOSIZE      (1 * NPTEPG)    /* 4mb */
                     92: #endif
                     93:
                     94: /*
                     95:  * PTEs for system V style shared memory.
                     96:  * This is basically slop for kmempt which we actually allocate (malloc) from.
                     97:  */
                     98: #ifndef SHMMAXPGS
                     99: #define SHMMAXPGS      1024            /* 4mb */
                    100: #endif
                    101:
                    102: /* user/kernel map constants */
                    103: #define VM_MIN_ADDRESS         ((vaddr_t)0)
                    104: #define VM_MAXUSER_ADDRESS     ((vaddr_t)(USRSTACK))
                    105: #define VM_MAX_ADDRESS         ((vaddr_t)(0-(UPAGES*NBPG)))
                    106: #define VM_MIN_KERNEL_ADDRESS  ((vaddr_t)0)
                    107: #define VM_MAX_KERNEL_ADDRESS  ((vaddr_t)(0-NBPG))
                    108:
                    109: /* virtual sizes (bytes) for various kernel submaps */
                    110: #define VM_PHYS_SIZE           (USRIOSIZE*PAGE_SIZE)
                    111:
                    112: /* # of kernel PT pages (initial only, can grow dynamically) */
                    113: #define VM_KERNEL_PT_PAGES     ((vsize_t)2)
                    114:
                    115: /*
                    116:  * Constants which control the way the VM system deals with memory segments.
                    117:  */
                    118: #define        VM_PHYSSEG_NOADD
                    119:
                    120: #define        VM_NFREELIST            1
                    121: #define        VM_FREELIST_DEFAULT     0
                    122:
                    123: #ifndef _LOCORE
                    124:
                    125: #include <machine/pte.h>       /* st_entry_t */
                    126:
                    127: /* XXX - belongs in pmap.h, but put here because of ordering issues */
                    128: struct pv_entry {
                    129:        struct pv_entry *pv_next;       /* next pv_entry */
                    130:        struct pmap     *pv_pmap;       /* pmap where mapping lies */
                    131:        vaddr_t         pv_va;          /* virtual address for mapping */
                    132:        st_entry_t      *pv_ptste;      /* non-zero if VA maps a PT page */
                    133:        struct pmap     *pv_ptpmap;     /* if pv_ptste, pmap for PT page */
                    134:        int             pv_flags;       /* flags */
                    135: };
                    136:
                    137: /*
                    138:  * pv_flags carries some PTE permission bits as well - make sure extra flags
                    139:  * values are > (1 << PG_SHIFT)
                    140:  */
                    141: /* header: all entries are cache inhibited */
                    142: #define        PV_CI           (0x01 << PG_SHIFT)
                    143: /* header: entry maps a page table page */
                    144: #define PV_PTPAGE      (0x02 << PG_SHIFT)
                    145:
                    146: #define        __HAVE_VM_PAGE_MD
                    147: struct vm_page_md {
                    148:        struct pv_entry pvent;
                    149: };
                    150:
                    151: #define        VM_MDPAGE_INIT(pg) do {                 \
                    152:        (pg)->mdpage.pvent.pv_next = NULL;      \
                    153:        (pg)->mdpage.pvent.pv_pmap = NULL;      \
                    154:        (pg)->mdpage.pvent.pv_va = 0;           \
                    155:        (pg)->mdpage.pvent.pv_ptste = NULL;     \
                    156:        (pg)->mdpage.pvent.pv_ptpmap = NULL;    \
                    157:        (pg)->mdpage.pvent.pv_flags = 0;        \
                    158: } while (0)
                    159:
                    160: #endif /* _LOCORE */
                    161:
                    162: #endif /* !_M68K_VMPARAM_H_ */

CVSweb