Skip to content

Commit

Permalink
arm_gicv2.c: fix armv7a compile error
Browse files Browse the repository at this point in the history
/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 <[email protected]>
  • Loading branch information
wyr-7 authored and xiaoxiang781216 committed Sep 28, 2024
1 parent 30be81a commit fa6d414
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
25 changes: 25 additions & 0 deletions arch/arm/src/armv7-a/arm_gicv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <errno.h>

#include <nuttx/arch.h>
#include <nuttx/pci/pci.h>
#include <nuttx/spinlock.h>
#include <arch/irq.h>

Expand Down Expand Up @@ -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 */
23 changes: 0 additions & 23 deletions arch/arm/src/armv7-a/arm_gicv2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit fa6d414

Please sign in to comment.