drivers/pcie: Extending parameters to pcie_msi_map

n_vector will be necessary for VT-D actually.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2021-03-23 14:33:37 +01:00 committed by Anas Nashif
commit 6ed593f861
3 changed files with 7 additions and 4 deletions

View file

@ -181,7 +181,8 @@ static bool get_vtd(void)
/* these functions are explained in include/drivers/pcie/msi.h */
uint32_t pcie_msi_map(unsigned int irq,
msi_vector_t *vector)
msi_vector_t *vector,
uint8_t n_vector)
{
ARG_UNUSED(irq);

View file

@ -204,7 +204,7 @@ static void enable_msix(pcie_bdf_t bdf,
int i;
for (i = 0; i < n_vector; i++) {
uint32_t map = pcie_msi_map(irq, &vectors[i]);
uint32_t map = pcie_msi_map(irq, &vectors[i], 1);
uint32_t mdr = pcie_msi_mdr(irq, &vectors[i]);
vectors[i].msix_vector->msg_addr = map;
@ -243,7 +243,7 @@ static void enable_msi(pcie_bdf_t bdf,
uint32_t mdr;
uint32_t mme;
map = pcie_msi_map(irq, vectors);
map = pcie_msi_map(irq, vectors, n_vector);
pcie_conf_write(bdf, base + PCIE_MSI_MAP0, map);
mdr = pcie_msi_mdr(irq, vectors);

View file

@ -78,10 +78,12 @@ extern bool pcie_msi_vector_connect(pcie_bdf_t bdf,
*
* @param irq The IRQ we wish to trigger via MSI.
* @param vector The vector for which you want the address (or NULL)
* @param n_vector the size of the vector array
* @return A (32-bit) value for the MSI MAP register.
*/
extern uint32_t pcie_msi_map(unsigned int irq,
msi_vector_t *vector);
msi_vector_t *vector,
uint8_t n_vector);
/**
* @brief Compute the data for an MSI posted write.