From owner-freebsd-arch@FreeBSD.ORG Fri Oct 29 15:36:05 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A827106566C; Fri, 29 Oct 2010 15:36:05 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170]) by mx1.freebsd.org (Postfix) with ESMTP id 1FAF48FC19; Fri, 29 Oct 2010 15:36:03 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAFGGykxbsWDm/2dsb2JhbAChU3K/FoVIBIlk Received: from 230.96-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.96.230]) by relay.skynet.be with ESMTP; 29 Oct 2010 17:36:02 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.4/8.14.4) with ESMTP id o9TFa1IP023273; Fri, 29 Oct 2010 17:36:01 +0200 (CEST) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: freebsd-arch@freebsd.org Date: Fri, 29 Oct 2010 17:35:50 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.5.2; i386; ; ) References: <201010282331.19825.tijl@coosemans.org> <201010290940.17353.jhb@freebsd.org> In-Reply-To: <201010290940.17353.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2362348.uCLvzsYlJ3"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201010291735.59702.tijl@coosemans.org> Cc: Attilio Rao , Warner Losh Subject: Re: [PATCH] Headers for the x86 subtree X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 15:36:05 -0000 --nextPart2362348.uCLvzsYlJ3 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Friday 29 October 2010 15:40:17 John Baldwin wrote: > On Thursday, October 28, 2010 5:31:09 pm Tijl Coosemans wrote: >> On Thursday 28 October 2010 16:13:02 John Baldwin wrote: >>> On Thursday, October 28, 2010 3:44:21 am Attilio Rao wrote: >>>> 2010/10/27 John Baldwin : >>>>> On Wednesday, October 27, 2010 10:56:06 am Attilio Rao wrote: >>>>>> This patch should convert a (simple and 100% shared between amd64 and >>>>>> i386 header) under the x86 sub-tree. Please note that in this patch I >>>>>> "svn cp" the file from sys/amd64/include/mptable.h into >>>>>> sys/x86/include/mptable.h: >>>>>> http://www.freebsd.org/~attilio/headers-x86.diff >>>>>> >>>>>> This is someway a POC, that I really want to get in. The idea is >>>>>> simple and someway follows the pc98 case (even if not entirely): the >>>>>> files under machine/include/* became just mere stubs for x86/include= /* >>>>>> contents and redirect there. >>>>>> This won't particulary help reducing the number of available files, >>>>>> but generally removing verbatim and would also be the way to go for >>>>>> handling MFCs. >>>>>> If you find this is the right way I'll commit the fix and start movi= ng >>>>>> other files as time permits. >>>>> >>>>> No, we want to do this differently because we also want this to work = in >>>>> userland. (e.g. I'd like to outright move mca.h to x86/include and t= hen >>>>> use '#include ' in both kernel and userland for it). We'd >>>>> need >>>>> some special glue to setup an 'x86' symlink during a kernel build that >>>>> points to @/x86/include as we do now to setup an 'i386' link for pc98 >>>>> kernels. >>>>> >>>>> We'd also need to install the x86 headers into /usr/include during an >>>>> installworld. Warner has some more pointers on this I think. >>>>=20 >>>> I spoke with Warner briefly about it. >>>> One question I'm having now, though, is how getting co-living of pc98 >>>> and x86 now, as we are basically overriding the same infrastructure >>>> (MACHINE_CPUARCH) in the i386/amd64 case? >>>> Do you have ideas about that? >>>=20 >>> I'm still doing testing, but this seems to be working so far. I am >>> moving mca.h as my current test. >>>=20 >>> Index: include/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- include/Makefile (revision 214386) >>> +++ include/Makefile (working copy) >>> @@ -116,8 +116,11 @@ >>> .endfor >>> =20 >>> .if ${MACHINE} !=3D ${MACHINE_CPUARCH} >>> -_MARCH=3D${MACHINE_CPUARCH} >>> +_MARCHS=3D ${MACHINE_CPUARCH} >>> .endif >>> +.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "amd= 64" >>> +_MARCHS+=3D x86 >>> +.endif >>=20 >> Can't MACHINE_CPUARCH be set to "x86" in the i386, amd64 and pc98 >> cases? This patch wouldn't be needed then. >=20 > As Warner said, we aren't quite ready for that yet. However, even if we > do that, pc98 would need further help as it still needs /usr/include/i386 > installed. So that will require a code along the lines of: >=20 > .if ${MACHINE} !=3D ${MACHINE_CPUARCH} > _MARCHS=3D ${MACHINE_CPUARCH} > .endif > .if ${MACHINE} !=3D ${MACHINE_ARCH} && ${MACHINE_ARCH} !=3D ${MACHINE_CPU= ARCH} > _MARCHS+=3D ${MACHINE_ARCH} > .endif >=20 > With pc98 having MACHINE=3Dpc98, MACHINE_ARCH=3Di386, MACHINE_CPUARCH=3Dx= 86. Ok, thanks. I'm interested in this mainly because to get "cc -m32" working on amd64, i386 headers would have to be installed there as well. I sent a patch similar to yours to this list a few months ago: http://lists.freebsd.org/pipermail/freebsd-arch/2010-August/010559.html http://people.freebsd.org/~tijl/cc-m32-2.diff One of the problems I encountered was that the build of kdump generates a file that includes all headers containing ioctl definitions. Both i386 and amd64 headers got included which caused conflicts. Moving common headers under x86 would solve that. --nextPart2362348.uCLvzsYlJ3 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iF4EABEIAAYFAkzK6d8ACgkQfoCS2CCgtiuYfwEAha9vverIJeemVNMWgoDKA0gJ IAtmCVZBu/Nv08I86LAA/3lA1XQiA+c9JLYjn4FZ7Uw02F8wIN9rrC0Jp6wr4+0s =BPo7 -----END PGP SIGNATURE----- --nextPart2362348.uCLvzsYlJ3--