From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 11 08:53:05 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92C9816A4E1 for ; Tue, 11 Jul 2006 08:53:05 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8C4C43D45 for ; Tue, 11 Jul 2006 08:53:03 +0000 (GMT) (envelope-from delphij@delphij.net) Received: from localhost (tarsier.geekcn.org [210.51.165.229]) by tarsier.geekcn.org (Postfix) with ESMTP id 32709EB2357; Tue, 11 Jul 2006 16:52:56 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([210.51.165.229]) by localhost (mail.geekcn.org [210.51.165.229]) (amavisd-new, port 10024) with ESMTP id K1IzR0Qp6+Yn; Tue, 11 Jul 2006 16:52:53 +0800 (CST) Received: from [10.217.12.96] (sina152-194.staff.sina.com.cn [61.135.152.194]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id 9E32CEB231B; Tue, 11 Jul 2006 16:52:50 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=subject:from:to:cc:in-reply-to:references:content-type: organization:date:message-id:mime-version:x-mailer; b=Mf/QpqtXMqqmqIgHD8hkR8r6bwnN8lkFexmVEr0jI7Cf6jDVXI5IO6g8mp3T5i5e1 KHalurGqndD8mzbrFEAFQ== From: Xin LI To: mag@intron.ac In-Reply-To: References: <200607092136.k69LaNDX055391@www.freebsd.org> <84dead720607092015q7f1701abse143f3855c2aa95a@mail.gmail.com> <1152540567.99616@origin.intron.ac> <44B2AE69.4080703@elischer.org> <44B2D2DF.2000401@sh.cvut.cz> <86sll8zl9x.fsf@xps.des.no> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-g2jNqYSpUv7auB1C2Vor" Organization: The FreeBSD Project Date: Tue, 11 Jul 2006 16:51:48 +0800 Message-Id: <1152607908.980.8.camel@spirit> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 FreeBSD GNOME Team Port X-Mailman-Approved-At: Tue, 11 Jul 2006 11:22:17 +0000 Cc: des@des.no, Julian Elischer , freebsd-hackers@freebsd.org Subject: Re: kern/99979: Get Ready for Kernel Module in C++ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2006 08:53:05 -0000 --=-g2jNqYSpUv7auB1C2Vor Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E5=9C=A8 2006-07-11=E4=BA=8C=E7=9A=84 16:13 +0800=EF=BC=8Cmag@intron.ac=E5= =86=99=E9=81=93=EF=BC=9A [...] > I agree with you. Firstly, we may keep up with OpenDarwin, just as > what's on >=20 > http://developer.apple.com/documentation/DeviceDrivers/Conceptual/IOKitFu= ndamentals/Features/chapter_2_section_6.html=20 >=20 > At the same time, we may port/rewrite C++ support library for GNU CC or > Intel C++ Compiler step by step as we really need. >=20 > But prior to long-term discussion, please commit my 4 patches > firstly. They are nearly CPP-independent and do no harm to current > FreeBSD kernel. No. These patches are incomplete, see below. > --- kern.mk.orig Fri Jun 30 05:15:25 2006 > +++ kern.mk Mon Jul 10 18:42:43 2006 > @@ -88,7 +88,7 @@ > .if ${CC} =3D=3D "icc" > CFLAGS+=3D -nolib_inline > .else > -CFLAGS+=3D -ffreestanding > +CFLAGS+=3D -fno-builtin > .endif > =20 > .if ${CC} =3D=3D "icc" It is wrong to remove -ffreestanding here, at least for now. > --- libkern.h.orig Fri Oct 7 03:06:07 2005 > +++ libkern.h Mon Jul 10 18:50:23 2006 > @@ -115,7 +115,7 @@ > static __inline uint32_t > crc32_raw(const void *buf, size_t size, uint32_t crc) > { > - const uint8_t *p =3D buf; > + const uint8_t *p =3D (const uint8_t *) buf; > =20 > while (size--) > crc =3D crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); This change hides an API problem here. We really should be more careful here. > --- systm.h.orig Mon Jul 10 05:42:58 2006 > +++ systm.h Mon Jul 10 18:44:01 2006 > @@ -203,7 +203,7 @@ > int suword16(void *base, int word); > int suword32(void *base, int32_t word); > int suword64(void *base, int64_t word); > -intptr_t casuptr(intptr_t *p, intptr_t old, intptr_t new); > +intptr_t casuptr(intptr_t *p, intptr_t old, intptr_t __new__); > =20 > void realitexpire(void *); __ is typically reserved for compilers. How can you assume that __new__ does not stand for a constructor in some compliers? Also the change would break the code consistency, and it is incomplete. I have take some time to investigate the kernel code and there are multiple instances of "new" as an identifier across the kernel source, and changing it here and leave others alone does not make the code better, IMHO. So, I think we should move the discussion to -arch@ and no change should be made until we have worked out a right way. Cheers, --=20 Xin LI http://www.delphij.net/ --=-g2jNqYSpUv7auB1C2Vor Content-Type: application/pgp-signature; name=signature.asc Content-Description: =?UTF-8?Q?=E8=BF=99=E6=98=AF=E4=BF=A1=E4=BB=B6=E7=9A=84=E6=95=B0?= =?UTF-8?Q?=E5=AD=97=E7=AD=BE=E5=90=8D=E9=83=A8=E5=88=86?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQBEs2akhcUczkLqiksRAi9uAKDRyY+GVELhYdtzNLgn5btHeZdQpACfd2/O EfrXE4AUfdGPzX0Xpx6NMHs= =r/1F -----END PGP SIGNATURE----- --=-g2jNqYSpUv7auB1C2Vor--