diff options
Diffstat (limited to 'core/arch.h')
| -rw-r--r-- | core/arch.h | 57 |
1 files changed, 57 insertions, 0 deletions
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 <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 +// ---------------------------------------------------------------------------- +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); |
