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



##########
File path: arch/risc-v/src/mpfs/mpfs_opensbi.c
##########
@@ -22,25 +22,12 @@
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/config.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdint.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/riscv_io.h>

Review comment:
       Probably after this PR I will try to renew my changes with OpenSBI NuttX 
types header file.

##########
File path: arch/sparc/src/common/up_internal.h
##########
@@ -175,6 +182,12 @@ extern uint32_t _bmxdupba_address;   /* BMX register 
setting */
  * functions prototyped in include/nuttx/arch.h.
  */
 
+/* Atomic modification of registers */
+
+void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits);
+void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits);
+void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
+

Review comment:
       Can we move this block before `/* Common Functions 
*********************************************************/`, just for 
consistency with other similar changes?

##########
File path: arch/z80/src/common/z80_internal.h
##########
@@ -73,6 +73,21 @@
 #define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
 #define STACK_ALIGN_UP(a)   (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
 
+/* Register access macros ***************************************************
+ *
+ * The register access mechanism provided in ez8.h differs from the useful in
+ * other NuttX architectures. The following NuttX common macros will at least
+ * make the access compatible at the source level (however, strict type check
+ * is lost).
+ */
+
+#define getreg8(a)          (a)
+#define putreg8(v,a)        (a) = (v)
+#define getreg16(a)         (a)
+#define putreg16(v,a)       (a) = (v)

Review comment:
       ```suggestion
   #define putreg16(v,a)       ((a) = (v))
   ```

##########
File path: arch/risc-v/src/bl602/bl602_systemreset.c
##########
@@ -68,6 +67,7 @@ void up_systemreset(void)
   asm volatile("csrci mstatus, 8");
 
   bl602_romapi_reset_system();
+  for (; ; );

Review comment:
       ```suggestion
   
     /* Wait for the reset */
   
     for (; ; );
   ```

##########
File path: boards/arm/sama5/sama5d4-ek/src/sam_sdram.c
##########
@@ -274,7 +273,7 @@ static void sam_config_slaveddr(void)
  *   "Two DDR2/SDRAM (MT47H64M16HR) used as main system memory (256 MByte).
  *   The board includes 2 Gbits of on-board solderedDDR2 (double data rate)
  *   SDRAM. The footprints can also host two DDR2 (MT47H128M16RT) from
- *   Micron� for a total of 512 MBytes of DDR2 memory. The memory bus is 32
+ *   Micron� for a total of 512 MBytes of DDR2 memory. The memory bus is 32

Review comment:
       Please revert or replace with something meaningful 

##########
File path: arch/z80/src/common/z80_internal.h
##########
@@ -73,6 +73,21 @@
 #define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
 #define STACK_ALIGN_UP(a)   (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
 
+/* Register access macros ***************************************************
+ *
+ * The register access mechanism provided in ez8.h differs from the useful in
+ * other NuttX architectures. The following NuttX common macros will at least
+ * make the access compatible at the source level (however, strict type check
+ * is lost).
+ */
+
+#define getreg8(a)          (a)
+#define putreg8(v,a)        (a) = (v)

Review comment:
       ```suggestion
   #define putreg8(v,a)        ((a) = (v))
   ```

##########
File path: arch/z80/src/common/z80_internal.h
##########
@@ -73,6 +73,21 @@
 #define STACK_ALIGN_DOWN(a) ((a) & ~STACK_ALIGN_MASK)
 #define STACK_ALIGN_UP(a)   (((a) + STACK_ALIGN_MASK) & ~STACK_ALIGN_MASK)
 
+/* Register access macros ***************************************************
+ *
+ * The register access mechanism provided in ez8.h differs from the useful in
+ * other NuttX architectures. The following NuttX common macros will at least
+ * make the access compatible at the source level (however, strict type check
+ * is lost).
+ */
+
+#define getreg8(a)          (a)
+#define putreg8(v,a)        (a) = (v)
+#define getreg16(a)         (a)
+#define putreg16(v,a)       (a) = (v)
+#define getreg32(a)         (a)
+#define putreg32(v,a)       (a) = (v)

Review comment:
       ```suggestion
   #define putreg32(v,a)       ((a) = (v))
   ```




-- 
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-unsubscr...@nuttx.apache.org

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


Reply via email to