aboutgitcodelistschat:MatrixIRC
path: root/common/gluten.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/gluten.h')
-rw-r--r--common/gluten.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/common/gluten.h b/common/gluten.h
index e80916a..1414d9e 100644
--- a/common/gluten.h
+++ b/common/gluten.h
@@ -70,6 +70,7 @@ enum op_type {
OP_RETURN,
OP_LOAD,
OP_STORE,
+ OP_IOVLOAD,
OP_BITWISE,
OP_CMP,
OP_RESOLVEDFD,
@@ -210,6 +211,13 @@ struct op_store {
struct gluten_offset count;
};
+struct op_iovload {
+ struct gluten_offset iov;
+ struct gluten_offset iovlen;
+ struct gluten_offset dst;
+ size_t size;
+};
+
enum op_cmp_type {
CMP_EQ,
CMP_NE,
@@ -278,6 +286,7 @@ struct op {
struct op_fd fd;
struct op_load load;
struct op_store store;
+ struct op_iovload iovload;
struct op_bitwise bitwise;
struct op_cmp cmp;
struct op_resolvefd resfd;
@@ -291,8 +300,12 @@ struct op {
# define GLUTEN_CONST const
#endif
+struct gluten_header {
+ struct gluten_offset relocation[256];
+};
+
struct gluten {
- GLUTEN_CONST char header[HEADER_SIZE];
+ GLUTEN_CONST struct gluten_header header;
GLUTEN_CONST char inst[INST_SIZE];
@@ -309,7 +322,7 @@ static inline bool is_offset_valid(const struct gluten_offset x)
{
switch (x.type) {
case OFFSET_NULL:
- return false;
+ return true;
case OFFSET_DATA:
return x.offset < DATA_SIZE;
case OFFSET_RO_DATA:
@@ -319,6 +332,7 @@ static inline bool is_offset_valid(const struct gluten_offset x)
case OFFSET_SECCOMP_DATA:
return x.offset < 6;
default:
+ debug("unknown offset in range check");
return false;
}
}