1 /* 2 * Memory and machine-specific definitions. Used in C and assembler. 3 */ 4 5 /* 6 * Sizes 7 */ 8 #define BI2BY 8 /* bits per byte */ 9 #define BI2WD 32 /* bits per word */ 10 #define BY2WD 4 /* bytes per word */ 11 #define BY2PG 4096 /* bytes per page */ 12 #define WD2PG (BY2PG/BY2WD) /* words per page */ 13 #define PGSHIFT 12 /* log(BY2PG) */ 14 #define PGROUND(s) (((s)+(BY2PG-1))&~(BY2PG-1)) 15 16 #define MAXMACH 1 /* max # cpus system can run */ 17 18 /* 19 * Time 20 */ 21 #define HZ (20) /* clock frequency */ 22 #define MS2HZ (1000/HZ) /* millisec per clock tick */ 23 #define TK2SEC(t) ((t)/HZ) /* ticks to seconds */ 24 #define TK2MS(t) ((((ulong)(t))*1000)/HZ) /* ticks to milliseconds */ 25 #define MS2TK(t) ((((ulong)(t))*HZ)/1000) /* milliseconds to ticks */ 26 27 /* 28 * Fundamental addresses 29 */ 30 31 /* 32 * Address spaces 33 * 34 * Kernel is at 0x00008000 35 */ 36 #define KZERO 0x00000000 /* base of kernel address space */ 37 #define KTZERO KZERO /* first address in kernel text */ 38 #define MACHSIZE 4096 39