12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PCI (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> PCI (9)The argument tag is the PCI tag for the current device attached to PCI chipset pc.pci_mapreg_map(pa , reg , type , busflags , tagp , handlep , basep , sizep)Maps the register windows for the device into kernel virtual address space. This function is generallyonly called during the driver attach step and takes a pointer to the struct pci_attach_args inpa. The physical address of the mapping is in the Base Address Register (BAR) in configurationspace specified by reg. Valid values for the type of mapping type are:PCI_MAPREG_TYPE_IOThe mapping should be to I/O address space.PCI_MAPREG_TYPE_MEMThe mapping should be to memory address space.PCI_MAPREG_TYPE_ROMThe mapping is to access ROM. This type of mapping is only permitted when thevalue for reg is PCI_MAPREG_ROM.The argument busflags are bus-space flags passed to bus_space_map() to perform themapping (see bus_space(9)). The bus-space tag and handle for the mapped register windoware returned in tagp and handlep respectively. The bus-address and size of the mapping arereturned in basep and sizep respectively. Ifany of tagp, handlep, basep, or sizep areNULL then pci_mapreg_map() does not define their return value. This function returns zeroon success and non-zero on error.pci_mapreg_info(pc , tag , reg , type , basep , sizep , flagsp)Performs the same operations as pci_mapreg_map() but doesn’t actually map the registerwindow into kernel virtual address space. Returns the bus-address, size and bus flags in basep,sizep and flagsp respectively. These return values can be used by bus_space_map() toactually map the register window into kernel virtual address space. This function is useful forsetting up the registers in configuration space and deferring the mapping to a later time, such asin a bus-independent attachment routine. pci_mapreg_info returns zero on success and nonzeroon failure.pci_find_rom(pa , bst , bsh , code , handlep , sizep)Locates a suitable ROM image within a PCI expansion ROM previously mapped withpci_mapreg_map() and creates a subregion for it with bus_space_subregion(). Thebst and bsh arguments are the bus tag and handle obtained with the prior call topci_mapreg_map(). Valid values for the image type code are:PCI_ROM_CODE_TYPE_X86Find a ROM image containing i386 executable code for use by PC BIOS.PCI_ROM_CODE_TYPE_OFWFind a ROM image containing Forth code for use by Open Firmware.PCI_ROM_CODE_TYPE_HPPAFind a ROM image containing HP PA/RISC executable code.The created subregion will cover the entire selected ROM image, including header data. Thehandle to this subregion is returned in handlep. The size of the image (and the correspondingsubregion) is returned in sizep. This function can only be used with expansion ROMs locatedat the PCI_MAPREG_ROM base address register (BAR).pci_intr_map(pa , ih)See pci_intr(9).<strong>NetBSD</strong> 3.0 June 17, 2006 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!