123264Smckusick /* 229186Smckusick * Copyright (c) 1982, 1986 Regents of the University of California. 323264Smckusick * All rights reserved. The Berkeley software License Agreement 423264Smckusick * specifies the terms and conditions for redistribution. 523264Smckusick * 6*29953Skarels * @(#)param.h 7.2 (Berkeley) 11/03/86 723264Smckusick */ 89118Ssam 99118Ssam /* 109118Ssam * Machine dependent constants for vax. 119118Ssam */ 12*29953Skarels 13*29953Skarels #ifndef ENDIAN 14*29953Skarels /* 15*29953Skarels * Definitions for byte order, 16*29953Skarels * according to byte significance from low address to high. 17*29953Skarels */ 18*29953Skarels #define LITTLE 1234 /* least-significant byte first (vax) */ 19*29953Skarels #define BIG 4321 /* most-significant byte first */ 20*29953Skarels #define PDP 3412 /* LSB first in word, MSW first in long (pdp) */ 21*29953Skarels #define ENDIAN LITTLE /* byte order on vax */ 22*29953Skarels 239118Ssam #define NBPG 512 /* bytes/page */ 249118Ssam #define PGOFSET (NBPG-1) /* byte offset into page */ 259118Ssam #define PGSHIFT 9 /* LOG2(NBPG) */ 269118Ssam 279118Ssam #define CLSIZE 2 289118Ssam #define CLSIZELOG2 1 299118Ssam 309118Ssam #define SSIZE 4 /* initial stack size/NBPG */ 319118Ssam #define SINCR 4 /* increment of stack/NBPG */ 329118Ssam 3317546Skarels #define UPAGES 10 /* pages of u-area */ 349118Ssam 359118Ssam /* 369118Ssam * Some macros for units conversion 379118Ssam */ 389118Ssam /* Core clicks (512 bytes) to segments and vice versa */ 399118Ssam #define ctos(x) (x) 409118Ssam #define stoc(x) (x) 419118Ssam 429118Ssam /* Core clicks (512 bytes) to disk blocks */ 439118Ssam #define ctod(x) (x) 449118Ssam #define dtoc(x) (x) 459118Ssam #define dtob(x) ((x)<<9) 469118Ssam 479118Ssam /* clicks to bytes */ 489118Ssam #define ctob(x) ((x)<<9) 499118Ssam 509118Ssam /* bytes to clicks */ 519118Ssam #define btoc(x) ((((unsigned)(x)+511)>>9)) 529118Ssam 539118Ssam /* 549118Ssam * Macros to decode processor status word. 559118Ssam */ 569118Ssam #define USERMODE(ps) (((ps) & PSL_CURMOD) == PSL_CURMOD) 579600Ssam #define BASEPRI(ps) (((ps) & PSL_IPL) == 0) 589118Ssam 5924887Skarels #ifdef KERNEL 6024887Skarels #ifndef LOCORE 6124887Skarels int cpuspeed; 62*29953Skarels #define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); } 6324887Skarels #endif 6424887Skarels 6524887Skarels #else KERNEL 669118Ssam #define DELAY(n) { register int N = (n); while (--N > 0); } 6724887Skarels #endif KERNEL 68*29953Skarels #endif 69