Annotation of 43BSDReno/sys/tahoe/machparam.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
        !             3:  * All rights reserved.  The Berkeley software License Agreement
        !             4:  * specifies the terms and conditions for redistribution.
        !             5:  *
        !             6:  *     @(#)machparam.h 7.6 (Berkeley) 5/10/90
        !             7:  */
        !             8: 
        !             9: /*
        !            10:  * Machine dependent constants for TAHOE.
        !            11:  */
        !            12: #define        MACHINE "tahoe"
        !            13: 
        !            14: #ifndef BYTE_ORDER
        !            15: #include <machine/endian.h>
        !            16: #endif
        !            17: 
        !            18: #include <machine/machlimits.h>
        !            19: 
        !            20: /*
        !            21:  * Round p (pointer or byte index) up to a correctly-aligned value
        !            22:  * for all data types (int, long, ...).   The result is u_int and
        !            23:  * must be cast to any desired pointer type.
        !            24:  */
        !            25: #define        ALIGN(p)        (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1))
        !            26: 
        !            27: #define        NBPG            1024            /* bytes/page */
        !            28: #define        PGOFSET         (NBPG-1)        /* byte offset into page */
        !            29: #define        PGSHIFT         10              /* LOG2(NBPG) */
        !            30: #define        NPTEPG          (NBPG/(sizeof (struct pte)))
        !            31: 
        !            32: #define        KERNBASE        0xc0000000      /* start of kernel virtual */
        !            33: #define        KERNTEXTOFF     (KERNBASE + 0x800)      /* start of kernel text */
        !            34: #define        BTOPKERNBASE    ((u_long)KERNBASE >> PGSHIFT)
        !            35: 
        !            36: #define        DEV_BSIZE       1024
        !            37: #define        DEV_BSHIFT      10              /* log2(DEV_BSIZE) */
        !            38: #define BLKDEV_IOSIZE  1024            /* NBPG for physical controllers */
        !            39: #define        MAXPHYS         (64 * 1024)     /* max raw I/O transfer size */
        !            40: 
        !            41: #define        CLSIZE          1
        !            42: #define        CLSIZELOG2      0
        !            43: 
        !            44: #define        SSIZE           2               /* initial stack size/NBPG */
        !            45: #define        SINCR           2               /* increment of stack/NBPG */
        !            46: #define        UPAGES          8               /* pages of u-area (2 stack pages) */
        !            47: 
        !            48: /*
        !            49:  * Constants related to network buffer management.
        !            50:  * MCLBYTES must be no larger than CLBYTES (the software page size), and,
        !            51:  * on machines that exchange pages of input or output buffers with mbuf
        !            52:  * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
        !            53:  * of the hardware page size.
        !            54:  */
        !            55: #define        MSIZE           128             /* size of an mbuf */
        !            56: #define        MAPPED_MBUFS                    /* can do scatter-gather I/O */
        !            57: #if CLBYTES > 1024
        !            58: #define        MCLBYTES        1024
        !            59: #define        MCLSHIFT        10
        !            60: #define        MCLOFSET        (MCLBYTES - 1)
        !            61: #else
        !            62: #define        MCLBYTES        CLBYTES
        !            63: #define        MCLSHIFT        CLSHIFT
        !            64: #define        MCLOFSET        CLOFSET
        !            65: #endif
        !            66: #ifdef GATEWAY
        !            67: #define        NMBCLUSTERS     512             /* map size, max cluster allocation */
        !            68: #else
        !            69: #define        NMBCLUSTERS     256             /* map size, max cluster allocation */
        !            70: #endif
        !            71: 
        !            72: #define        MAXCKEY 255             /* maximal allowed code key */
        !            73: #define        MAXDKEY 255             /* maximal allowed data key */
        !            74: #define        NCKEY   (MAXCKEY+1)     /* # code keys, including 0 (reserved) */
        !            75: #define        NDKEY   (MAXDKEY+1)     /* # data keys, including 0 (reserved) */
        !            76: 
        !            77: /*
        !            78:  * Size of kernel malloc arena in CLBYTES-sized logical pages
        !            79:  */ 
        !            80: #ifndef NKMEMCLUSTERS
        !            81: #define        NKMEMCLUSTERS   (512*1024/CLBYTES)
        !            82: #endif
        !            83: 
        !            84: /*
        !            85:  * Some macros for units conversion
        !            86:  */
        !            87: /* Core clicks (1024 bytes) to segments and vice versa */
        !            88: #define        ctos(x) (x)
        !            89: #define        stoc(x) (x)
        !            90: 
        !            91: /* Core clicks (1024 bytes) to disk blocks */
        !            92: #define        ctod(x) (x)
        !            93: #define        dtoc(x) (x)
        !            94: #define        dtob(x) ((x)<<PGSHIFT)
        !            95: 
        !            96: /* clicks to bytes */
        !            97: #define        ctob(x) ((x)<<PGSHIFT)
        !            98: 
        !            99: /* bytes to clicks */
        !           100: #define        btoc(x) ((((unsigned)(x)+NBPG-1) >> PGSHIFT))
        !           101: 
        !           102: #define        btodb(bytes)                    /* calculates (bytes / DEV_BSIZE) */ \
        !           103:        ((unsigned)(bytes) >> DEV_BSHIFT)
        !           104: #define        dbtob(db)                       /* calculates (db * DEV_BSIZE) */ \
        !           105:        ((unsigned)(db) << DEV_BSHIFT)
        !           106: 
        !           107: /*
        !           108:  * Map a ``block device block'' to a file system block.
        !           109:  * This should be device dependent, and will be if we
        !           110:  * add an entry to cdevsw/bdevsw for that purpose.
        !           111:  * For now though just use DEV_BSIZE.
        !           112:  */
        !           113: #define        bdbtofsb(bn)    ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
        !           114: 
        !           115: /*
        !           116:  * Macros to decode processor status word.
        !           117:  */
        !           118: #define        USERMODE(ps)    (((ps) & PSL_CURMOD) == PSL_CURMOD)
        !           119: #define        BASEPRI(ps)     (((ps) & PSL_IPL) == 0)
        !           120: 
        !           121: #define        DELAY(n)        { register int N = 3*(n); while (--N > 0); }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.