From 576ba17c841af62bb43726b5c4c1b0e926078915 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Wed, 20 Nov 2024 14:41:25 +0800 Subject: [PATCH 1/3] arm: remove up_set_current_regs/up_current_regs reason: up_set_current_regs initially had two functions: 1: To mark the entry into an interrupt state. 2: To record the context before an interrupt/exception. If we switch to a new task, we need to store the upcoming context regs by calling up_set_current_regs(regs). Currently, we record the context in other ways, so the second function is obsolete. Therefore, we need to rename up_set_current_regs to better reflect its actual meaning, which is solely to mark an interrupt. Signed-off-by: hujun5 --- arch/arm/include/irq.h | 14 +++---- arch/arm/include/tlsr82/irq.h | 2 + arch/arm/src/arm/arm_sigdeliver.c | 4 +- arch/arm/src/arm/arm_syscall.c | 39 ------------------ arch/arm/src/armv6-m/arm_sigdeliver.c | 5 ++- arch/arm/src/armv6-m/arm_svcall.c | 58 ++++++--------------------- arch/arm/src/armv7-a/arm_sigdeliver.c | 4 +- arch/arm/src/armv7-a/arm_syscall.c | 40 ------------------ arch/arm/src/armv7-m/arm_sigdeliver.c | 6 ++- arch/arm/src/armv7-m/arm_svcall.c | 58 ++++++--------------------- arch/arm/src/armv7-r/arm_sigdeliver.c | 4 +- arch/arm/src/armv7-r/arm_syscall.c | 39 ------------------ arch/arm/src/armv8-m/arm_sigdeliver.c | 5 ++- arch/arm/src/armv8-m/arm_svcall.c | 58 ++++++--------------------- arch/arm/src/armv8-r/arm_sigdeliver.c | 4 +- arch/arm/src/armv8-r/arm_syscall.c | 39 ------------------ arch/arm/src/common/arm_exit.c | 10 +---- arch/arm/src/common/arm_internal.h | 5 +-- arch/arm/src/tlsr82/Make.defs | 2 - 19 files changed, 71 insertions(+), 325 deletions(-) diff --git a/arch/arm/include/irq.h b/arch/arm/include/irq.h index d6fd08cdddb23..6f96b99511557 100644 --- a/arch/arm/include/irq.h +++ b/arch/arm/include/irq.h @@ -82,13 +82,13 @@ #ifndef __ASSEMBLY__ #ifndef up_switch_context -#define up_switch_context(tcb, rtcb) \ - do { \ - if (!up_interrupt_context()) \ - { \ - sys_call2(SYS_switch_context, (uintptr_t)&rtcb->xcp.regs, \ - (uintptr_t)tcb->xcp.regs); \ - } \ +#define up_switch_context(tcb, rtcb) \ + do { \ + if (!up_interrupt_context()) \ + { \ + sys_call0(SYS_switch_context); \ + } \ + UNUSED(rtcb); \ } while (0) #endif diff --git a/arch/arm/include/tlsr82/irq.h b/arch/arm/include/tlsr82/irq.h index 115f9f14b689d..529c5692aadd1 100644 --- a/arch/arm/include/tlsr82/irq.h +++ b/arch/arm/include/tlsr82/irq.h @@ -283,6 +283,8 @@ static inline_function void up_set_interrupt_context(bool flag) #endif } +#define arm_fullcontextrestore() tc32_fullcontextrestore(this_task()->xcp.regs) + #define up_switch_context(tcb, rtcb) \ do { \ if (!up_interrupt_context()) \ diff --git a/arch/arm/src/arm/arm_sigdeliver.c b/arch/arm/src/arm/arm_sigdeliver.c index b55e820604f65..a76152b535439 100644 --- a/arch/arm/src/arm/arm_sigdeliver.c +++ b/arch/arm/src/arm/arm_sigdeliver.c @@ -54,7 +54,6 @@ void arm_sigdeliver(void) { struct tcb_s *rtcb = this_task(); - uint32_t *regs = rtcb->xcp.saved_regs; board_autoled_on(LED_SIGNAL); @@ -99,5 +98,6 @@ void arm_sigdeliver(void) board_autoled_off(LED_SIGNAL); g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); } diff --git a/arch/arm/src/arm/arm_syscall.c b/arch/arm/src/arm/arm_syscall.c index 338c2216e6857..7443e27c1dfc8 100644 --- a/arch/arm/src/arm/arm_syscall.c +++ b/arch/arm/src/arm/arm_syscall.c @@ -79,46 +79,7 @@ uint32_t *arm_syscall(uint32_t *regs) switch (cmd) { - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/armv6-m/arm_sigdeliver.c b/arch/arm/src/armv6-m/arm_sigdeliver.c index fa6797351d086..5fd3f44463ba3 100644 --- a/arch/arm/src/armv6-m/arm_sigdeliver.c +++ b/arch/arm/src/armv6-m/arm_sigdeliver.c @@ -162,5 +162,8 @@ void arm_sigdeliver(void) leave_critical_section((uint16_t)regs[REG_PRIMASK]); rtcb->irqcount--; #endif - arm_fullcontextrestore(regs); + g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv6-m/arm_svcall.c b/arch/arm/src/armv6-m/arm_svcall.c index 2ae54ac4ec2bd..3ef29e4c4773a 100644 --- a/arch/arm/src/armv6-m/arm_svcall.c +++ b/arch/arm/src/armv6-m/arm_svcall.c @@ -117,9 +117,8 @@ static void dispatch_syscall(void) int arm_svcall(int irq, void *context, void *arg) { - struct tcb_s *tcb = this_task(); uint32_t *regs = (uint32_t *)context; - uint32_t *new_regs = regs; + struct tcb_s *tcb; uint32_t cmd; cmd = regs[REG_R0]; @@ -149,41 +148,15 @@ int arm_svcall(int irq, void *context, void *arg) switch (cmd) { - /* R0=SYS_restore_context: This a restore context command: - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - DEBUGASSERT(regs[REG_R1] != 0); - new_regs = (uint32_t *)regs[REG_R1]; - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - */ - case SYS_switch_context: { - DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - new_regs = (uint32_t *)regs[REG_R2]; + tcb = this_task(); + restore_critical_section(tcb, this_cpu()); + +#ifdef CONFIG_DEBUG_SYSCALL_INFO + regs = tcb->xcp.regs; +#endif } break; @@ -437,13 +410,11 @@ int arm_svcall(int irq, void *context, void *arg) * switch. */ - if (regs != new_regs) - { - restore_critical_section(tcb, this_cpu()); - #ifdef CONFIG_DEBUG_SYSCALL_INFO - regs = new_regs; - +# ifndef CONFIG_DEBUG_SVCALL + if (cmd > SYS_switch_context) +# endif + { svcinfo("SVCall Return:\n"); svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], @@ -453,14 +424,9 @@ int arm_svcall(int irq, void *context, void *arg) regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); -#endif - } -#ifdef CONFIG_DEBUG_SYSCALL_INFO - else - { - svcinfo("SVCall Return: %d\n", regs[REG_R0]); } #endif + UNUSED(tcb); return OK; } diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index 1867aa8844605..5c0e058a4e6af 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -162,5 +162,7 @@ void arm_sigdeliver(void) #endif g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index 3e43e961bfd83..f31e4031553ab 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -255,47 +255,7 @@ uint32_t *arm_syscall(uint32_t *regs) } break; #endif - - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/armv7-m/arm_sigdeliver.c b/arch/arm/src/armv7-m/arm_sigdeliver.c index 524f2c445b691..5642e82623e92 100644 --- a/arch/arm/src/armv7-m/arm_sigdeliver.c +++ b/arch/arm/src/armv7-m/arm_sigdeliver.c @@ -174,5 +174,9 @@ void arm_sigdeliver(void) #endif rtcb->irqcount--; #endif - arm_fullcontextrestore(regs); + + g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv7-m/arm_svcall.c b/arch/arm/src/armv7-m/arm_svcall.c index cd3a7e214a667..03e9a43abbb77 100644 --- a/arch/arm/src/armv7-m/arm_svcall.c +++ b/arch/arm/src/armv7-m/arm_svcall.c @@ -125,9 +125,8 @@ static void dispatch_syscall(void) int arm_svcall(int irq, void *context, void *arg) { - struct tcb_s *tcb = this_task(); uint32_t *regs = (uint32_t *)context; - uint32_t *new_regs = regs; + struct tcb_s *tcb; uint32_t cmd; cmd = regs[REG_R0]; @@ -157,41 +156,15 @@ int arm_svcall(int irq, void *context, void *arg) switch (cmd) { - /* R0=SYS_restore_context: This a restore context command: - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - DEBUGASSERT(regs[REG_R1] != 0); - new_regs = (uint32_t *)regs[REG_R1]; - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - */ - case SYS_switch_context: { - DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - new_regs = (uint32_t *)regs[REG_R2]; + tcb = this_task(); + restore_critical_section(tcb, this_cpu()); + +#ifdef CONFIG_DEBUG_SYSCALL_INFO + regs = tcb->xcp.regs; +#endif } break; @@ -446,13 +419,11 @@ int arm_svcall(int irq, void *context, void *arg) * switch. */ - if (regs != new_regs) - { - restore_critical_section(tcb, this_cpu()); - #ifdef CONFIG_DEBUG_SYSCALL_INFO - regs = new_regs; - +# ifndef CONFIG_DEBUG_SVCALL + if (cmd > SYS_switch_context) +# endif + { svcinfo("SVCall Return:\n"); svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], @@ -462,14 +433,9 @@ int arm_svcall(int irq, void *context, void *arg) regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); -#endif - } -#ifdef CONFIG_DEBUG_SYSCALL_INFO - else - { - svcinfo("SVCall Return: %d\n", regs[REG_R0]); } #endif + UNUSED(tcb); return OK; } diff --git a/arch/arm/src/armv7-r/arm_sigdeliver.c b/arch/arm/src/armv7-r/arm_sigdeliver.c index 5a63458b9b04f..009ad90657d87 100644 --- a/arch/arm/src/armv7-r/arm_sigdeliver.c +++ b/arch/arm/src/armv7-r/arm_sigdeliver.c @@ -159,5 +159,7 @@ void arm_sigdeliver(void) #endif g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv7-r/arm_syscall.c b/arch/arm/src/armv7-r/arm_syscall.c index 414518012e88f..315a6f42d4723 100644 --- a/arch/arm/src/armv7-r/arm_syscall.c +++ b/arch/arm/src/armv7-r/arm_syscall.c @@ -253,46 +253,7 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/armv8-m/arm_sigdeliver.c b/arch/arm/src/armv8-m/arm_sigdeliver.c index 2db03f17d166b..aff8738235c16 100644 --- a/arch/arm/src/armv8-m/arm_sigdeliver.c +++ b/arch/arm/src/armv8-m/arm_sigdeliver.c @@ -174,5 +174,8 @@ void arm_sigdeliver(void) #endif rtcb->irqcount--; #endif - arm_fullcontextrestore(regs); + g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv8-m/arm_svcall.c b/arch/arm/src/armv8-m/arm_svcall.c index 2a42d19dc7dc8..5082ee952e321 100644 --- a/arch/arm/src/armv8-m/arm_svcall.c +++ b/arch/arm/src/armv8-m/arm_svcall.c @@ -125,9 +125,8 @@ static void dispatch_syscall(void) int arm_svcall(int irq, void *context, void *arg) { - struct tcb_s *tcb = this_task(); uint32_t *regs = (uint32_t *)context; - uint32_t *new_regs = regs; + struct tcb_s *tcb; uint32_t cmd; cmd = regs[REG_R0]; @@ -157,41 +156,15 @@ int arm_svcall(int irq, void *context, void *arg) switch (cmd) { - /* R0=SYS_restore_context: This a restore context command: - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - DEBUGASSERT(regs[REG_R1] != 0); - new_regs = (uint32_t *)regs[REG_R1]; - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - */ - case SYS_switch_context: { - DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - new_regs = (uint32_t *)regs[REG_R2]; + tcb = this_task(); + restore_critical_section(tcb, this_cpu()); + +#ifdef CONFIG_DEBUG_SYSCALL_INFO + regs = tcb->xcp.regs; +#endif } break; @@ -446,13 +419,11 @@ int arm_svcall(int irq, void *context, void *arg) * switch. */ - if (regs != new_regs) - { - restore_critical_section(tcb, this_cpu()); - #ifdef CONFIG_DEBUG_SYSCALL_INFO - regs = new_regs; - +# ifndef CONFIG_DEBUG_SVCALL + if (cmd > SYS_switch_context) +# endif + { svcinfo("SVCall Return:\n"); svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], @@ -462,14 +433,9 @@ int arm_svcall(int irq, void *context, void *arg) regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); -#endif - } -#ifdef CONFIG_DEBUG_SYSCALL_INFO - else - { - svcinfo("SVCall Return: %d\n", regs[REG_R0]); } #endif + UNUSED(tcb); return OK; } diff --git a/arch/arm/src/armv8-r/arm_sigdeliver.c b/arch/arm/src/armv8-r/arm_sigdeliver.c index e4a8ad59353b1..5e4015e986a55 100644 --- a/arch/arm/src/armv8-r/arm_sigdeliver.c +++ b/arch/arm/src/armv8-r/arm_sigdeliver.c @@ -157,5 +157,7 @@ void arm_sigdeliver(void) #endif g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv8-r/arm_syscall.c b/arch/arm/src/armv8-r/arm_syscall.c index f1a4d8175b08e..e478aafecf618 100644 --- a/arch/arm/src/armv8-r/arm_syscall.c +++ b/arch/arm/src/armv8-r/arm_syscall.c @@ -253,46 +253,7 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/common/arm_exit.c b/arch/arm/src/common/arm_exit.c index f238dfa5f3fb6..fa49dc5fed785 100644 --- a/arch/arm/src/common/arm_exit.c +++ b/arch/arm/src/common/arm_exit.c @@ -54,25 +54,17 @@ void up_exit(int status) { - struct tcb_s *tcb = this_task(); - /* Destroy the task at the head of the ready to run list. */ nxtask_exit(); - /* Now, perform the context switch to the new ready-to-run task at the - * head of the list. - */ - - tcb = this_task(); - /* Scheduler parameters will update inside syscall */ g_running_tasks[this_cpu()] = NULL; /* Then switch contexts */ - arm_fullcontextrestore(tcb->xcp.regs); + arm_fullcontextrestore(); /* arm_fullcontextrestore() should not return but could if the software * interrupts are disabled. diff --git a/arch/arm/src/common/arm_internal.h b/arch/arm/src/common/arm_internal.h index 6303c6fc96da4..b72c256a83df1 100644 --- a/arch/arm/src/common/arm_internal.h +++ b/arch/arm/src/common/arm_internal.h @@ -147,10 +147,7 @@ /* Context switching */ #ifndef arm_fullcontextrestore -# define arm_fullcontextrestore(restoreregs) \ - sys_call1(SYS_restore_context, (uintptr_t)restoreregs); -#else -extern void arm_fullcontextrestore(uint32_t *restoreregs); +# define arm_fullcontextrestore() sys_call0(SYS_restore_context) #endif /* Redefine the linker symbols as armlink style */ diff --git a/arch/arm/src/tlsr82/Make.defs b/arch/arm/src/tlsr82/Make.defs index f1fe854475fea..9ae208705507e 100644 --- a/arch/arm/src/tlsr82/Make.defs +++ b/arch/arm/src/tlsr82/Make.defs @@ -64,5 +64,3 @@ ifeq ($(CONFIG_TLSR82_SOFT_FPU),y) EXTRA_LIBPATHS += -L$(TOPDIR)/$(CONFIG_TLSR82_SOFT_FPU_LIB_PATH) EXTRA_LIBS += -l$(CONFIG_TLSR82_SOFT_FPU_LIB_NAME) endif - -CFLAGS += -Darm_fullcontextrestore=tc32_fullcontextrestore From 9a697ab917dae57fff34288798801eb902ba677f Mon Sep 17 00:00:00 2001 From: hujun5 Date: Thu, 21 Nov 2024 16:48:42 +0800 Subject: [PATCH 2/3] arm: remove g_running_tasks[this_cpu()] = NULL reason: We hope to keep g_running_tasks valid forever. Signed-off-by: hujun5 --- arch/arm/include/tlsr82/irq.h | 2 - arch/arm/src/arm/arm_sigdeliver.c | 1 - arch/arm/src/arm/arm_syscall.c | 60 ++++++++++++----------- arch/arm/src/armv6-m/arm_doirq.c | 6 ++- arch/arm/src/armv6-m/arm_sigdeliver.c | 2 +- arch/arm/src/armv7-a/arm_sigdeliver.c | 1 - arch/arm/src/armv7-a/arm_syscall.c | 68 ++++++++++++--------------- arch/arm/src/armv7-m/arm_doirq.c | 6 ++- arch/arm/src/armv7-m/arm_sigdeliver.c | 1 - arch/arm/src/armv7-r/arm_sigdeliver.c | 1 - arch/arm/src/armv7-r/arm_syscall.c | 57 +++++++++++----------- arch/arm/src/armv8-m/arm_doirq.c | 6 ++- arch/arm/src/armv8-m/arm_sigdeliver.c | 2 +- arch/arm/src/armv8-r/arm_sigdeliver.c | 1 - arch/arm/src/armv8-r/arm_syscall.c | 57 +++++++++++----------- arch/arm/src/common/arm_exit.c | 2 +- arch/arm/src/common/arm_internal.h | 2 + arch/arm/src/tlsr82/chip.h | 2 + 18 files changed, 142 insertions(+), 135 deletions(-) diff --git a/arch/arm/include/tlsr82/irq.h b/arch/arm/include/tlsr82/irq.h index 529c5692aadd1..115f9f14b689d 100644 --- a/arch/arm/include/tlsr82/irq.h +++ b/arch/arm/include/tlsr82/irq.h @@ -283,8 +283,6 @@ static inline_function void up_set_interrupt_context(bool flag) #endif } -#define arm_fullcontextrestore() tc32_fullcontextrestore(this_task()->xcp.regs) - #define up_switch_context(tcb, rtcb) \ do { \ if (!up_interrupt_context()) \ diff --git a/arch/arm/src/arm/arm_sigdeliver.c b/arch/arm/src/arm/arm_sigdeliver.c index a76152b535439..a0ab5f36fb7c4 100644 --- a/arch/arm/src/arm/arm_sigdeliver.c +++ b/arch/arm/src/arm/arm_sigdeliver.c @@ -97,7 +97,6 @@ void arm_sigdeliver(void) board_autoled_off(LED_SIGNAL); - g_running_tasks[this_cpu()] = NULL; rtcb->xcp.regs = rtcb->xcp.saved_regs; arm_fullcontextrestore(); } diff --git a/arch/arm/src/arm/arm_syscall.c b/arch/arm/src/arm/arm_syscall.c index 7443e27c1dfc8..3903159bfdada 100644 --- a/arch/arm/src/arm/arm_syscall.c +++ b/arch/arm/src/arm/arm_syscall.c @@ -54,7 +54,8 @@ uint32_t *arm_syscall(uint32_t *regs) { - struct tcb_s **running_task = &g_running_tasks[this_cpu()]; + int cpu = this_cpu(); + struct tcb_s **running_task = &g_running_tasks[cpu]; FAR struct tcb_s *tcb = this_task(); uint32_t cmd; @@ -62,12 +63,9 @@ uint32_t *arm_syscall(uint32_t *regs) DEBUGASSERT(!up_interrupt_context()); - if (*running_task != NULL) - { - (*running_task)->xcp.regs = regs; - } - - /* Set irq flag */ + /* Current regs non-zero indicates that we are processing an interrupt; + * current_regs is also used to manage interrupt level context switches. + */ up_set_interrupt_context(true); @@ -75,12 +73,35 @@ uint32_t *arm_syscall(uint32_t *regs) cmd = regs[REG_R0]; + /* if cmd == SYS_restore_context (*running_task)->xcp.regs is valid + * should not be overwriten + */ + + if (cmd != SYS_restore_context) + { + (*running_task)->xcp.regs = regs; + } + /* Handle the SVCall according to the command in R0 */ switch (cmd) { - case SYS_restore_context: case SYS_switch_context: + + /* Update scheduler parameters */ + + nxsched_resume_scheduler(tcb); + + case SYS_restore_context: + nxsched_suspend_scheduler(*running_task); + *running_task = tcb; + + /* Restore the cpu lock */ + + restore_critical_section(tcb, cpu); +#ifdef CONFIG_ARCH_ADDRENV + addrenv_switch(tcb); +#endif break; default: @@ -92,29 +113,6 @@ uint32_t *arm_syscall(uint32_t *regs) break; } - if (*running_task != tcb) - { -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ - - addrenv_switch(NULL); -#endif - /* Update scheduler parameters */ - - nxsched_suspend_scheduler(*running_task); - nxsched_resume_scheduler(tcb); - - *running_task = tcb; - - /* Restore the cpu lock */ - - restore_critical_section(tcb, this_cpu()); - } - /* Set irq flag */ up_set_interrupt_context(false); diff --git a/arch/arm/src/armv6-m/arm_doirq.c b/arch/arm/src/armv6-m/arm_doirq.c index 9c9e78d3cfd00..e3e6383e48a71 100644 --- a/arch/arm/src/armv6-m/arm_doirq.c +++ b/arch/arm/src/armv6-m/arm_doirq.c @@ -59,7 +59,11 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) struct tcb_s **running_task = &g_running_tasks[this_cpu()]; FAR struct tcb_s *tcb; - if (*running_task != NULL) + /* This judgment proves that (*running_task)->xcp.regs + * is invalid, and we can safely overwrite it. + */ + + if (!(NVIC_IRQ_SVCALL == irq && regs[REG_R0] == SYS_restore_context)) { (*running_task)->xcp.regs = regs; } diff --git a/arch/arm/src/armv6-m/arm_sigdeliver.c b/arch/arm/src/armv6-m/arm_sigdeliver.c index 5fd3f44463ba3..73ad65e14ad73 100644 --- a/arch/arm/src/armv6-m/arm_sigdeliver.c +++ b/arch/arm/src/armv6-m/arm_sigdeliver.c @@ -162,7 +162,7 @@ void arm_sigdeliver(void) leave_critical_section((uint16_t)regs[REG_PRIMASK]); rtcb->irqcount--; #endif - g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; arm_fullcontextrestore(); UNUSED(regs); diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index 5c0e058a4e6af..5de0caa880af6 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -161,7 +161,6 @@ void arm_sigdeliver(void) rtcb->irqcount--; #endif - g_running_tasks[this_cpu()] = NULL; rtcb->xcp.regs = rtcb->xcp.saved_regs; arm_fullcontextrestore(); UNUSED(regs); diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index f31e4031553ab..df7f68d1ffc38 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -159,7 +159,8 @@ static void dispatch_syscall(void) uint32_t *arm_syscall(uint32_t *regs) { - struct tcb_s **running_task = &g_running_tasks[this_cpu()]; + int cpu = this_cpu(); + struct tcb_s **running_task = &g_running_tasks[cpu]; struct tcb_s *tcb = this_task(); uint32_t cmd; #ifdef CONFIG_BUILD_KERNEL @@ -170,12 +171,9 @@ uint32_t *arm_syscall(uint32_t *regs) DEBUGASSERT(!up_interrupt_context()); - if (*running_task != NULL) - { - (*running_task)->xcp.regs = regs; - } - - /* Set irq flag */ + /* Current regs non-zero indicates that we are processing an interrupt; + * current_regs is also used to manage interrupt level context switches. + */ up_set_interrupt_context(true); @@ -183,6 +181,15 @@ uint32_t *arm_syscall(uint32_t *regs) cmd = regs[REG_R0]; + /* if cmd == SYS_restore_context (*running_task)->xcp.regs is valid + * should not be overwriten + */ + + if (cmd != SYS_restore_context) + { + (*running_task)->xcp.regs = regs; + } + /* The SVCall software interrupt is called with R0 = system call command * and R1..R7 = variable number of arguments depending on the system call. */ @@ -255,8 +262,24 @@ uint32_t *arm_syscall(uint32_t *regs) } break; #endif - case SYS_restore_context: + case SYS_switch_context: + + /* Update scheduler parameters */ + + nxsched_resume_scheduler(tcb); + + case SYS_restore_context: + nxsched_suspend_scheduler(*running_task); + *running_task = tcb; + + /* Restore the cpu lock */ + + restore_critical_section(tcb, cpu); + regs = tcb->xcp.regs; +#ifdef CONFIG_ARCH_ADDRENV + addrenv_switch(tcb); +#endif break; /* R0=SYS_task_start: This a user task start @@ -522,35 +545,6 @@ uint32_t *arm_syscall(uint32_t *regs) break; } - if (*running_task != tcb) - { -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ - - addrenv_switch(NULL); -#endif - - /* Update scheduler parameters */ - - nxsched_suspend_scheduler(*running_task); - nxsched_resume_scheduler(tcb); - - /* Record the new "running" task. g_running_tasks[] is only used by - * assertion logic for reporting crashes. - */ - - *running_task = tcb; - - /* Restore the cpu lock */ - - restore_critical_section(tcb, this_cpu()); - regs = tcb->xcp.regs; - } - /* Report what happened */ dump_syscall("Exit", cmd, regs); diff --git a/arch/arm/src/armv7-m/arm_doirq.c b/arch/arm/src/armv7-m/arm_doirq.c index 9989437e4752c..dcbdd9dc12a8f 100644 --- a/arch/arm/src/armv7-m/arm_doirq.c +++ b/arch/arm/src/armv7-m/arm_doirq.c @@ -59,7 +59,11 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) struct tcb_s **running_task = &g_running_tasks[this_cpu()]; FAR struct tcb_s *tcb; - if (*running_task != NULL) + /* This judgment proves that (*running_task)->xcp.regs + * is invalid, and we can safely overwrite it. + */ + + if (!(NVIC_IRQ_SVCALL == irq && regs[REG_R0] == SYS_restore_context)) { (*running_task)->xcp.regs = regs; } diff --git a/arch/arm/src/armv7-m/arm_sigdeliver.c b/arch/arm/src/armv7-m/arm_sigdeliver.c index 5642e82623e92..3d617ea46a5e4 100644 --- a/arch/arm/src/armv7-m/arm_sigdeliver.c +++ b/arch/arm/src/armv7-m/arm_sigdeliver.c @@ -175,7 +175,6 @@ void arm_sigdeliver(void) rtcb->irqcount--; #endif - g_running_tasks[this_cpu()] = NULL; rtcb->xcp.regs = rtcb->xcp.saved_regs; arm_fullcontextrestore(); UNUSED(regs); diff --git a/arch/arm/src/armv7-r/arm_sigdeliver.c b/arch/arm/src/armv7-r/arm_sigdeliver.c index 009ad90657d87..bd715470cd519 100644 --- a/arch/arm/src/armv7-r/arm_sigdeliver.c +++ b/arch/arm/src/armv7-r/arm_sigdeliver.c @@ -158,7 +158,6 @@ void arm_sigdeliver(void) rtcb->irqcount--; #endif - g_running_tasks[this_cpu()] = NULL; rtcb->xcp.regs = rtcb->xcp.saved_regs; arm_fullcontextrestore(); UNUSED(regs); diff --git a/arch/arm/src/armv7-r/arm_syscall.c b/arch/arm/src/armv7-r/arm_syscall.c index 315a6f42d4723..179b27baaeff9 100644 --- a/arch/arm/src/armv7-r/arm_syscall.c +++ b/arch/arm/src/armv7-r/arm_syscall.c @@ -156,7 +156,8 @@ static void dispatch_syscall(void) uint32_t *arm_syscall(uint32_t *regs) { - struct tcb_s **running_task = &g_running_tasks[this_cpu()]; + int cpu = this_cpu(); + struct tcb_s **running_task = &g_running_tasks[cpu]; FAR struct tcb_s *tcb = this_task(); uint32_t cmd; #ifdef CONFIG_BUILD_PROTECTED @@ -167,12 +168,9 @@ uint32_t *arm_syscall(uint32_t *regs) DEBUGASSERT(!up_interrupt_context()); - if (*running_task != NULL) - { - (*running_task)->xcp.regs = regs; - } - - /* Set irq flag */ + /* Current regs non-zero indicates that we are processing an interrupt; + * current_regs is also used to manage interrupt level context switches. + */ up_set_interrupt_context(true); @@ -180,6 +178,15 @@ uint32_t *arm_syscall(uint32_t *regs) cmd = regs[REG_R0]; + /* if cmd == SYS_restore_context (*running_task)->xcp.regs is valid + * should not be overwriten + */ + + if (cmd != SYS_restore_context) + { + (*running_task)->xcp.regs = regs; + } + /* The SVCall software interrupt is called with R0 = system call command * and R1..R7 = variable number of arguments depending on the system call. */ @@ -253,8 +260,23 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif - case SYS_restore_context: case SYS_switch_context: + + /* Update scheduler parameters */ + + nxsched_resume_scheduler(tcb); + + case SYS_restore_context: + nxsched_suspend_scheduler(*running_task); + *running_task = tcb; + + /* Restore the cpu lock */ + + restore_critical_section(tcb, cpu); + regs = tcb->xcp.regs; +#ifdef CONFIG_ARCH_ADDRENV + addrenv_switch(tcb); +#endif break; /* R0=SYS_task_start: This a user task start @@ -520,25 +542,6 @@ uint32_t *arm_syscall(uint32_t *regs) break; } - if (*running_task != tcb) - { - /* Update scheduler parameters */ - - nxsched_suspend_scheduler(*running_task); - nxsched_resume_scheduler(tcb); - - /* Record the new "running" task. g_running_tasks[] is only used by - * assertion logic for reporting crashes. - */ - - *running_task = tcb; - - /* Restore the cpu lock */ - - restore_critical_section(tcb, this_cpu()); - regs = tcb->xcp.regs; - } - /* Report what happened */ dump_syscall("Exit", cmd, regs); diff --git a/arch/arm/src/armv8-m/arm_doirq.c b/arch/arm/src/armv8-m/arm_doirq.c index 3cd28ae2989f3..55183573a54fb 100644 --- a/arch/arm/src/armv8-m/arm_doirq.c +++ b/arch/arm/src/armv8-m/arm_doirq.c @@ -70,7 +70,11 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) struct tcb_s **running_task = &g_running_tasks[this_cpu()]; FAR struct tcb_s *tcb; - if (*running_task != NULL) + /* This judgment proves that (*running_task)->xcp.regs + * is invalid, and we can safely overwrite it. + */ + + if (!(NVIC_IRQ_SVCALL == irq && regs[REG_R0] == SYS_restore_context)) { (*running_task)->xcp.regs = regs; } diff --git a/arch/arm/src/armv8-m/arm_sigdeliver.c b/arch/arm/src/armv8-m/arm_sigdeliver.c index aff8738235c16..43d72e35a8da8 100644 --- a/arch/arm/src/armv8-m/arm_sigdeliver.c +++ b/arch/arm/src/armv8-m/arm_sigdeliver.c @@ -174,7 +174,7 @@ void arm_sigdeliver(void) #endif rtcb->irqcount--; #endif - g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; arm_fullcontextrestore(); UNUSED(regs); diff --git a/arch/arm/src/armv8-r/arm_sigdeliver.c b/arch/arm/src/armv8-r/arm_sigdeliver.c index 5e4015e986a55..17fbc7b19839e 100644 --- a/arch/arm/src/armv8-r/arm_sigdeliver.c +++ b/arch/arm/src/armv8-r/arm_sigdeliver.c @@ -156,7 +156,6 @@ void arm_sigdeliver(void) rtcb->irqcount--; #endif - g_running_tasks[this_cpu()] = NULL; rtcb->xcp.regs = rtcb->xcp.saved_regs; arm_fullcontextrestore(); UNUSED(regs); diff --git a/arch/arm/src/armv8-r/arm_syscall.c b/arch/arm/src/armv8-r/arm_syscall.c index e478aafecf618..d003166840754 100644 --- a/arch/arm/src/armv8-r/arm_syscall.c +++ b/arch/arm/src/armv8-r/arm_syscall.c @@ -156,7 +156,8 @@ static void dispatch_syscall(void) uint32_t *arm_syscall(uint32_t *regs) { - struct tcb_s **running_task = &g_running_tasks[this_cpu()]; + int cpu = this_cpu(); + struct tcb_s **running_task = &g_running_tasks[cpu]; FAR struct tcb_s *tcb = this_task(); uint32_t cmd; #ifdef CONFIG_BUILD_PROTECTED @@ -167,12 +168,9 @@ uint32_t *arm_syscall(uint32_t *regs) DEBUGASSERT(!up_interrupt_context()); - if (*running_task != NULL) - { - (*running_task)->xcp.regs = regs; - } - - /* Set irq flag */ + /* Current regs non-zero indicates that we are processing an interrupt; + * current_regs is also used to manage interrupt level context switches. + */ up_set_interrupt_context(true); @@ -180,6 +178,15 @@ uint32_t *arm_syscall(uint32_t *regs) cmd = regs[REG_R0]; + /* if cmd == SYS_restore_context (*running_task)->xcp.regs is valid + * should not be overwriten + */ + + if (cmd != SYS_restore_context) + { + (*running_task)->xcp.regs = regs; + } + /* The SVCall software interrupt is called with R0 = system call command * and R1..R7 = variable number of arguments depending on the system call. */ @@ -253,8 +260,23 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif - case SYS_restore_context: case SYS_switch_context: + + /* Update scheduler parameters */ + + nxsched_resume_scheduler(tcb); + + case SYS_restore_context: + nxsched_suspend_scheduler(*running_task); + *running_task = tcb; + + /* Restore the cpu lock */ + + restore_critical_section(tcb, cpu); + regs = tcb->xcp.regs; +#ifdef CONFIG_ARCH_ADDRENV + addrenv_switch(tcb); +#endif break; /* R0=SYS_task_start: This a user task start @@ -520,25 +542,6 @@ uint32_t *arm_syscall(uint32_t *regs) break; } - if (*running_task != tcb) - { - /* Update scheduler parameters */ - - nxsched_suspend_scheduler(*running_task); - nxsched_resume_scheduler(tcb); - - /* Record the new "running" task. g_running_tasks[] is only used by - * assertion logic for reporting crashes. - */ - - *running_task = tcb; - - /* Restore the cpu lock */ - - restore_critical_section(tcb, this_cpu()); - regs = tcb->xcp.regs; - } - /* Report what happened */ dump_syscall("Exit", cmd, regs); diff --git a/arch/arm/src/common/arm_exit.c b/arch/arm/src/common/arm_exit.c index fa49dc5fed785..1b6cafbf80432 100644 --- a/arch/arm/src/common/arm_exit.c +++ b/arch/arm/src/common/arm_exit.c @@ -60,7 +60,7 @@ void up_exit(int status) /* Scheduler parameters will update inside syscall */ - g_running_tasks[this_cpu()] = NULL; + g_running_tasks[this_cpu()] = this_task(); /* Then switch contexts */ diff --git a/arch/arm/src/common/arm_internal.h b/arch/arm/src/common/arm_internal.h index b72c256a83df1..c7e4243cae6ab 100644 --- a/arch/arm/src/common/arm_internal.h +++ b/arch/arm/src/common/arm_internal.h @@ -33,6 +33,8 @@ # include # include # include + +# include "chip.h" #endif /**************************************************************************** diff --git a/arch/arm/src/tlsr82/chip.h b/arch/arm/src/tlsr82/chip.h index dfc81861bde5b..18be19cf38367 100644 --- a/arch/arm/src/tlsr82/chip.h +++ b/arch/arm/src/tlsr82/chip.h @@ -33,6 +33,8 @@ #define ARMV6M_PERIPHERAL_INTERRUPTS NR_IRQS +#define arm_fullcontextrestore() tc32_fullcontextrestore(this_task()->xcp.regs) + /* Include the memory map file. * Other chip hardware files should then include this file for the proper * setup. From e49edaf74f5dc0c78400d81ec407a127d360f082 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Tue, 3 Dec 2024 12:39:20 +0800 Subject: [PATCH 3/3] fix compile error lcd/st7565.c:107:4: warning: #warning "Optimal setting of CONFIG_LCD_MAXCONTRAST is 255" [-Wcpp] 107 | # warning "Optimal setting of CONFIG_LCD_MAXCONTRAST is 255" | ^~~~~~~ chip/lc823450_cpuindex.c:36: warning: "CORE_COREID" redefined 36 | #define CORE_COREID (LC823450_CORE_BASE + 0x0) | In file included from /home/hujun5/downloads1/vela_sim/nuttx/arch/arm/src/common/arm_internal.h:37, from chip/lc823450_cpuindex.c:29: /home/hujun5/downloads1/vela_sim/nuttx/arch/arm/src/chip/chip.h:48: note: this is the location of the previous definition 48 | #define CORE_COREID (LC823450_CORE_BASE + 0) | chip/lc823450_cpuindex.c:37: warning: "CORE_COREID_ID" redefined 37 | #define CORE_COREID_ID (0x1 << 0) | /home/hujun5/downloads1/vela_sim/nuttx/arch/arm/src/chip/chip.h:49: note: this is the location of the previous definition 49 | #define CORE_COREID_ID (1 << 0) Signed-off-by: hujun5 --- arch/arm/src/arm/arm_allocpage.c | 2 +- arch/arm/src/lc823450/lc823450_cpuindex.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/arm/src/arm/arm_allocpage.c b/arch/arm/src/arm/arm_allocpage.c index 003ffa7267a4a..359fc60a03d24 100644 --- a/arch/arm/src/arm/arm_allocpage.c +++ b/arch/arm/src/arm/arm_allocpage.c @@ -36,8 +36,8 @@ #include -#include "pg_macros.h" #include "arm_internal.h" +#include "pg_macros.h" /**************************************************************************** * Pre-processor Definitions diff --git a/arch/arm/src/lc823450/lc823450_cpuindex.c b/arch/arm/src/lc823450/lc823450_cpuindex.c index 573b89c142f80..dcce257fb2795 100644 --- a/arch/arm/src/lc823450/lc823450_cpuindex.c +++ b/arch/arm/src/lc823450/lc823450_cpuindex.c @@ -32,10 +32,6 @@ * Pre-processor Definitions ****************************************************************************/ -#define LC823450_CORE_BASE 0xe00fe000 -#define CORE_COREID (LC823450_CORE_BASE + 0x0) -#define CORE_COREID_ID (0x1 << 0) - /**************************************************************************** * Public Functions ****************************************************************************/