You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2022/04/09 00:02:18 UTC

[incubator-nuttx] branch master updated (074beff551 -> c235c0fa43)

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

acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


    from 074beff551 tools/checkrelease.sh: Don't check DISCLAIMER-WIP anymore
     new bf3da321c9 sched/wqueue: Simplify CALL_WORKER dispatch condition
     new aed5dadc3d sched/irq: Remove CONFIG_SCHED_IRQMONITOR when define CALL_VECTOR
     new 51ffa3edb0 sched/irq: Fix array overrun in coverity check
     new 1f7b49d700 boards/nucleo-h743zi2: Enable up_perf API
     new c235c0fa43 boards/lx_cpu: Enable up_perf API

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/arm/src/lpc17xx_40xx/Make.defs                |  2 +-
 arch/arm/src/stm32h7/Make.defs                     |  2 +-
 .../lx_cpu/src/lpc17_40_boardinitialize.c          |  4 +++
 boards/arm/stm32h7/nucleo-h743zi2/src/stm32_boot.c |  4 +++
 sched/irq/irq_dispatch.c                           | 39 ++++++++--------------
 sched/wqueue/kwork_thread.c                        |  6 +++-
 6 files changed, 29 insertions(+), 28 deletions(-)


[incubator-nuttx] 02/05: sched/irq: Remove CONFIG_SCHED_IRQMONITOR when define CALL_VECTOR

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit aed5dadc3dd1a3f93c5ac540d8c729d72c1e7460
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Apr 5 14:50:23 2022 +0800

    sched/irq: Remove CONFIG_SCHED_IRQMONITOR when define CALL_VECTOR
    
    since up_perf_ API doesn't couple with CONFIG_SCHED_IRQMONITOR
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 sched/irq/irq_dispatch.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/sched/irq/irq_dispatch.c b/sched/irq/irq_dispatch.c
index 2b25e132fe..7a6c8711f6 100644
--- a/sched/irq/irq_dispatch.c
+++ b/sched/irq/irq_dispatch.c
@@ -70,10 +70,7 @@
 #  define CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQ 0
 #endif
 
