qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] Always swap endianness in DBDMA


From: Aurelien Jarno
Subject: Re: [Qemu-devel] Re: [PATCH] Always swap endianness in DBDMA
Date: Thu, 24 Dec 2009 01:08:15 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Dec 24, 2009 at 12:39:36AM +0100, Laurent Vivier wrote:
> Le mercredi 23 décembre 2009 à 10:55 +0000, Paul Brook a écrit :
> > > The problem is that the whole define is just plain wrong which tells me
> > > that the code is using the bswap functions incorrectly. This really
> > > needs to be fixed by someone who knows the dbdma device. I don't see how
> > > calling incorrect calls even more incorrect makes any difference.
> > 
> > The real problem is that devices shouldn't be doing byteswapping at all. 
> > This 
> > should be determined by the (currently non-existant) bus layers and 
> > implemented in generic code before the device callback.
> > 
> > The current code[1] is a nasty hack that sort-of works for most of the 
> > current 
> > machines because all devices happen to be connected the same way.  However 
> > there are other machines (e.g. ixp4xx) some peripherals are connected 
> > natively, whereas others are cross-wired.
> > 
> > On a related note, I'm not sure what the author of mac_bdbma.c was 
> > smoking[2]. 
> 
> I didn't smoke... just need some sleep.
> 
> > It appears to keep register values in big-endian form for no good reason. 
> > Much 
> > easier would be to store them in native form, and just do the byteswapping 
> > when accessed by the CPU.
> > 

I have just posted a patch that does that, and also simulate the bus is
connected backward, using the same trick as in other devices. Alexander,
could you please try if it works for you on a big endian host?

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]