Date: Tue, 3 Jul 2018 11:19:12 -0700 From: Matthew Macy <mmacy@freebsd.org> To: Bryan Drewery <bdrewery@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335879 - in head/sys: conf kern sys Message-ID: <CAPrugNoKOdPegdxnyfmRtSTs-=c=Hje3onXqHQS=KgTnZfA6Zg@mail.gmail.com> In-Reply-To: <dcb9eaa8-71ab-1830-e3d5-583a9e324794@FreeBSD.org> References: <201807030155.w631tARo009470@repo.freebsd.org> <dcb9eaa8-71ab-1830-e3d5-583a9e324794@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
genoffset_test tests that the offsets match up On Tue, Jul 3, 2018 at 11:02 AM, Bryan Drewery <bdrewery@freebsd.org> wrote: > 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 >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPrugNoKOdPegdxnyfmRtSTs-=c=Hje3onXqHQS=KgTnZfA6Zg>