-#ifndef CONFIG_SCHED_IRQMONITOR
-#  define CALL_VECTOR(ndx, vector, irq, context, arg) \
-     vector(irq, context, arg)
-#elif defined(CONFIG_SCHED_CRITMONITOR)
+#ifdef CONFIG_SCHED_IRQMONITOR
 #  define CALL_VECTOR(ndx, vector, irq, context, arg) \
      do \
        { \
@@ -98,21 +95,7 @@
      while (0)
 #else
 #  define CALL_VECTOR(ndx, vector, irq, context, arg) \
-     do \
-       { \
-         struct timespec start; \
-         struct timespec end; \
-         struct timespec delta; \
-         clock_systime_timespec(&start); \
-         vector(irq, context, arg); \
-         clock_systime_timespec(&end); \
-         clock_timespec_subtract(&end, &start, &delta); \
-         if (delta.tv_nsec > g_irqvector[ndx].time) \
-           { \
-             g_irqvector[ndx].time = delta.tv_nsec; \
-           } \
-       } \
-     while (0)
+     vector(irq, context, arg)
 #endif /* CONFIG_SCHED_IRQMONITOR */
 
 /****************************************************************************


[incubator-nuttx] 04/05: boards/nucleo-h743zi2: Enable up_perf API

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1f7b49d7003c9bf27ade13be6fcd177b4352299d
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Apr 5 17:16:18 2022 +0800

    boards/nucleo-h743zi2: Enable up_perf API
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/stm32h7/Make.defs                     | 2 +-
 boards/arm/stm32h7/nucleo-h743zi2/src/stm32_boot.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/stm32h7/Make.defs b/arch/arm/src/stm32h7/Make.defs
index 7c3634151f..daa9d21734 100644
--- a/arch/arm/src/stm32h7/Make.defs
+++ b/arch/arm/src/stm32h7/Make.defs
@@ -34,7 +34,7 @@ CMN_CSRCS += arm_releasepending.c arm_releasestack.c arm_reprioritizertr.c
 CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c arm_stackframe.c arm_svcall.c
 CMN_CSRCS += arm_systemreset.c arm_trigger_irq.c arm_udelay.c arm_unblocktask.c
 CMN_CSRCS += arm_usestack.c arm_vfork.c arm_switchcontext.c arm_puts.c
-CMN_CSRCS += arm_tcbinfo.c
+CMN_CSRCS += arm_tcbinfo.c arm_perf.c
 
 ifeq ($(CONFIG_ARMV7M_SYSTICK),y)
 CMN_CSRCS += arm_systick.c
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_boot.c b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_boot.c
index eea8065eeb..31b642fa78 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_boot.c
+++ b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_boot.c
@@ -50,6 +50,10 @@
 
 void stm32_boardinitialize(void)
 {
+#ifdef CONFIG_SCHED_IRQMONITOR
+  up_perf_init((FAR void *)STM32_SYSCLK_FREQUENCY);
+#endif
+
 #ifdef CONFIG_ARCH_LEDS
   /* Configure on-board LEDs if LED support has been selected. */
 


[incubator-nuttx] 05/05: boards/lx_cpu: Enable up_perf API

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit c235c0fa4335944b2ed7bc3dadd459ca6c94d844
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Apr 5 17:25:56 2022 +0800

    boards/lx_cpu: Enable up_perf API
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/lpc17xx_40xx/Make.defs                           | 2 +-
 boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/lpc17xx_40xx/Make.defs b/arch/arm/src/lpc17xx_40xx/Make.defs
index 72c63e532c..016a281549 100644
--- a/arch/arm/src/lpc17xx_40xx/Make.defs
+++ b/arch/arm/src/lpc17xx_40xx/Make.defs
@@ -31,7 +31,7 @@ CMN_CSRCS += arm_releasestack.c arm_reprioritizertr.c arm_schedulesigaction.c
 CMN_CSRCS += arm_sigdeliver.c arm_stackframe.c arm_trigger_irq.c
 CMN_CSRCS += arm_unblocktask.c arm_usestack.c arm_doirq.c arm_hardfault.c
 CMN_CSRCS += arm_svcall.c arm_checkstack.c arm_vfork.c arm_switchcontext.c
-CMN_CSRCS += arm_systemreset.c arm_puts.c arm_tcbinfo.c
+CMN_CSRCS += arm_systemreset.c arm_puts.c arm_tcbinfo.c arm_perf.c
 
 ifeq ($(CONFIG_SCHED_BACKTRACE),y)
 CMN_CSRCS += arm_backtrace_thumb.c
diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c
index f0110c6b85..367bf6a41d 100644
--- a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c
+++ b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c
@@ -51,6 +51,10 @@
 
 void lpc17_40_boardinitialize(void)
 {
+#ifdef CONFIG_SCHED_IRQMONITOR
+  up_perf_init((FAR void *)LPC17_40_CCLK);
+#endif
+
   /* Initialize the EMC, and SDRAM */
 
 #ifndef BOARD_EMC_CONFIG_BY_LOADER


[incubator-nuttx] 01/05: sched/wqueue: Simplify CALL_WORKER dispatch condition

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit bf3da321c98ee87b502a1c6b8081b4d27006f435
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Apr 5 14:49:11 2022 +0800

    sched/wqueue: Simplify CALL_WORKER dispatch condition
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 sched/wqueue/kwork_thread.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sched/wqueue/kwork_thread.c b/sched/wqueue/kwork_thread.c
index 847d26283b..cb63a52747 100644
--- a/sched/wqueue/kwork_thread.c
+++ b/sched/wqueue/kwork_thread.c
@@ -46,7 +46,11 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#if defined(CONFIG_SCHED_CRITMONITOR_MAXTIME_WQUEUE) && CONFIG_SCHED_CRITMONITOR_MAXTIME_WQUEUE > 0
+#ifndef CONFIG_SCHED_CRITMONITOR_MAXTIME_WQUEUE
+#  define CONFIG_SCHED_CRITMONITOR_MAXTIME_WQUEUE 0
+#endif
+
+#if CONFIG_SCHED_CRITMONITOR_MAXTIME_WQUEUE > 0
 #  define CALL_WORKER(worker, arg) \
      do \
        { \


[incubator-nuttx] 03/05: sched/irq: Fix array overrun in coverity check

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 51ffa3edb085ae84949bd7eb5d6e2b69ab398ff5
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Apr 5 14:57:47 2022 +0800

    sched/irq: Fix array overrun in coverity check
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 sched/irq/irq_dispatch.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/sched/irq/irq_dispatch.c b/sched/irq/irq_dispatch.c
index 7a6c8711f6..a2afbb48c5 100644
--- a/sched/irq/irq_dispatch.c
+++ b/sched/irq/irq_dispatch.c
@@ -39,6 +39,12 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
+#ifdef CONFIG_ARCH_MINIMAL_VECTORTABLE
+#  define NUSER_IRQS CONFIG_ARCH_NUSER_INTERRUPTS
+#else
+#  define NUSER_IRQS NR_IRQS
+#endif
+
 /* INCR_COUNT - Increment the count of interrupts taken on this IRQ number */
 
 #ifndef CONFIG_SCHED_IRQMONITOR
@@ -81,9 +87,13 @@
          vector(irq, context, arg); \
          elapsed = up_perf_gettime() - start; \
          up_perf_convert(elapsed, &delta); \
-         if (delta.tv_nsec > g_irqvector[ndx].time) \
+         if (ndx < NUSER_IRQS) \
            { \
-             g_irqvector[ndx].time = delta.tv_nsec; \
+             INCR_COUNT(ndx); \
+             if (delta.tv_nsec > g_irqvector[ndx].time) \
+               { \
+                 g_irqvector[ndx].time = delta.tv_nsec; \
+               } \
            } \
          if (CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQ > 0 && \
              elapsed > CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQ) \
@@ -130,8 +140,6 @@ void irq_dispatch(int irq, FAR void *context)
               vector = g_irqvector[ndx].handler;
               arg    = g_irqvector[ndx].arg;
             }
-
-          INCR_COUNT(ndx);
         }
 #else
       if (g_irqvector[ndx].handler)
@@ -139,8 +147,6 @@ void irq_dispatch(int irq, FAR void *context)
           vector = g_irqvector[ndx].handler;
           arg    = g_irqvector[ndx].arg;
         }
-
-      INCR_COUNT(ndx);
 #endif
     }
 #endif