svn commit: r208921 - in head/sys: amd64/amd64 conf i386/i386 x86/x86

M. Warner Losh imp at bsdimp.com
Tue Jun 8 19:27:58 UTC 2010


In message: <201006081446.09423.jhb at freebsd.org>
            John Baldwin <jhb at freebsd.org> writes:
: On Tuesday 08 June 2010 2:04:07 pm John Baldwin wrote:
: > Author: jhb
: > Date: Tue Jun  8 18:04:07 2010
: > New Revision: 208921
: > URL: http://svn.freebsd.org/changeset/base/208921
: > 
: > Log:
: >   Move the machine check support code to the x86 tree since it is identical
: >   on i386 and amd64.
: >   
: >   Requested by:	alc
: 
: It would be nice to consolidate <machine/mca.h> as that is identical on both 
: platforms, but that moving to x86/include is trickier as the header needs to 
: be available in userland, probably as <machine/mca.h> still.  <x86/mca.h> 
: would work ok (i.e. in /usr/include/x86/mca.h), but that makes things trickier 
: in the kernel as the file should really live in sys/x86/include, not sys/x86 
: directly.
: 
: I'm open to suggestions on if this is feasible and if so how to do it.

I believe we had a long talk about this before.

copy the current {i386,amd64}/mca.h to x86/mca.h
new {i386,amd64}/mca.h == #include <x86/mca.h> (no copyright notice, etc)

just like we do for the pc98 stuff.  The mca.h file would live in
sys/x86/include.

That was the consensus of the conversation at the time.  There's some
support for this already in the tree for pc98 vs i386 stuff.  There's
work in flight for mips and powerpc that do similar things for the
64-bit versions (the mips stuff is on the drawing board, the powerpc
stuff is in nathanw's branch).  Plus this dove-tails into the
MACHINE_CPUARCH stuff I've worked on with the tbemd branch that's
headed into head as soon as the mips merge is sorted out.

In src/include/Makefile we have:
.if defined(_MARCH)
	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
	cd ${.CURDIR}/../sys/${_MARCH}/include; \
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}
.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
	cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
.endif
.endif

we could add

.if defined(_MCARCH)
	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
	    ${DESTDIR}${INCLUDEDIR}/${_MCARCH}; \
	cd ${.CURDIR}/../sys/${_MARCH}/include; \
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
	    ${DESTDIR}${INCLUDEDIR}/${_MCARCH}
.endif

just after it, plus a few touch-ups elsewhere in the file (like
defining _MCARCH if MACHINE_CPUARCH != MACHINE_ARCH).

And just to recap, MACHINE_ARCH is the binary architecture that's
being built.  MACHINE_CPUARCH is where the source for a group of
related MACHINE_ARCH live.  MACHINE_CPUARCH is mips for all mips
platforms, but MACHINE_ARCH is mipsel or mipseb (and maybe mips64el
and mips64eb) for those platforms.  To apply this pattern to intel,
MACHINE_ARCH={i386,amd64} and MACHINE_CPUARCH=x86.

Warner


More information about the svn-src-head mailing list