diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2023-05-02 09:48:50 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-05-02 10:39:32 +0200 |
commit | 82b77505f9420f11d614c2ae0f74153ca4ee3cb5 (patch) | |
tree | ec93abd39cd8c7ff2818c7446da6cc01864b2ae1 /cooker/gluten.h | |
parent | a2c20b2caf4e9cedb32b0930ffd7ca2e9ec72086 (diff) | |
download | seitan-82b77505f9420f11d614c2ae0f74153ca4ee3cb5.tar seitan-82b77505f9420f11d614c2ae0f74153ca4ee3cb5.tar.gz seitan-82b77505f9420f11d614c2ae0f74153ca4ee3cb5.tar.bz2 seitan-82b77505f9420f11d614c2ae0f74153ca4ee3cb5.tar.lz seitan-82b77505f9420f11d614c2ae0f74153ca4ee3cb5.tar.xz seitan-82b77505f9420f11d614c2ae0f74153ca4ee3cb5.tar.zst seitan-82b77505f9420f11d614c2ae0f74153ca4ee3cb5.zip |
cooker updates spilling all over the place
Only tangentially related:
- make seitan C99 again, so that I can build cooker without warnings
- make Makefiles make use of the usual conventions about assigning
directory paths in variables, drop numbers.h as requirement for
cooker and make it convenient to run stand-alone Makefiles
- fix up nr_syscalls.sh to be POSIX, otherwise it will give syntax
errors on my system
- define a single, common way to refer to offsets in gluten, and
functions to use those offsets in a safe way. Immediates are gone:
cooker will write any bit of "data" to the read-only section
- call const what has to be const
- define on-disk layout for gluten
- add OP_NR (to check syscall numbers), rename OP_COPY_ARGS to
OP_LOAD (it loads _selected_ stuff from arguments)
As for cooker itself:
- drop ARG_ and arg_ prefixes from struct names, and similar
- add/rework functions to build OP_NR, OP_LOAD, OP_CMP, and to
write constant data to gluten
- add parsing for "compound" arguments, but that's not completely
hooked into evaluation for numeric arguments yet
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'cooker/gluten.h')
-rw-r--r-- | cooker/gluten.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/cooker/gluten.h b/cooker/gluten.h index 440029d..a48cd6d 100644 --- a/cooker/gluten.h +++ b/cooker/gluten.h @@ -6,22 +6,27 @@ #ifndef GLUTEN_H #define GLUTEN_H +#define COOKER +#include <gluten.h> + struct gluten_arg_data { - int offset; + struct gluten_offset offset; size_t len; }; struct gluten_ref_data { - int name; - int offset; + char name[REF_NAMEMAX]; + struct gluten_offset offset; size_t len; }; struct gluten_ctx { - int ip; - int lr; - int sp; - char *gluten; + struct gluten_offset ip; + struct gluten_offset lr; + struct gluten_offset cp; + struct gluten_offset dp; + + struct gluten g; struct gluten_arg_data match_dst[CALL_ARGS]; struct gluten_arg_data call_src[CALL_ARGS]; @@ -29,8 +34,11 @@ struct gluten_ctx { struct gluten_ref_data refs[REFS_MAX]; }; -int gluten_alloc(struct gluten_ctx *g, size_t size); -int gluten_alloc_type(struct gluten_ctx *g, enum arg_type type); -int gluten_init(struct gluten_ctx *g); +struct gluten_offset gluten_alloc(struct gluten_ctx *g, size_t size); +struct gluten_offset gluten_alloc_type(struct gluten_ctx *g, enum type type); +void gluten_init(struct gluten_ctx *g); +void gluten_block_init(struct gluten_ctx *g); + +extern size_t gluten_size[TYPE_COUNT]; #endif /* GLUTEN_H */ |