|
|
1.1 root 1: /* @(#)param.h 1.1 86/02/03 SMI */
2:
3: /*
4: * Copyright (c) 1985 by Sun Microsystems, Inc.
5: *
6: * This file is intended to contain the
7: * specific details of a given architecture.
8: */
9:
10: /*
11: * Machine dependent constants for Sun-3.
12: */
13: #define NBPG 8192 /* bytes/page */
14: #define PGOFSET (NBPG-1) /* byte offset into page */
15: #define PGSHIFT 13 /* LOG2(NBPG) */
16:
17: #define NBSG 131072 /* bytes/segment */
18: #define SGOFSET (NBSG-1) /* byte offset into segment */
19: #define SGSHIFT 17 /* LOG2(NBSG) */
20:
21: #define CLSIZE 1
22: #define CLSIZELOG2 0
23:
24: #define SSIZE 1 /* initial stack size/NBPG */
25: #define SINCR 1 /* increment of stack/NBPG */
26:
27: /*
28: * Define UADDR as a 32 bit address so that the compiler will
29: * generate short absolute references to access the u-area.
30: */
31: #define UADDR (0-4*NBPG) /* u-area virtual address - 4th page down */
32: #define UPAGES 1 /* pages of u-area, NOT including red zone */
33:
34: #define KERNSTACK 0x800 /* size of kernel stack in u-area */
35:
36: /*
37: * KERNELBASE is the virtual address which
38: * the kernel mapping starts in all contexts.
39: */
40: #define KERNELBASE 0x0F000000
41:
42: /*
43: * Some macros for units conversion
44: */
45: /* Core clicks (8192 bytes) to segments and vice versa */
46: #define ctos(x) (((x)+15)>>(SGSHIFT-PGSHIFT))
47: #define stoc(x) ((x)<<(SGSHIFT-PGSHIFT))
48:
49: /* Page number to segment number */
50: #define ptos(x) ((x)>>(SGSHIFT-PGSHIFT))
51:
52: /* Core clicks (8192 bytes) to disk blocks and vice versa */
53: #define ctod(x) ((x)<<4)
54: #define dtoc(x) (((x)+15)>>4)
55: #define dtob(x) ((x)<<9)
56:
57: /* clicks to bytes */
58: #define ctob(x) ((x)<<PGSHIFT)
59:
60: /* bytes to clicks */
61: #define btoc(x) ((((unsigned)(x)+(NBPG-1))>>PGSHIFT))
62:
63: /*
64: * Macros to decode processor status word.
65: */
66: #define USERMODE(ps) (((ps) & SR_SMODE) == 0)
67: #define BASEPRI(ps) (((ps) & SR_INTPRI) == 0)
68:
69: /*
70: * Delay units are in microseconds.
71: */
72: #define DELAY(n) \
73: { \
74: extern int cpudelay; \
75: register int N = (((n)<<4) >> cpudelay); \
76: \
77: while (--N > 0) ; \
78: }
79:
80: #define CDELAY(c, n) \
81: { \
82: extern int cpudelay; \
83: register int N = (((n)<<3) >> cpudelay); \
84: \
85: while (--N > 0) \
86: if (c) \
87: break; \
88: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.