From f2c34b1d2c18270a0327fb4896fa307fae098770 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Tue, 14 Jul 2026 17:29:02 +0200 Subject: Initial --- core/arch.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 core/arch.h (limited to 'core/arch.h') diff --git a/core/arch.h b/core/arch.h new file mode 100644 index 0000000..b44d193 --- /dev/null +++ b/core/arch.h @@ -0,0 +1,57 @@ +// file : core/arch.h +// project : Salis-VM +// author : Paul Oliver + +#pragma once + +// index: +// [section] structs +// [section] getters +// [section] callbacks +// [section] validation +// [section] data +// [section] main + +// ---------------------------------------------------------------------------- +// [section] structs +// ---------------------------------------------------------------------------- +struct Core; + +// ---------------------------------------------------------------------------- +// [section] getters +// ---------------------------------------------------------------------------- +uint64_t arch_proc_get_ip_addr(const struct Core *core, uint64_t pix); +uint64_t arch_proc_get_sp_addr(const struct Core *core, uint64_t pix); +uint64_t arch_proc_get_mb0_addr(const struct Core *core, uint64_t pix); +uint64_t arch_proc_get_mb0_size(const struct Core *core, uint64_t pix); +uint64_t arch_proc_get_mb1_addr(const struct Core *core, uint64_t pix); +uint64_t arch_proc_get_mb1_size(const struct Core *core, uint64_t pix); +uint64_t arch_proc_get_slice(const struct Core *core, uint64_t pix); + +// ---------------------------------------------------------------------------- +// [section] callbacks +// ---------------------------------------------------------------------------- +void arch_on_proc_step(struct Core *core, uint64_t pix); +void arch_on_proc_kill(struct Core *core); + +// ---------------------------------------------------------------------------- +// [section] validation +// ---------------------------------------------------------------------------- +#if !defined(NDEBUG) +void arch_validate_core(struct Core *core); +#endif + +// ---------------------------------------------------------------------------- +// [section] data +// ---------------------------------------------------------------------------- +void arch_push_data_header(void); +void arch_prepare_data_line(void); +void arch_push_data_line(FILE *eva_file); + +// ---------------------------------------------------------------------------- +// [section] main +// ---------------------------------------------------------------------------- +void arch_core_init(struct Core *core); +void arch_core_free(struct Core *core); +void arch_core_load(struct Core *core, FILE *f); +void arch_core_save(const struct Core *core, FILE *f); -- cgit v1.3.1