Commit Graph

4 Commits

Author SHA1 Message Date
Warner Losh
ecfbb2e302 genoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations
Linux fails to build now because the mkdtemp in the bootstrapped
environment wants 6 or more X's. Use 10 out of an abundance of caution.

Sponsored by:		Netflix
Reviewed by:		arichards
Differential Revision:	https://reviews.freebsd.org/D31863
2021-09-07 10:08:51 -06:00
Warner Losh
824897a3ae 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
2021-07-28 13:50:09 -06:00
Matt Macy
8bedbb4d42 expose thread_lite definition to tied modules 2018-07-03 02:50:07 +00:00
Matt Macy
6443773dab make critical_{enter, exit} inline
Avoid pulling in all of the <sys/proc.h> dependencies by
automatically generating a stripped down thread_lite exporting
only the fields of interest. The field declarations are type checked
against the original and the offsets of the generated result is
automatically checked.

kib has expressed disagreement and would have preferred to simply
use genassym style offsets (which loses type check enforcement).
jhb has expressed dislike of it due to header pollution and a
duplicate structure. He would have preferred to just have defined
thread in _thread.h. Nonetheless, he admits that this is the only
viable solution at the moment.

The impetus for this came from mjg's D15331:
"Inline critical_enter/exit for amd64"

Reviewed by: jeff
Differential Revision: https://reviews.freebsd.org/D16078
2018-07-03 01:55:09 +00:00