On 7/2/2018 6:55 PM, Matt Macy wrote:
> Author: mmacy
> Date: Tue Jul  3 01:55:09 2018
> New Revision: 335879
> URL: https://svnweb.freebsd.org/changeset/base/335879
> 
> Log:
>   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
> 
> Added:
>   head/sys/kern/genoffset.c   (contents, props changed)
>   head/sys/kern/genoffset.sh   (contents, props changed)
>   head/sys/sys/kpilite.h   (contents, props changed)
> Modified:
>   head/sys/conf/kern.post.mk
>   head/sys/conf/kern.pre.mk
>   head/sys/kern/kern_switch.c
>   head/sys/sys/assym.h
>   head/sys/sys/systm.h
> 
> Modified: head/sys/conf/kern.post.mk
> ==============================================================================
> --- head/sys/conf/kern.post.mk        Mon Jul  2 22:59:29 2018        
> (r335878)
> +++ head/sys/conf/kern.post.mk        Tue Jul  3 01:55:09 2018        
> (r335879)
> @@ -185,13 +185,25 @@ hack.pico: Makefile
>       ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico
>       rm -f hack.c
>  
> -assym.inc: $S/kern/genassym.sh genassym.o
> +offset.inc: $S/kern/genoffset.sh genoffset.o
> +     NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > 
> ${.TARGET}
> +
> +genoffset.o: $S/kern/genoffset.c
> +     ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c
> +
> +genoffset_test.c: $S/kern/genoffset.c
> +     cp $S/kern/genoffset.c genoffset_test.c
> +
> +genoffset_test.o: genoffset_test.c offset.inc
> +     ${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST genoffset_test.c
> +
> +assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o
>       NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > 
> ${.TARGET}

What's genoffset_test? Nothing seems to use it.

-- 
Regards,
Bryan Drewery

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to