From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Re: hdsp on big-endian Date: Wed, 22 May 2002 15:47:17 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <20020522132801.E18131E7CC@Cantor.suse.de> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20020522132801.E18131E7CC@Cantor.suse.de> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Paul Davis Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 22 May 2002 09:29:57 -0400, Paul Davis wrote: > > >> >anyway... after looking at the hdsp code again, i found that these > >> >endian conversions are not necessary at all! > >> >IIRC, readX/writeX already convert the endianess in itself. thus, the > >> > >> absolutely not. readl/writel on most architectures translate to: > >> > >> *addr = val; > >> > > > >really? for example, ppc uses in_le32() for readl(), which implies > >byte swapping. > > what does CONFIG_APUS do? thats the conditional on which in_le32 is > used or not. AFAIK, readl is not supposed to have > endian-characteristics, but if true, that would make the non-APUS ppc > version totally wrong. CONFIG_APUS is for amiga. it's not set usually. i have no idea about APUS, but it looks like the BE interface. basically PCI bus is accessed as LE. that's why in_le32 is used there. we can access to io without considration of endianess as long as using readX/writeX. (for direct access, you can use __raw_readX() macros.) > on x86: > > #define __io_virt(x) ((void *)(x)) > #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) > #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) yep, on LE architectures, no conversion is necessary. Takashi _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm