From 2dc9d118efb64de6ea54a5a9eb4474f8e5ef3145 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 01:50:44 +0100 Subject: Initial commit --- include/process.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 include/process.h (limited to 'include/process.h') diff --git a/include/process.h b/include/process.h new file mode 100644 index 0000000..35e1fdf --- /dev/null +++ b/include/process.h @@ -0,0 +1,40 @@ +#ifndef SALIS_PROCESS_H +#define SALIS_PROCESS_H + +#define SPROC_REG_COUNT 4 +#define SPROC_STACK_SIZE 8 +#define SPROC_ELEM_COUNT (6 + SPROC_REG_COUNT + SPROC_STACK_SIZE) + +typedef struct { + sword mb1a; + sword mb1s; + sword mb2a; + sword mb2s; + + sword ip; + sword sp; + + sword regs [SPROC_REG_COUNT]; + sword stack [SPROC_STACK_SIZE]; +} SProc; + +void sp_init (void); +void sp_quit (void); +void sp_load (FILE *file); +void sp_save (FILE *file); + +sbool sp_isInit (void); +sword sp_getCount (void); +sword sp_getCap (void); +sword sp_getFirst (void); +sword sp_getLast (void); + +sbool sp_isFree (sword pidx); +SProc sp_getProc (sword pidx); +void sp_setProc (sword pidx, SProc proc); + +void sp_create (sword addr, sword size); +void sp_kill (void); +void sp_cycle (void); + +#endif -- cgit v1.2.1