summaryrefslogtreecommitdiff
path: root/os/boot/puma/mem.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/boot/puma/mem.h')
-rw-r--r--os/boot/puma/mem.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/os/boot/puma/mem.h b/os/boot/puma/mem.h
new file mode 100644
index 00000000..35bca0a6
--- /dev/null
+++ b/os/boot/puma/mem.h
@@ -0,0 +1,38 @@
+/*
+ * Memory and machine-specific definitions. Used in C and assembler.
+ */
+
+/*
+ * Sizes
+ */
+#define BI2BY 8 /* bits per byte */
+#define BI2WD 32 /* bits per word */
+#define BY2WD 4 /* bytes per word */
+#define BY2PG 4096 /* bytes per page */
+#define WD2PG (BY2PG/BY2WD) /* words per page */
+#define PGSHIFT 12 /* log(BY2PG) */
+#define PGROUND(s) (((s)+(BY2PG-1))&~(BY2PG-1))
+
+#define MAXMACH 1 /* max # cpus system can run */
+
+/*
+ * Time
+ */
+#define HZ (20) /* clock frequency */
+#define MS2HZ (1000/HZ) /* millisec per clock tick */
+#define TK2SEC(t) ((t)/HZ) /* ticks to seconds */
+#define TK2MS(t) ((((ulong)(t))*1000)/HZ) /* ticks to milliseconds */
+#define MS2TK(t) ((((ulong)(t))*HZ)/1000) /* milliseconds to ticks */
+
+/*
+ * Fundamental addresses
+ */
+
+/*
+ * Address spaces
+ *
+ * Kernel is at 0x00008000
+ */
+#define KZERO 0x00000000 /* base of kernel address space */
+#define KTZERO KZERO /* first address in kernel text */
+#define MACHSIZE 4096