refactor config loading

This commit is contained in:
2026-04-08 23:12:40 +03:00
parent 9d55a87200
commit b5162a19e8
7 changed files with 219 additions and 178 deletions

View File

@@ -53,6 +53,17 @@ typedef uint32_t io_reg_cell_t;
typedef uint32_t io_reg_cell_t;
#endif
typedef struct
{
uint8_t seg_id;
char* name;
uint8_t word_len;
uint64_t default_size;
uint64_t default_addr;
uint8_t is_executable;
} memseg_metadata_t;
void* default_addr_read_handler(uint64_t ident, uint64_t addr, void* rawCells);

17
inc/mem_seg.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef __MEM_SEG_H__
#define __MEM_SEG_H__
// #define MEMSEG_PC_SEG_NUM 0
// #define MEMSEG_PC_ADDR 0
#define MEMSEG_DEFINES {\
{0, "seg0", 1, 0, 0, 0}, \
{1, "seg1", 1, 0, 0, 0}, \
{2, "seg2", 1, 0, 0, 0}, \
{3, "seg3", 1, 0, 0, 0}, \
{4, "seg4", 1, 0, 0, 0}, \
{5, "seg5", 1, 0, 0, 0}, \
}
#endif //ifndef __MEM_SEG_H__