1*29950Skarels /* param.h 1.4 86/11/03 */ 225681Ssam 325681Ssam /* 425681Ssam * Machine dependent constants for TAHOE. 525681Ssam */ 6*29950Skarels 7*29950Skarels #ifndef ENDIAN 8*29950Skarels /* 9*29950Skarels * Definitions for byte order, 10*29950Skarels * according to byte significance from low address to high. 11*29950Skarels */ 12*29950Skarels #define LITTLE 1234 /* least-significant byte first (vax) */ 13*29950Skarels #define BIG 4321 /* most-significant byte first */ 14*29950Skarels #define PDP 3412 /* LSB first in word, MSW first in long (pdp) */ 15*29950Skarels #define ENDIAN BIG /* byte order on tahoe */ 16*29950Skarels 1725681Ssam #define NBPG 1024 /* bytes/page */ 1825681Ssam #define PGOFSET (NBPG-1) /* byte offset into page */ 1925681Ssam #define PGSHIFT 10 /* LOG2(NBPG) */ 2025681Ssam 2125681Ssam #define CLSIZE 1 2225681Ssam #define CLSIZELOG2 0 2325681Ssam 2425681Ssam #define SSIZE 2 /* initial stack size/NBPG */ 2525681Ssam #define SINCR 2 /* increment of stack/NBPG */ 2625681Ssam #define UPAGES 6 /* pages of u-area (2 stack pages) */ 2725681Ssam 2825681Ssam #define MAXCKEY 255 /* maximal allowed code key */ 2925681Ssam #define MAXDKEY 255 /* maximal allowed data key */ 3025681Ssam #define NCKEY (MAXCKEY+1) /* # code keys, including 0 (reserved) */ 3125681Ssam #define NDKEY (MAXDKEY+1) /* # data keys, including 0 (reserved) */ 3225681Ssam 3325681Ssam /* 3425681Ssam * Some macros for units conversion 3525681Ssam */ 3625681Ssam /* Core clicks (1024 bytes) to segments and vice versa */ 3725681Ssam #define ctos(x) (x) 3825681Ssam #define stoc(x) (x) 3925681Ssam 4025681Ssam /* Core clicks (1024 bytes) to disk blocks */ 4125681Ssam #define ctod(x) (x) 4225681Ssam #define dtoc(x) (x) 4325681Ssam #define dtob(x) ((x)<<PGSHIFT) 4425681Ssam 4525681Ssam /* clicks to bytes */ 4625681Ssam #define ctob(x) ((x)<<PGSHIFT) 4725681Ssam 4825681Ssam /* bytes to clicks */ 4925681Ssam #define btoc(x) ((((unsigned)(x)+NBPG-1) >> PGSHIFT)) 5025681Ssam 5125681Ssam /* 5225681Ssam * Macros to decode processor status word. 5325681Ssam */ 5425681Ssam #define USERMODE(ps) (((ps) & PSL_CURMOD) == PSL_CURMOD) 5525681Ssam #define BASEPRI(ps) (((ps) & PSL_IPL) == 0) 5625681Ssam 5725681Ssam #define DELAY(n) { register int N = 3*(n); while (--N > 0); } 58*29950Skarels #endif 59