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
signature.asc
Description: OpenPGP digital signature