Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932189AbWAJRtx (ORCPT ); Tue, 10 Jan 2006 12:49:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932312AbWAJRtx (ORCPT ); Tue, 10 Jan 2006 12:49:53 -0500 Received: from mx.pathscale.com ([64.160.42.68]:54686 "EHLO mx.pathscale.com") by vger.kernel.org with ESMTP id S932292AbWAJRtv (ORCPT ); Tue, 10 Jan 2006 12:49:51 -0500 Subject: Re: [PATCH 1 of 3] Introduce __raw_memcpy_toio32 From: "Bryan O'Sullivan" To: Christoph Hellwig Cc: Roland Dreier , sam@ravnborg.org, Andrew Morton , linux-kernel@vger.kernel.org In-Reply-To: <20060110170722.GA3187@infradead.org> References: <20060110011844.7a4a1f90.akpm@osdl.org> <1136909276.32183.28.camel@serpentine.pathscale.com> <20060110170722.GA3187@infradead.org> Content-Type: text/plain Organization: PathScale, Inc. Date: Tue, 10 Jan 2006 09:49:46 -0800 Message-Id: <1136915386.6294.8.camel@serpentine.pathscale.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2835 Lines: 91 On Tue, 2006-01-10 at 17:07 +0000, Christoph Hellwig wrote: > Or add a CONFIG_GENERIC_MEMCPY_IO that's non-uservisible and just set > by all the architectures that don't provide their own version. Here's another i386-only review patch that does essentially that. It looks cleaner to me than my previous patch from this morning. (Copyrights and other arches omitted, for clarity.) What do you think? +#include +#include + +void __raw_memcpy_toio32(void __iomem *to, const void *from, size_t count) +{ + u32 __iomem *dst = to; + const u32 *src = from; + size_t i; + + for (i = 0; i < count; i++) + __raw_writel(*src++, dst++); +} --- a/include/asm-i386/io.h Tue Jan 10 09:32:58 2006 -0800 +++ b/include/asm-i386/io.h Tue Jan 10 09:35:16 2006 -0800 @@ -203,6 +203,8 @@ { __memcpy((void __force *) dst, src, count); } + +#include /* * ISA space is 'always mapped' on a typical x86 system, no need to --- a/arch/i386/Kconfig Tue Jan 10 09:32:58 2006 -0800 +++ b/arch/i386/Kconfig Tue Jan 10 09:35:16 2006 -0800 @@ -34,6 +34,10 @@ default y config GENERIC_IOMAP + bool + default y + +config GENERIC_RAW_MEMCPY_IO bool default y - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/