svn commit: r254882 - head/sys/dev/pci

Jean-Sébastien Pédron dumbbell at FreeBSD.org
Thu Aug 29 10:10:28 UTC 2013


On 26.08.2013 16:55, John Baldwin wrote:
> On Sunday, August 25, 2013 2:09:12 pm Jean-Sebastien Pedron wrote:
>> Author: dumbbell
>> Date: Sun Aug 25 18:09:11 2013
>> New Revision: 254882
>> URL: http://svnweb.freebsd.org/changeset/base/254882
>>
>> Log:
>>   vga_pci: Add API to map the Video BIOS
> 
> This won't actually work (the PCI bus will panic when you do the duplicate 
> alloc).  Why not put this in the softc of the vga_pci device?  In fact, it is 
> already there.  You just need to bump the vr_refs on the vga_bios resource 
> similar to what vga_pci_alloc_resource() does.

Ok, so just calling vga_pci_alloc_resource() instead of
bus_alloc_resource_any() in vga_pci_map_bios() would be enough to fix
this first problem.

> Also, returning a void * for this API seems rather hacky.  Have you considered
> returning a struct resource * instead (and requiring the caller to use 
> bus_space_* on it)?  That would be more consistent with new-bus.

You're right.

> I can help with getting the right bus_alloc_resource() incantation to
> alloc a struct resource * for the shadow copy if so.

Yes please, I'd appreciate it :) I see that the function allocates
resources from the parent device, but I'm not sure what to do with this,
because the shadow copy is at a fixed physical address.

-- 
Jean-Sébastien Pédron

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20130829/c769e935/attachment.sig>


More information about the svn-src-head mailing list