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

Annotation of sys/arch/vax/include/param.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: param.h,v 1.33 2007/05/28 21:02:49 thib Exp $ */
                      2: /*      $NetBSD: param.h,v 1.39 1999/10/22 21:14:34 ragge Exp $    */
                      3: /*-
                      4:  * Copyright (c) 1990 The Regents of the University of California.
                      5:  * All rights reserved.
                      6:  *
                      7:  * This code is derived from software contributed to Berkeley by
                      8:  * William Jolitz.
                      9:  *
                     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.
                     18:  * 3. Neither the name of the University nor the names of its contributors
                     19:  *    may be used to endorse or promote products derived from this software
                     20:  *    without specific prior written permission.
                     21:  *
                     22:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     23:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     24:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     25:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     26:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     27:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     28:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     29:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     30:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     31:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     32:  * SUCH DAMAGE.
                     33:  *
                     34:  *     @(#)param.h     5.8 (Berkeley) 6/28/91
                     35:  */
                     36:
                     37: #ifndef _VAX_PARAM_H_
                     38: #define _VAX_PARAM_H_
                     39:
                     40: /*
                     41:  * Machine dependent constants for VAX.
                     42:  */
                     43:
                     44: #define        _MACHINE        vax
                     45: #define        MACHINE         "vax"
                     46: #define        _MACHINE_ARCH   vax
                     47: #define        MACHINE_ARCH    "vax"
                     48: #define        MID_MACHINE     MID_VAX
                     49:
                     50: /*
                     51:  * Round p (pointer or byte index) up to a correctly-aligned value
                     52:  * for all data types (int, long, ...).   The result is u_int and
                     53:  * must be cast to any desired pointer type.
                     54:  *
                     55:  * ALIGNED_POINTER is a boolean macro that checks whether an address
                     56:  * is valid to fetch data elements of type t from on this architecture.
                     57:  * This does not reflect the optimal alignment, just the possibility
                     58:  * (within reasonable limits).
                     59:  *
                     60:  */
                     61:
                     62: #define ALIGNBYTES             (sizeof(int) - 1)
                     63: #define ALIGN(p)               (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
                     64: #define ALIGNED_POINTER(p,t)   ((((u_long)(p)) & (sizeof(t)-1)) == 0)
                     65:
                     66: #define        PGSHIFT         12                      /* LOG2(NBPG) */
                     67: #define        NBPG            (1 << PGSHIFT)          /* (1 << PGSHIFT) bytes/page */
                     68: #define        PGOFSET         (NBPG - 1)               /* byte offset into page */
                     69:
                     70: #define        PAGE_SHIFT      12
                     71: #define        PAGE_SIZE       (1 << PAGE_SHIFT)
                     72: #define        PAGE_MASK       (PAGE_SIZE - 1)
                     73:
                     74: #define        VAX_PGSHIFT     9
                     75: #define        VAX_NBPG        (1 << VAX_PGSHIFT)
                     76: #define        VAX_PGOFSET     (VAX_NBPG - 1)
                     77: #define        VAX_NPTEPG      (VAX_NBPG / 4)
                     78:
                     79: #define        KERNBASE        0x80000000              /* start of kernel virtual */
                     80:
                     81: #define        DEV_BSHIFT      9                              /* log2(DEV_BSIZE) */
                     82: #define        DEV_BSIZE       (1 << DEV_BSHIFT)
                     83:
                     84: #define BLKDEV_IOSIZE  2048
                     85: #define        MAXPHYS         (64 * 1024)     /* max raw I/O transfer size */
                     86: #define        MAXBSIZE        0x4000          /* max FS block size - XXX */
                     87:
                     88: #define        UPAGES          2               /* pages of u-area */
                     89: #define USPACE         (NBPG*UPAGES)
                     90: #define        USPACE_ALIGN    (0)             /* u-area alignment 0-none */
                     91: #define        REDZONEADDR     (VAX_NBPG*3)    /* Must be > sizeof(struct user) */
                     92:
                     93: #ifndef MSGBUFSIZE
                     94: #define MSGBUFSIZE     8192            /* default message buffer size */
                     95: #endif
                     96:
                     97: /*
                     98:  * Constants related to network buffer management.
                     99:  */
                    100: #define        NMBCLUSTERS     768             /* map size, max cluster allocation */
                    101:
                    102: /*
                    103:  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
                    104:  * logical pages.
                    105:  */
                    106: #define        NKMEMPAGES_MIN_DEFAULT  ((4 * 1024 * 1024) >> PAGE_SHIFT)
                    107: #define        NKMEMPAGES_MAX_DEFAULT  ((4 * 1024 * 1024) >> PAGE_SHIFT)
                    108:
                    109: /*
                    110:  * Some macros for units conversion
                    111:  */
                    112:
                    113: /* pages ("clicks") to disk blocks */
                    114: #define        ctod(x)         ((x) << (PGSHIFT - DEV_BSHIFT))
                    115: #define        dtoc(x)         ((x) >> (PGSHIFT - DEV_BSHIFT))
                    116:
                    117: /* clicks to bytes */
                    118: #define        ctob(x)         ((x) << PGSHIFT)
                    119: #define        btoc(x)         (((unsigned)(x) + PGOFSET) >> PGSHIFT)
                    120:
                    121: /* bytes to disk blocks */
                    122: #define        btodb(x)        ((x) >> DEV_BSHIFT)
                    123: #define        dbtob(x)        ((x) << DEV_BSHIFT)
                    124:
                    125: /* MD conversion macros */
                    126: #define        vax_btoc(x)     (((unsigned)(x) + VAX_PGOFSET) >> VAX_PGSHIFT)
                    127: #define        vax_btop(x)     (((unsigned)(x)) >> VAX_PGSHIFT)
                    128:
                    129: #define       ovbcopy(x,y,z)  bcopy(x, y, z)
                    130:
                    131: #ifdef _KERNEL
                    132:
                    133: #include <machine/intr.h>
                    134:
                    135: /* Prototype needed for delay() */
                    136: #ifndef        _LOCORE
                    137: #include <machine/cpu.h>
                    138:
                    139: void   delay(int);
                    140: /* inline macros used inside kernel */
                    141: #include <machine/macros.h>
                    142: #endif
                    143:
                    144: #define        DELAY(x) delay(x)
                    145: #endif /* _KERNEL */
                    146:
                    147: #endif /* _VAX_PARAM_H_ */

CVSweb