From owner-freebsd-arch@FreeBSD.ORG Fri Feb 27 16:40:52 2009 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 1FC52106566B for ; Fri, 27 Feb 2009 16:40:52 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id D715E8FC14 for ; Fri, 27 Feb 2009 16:40:51 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id n1RGegbV069404; Fri, 27 Feb 2009 10:40:42 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Fri, 27 Feb 2009 10:40:30 -0600 (CST) From: "Sean C. Farley" To: Ed Schouten In-Reply-To: <20090227131155.GE19161@hoeg.nl> Message-ID: References: <20090227131155.GE19161@hoeg.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: FreeBSD Arch Subject: Re: Making LLVM happy: memmove() in the kernel 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, 27 Feb 2009 16:40:52 -0000 On Fri, 27 Feb 2009, Ed Schouten wrote: > Hi all, > > The FreeBSD+LLVM folks* noticed Clang generates calls to memmove() by > itself. I have yet to confirm this, but I assume this is done when > performing copies of structs greater than a certain size. In our > kernel, we don't have a memmove() function, but we do have a bcopy(). > > Because memmove() must be a function in this case (not a simple > macro), Roman and I agreed that adding a memmove() to libkern would be > the best thing to do for now, simply by calling bcopy(). ARM already > has a memmove() in support.S, so we don't need it there. > > So my question is: what is your folks opinion on this patch? > > http://80386.nl/pub/memmove.diff > > It would be lovely if we could integrate this patch (or a similar > one), because this will allow us to build kernels with Clang out of > the box. Does bcopy() in the kernel allow for overlapping strings? Sean -- scf@FreeBSD.org