Skip to content

Commit

Permalink
arch: Rename g_cpu_intstack_top to g_intstacktop
Browse files Browse the repository at this point in the history
and g_intstack_alloc to g_intstackalloc for naming consistency.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 committed Apr 6, 2024
1 parent 6334760 commit 579e973
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 45 deletions.
20 changes: 10 additions & 10 deletions arch/arm/src/cxd56xx/cxd56_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,23 @@ extern void up_send_irqreq(int idx, int irq, int cpu);
* These definitions provide the aligned stack allocations.
*/

static uint64_t g_intstack_alloc[INTSTACK_ALLOC >> 3];
static uint64_t g_intstackalloc[INTSTACK_ALLOC >> 3];

/* These definitions provide the "top" of the push-down stacks. */

const uint32_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
const uint32_t g_intstacktop[CONFIG_SMP_NCPUS] =
{
(uint32_t)g_intstack_alloc + INTSTACK_SIZE,
(uint32_t)g_intstackalloc + INTSTACK_SIZE,
#if CONFIG_SMP_NCPUS > 1
(uint32_t)g_intstack_alloc + (2 * INTSTACK_SIZE),
(uint32_t)g_intstackalloc + (2 * INTSTACK_SIZE),
#if CONFIG_SMP_NCPUS > 2
(uint32_t)g_intstack_alloc + (3 * INTSTACK_SIZE),
(uint32_t)g_intstackalloc + (3 * INTSTACK_SIZE),
#if CONFIG_SMP_NCPUS > 3
(uint32_t)g_intstack_alloc + (4 * INTSTACK_SIZE),
(uint32_t)g_intstackalloc + (4 * INTSTACK_SIZE),
#if CONFIG_SMP_NCPUS > 4
(uint32_t)g_intstack_alloc + (5 * INTSTACK_SIZE),
(uint32_t)g_intstackalloc + (5 * INTSTACK_SIZE),
#if CONFIG_SMP_NCPUS > 5
(uint32_t)g_intstack_alloc + (6 * INTSTACK_SIZE),
(uint32_t)g_intstackalloc + (6 * INTSTACK_SIZE),
#endif /* CONFIG_SMP_NCPUS > 5 */
#endif /* CONFIG_SMP_NCPUS > 4 */
#endif /* CONFIG_SMP_NCPUS > 3 */
Expand Down Expand Up @@ -584,7 +584,7 @@ int up_prioritize_irq(int irq, int priority)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(int cpu)
{
return g_cpu_intstack_top[cpu];
return g_intstacktop[cpu];
}
#endif

Expand All @@ -600,6 +600,6 @@ uintptr_t arm_intstack_top(int cpu)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
return g_intstacktop[cpu] - INTSTACK_SIZE;
}
#endif
12 changes: 6 additions & 6 deletions arch/arm/src/lc823450/lc823450_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@
* These definitions provide the aligned stack allocations.
*/

uint64_t g_intstack_alloc[INTSTACK_ALLOC >> 3];
uint64_t g_intstackalloc[INTSTACK_ALLOC >> 3];

/* These definitions provide the "top" of the push-down stacks. */

const uint32_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
const uint32_t g_intstacktop[CONFIG_SMP_NCPUS] =
{
(uint32_t)g_intstack_alloc + INTSTACK_SIZE,
(uint32_t)g_intstackalloc + INTSTACK_SIZE,
#if CONFIG_SMP_NCPUS > 1
(uint32_t)g_intstack_alloc + (2 * INTSTACK_SIZE),
(uint32_t)g_intstackalloc + (2 * INTSTACK_SIZE),
#endif /* CONFIG_SMP_NCPUS > 1 */
};
#endif
Expand Down Expand Up @@ -831,7 +831,7 @@ int lc823450_irq_register(int irq, struct lc823450_irq_ops *ops)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(int cpu)
{
return g_cpu_intstack_top[cpu];
return g_intstacktop[cpu];
}
#endif

Expand All @@ -847,6 +847,6 @@ uintptr_t arm_intstack_top(int cpu)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
return g_intstacktop[cpu] - INTSTACK_SIZE;
}
#endif
12 changes: 6 additions & 6 deletions arch/arm/src/rp2040/rp2040_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ extern void rp2040_send_irqreq(int irqreq);
* These definitions provide the aligned stack allocations.
*/

