diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-07-14 17:29:02 +0200 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-08-30 16:24:48 +0200 |
| commit | 1961b4b237083f4cfac9ca6b249c1d6cb665d149 (patch) | |
| tree | fd9fc8260360e2ac30be9747ca558bcfc824a4c4 /core/arch.h | |
Diffstat (limited to 'core/arch.h')
| -rw-r--r-- | core/arch.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/core/arch.h b/core/arch.h new file mode 100644 index 0000000..06dbfe3 --- /dev/null +++ b/core/arch.h @@ -0,0 +1,63 @@ +// file : core/arch.h +// project : Salis-VM +// author : Paul Oliver <contact@pauloliver.dev> + +#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 +// ---------------------------------------------------------------------------- +#if defined(COMMAND_NEW) +void arch_core_init(struct Core *core); +#endif + +#if defined(COMMAND_LOAD) +void arch_core_load(struct Core *core, FILE *f); +#endif + +void arch_core_save(const struct Core *core, FILE *f); +void arch_core_free(struct Core *core); |
