From c021082abcc9d94c2e94679f6729265fe65529a3 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 4 Jun 2023 09:51:15 +0200 Subject: cooker: Generic attributes and ATTR_SIZE Signed-off-by: Stefano Brivio --- cooker/cooker.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'cooker/cooker.h') diff --git a/cooker/cooker.h b/cooker/cooker.h index c59a5dc..40277c2 100644 --- a/cooker/cooker.h +++ b/cooker/cooker.h @@ -20,6 +20,7 @@ #include #define TAGS_MAX 256 +#define ATTRS_MAX 256 #define CALL_ARGS 6 struct num; @@ -38,7 +39,7 @@ union desc { struct num *d_num; struct field *d_struct; struct select *d_select; - int d_arg_size; + intptr_t d_size; }; /** @@ -152,10 +153,12 @@ struct arg { /** * struct select_num - List of possible selections based on numeric selector * @value: Numeric value of the selector + * @sel_size: Size associated with selection (not necessarily argument size) * @target: Argument description defined by this selector */ struct select_num { long long value; + ssize_t sel_size; struct arg target; }; @@ -172,4 +175,20 @@ struct select { } desc; }; +enum attr_type { + ATTR_NONE = 0, + ATTR_SIZE, +}; + +/** + * struct attr - Generic attribute for syscall model with link + * @id: Link + * @v: Attribute value + */ +struct attr { + enum attr_type type; + intptr_t id; + union value v; +}; + #endif /* COOKER_H */ -- cgit v1.2.3