static uint64_t g_intstack_alloc[INTSTACK_ALLOC >> 3];
static uint64_t g_intstackalloc[INTSTACK_ALLOC >> 3];

/* These definitions provide the "top" of the push-down stacks. */

const uint32_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
const uint32_t g_intstacktop[CONFIG_SMP_NCPUS] =
{
(uint32_t)g_intstack_alloc + INTSTACK_SIZE,
(uint32_t)g_intstackalloc + INTSTACK_SIZE,
#if CONFIG_SMP_NCPUS > 1
(uint32_t)g_intstack_alloc + (2 * INTSTACK_SIZE),
(uint32_t)g_intstackalloc + (2 * INTSTACK_SIZE),
#endif /* CONFIG_SMP_NCPUS > 1 */
};
#endif /* defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7 */
Expand Down Expand Up @@ -449,7 +449,7 @@ int up_prioritize_irq(int irq, int priority)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(int cpu)
{
return g_cpu_intstack_top[cpu];
return g_intstacktop[cpu];
}
#endif

Expand All @@ -465,6 +465,6 @@ uintptr_t arm_intstack_top(int cpu)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
return g_intstacktop[cpu] - INTSTACK_SIZE;
}
#endif
20 changes: 10 additions & 10 deletions arch/sparc/src/s698pm/s698pm-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ static volatile uint8_t g_irqmap[NR_IRQS];
* These definitions provide the aligned stack allocations.
*/

static uint64_t g_intstack_alloc[INTSTACK_ALLOC >> 3];
static uint64_t g_intstackalloc[INTSTACK_ALLOC >> 3];

/* These definitions provide the "top" of the push-down stacks. */

