aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-07-28 19:47:05 +0000
committerWarner Losh <imp@FreeBSD.org>2021-07-28 19:50:09 +0000
commit824897a3aea5ca22db8cb7d5b404697a1de1210a (patch)
tree7a0e8483a29cdd3b56dd1e55d1ee13961f12510c /sys/sys
parent46dd3ef0338ba2ad24d05bab2a614410cf17b017 (diff)
downloadsrc-824897a3aea5ca22db8cb7d5b404697a1de1210a.tar.gz
src-824897a3aea5ca22db8cb7d5b404697a1de1210a.zip
genoffset: simplify and rewrite in sh
genoffset used the fully generic ASSYM macro to generate the offsets needed for the thread_lite structure. However, since these are offsets into a structure, they will always be necessarily small and positive. As such, just create a simple character array of the right size and use a naming convention such that we can recover the field name, structure name and type. Use nm -t d and sort -n to sort these into order, then loop over the resutls to generate the thread_lite structure. MFC After: 2 weeks Reviewed by: kib, markj (earlier versions) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31203
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/assym.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/sys/assym.h b/sys/sys/assym.h
index 858989fe505f..3cb4afd5803c 100644
--- a/sys/sys/assym.h
+++ b/sys/sys/assym.h
@@ -51,9 +51,7 @@ char name ## w3[((ASSYM_ABS(value) & 0xFFFF000000000000ULL) >> 48) + ASSYM_BIAS]
#endif
#define OFFSYM(name, parenttype, datatype) \
-ASSYM(name, offsetof(struct parenttype, name)); \
-char name ## _datatype_ ## datatype [1]; \
-char name ## _parenttype_ ## parenttype [1]; \
+char __assym_offset__ ## parenttype ## __ ## name ## __ ## datatype [offsetof(struct parenttype, name)]; \
CTASSERT(__builtin_types_compatible_p(__typeof(((struct parenttype *)(0x0))-> name), datatype)); \
OFFSET_CTASSERT(offsetof(struct parenttype, name) == offsetof(struct parenttype ## _lite, name))