From 00a0cb3821ce2bd0fc589ae64ed9cbb791ce44bb Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Tue, 16 Jun 2026 23:00:21 +0200 Subject: Adds index to all large files --- core/salis.c | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'core/salis.c') diff --git a/core/salis.c b/core/salis.c index 3740f3c..9f9a3d0 100644 --- a/core/salis.c +++ b/core/salis.c @@ -1,3 +1,19 @@ +// index +// [section] includes +// [section] macros & enums +// [section] structs +// [section] globals +// [section] architecture forward declarations +// [section] memory vector functions +// [section] mutator functions +// [section] process functions +// [section] core functions +// [section] salis functions +// [section] architecture & ui includes + +// ---------------------------------------------------------------------------- +// [section] includes +// ---------------------------------------------------------------------------- #include #include #include @@ -12,6 +28,9 @@ #include "compress.c" #include "sql.c" +// ---------------------------------------------------------------------------- +// [section] macros & enums +// ---------------------------------------------------------------------------- #define INST_CAP 0x80 #define INST_MASK 0x7f #define IPC_FLAG 0x80 @@ -24,6 +43,9 @@ EVENT_ARRAY(core, 2, bev) /* birth events array */ #define EVENT_ARRAYS_COUNT 3 +// ---------------------------------------------------------------------------- +// [section] structs +// ---------------------------------------------------------------------------- struct Proc { #define PROC_FIELD(type, name) type name; PROC_FIELDS @@ -71,7 +93,9 @@ struct Core { uint8_t tgap[THREAD_GAP]; }; -// Globals +// ---------------------------------------------------------------------------- +// [section] globals +// ---------------------------------------------------------------------------- struct Core g_cores[CORES]; uint64_t g_steps; uint64_t g_syncs; @@ -84,7 +108,9 @@ char g_asav_pbuf[AUTOSAVE_NAME_LEN]; thrd_t g_eva_thrds[CORES][EVENT_ARRAYS_COUNT]; struct DeflateParams g_eva_deflate_params[CORES][EVENT_ARRAYS_COUNT]; -// Each architecture must define these functions +// ---------------------------------------------------------------------------- +// [section] architecture forward declarations +// ---------------------------------------------------------------------------- #if defined(COMMAND_NEW) void arch_core_init(struct Core *core); #endif @@ -122,7 +148,7 @@ void arch_push_data_header(void); void arch_push_data_line(void); // ---------------------------------------------------------------------------- -// Memory vector functions +// [section] memory vector functions // ---------------------------------------------------------------------------- #if defined(MVEC_LOOP) uint64_t mvec_loop(uint64_t addr) { @@ -282,7 +308,7 @@ uint64_t mvec_get_owner(const struct Core *core, uint64_t addr) { } // ---------------------------------------------------------------------------- -// Mutator functions +// [section] mutator functions // ---------------------------------------------------------------------------- #if defined(COMMAND_NEW) uint64_t muta_smix(uint64_t *seed) { @@ -333,7 +359,7 @@ void muta_cosmic_ray(struct Core *core) { } // ---------------------------------------------------------------------------- -// Process functions +// [section] process functions // ---------------------------------------------------------------------------- void proc_new(struct Core *core, const struct Proc *proc) { assert(core); @@ -402,7 +428,7 @@ struct Proc *proc_fetch(struct Core *core, uint64_t pix) { } // ---------------------------------------------------------------------------- -// Core functions +// [section] core functions // ---------------------------------------------------------------------------- #if defined(COMMAND_NEW) || defined(COMMAND_LOAD) void core_save(FILE *f, const struct Core *core) { @@ -621,7 +647,7 @@ void core_step(struct Core *core) { } // ---------------------------------------------------------------------------- -// Main salis functions +// [section] salis functions // ---------------------------------------------------------------------------- #if defined(COMMAND_NEW) || defined(COMMAND_LOAD) void salis_save(const char *path) { @@ -1071,13 +1097,10 @@ void salis_free(void) { } // ---------------------------------------------------------------------------- -// Architecture +// [section] architecture & ui includes // ---------------------------------------------------------------------------- #include "arch.c" -// ---------------------------------------------------------------------------- -// UI -// ---------------------------------------------------------------------------- #if defined(COMMAND_NEW) || defined(COMMAND_LOAD) #include "ui.c" #endif -- cgit v1.2.1