summaryrefslogtreecommitdiff
path: root/emux64/src/include/cpu/cpu.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-10-12 20:34:32 -0400
committerIan Moffett <ian@osmora.org>2025-10-12 20:34:32 -0400
commitf97bc605512c482936f09410c95f4af2cc8d3b58 (patch)
tree263511bab6df8f9cb281db619fda571c6b8b3d8e /emux64/src/include/cpu/cpu.h
parentad8adc4165375a2e803be6d5782477c9f88d717e (diff)
cpu: Add initial bring-up and debug logic
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'emux64/src/include/cpu/cpu.h')
-rw-r--r--emux64/src/include/cpu/cpu.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/emux64/src/include/cpu/cpu.h b/emux64/src/include/cpu/cpu.h
index 04b2a9f..9b045c9 100644
--- a/emux64/src/include/cpu/cpu.h
+++ b/emux64/src/include/cpu/cpu.h
@@ -38,6 +38,14 @@
#include <stdint.h>
#include <stddef.h>
+/* Bring up area physical base */
+#define CPU_BUA_PBASE 0xFFF00000
+
+/* Register type counts */
+#define N_GPREG 16
+#define N_FLOATREG 7
+#define N_DUBREG 7
+
/*
* Represents a single unit of execution
*
@@ -47,9 +55,9 @@
* @pc: Program counter
*/
struct osmx_core {
- uint64_t xn[16];
- float fn[7];
- double dn[7];
+ uint64_t xn[N_GPREG];
+ float fn[N_FLOATREG];
+ double dn[N_DUBREG];
uintptr_t pc;
};
@@ -60,7 +68,24 @@ struct osmx_core {
* TODO: Dynamically allocate cores
*/
struct osmx_cpu {
- struct osmx_core[1];
+ struct osmx_core cores[1];
};
+/*
+ * Bring the CPU to an initial reset state
+ *
+ * @core: Core to bring to reset state
+ *
+ * Returns zero on success
+ */
+int cpu_reset(struct osmx_core *core);
+
+/*
+ * Dump the registers to the console for debugging
+ * purposes
+ *
+ * @core: Core to dump
+ */
+void cpu_dump(struct osmx_core *core);
+
#endif /* !CPU_CPU_H */