[vbox-dev] PCI config read/write
robertzeljko at yahoo.com
Wed May 9 20:28:17 PDT 2007
Attached is the proposed patch to the PCI config read/write callback functions.
New API is called:
PDMDevHlpPCISetConfigCallbacks API which should be called right after
PDMDevHlpPCISetConfigCallbacks allows user version of read/write PCI config
callbacks to be inserted in place of default callbacks.
PDMDevHlpPCISetConfigCallbacks will optionally return old read/write PCI config
callbacks so user can decide how and when to call default implementations if he
desires to do so.
I've tried to preserve coding style and architecture as much as I
could/understood but I fairly new to the Virtual Box code base.
Let me know if I can be of any further assistance.
--- "Knut St. Osmundsen" <bird at innotek.de> wrote:
> Robert Zeljko wrote:
> > I was wondering if there is an interface which can be used to register
> > read/write functions for the PCI config space.
> > I'm adding a network device to the Virtual Box and need to trap all
> > to the PCI config space.
> > I've solved my problem by "hacking" VBox PCIDevice structure and exposing
> > PCIDEVICEINT structure which is embedded within. This way, after calling
> > PDMDevHlpPCIRegister, I change pfnConfigRead and pfnConfigWrite to point to
> > own handlers. I also had to store original pfnConfigWrite pointer and call
> > later from my write handler to keep everything in sync.
> > Again, I don't know if there is a way to do this without a hack, however,
> > feature is very important one for anyone who wishes to add a new device to
> > Virtual Box.
> Since we haven't yet needed this feature, there is no interface for it
> yet. So, it has to be added and the callback prototypes has to be
> exposed by VBox/pci.h. I'm not entirely sure what would makes the most
> sense here, to adding a pfnPCIRegisterEx or a pfnPCISetConfigCallbacks.
> Probably the latter since the former might be needed to deal with
> multiple pci device/functions per device. Anyway, I won't have time to
> implement this for a while, so a patche would be welcome.
> Kind Regards,
> vbox-dev mailing list
> vbox-dev at virtualbox.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3180 bytes
Url : http://www.virtualbox.org/pipermail/vbox-dev/attachments/20070509/1b22f9aa/attachment-0001.obj
More information about the vbox-dev