commit | 987c0ff61c3b95845b2a2491e3f9a848b0c36ec7 | [log] [tgz] |
---|---|---|
author | Wedson Almeida Filho <wedsonaf@google.com> | Wed Jun 20 16:34:38 2018 +0100 |
committer | Wedson Almeida Filho <wedsonaf@google.com> | Thu Jun 28 15:09:42 2018 +0100 |
tree | 8f29452c208a8fd8f9f5cf5c7d87e7ebc4e380d4 |
Initial commit.
diff --git a/inc/decl_offsets.h b/inc/decl_offsets.h new file mode 100644 index 0000000..01f182f --- /dev/null +++ b/inc/decl_offsets.h
@@ -0,0 +1,10 @@ +#ifndef _DECL_OFFSETS_H +#define _DECL_OFFSETS_H + +#define DECL(name, type, field) \ + __asm("DEFINE_OFFSET " #name " %0" : : "n" (offsetof(type, field))) + +#define DECL_SIZE(name, type) \ + __asm("DEFINE_OFFSET " #name " %0" : : "n" (sizeof(type))) + +#endif /* _DECL_OFFSETS_H */