qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [patch 1/2] add pci config space struct


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [patch 1/2] add pci config space struct
Date: Wed, 27 Aug 2008 15:17:19 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Paul Brook wrote:
> On Tuesday 26 August 2008, Gerd Hoffmann wrote:
>>   Hi,
>>
>> This patch adds a struct for the pci config header make it easier to
>> deal with it.  Comes from qemu-xen.
> 
> Adding a nice easy-to-use structure, then requiring all devices do 
> byteswapping themselves (negating most of the easy-to-use benefit) seems less 
> than ideal.

Byteswapping must be done anyway, with or without the struct.  Using the
struct allows to avoid casting all over the place though.  I'll go
switch over the config header struct to use the byteswapped types, then
repost together with some pci.c functions changed to use the new struct.
 IMHO it makes the code more readable due to hardcoded magic numbers and
casts going away.

cheers,
  Gerd





reply via email to

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