sched: replace up_cpu_index with this_cpu

Make this_cpu is arch independent and up_cpu_index do that.
In AMP mode, up_cpu_index() may return the index of the physical core.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2024-11-26 20:39:39 +08:00 committed by Xiang Xiao
parent 925573da2a
commit ef313755e7
2 changed files with 3 additions and 3 deletions

View file

@ -305,7 +305,7 @@ void up_disable_irq(int irq)
#ifdef CONFIG_SMP
if (irq >= RP23XX_IRQ_EXTINT && irq != RP23XX_SIO_IRQ_FIFO &&
up_cpu_index() != 0)
this_cpu() != 0)
{
/* Must be handled by Core 0 */
@ -361,7 +361,7 @@ void up_enable_irq(int irq)
#ifdef CONFIG_SMP
if (irq >= RP23XX_IRQ_EXTINT && irq != RP23XX_SIO_IRQ_FIFO &&
up_cpu_index() != 0)
this_cpu() != 0)
{
/* Must be handled by Core 0 */

View file

@ -440,7 +440,7 @@ static inline void up_idtinit(void)
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
static inline void x86_64_color_intstack(void)
{
x86_64_stack_color((void *)up_get_intstackbase(up_cpu_index()),
x86_64_stack_color((void *)up_get_intstackbase(this_cpu()),
IRQ_STACK_SIZE);
}
#else