arm_gicv2.c: fix armv7a compile error

/vela/nuttx/drivers/pci/pci_ecam.c:432:(.text.pci_ecam_get_irq+0x16): undefined reference to `up_get_legacy_irq'

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
This commit is contained in:
Yongrong Wang 2024-08-15 15:32:17 +08:00 committed by Xiang Xiao
parent 30be81add6
commit fa6d41471f
2 changed files with 25 additions and 23 deletions

View File

@ -30,6 +30,7 @@
#include <errno.h>
#include <nuttx/arch.h>
#include <nuttx/pci/pci.h>
#include <nuttx/spinlock.h>
#include <arch/irq.h>
@ -773,4 +774,28 @@ void up_send_smp_call(cpu_set_t cpuset)
up_trigger_irq(GIC_SMP_CPUCALL, cpuset);
}
#endif
/****************************************************************************
* Name: up_get_legacy_irq
*
* Description:
* Reserve vector for legacy
*
****************************************************************************/
int up_get_legacy_irq(uint32_t devfn, uint8_t line, uint8_t pin)
{
#if CONFIG_ARMV7A_GICV2_LEGACY_IRQ0 >= 0
uint8_t slot;
uint8_t tmp;
UNUSED(line);
slot = PCI_SLOT(devfn);
tmp = (pin - 1 + slot) % 4;
return CONFIG_ARMV7A_GICV2_LEGACY_IRQ0 + tmp;
#else
return -ENOTSUP;
#endif
}
#endif /* CONFIG_ARMV7A_HAVE_GICv2 */

View File

@ -137,26 +137,3 @@ int up_connect_irq(int *irq, int num,
*mdr = *irq;
return 0;
}
/****************************************************************************
* Name: up_get_legacy_irq
*
* Description:
* Reserve vector for legacy
*
****************************************************************************/
int up_get_legacy_irq(uint32_t devfn, uint8_t line, uint8_t pin)
{
#if CONFIG_ARMV7A_GICV2_LEGACY_IRQ0 >= 0
uint8_t slot;
uint8_t tmp;
UNUSED(line);
slot = PCI_SLOT(devfn);
tmp = (pin - 1 + slot) % 4;
return CONFIG_ARMV7A_GICV2_LEGACY_IRQ0 + tmp;
#else
return -ENOTSUP;
#endif
}