You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/22 11:04:09 UTC

[GitHub] [incubator-nuttx] no1wudi opened a new pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

no1wudi opened a new pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314


   ## Summary
   It's a common solution for MSIP and IPI based risc-v smp soc,
   also works on qemu-rv smp (WIP).
   ## Impact
   None
   ## Testing
   CI and maix-bit.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790241895



##########
File path: arch/risc-v/src/common/riscv_internal.h
##########
@@ -116,6 +116,10 @@ EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
 EXTERN uint32_t g_intstacktop;   /* Initial top of interrupt stack */
 #endif
 
+#ifdef CONFIG_SMP
+EXTERN volatile bool g_serial_ok;

Review comment:
       Yes, only k210 need it now, but other smp system also need it, qemu-rv smp support is ready to submit.
   Or `WFI` it's enough to synchorize the state of cpus, then we can remove all `g_serial_ok` from every where?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790241895



##########
File path: arch/risc-v/src/common/riscv_internal.h
##########
@@ -116,6 +116,10 @@ EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
 EXTERN uint32_t g_intstacktop;   /* Initial top of interrupt stack */
 #endif
 
+#ifdef CONFIG_SMP
+EXTERN volatile bool g_serial_ok;

Review comment:
       Yes, only k210 need it now, but other smp system also need it, qemu-rv smp support is ready to submit.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790149526



##########
File path: arch/risc-v/src/common/riscv_cpustart.c
##########
@@ -41,37 +41,24 @@
 #include "riscv_internal.h"
 #include "chip.h"
 
-#ifdef CONFIG_SMP
-
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-#if 0
-#  define DPRINTF(fmt, args...) _err(fmt, ##args)
-#else
-#  define DPRINTF(fmt, args...) do {} while (0)
-#endif
-
-#ifdef CONFIG_DEBUG_FEATURES
-#  define showprogress(c) riscv_lowputc(c)
-#else
-#  define showprogress(c)
-#endif
-
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
 extern volatile bool g_serial_ok;
-extern int riscv_pause_handler(int irq, void *c, void *arg);
 
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
 
+extern int riscv_pause_handler(int irq, void *c, void *arg);

Review comment:
       should we move to riscv_internal.h?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790238792



##########
File path: arch/risc-v/src/common/riscv_cpustart.c
##########
@@ -41,37 +41,22 @@
 #include "riscv_internal.h"
 #include "chip.h"
 
-#ifdef CONFIG_SMP
-
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-#if 0
-#  define DPRINTF(fmt, args...) _err(fmt, ##args)
-#else
-#  define DPRINTF(fmt, args...) do {} while (0)
-#endif
-
-#ifdef CONFIG_DEBUG_FEATURES
-#  define showprogress(c) riscv_lowputc(c)
-#else
-#  define showprogress(c)
-#endif
-
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
 extern volatile bool g_serial_ok;

Review comment:
       Ok, and also removed it from non-smp system.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790204621



##########
File path: arch/risc-v/src/common/riscv_cpustart.c
##########
@@ -41,37 +41,24 @@
 #include "riscv_internal.h"
 #include "chip.h"
 
-#ifdef CONFIG_SMP
-
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-#if 0
-#  define DPRINTF(fmt, args...) _err(fmt, ##args)
-#else
-#  define DPRINTF(fmt, args...) do {} while (0)
-#endif
-
-#ifdef CONFIG_DEBUG_FEATURES
-#  define showprogress(c) riscv_lowputc(c)
-#else
-#  define showprogress(c)
-#endif
-
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
 extern volatile bool g_serial_ok;
-extern int riscv_pause_handler(int irq, void *c, void *arg);
 
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
 
+extern int riscv_pause_handler(int irq, void *c, void *arg);

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790235271



##########
File path: arch/risc-v/src/common/riscv_cpustart.c
##########
@@ -41,37 +41,22 @@
 #include "riscv_internal.h"
 #include "chip.h"
 
-#ifdef CONFIG_SMP
-
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-#if 0
-#  define DPRINTF(fmt, args...) _err(fmt, ##args)
-#else
-#  define DPRINTF(fmt, args...) do {} while (0)
-#endif
-
-#ifdef CONFIG_DEBUG_FEATURES
-#  define showprogress(c) riscv_lowputc(c)
-#else
-#  define showprogress(c)
-#endif
-
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
 extern volatile bool g_serial_ok;

Review comment:
       remove g_serial_ok too?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790241531



##########
File path: arch/risc-v/src/common/riscv_internal.h
##########
@@ -116,6 +116,10 @@ EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
 EXTERN uint32_t g_intstacktop;   /* Initial top of interrupt stack */
 #endif
 
+#ifdef CONFIG_SMP
+EXTERN volatile bool g_serial_ok;

Review comment:
       only k210 really use g_serial_ok, so it's better to move it to k210 specific header file instead.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on a change in pull request #5314: arch/risc-v: Move xxx_cpustart.c to common

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5314:
URL: https://github.com/apache/incubator-nuttx/pull/5314#discussion_r790241895



##########
File path: arch/risc-v/src/common/riscv_internal.h
##########
@@ -116,6 +116,10 @@ EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
 EXTERN uint32_t g_intstacktop;   /* Initial top of interrupt stack */
 #endif
 
+#ifdef CONFIG_SMP
+EXTERN volatile bool g_serial_ok;

Review comment:
       Yes, only k210 need it now, but other smp system also need it, qemu-rv smp support is ready to submit.
   Or `WFI` it's enough to synchorize the state of cpus in riscv_startcpu.c:85, then we can remove all `g_serial_ok` from every where?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org