1 /* 2 * Copyright (c) 1982, 1986 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 * @(#)param.h 7.2 (Berkeley) 11/03/86 7 */ 8 9 /* 10 * Machine dependent constants for vax. 11 */ 12 13 #ifndef ENDIAN 14 /* 15 * Definitions for byte order, 16 * according to byte significance from low address to high. 17 */ 18 #define LITTLE 1234 /* least-significant byte first (vax) */ 19 #define BIG 4321 /* most-significant byte first */ 20 #define PDP 3412 /* LSB first in word, MSW first in long (pdp) */ 21 #define ENDIAN LITTLE /* byte order on vax */ 22 23 #define NBPG 512 /* bytes/page */ 24 #define PGOFSET (NBPG-1) /* byte offset into page */ 25 #define PGSHIFT 9 /* LOG2(NBPG) */ 26 27 #define CLSIZE 2 28 #define CLSIZELOG2 1 29 30 #define SSIZE 4 /* initial stack size/NBPG */ 31 #define SINCR 4 /* increment of stack/NBPG */ 32 33 #define UPAGES 10 /* pages of u-area */ 34 35 /* 36 * Some macros for units conversion 37 */ 38 /* Core clicks (512 bytes) to segments and vice versa */ 39 #define ctos(x) (x) 40 #define stoc(x) (x) 41 42 /* Core clicks (512 bytes) to disk blocks */ 43 #define ctod(x) (x) 44 #define dtoc(x) (x) 45 #define dtob(x) ((x)<<9) 46 47 /* clicks to bytes */ 48 #define ctob(x) ((x)<<9) 49 50 /* bytes to clicks */ 51 #define btoc(x) ((((unsigned)(x)+511)>>9)) 52 53 /* 54 * Macros to decode processor status word. 55 */ 56 #define USERMODE(ps) (((ps) & PSL_CURMOD) == PSL_CURMOD) 57 #define BASEPRI(ps) (((ps) & PSL_IPL) == 0) 58 59 #ifdef KERNEL 60 #ifndef LOCORE 61 int cpuspeed; 62 #define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); } 63 #endif 64 65 #else KERNEL 66 #define DELAY(n) { register int N = (n); while (--N > 0); } 67 #endif KERNEL 68 #endif 69