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/24 11:14:34 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5323: Fix opensbi build

pkarashchenko commented on a change in pull request #5323:
URL: https://github.com/apache/incubator-nuttx/pull/5323#discussion_r790640923



##########
File path: arch/risc-v/src/Makefile
##########
@@ -38,10 +38,9 @@ INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip}
 INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)common}
 INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)$(ARCH_SUBDIR)}
 INCLUDES += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)sched}
-ifeq ($(CONFIG_OPENSBI),y)
-INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)opensbi)
+#ifeq ($(CONFIG_OPENSBI),y)
 INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)opensbi$(DELIM)opensbi-3rdparty$(DELIM)include)
-endif
+#endif

Review comment:
       ```suggestion
   endif
   ```

##########
File path: arch/risc-v/src/Makefile
##########
@@ -38,10 +38,9 @@ INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip}
 INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)common}
 INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)$(ARCH_SUBDIR)}
 INCLUDES += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)sched}
-ifeq ($(CONFIG_OPENSBI),y)
-INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)opensbi)
+#ifeq ($(CONFIG_OPENSBI),y)

Review comment:
       ```suggestion
   ifeq ($(CONFIG_OPENSBI),y)
   ```

##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -23,27 +23,36 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-
 #include <assert.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include "riscv_internal.h"
-#include "riscv_arch.h"
+#include <riscv_arch.h>
 
 #include <hardware/mpfs_plic.h>
 #include <hardware/mpfs_memorymap.h>
 #include <hardware/mpfs_clint.h>
 #include <hardware/mpfs_sysreg.h>
 
+/* OpenSBI will also define NULL. Undefine NULL in order to avoid warning:
+ * 'warning: "NULL" redefined'
+ */
+
+#ifdef NULL
+  #undef NULL
+#endif
+
 #include <sbi/sbi_types.h>
 #include <sbi/riscv_atomic.h>
+#include <sbi/riscv_asm.h>

Review comment:
       please check, but I think it is not needed here

##########
File path: arch/risc-v/src/opensbi/Kconfig
##########
@@ -9,4 +9,4 @@ config OPENSBI
 	default n
 	---help---
 		Enable or disable Open Source Supervisor Binary Interface (OpenSBI) features
-		for RISC-V.
+                for RISC-V.

Review comment:
       Lets keep this change

##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -23,27 +23,36 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-
 #include <assert.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include "riscv_internal.h"
-#include "riscv_arch.h"
+#include <riscv_arch.h>
 
 #include <hardware/mpfs_plic.h>
 #include <hardware/mpfs_memorymap.h>
 #include <hardware/mpfs_clint.h>
 #include <hardware/mpfs_sysreg.h>
 
+/* OpenSBI will also define NULL. Undefine NULL in order to avoid warning:
+ * 'warning: "NULL" redefined'
+ */
+
+#ifdef NULL
+  #undef NULL
+#endif
+
 #include <sbi/sbi_types.h>
 #include <sbi/riscv_atomic.h>
+#include <sbi/riscv_asm.h>
 #include <sbi/riscv_io.h>
+#include <sbi/riscv_encoding.h>
 #include <sbi/sbi_hart.h>
 #include <sbi/sbi_console.h>
 #include <sbi/sbi_platform.h>
+#include <sbi/sbi_domain.h>

Review comment:
       please check, but I think it is not needed here

##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -23,27 +23,36 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-
 #include <assert.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include "riscv_internal.h"
-#include "riscv_arch.h"
+#include <riscv_arch.h>
 
 #include <hardware/mpfs_plic.h>
 #include <hardware/mpfs_memorymap.h>
 #include <hardware/mpfs_clint.h>
 #include <hardware/mpfs_sysreg.h>
 
+/* OpenSBI will also define NULL. Undefine NULL in order to avoid warning:
+ * 'warning: "NULL" redefined'
+ */
+
+#ifdef NULL
+  #undef NULL
+#endif
+
 #include <sbi/sbi_types.h>
 #include <sbi/riscv_atomic.h>
+#include <sbi/riscv_asm.h>
 #include <sbi/riscv_io.h>
+#include <sbi/riscv_encoding.h>
 #include <sbi/sbi_hart.h>
 #include <sbi/sbi_console.h>
 #include <sbi/sbi_platform.h>
+#include <sbi/sbi_domain.h>
 #include <sbi/sbi_timer.h>
 #include <sbi/sbi_init.h>
+#include <sbi/sbi_scratch.h>

Review comment:
       please check, but I think it is not needed here

##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -23,27 +23,36 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-
 #include <assert.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include "riscv_internal.h"
-#include "riscv_arch.h"
+#include <riscv_arch.h>
 
 #include <hardware/mpfs_plic.h>
 #include <hardware/mpfs_memorymap.h>
 #include <hardware/mpfs_clint.h>
 #include <hardware/mpfs_sysreg.h>
 
+/* OpenSBI will also define NULL. Undefine NULL in order to avoid warning:
+ * 'warning: "NULL" redefined'
+ */
+
+#ifdef NULL
+  #undef NULL
+#endif
+
 #include <sbi/sbi_types.h>
 #include <sbi/riscv_atomic.h>
+#include <sbi/riscv_asm.h>
 #include <sbi/riscv_io.h>
+#include <sbi/riscv_encoding.h>

Review comment:
       please check, but I think it is not needed here

##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -23,27 +23,36 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-
 #include <assert.h>
 #include <errno.h>
 #include <stdint.h>
-
-#include "riscv_internal.h"
-#include "riscv_arch.h"
+#include <riscv_arch.h>

Review comment:
       ```suggestion
   
   #include "riscv_arch.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