This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit d573952790190349f9df73f1b43f638cc414f684
Author: hujun5 <[email protected]>
AuthorDate: Tue Jun 25 21:33:35 2024 +0800

    irq: use up_interrupt_context to replace up_current_regs
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/arm/src/common/arm_switchcontext.c             | 2 +-
 arch/arm64/src/common/arm64_switchcontext.c         | 2 +-
 arch/risc-v/src/common/riscv_switchcontext.c        | 2 +-
 arch/sim/src/sim/sim_switchcontext.c                | 2 +-
 arch/x86_64/src/common/x86_64_switchcontext.c       | 2 +-
 boards/arm/cxd56xx/common/src/cxd56_crashdump.c     | 7 +------
 boards/arm/stm32/nucleo-f429zi/src/stm32_bbsram.c   | 7 +------
 boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c    | 7 +------
 boards/renesas/rx65n/rx65n-grrose/src/rx65n_sbram.c | 7 +------
 boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_sbram.c | 7 +------
 10 files changed, 10 insertions(+), 35 deletions(-)

diff --git a/arch/arm/src/common/arm_switchcontext.c 
b/arch/arm/src/common/arm_switchcontext.c
index f342da9ebc..ab266f29fb 100644
--- a/arch/arm/src/common/arm_switchcontext.c
+++ b/arch/arm/src/common/arm_switchcontext.c
@@ -61,7 +61,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
 
   /* Are we in an interrupt handler? */
 
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       /* Update scheduler parameters */
 
diff --git a/arch/arm64/src/common/arm64_switchcontext.c 
b/arch/arm64/src/common/arm64_switchcontext.c
index 28b6014f14..78b9784e70 100644
--- a/arch/arm64/src/common/arm64_switchcontext.c
+++ b/arch/arm64/src/common/arm64_switchcontext.c
@@ -61,7 +61,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
 
   /* Are we in an interrupt handler? */
 
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       /* Yes, then we have to do things differently.
        * Just copy the current_regs into the OLD rtcb.
diff --git a/arch/risc-v/src/common/riscv_switchcontext.c 
b/arch/risc-v/src/common/riscv_switchcontext.c
index fe3db42d0e..d7df00ef86 100644
--- a/arch/risc-v/src/common/riscv_switchcontext.c
+++ b/arch/risc-v/src/common/riscv_switchcontext.c
@@ -63,7 +63,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
 
   /* Are we in an interrupt handler? */
 
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       /* Yes, then we have to do things differently.
        * Just copy the current_regs into the OLD rtcb.
diff --git a/arch/sim/src/sim/sim_switchcontext.c 
b/arch/sim/src/sim/sim_switchcontext.c
index 106af71e3a..fc8d9d703d 100644
--- a/arch/sim/src/sim/sim_switchcontext.c
+++ b/arch/sim/src/sim/sim_switchcontext.c
@@ -64,7 +64,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
 
   /* Are we in an interrupt handler? */
 
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       /* Yes, then we have to do things differently.
        * Just copy the current_regs into the OLD rtcb.
diff --git a/arch/x86_64/src/common/x86_64_switchcontext.c 
b/arch/x86_64/src/common/x86_64_switchcontext.c
index 16f1417140..d876f20a30 100644
--- a/arch/x86_64/src/common/x86_64_switchcontext.c
+++ b/arch/x86_64/src/common/x86_64_switchcontext.c
@@ -65,7 +65,7 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
 
   /* Are we in an interrupt handler? */
 
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       /* Yes, then we have to do things differently.
        * Just copy the g_current_regs into the OLD rtcb.
diff --git a/boards/arm/cxd56xx/common/src/cxd56_crashdump.c 
b/boards/arm/cxd56xx/common/src/cxd56_crashdump.c
index fc99e88090..c3c37a164c 100644
--- a/boards/arm/cxd56xx/common/src/cxd56_crashdump.c
+++ b/boards/arm/cxd56xx/common/src/cxd56_crashdump.c
@@ -155,12 +155,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
 
   pdump->info.pid = tcb->pid;
 
-  /* If  current_regs is not NULL then we are in an interrupt context
-   * and the user context is in current_regs else we are running in
-   * the users context
-   */
-
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
 #if CONFIG_ARCH_INTERRUPTSTACK > 3
       pdump->info.stacks.interrupt.sp = sp;
diff --git a/boards/arm/stm32/nucleo-f429zi/src/stm32_bbsram.c 
b/boards/arm/stm32/nucleo-f429zi/src/stm32_bbsram.c
index 0b2e362525..9f4c643368 100644
--- a/boards/arm/stm32/nucleo-f429zi/src/stm32_bbsram.c
+++ b/boards/arm/stm32/nucleo-f429zi/src/stm32_bbsram.c
@@ -426,12 +426,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
 
   pdump->info.pid = tcb->pid;
 
-  /* If  current_regs is not NULL then we are in an interrupt context
-   * and the user context is in current_regs else we are running in
-   * the users context
-   */
-
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       pdump->info.stacks.interrupt.sp = sp;
       pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c 
b/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c
index 5ea551dd90..9e11adaaa6 100644
--- a/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c
+++ b/boards/arm/stm32f7/nucleo-144/src/stm32_bbsram.c
@@ -426,12 +426,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
 
   pdump->info.pid = tcb->pid;
 
-  /* If  current_regs is not NULL then we are in an interrupt context
-   * and the user context is in current_regs else we are running in
-   * the users context
-   */
-
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       pdump->info.stacks.interrupt.sp = sp;
       pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
diff --git a/boards/renesas/rx65n/rx65n-grrose/src/rx65n_sbram.c 
b/boards/renesas/rx65n/rx65n-grrose/src/rx65n_sbram.c
index 09a32bbccc..881c785040 100644
--- a/boards/renesas/rx65n/rx65n-grrose/src/rx65n_sbram.c
+++ b/boards/renesas/rx65n/rx65n-grrose/src/rx65n_sbram.c
@@ -380,12 +380,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
 
   pdump->info.pid = tcb->pid;
 
-  /* If  current_regs is not NULL then we are in an interrupt context
-   * and the user context is in current_regs else we are running in
-   * the users context
-   */
-
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       pdump->info.stacks.interrupt.sp = sp;
       pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |
diff --git a/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_sbram.c 
b/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_sbram.c
index f4f24219ed..f5918bb850 100644
--- a/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_sbram.c
+++ b/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_sbram.c
@@ -378,12 +378,7 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
 
   pdump->info.pid = tcb->pid;
 
-  /* If  current_regs is not NULL then we are in an interrupt context
-   * and the user context is in current_regs else we are running in
-   * the users context
-   */
-
-  if (up_current_regs())
+  if (up_interrupt_context())
     {
       pdump->info.stacks.interrupt.sp = sp;
       pdump->info.flags |= (REGS_PRESENT | USERSTACK_PRESENT |

Reply via email to