move key stats, etc. to cpu.h
[unix-history] / usr / src / sys / tahoe / include / param.h
CommitLineData
c85a98bf 1/* param.h 1.4 86/11/03 */
e6960968
SL
2
3/*
4 * Machine dependent constants for TAHOE.
5 */
c85a98bf
MK
6
7#ifndef ENDIAN
8/*
9 * Definitions for byte order,
10 * according to byte significance from low address to high.
11 */
12#define LITTLE 1234 /* least-significant byte first (vax) */
13#define BIG 4321 /* most-significant byte first */
14#define PDP 3412 /* LSB first in word, MSW first in long (pdp) */
15#define ENDIAN BIG /* byte order on tahoe */
16
e6960968
SL
17#define NBPG 1024 /* bytes/page */
18#define PGOFSET (NBPG-1) /* byte offset into page */
19#define PGSHIFT 10 /* LOG2(NBPG) */
20
21#define CLSIZE 1
22#define CLSIZELOG2 0
23
24#define SSIZE 2 /* initial stack size/NBPG */
25#define SINCR 2 /* increment of stack/NBPG */
26#define UPAGES 6 /* pages of u-area (2 stack pages) */
e6960968
SL
27
28#define MAXCKEY 255 /* maximal allowed code key */
29#define MAXDKEY 255 /* maximal allowed data key */
30#define NCKEY (MAXCKEY+1) /* # code keys, including 0 (reserved) */
31#define NDKEY (MAXDKEY+1) /* # data keys, including 0 (reserved) */
32
33/*
34 * Some macros for units conversion
35 */
36/* Core clicks (1024 bytes) to segments and vice versa */
37#define ctos(x) (x)
38#define stoc(x) (x)
39
40/* Core clicks (1024 bytes) to disk blocks */
41#define ctod(x) (x)
42#define dtoc(x) (x)
43#define dtob(x) ((x)<<PGSHIFT)
44
45/* clicks to bytes */
46#define ctob(x) ((x)<<PGSHIFT)
47
48/* bytes to clicks */
49#define btoc(x) ((((unsigned)(x)+NBPG-1) >> PGSHIFT))
50
51/*
52 * Macros to decode processor status word.
53 */
54#define USERMODE(ps) (((ps) & PSL_CURMOD) == PSL_CURMOD)
55#define BASEPRI(ps) (((ps) & PSL_IPL) == 0)
56
57#define DELAY(n) { register int N = 3*(n); while (--N > 0); }
c85a98bf 58#endif