arch/esp32_cpuint.c: Simplify up_disable/enable_irq.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche 2021-08-03 14:13:15 +02:00 committed by Xiang Xiao
parent 4f2f2ef9fb
commit 238a96e7de

View File

@ -399,18 +399,11 @@ int esp32_cpuint_initialize(void)
void up_disable_irq(int cpuint)
{
#ifdef CONFIG_SMP
int cpu;
#endif
int cpu = up_cpu_index();
DEBUGASSERT(cpuint >= 0 && cpuint <= ESP32_CPUINT_MAX);
#ifdef CONFIG_SMP
cpu = up_cpu_index();
xtensa_disable_cpuint(&g_intenable[cpu], (1ul << cpuint));
#else
xtensa_disable_cpuint(&g_intenable[0], (1ul << cpuint));
#endif
}
/****************************************************************************
@ -423,18 +416,11 @@ void up_disable_irq(int cpuint)
void up_enable_irq(int cpuint)
{
#ifdef CONFIG_SMP
int cpu;
#endif
int cpu = up_cpu_index();
DEBUGASSERT(cpuint >= 0 && cpuint <= ESP32_CPUINT_MAX);
#ifdef CONFIG_SMP
cpu = up_cpu_index();
xtensa_enable_cpuint(&g_intenable[cpu], (1ul << cpuint));
#else
xtensa_enable_cpuint(&g_intenable[0], (1ul << cpuint));
#endif
}
/****************************************************************************