uintptr_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
uintptr_t g_intstacktop[CONFIG_SMP_NCPUS] =
{
(uintptr_t)g_intstack_alloc + INTSTACK_SIZE,
(uintptr_t)g_intstackalloc + INTSTACK_SIZE,
#if defined(CONFIG_SMP)

#if CONFIG_SMP_NCPUS > 1
(uintptr_t)g_intstack_alloc + (2 * INTSTACK_SIZE),
(uintptr_t)g_intstackalloc + (2 * INTSTACK_SIZE),
#if CONFIG_SMP_NCPUS > 2
(uintptr_t)g_intstack_alloc + (3 * INTSTACK_SIZE),
(uintptr_t)g_intstackalloc + (3 * INTSTACK_SIZE),
#if CONFIG_SMP_NCPUS > 3
(uintptr_t)g_intstack_alloc + (4 * INTSTACK_SIZE),
(uintptr_t)g_intstackalloc + (4 * INTSTACK_SIZE),
#endif /* CONFIG_SMP_NCPUS > 3 */
#endif /* CONFIG_SMP_NCPUS > 2 */
#endif /* CONFIG_SMP_NCPUS > 1 */
Expand Down Expand Up @@ -511,9 +511,9 @@ int up_prioritize_irq(int irq, int priority)
uintptr_t sparc_intstack_top(int cpu)
{
#if defined(CONFIG_SMP)
return g_cpu_intstack_top[cpu];
return g_intstacktop[cpu];
#else
return g_cpu_intstack_top[0];
return g_intstacktop[0];
#endif
}
#endif
Expand All @@ -531,9 +531,9 @@ uintptr_t sparc_intstack_top(int cpu)
uintptr_t sparc_intstack_alloc(int cpu)
{
#if defined(CONFIG_SMP)
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
return g_intstacktop[cpu] - INTSTACK_SIZE;
#else
return g_cpu_intstack_top[0] - INTSTACK_SIZE;
return g_intstacktop[0] - INTSTACK_SIZE;
#endif
}
#endif
6 changes: 3 additions & 3 deletions arch/sparc/src/s698pm/s698pm_exceptions.S
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

.global _ISR_Handler
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
.global g_cpu_intstack_top
.global g_intstacktop
#endif /* CONFIG_SMP && CONFIG_ARCH_INTERRUPTSTACK > 7 */
.global sparc_doirq /* Dispatch an IRQ */
.align 8
Expand Down Expand Up @@ -173,8 +173,8 @@ save_isf:
mov %g0, %g5 ! CPU ID = 0
#endif
sll %g5, 2 , %g5 ! %g5 = CPUID * 4
set g_cpu_intstack_top, %g4 ! %g4 = Array of stack pointers
add %g4, %g5, %g4 ! %g4 = g_cpu_intstack_top + CPUID * 4
set g_intstacktop, %g4 ! %g4 = Array of stack pointers
add %g4, %g5, %g4 ! %g4 = g_intstacktop + CPUID * 4
ld [%g4], %g5 ! restore %sp
sub %g5, CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE, %sp

Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/src/esp32/chip_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
#ifdef __ASSEMBLY__

#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
.global g_cpu_intstack_top
.global g_intstacktop
#endif /* CONFIG_SMP && CONFIG_ARCH_INTERRUPTSTACK > 15 */

#endif /* __ASSEMBLY__ */
Expand Down Expand Up @@ -121,7 +121,7 @@
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
.macro setintstack tmp1 tmp2
getcoreid \tmp1 /* tmp1 = Core ID (0 or 1) */
movi \tmp2, g_cpu_intstack_top /* tmp2 = Array of stack pointers */
movi \tmp2, g_intstacktop /* tmp2 = Array of stack pointers */
addx4 \tmp2, \tmp1, \tmp2 /* tmp2 = tmp2 + (tmp1 << 2) */
l32i a1, \tmp2, 0 /* a1 = *tmp2 */
.endm
Expand Down
6 changes: 3 additions & 3 deletions arch/xtensa/src/esp32/esp32_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static uint32_t g_intstackalloc[INTSTACK_ALLOC >> 2];

/* These definitions provide the "top" of the push-down stacks. */

uintptr_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
uintptr_t g_intstacktop[CONFIG_SMP_NCPUS] =
{
(uintptr_t)g_intstackalloc + INTSTACK_SIZE,
#if CONFIG_SMP_NCPUS > 1
Expand Down Expand Up @@ -751,7 +751,7 @@ void up_enable_irq(int irq)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
uintptr_t xtensa_intstack_top(int cpu)
{
return g_cpu_intstack_top[cpu];
return g_intstacktop[cpu];
}

/****************************************************************************
Expand All @@ -765,7 +765,7 @@ uintptr_t xtensa_intstack_top(int cpu)

uintptr_t xtensa_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
return g_intstacktop[cpu] - INTSTACK_SIZE;
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/src/esp32s3/chip_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#ifdef __ASSEMBLY__

#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
.global g_cpu_intstack_top
.global g_intstacktop
#endif /* CONFIG_SMP && CONFIG_ARCH_INTERRUPTSTACK > 15 */

#endif /* __ASSEMBLY__ */
Expand Down Expand Up @@ -105,7 +105,7 @@
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
.macro setintstack tmp1 tmp2
getcoreid \tmp1 /* tmp1 = Core ID (0 or 1) */
movi \tmp2, g_cpu_intstack_top /* tmp2 = Array of stack pointers */
movi \tmp2, g_intstacktop /* tmp2 = Array of stack pointers */
addx4 \tmp2, \tmp1, \tmp2 /* tmp2 = tmp2 + (tmp1 << 2) */
l32i a1, \tmp2, 0 /* a1 = *tmp2 */
.endm
Expand Down
6 changes: 3 additions & 3 deletions arch/xtensa/src/esp32s3/esp32s3_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static uint32_t g_intstackalloc[INTSTACK_ALLOC >> 2];

/* These definitions provide the "top" of the push-down stacks. */

uintptr_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
uintptr_t g_intstacktop[CONFIG_SMP_NCPUS] =
{
(uintptr_t)g_intstackalloc + INTSTACK_SIZE,
#if CONFIG_SMP_NCPUS > 1
Expand Down Expand Up @@ -698,7 +698,7 @@ void up_enable_irq(int irq)
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
uintptr_t xtensa_intstack_top(int cpu)
{
return g_cpu_intstack_top[cpu];
return g_intstacktop[cpu];
}

/****************************************************************************
Expand All @@ -712,7 +712,7 @@ uintptr_t xtensa_intstack_top(int cpu)

uintptr_t xtensa_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
return g_intstacktop[cpu] - INTSTACK_SIZE;
}
#endif

Expand Down

0 comments on commit 579e973

Please sign in to comment.