qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks
Date: Tue, 26 Oct 2010 10:05:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.4

 On 10/25/2010 08:38 PM, Blue Swirl wrote:
>
>  I don't really see why we need registration; cpu_register_io() takes
>  function pointers, a size, and an opaque, and gives an integer handle in
>  return.  With the IOPort object approach, you set up the IOPort with
>  function pointers, size is implied, and the opaque is derived using
>  container_of(); the handle is simply the address of the object.

With the handle, we can separate setting up the structures at device
level, and mapping the object using only the handle at bus or other
higher level. Can this be done with the object approach?

I believe so.  The handle is simply an indirect pointer, no?

The purpose of that patch series was to perform the separation for PCI
BARs. I wasn't so happy with the series, so I never pushed.

In fact I think an IOPort is even more suitable; if we need additional attributes we can use a derived object:

struct PCIIOPort {
    IOPort ioport;
    /* additional fields */
};



--
error compiling committee.c: too many arguments to function




reply via email to

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