FreeBSD/sys/dev/pci/pci.c
/*
 * Support for MSI message signalled interrupts.
 */
Support for MSI message signalled interrupts.
Support for MSI message signalled interrupts .
void
pci_enable_msi_method(device_t dev, device_t child, uint64_t address,
    uint16_t data)
{
	struct pci_devinfo *dinfo = device_get_ivars(child);
	struct pcicfg_msi *msi = &dinfo->cfg.msi;
	pci_write_config(child, msi->msi_location + PCIR_MSI_ADDR,
	    address & 0xffffffff, 4);
	if (msi->msi_ctrl & PCIM_MSICTRL_64BIT) {
		pci_write_config(child, msi->msi_location + PCIR_MSI_ADDR_HIGH,
		    address >> 32, 4);
		pci_write_config(child, msi->msi_location + PCIR_MSI_DATA_64BIT,
		    data, 2);
	} else
		pci_write_config(child, msi->msi_location + PCIR_MSI_DATA, data,
		    2);
	msi->msi_ctrl |= PCIM_MSICTRL_MSI_ENABLE;
	pci_write_config(child, msi->msi_location + PCIR_MSI_CTRL,
	    msi->msi_ctrl, 2);
	pci_ht_map_msi(child, address);
}
void pci_enable_msi_method ( device_t dev , device_t child , uint64_t address , uint16_t data ) { struct pci_devinfo * dinfo = device_get_ivars ( child ) ; struct pcicfg_msi * msi = & dinfo -> cfg . msi ; pci_write_config ( child , msi -> msi_location + PCIR_MSI_ADDR , address & 0xffffffff , 4 ) ; if ( msi -> msi_ctrl & PCIM_MSICTRL_64BIT ) { pci_write_config ( child , msi -> msi_location + PCIR_MSI_ADDR_HIGH , address >> 32 , 4 ) ; pci_write_config ( child , msi -> msi_location + PCIR_MSI_DATA_64BIT , data , 2 ) ; } else pci_write_config ( child , msi -> msi_location + PCIR_MSI_DATA , data , 2 ) ; msi -> msi_ctrl |= PCIM_MSICTRL_MSI_ENABLE ; pci_write_config ( child , msi -> msi_location + PCIR_MSI_CTRL , msi -> msi_ctrl , 2 ) ; pci_ht_map_msi ( child , address ) ; }
Support for MSI message signalled interrupts.
Support for MSI message signalled interrupts .
/* Write data and address values. */ /* Enable MSI in the control register. */ /* Enable MSI -> HT mapping. */