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



##########
File path: arch/arm/src/armv8-m/arm_securefault.c
##########
@@ -41,6 +41,38 @@
 
 #ifdef CONFIG_DEBUG_SECUREFAULT
 #  define sfalert(format, ...)  _alert(format, ##__VA_ARGS__)
+
+#define OFFSET_R0              (0 * 4) /* R0 */
+#define OFFSET_R1              (1 * 4) /* R1 */
+#define OFFSET_R2              (2 * 4) /* R2 */
+#define OFFSET_R3              (3 * 4) /* R3 */
+#define OFFSET_R12             (4 * 4) /* R12 */
+#define OFFSET_R14             (5 * 4) /* R14 = LR */
+#define OFFSET_R15             (6 * 4) /* R15 = PC */
+#define OFFSET_XPSR            (7 * 4) /* xPSR */

Review comment:
       ```suggestion
   #  define OFFSET_R0              (0 * 4) /* R0 */
   #  define OFFSET_R1              (1 * 4) /* R1 */
   #  define OFFSET_R2              (2 * 4) /* R2 */
   #  define OFFSET_R3              (3 * 4) /* R3 */
   #  define OFFSET_R12             (4 * 4) /* R12 */
   #  define OFFSET_R14             (5 * 4) /* R14 = LR */
   #  define OFFSET_R15             (6 * 4) /* R15 = PC */
   #  define OFFSET_XPSR            (7 * 4) /* xPSR */
   ```

##########
File path: arch/arm/src/armv8-m/arm_securefault.c
##########
@@ -41,6 +41,38 @@
 
 #ifdef CONFIG_DEBUG_SECUREFAULT
 #  define sfalert(format, ...)  _alert(format, ##__VA_ARGS__)
+
+#define OFFSET_R0              (0 * 4) /* R0 */
+#define OFFSET_R1              (1 * 4) /* R1 */
+#define OFFSET_R2              (2 * 4) /* R2 */
+#define OFFSET_R3              (3 * 4) /* R3 */
+#define OFFSET_R12             (4 * 4) /* R12 */
+#define OFFSET_R14             (5 * 4) /* R14 = LR */
+#define OFFSET_R15             (6 * 4) /* R15 = PC */
+#define OFFSET_XPSR            (7 * 4) /* xPSR */
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static void generate_nonsecure_busfault(void)
+{
+  uint32_t nsp;
+
+  /* Get non-secure SP */
+
+  __asm__ __volatile__ ("mrs %0, msp_ns" : "=r" (nsp));
+
+  sfalert("Non-sec sp %08x\n", nsp);

Review comment:
       ```suggestion
     sfalert("Non-sec sp %08" PRIx32 "\n", nsp);
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to