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/21 15:55:30 UTC

[GitHub] [incubator-nuttx] no1wudi commented on a change in pull request #5308: arch/risc-v: Merge mcause.h into irq.h

no1wudi commented on a change in pull request #5308:
URL: https://github.com/apache/incubator-nuttx/pull/5308#discussion_r789777546



##########
File path: arch/risc-v/src/common/riscv_exception.c
##########
@@ -74,10 +72,9 @@ static const char *g_reasons_str[MCAUSE_MAX_EXCEPTION + 1] =
 
 void riscv_exception(uintptr_t mcause, uintptr_t *regs)
 {
-  uintptr_t cause = mcause & MCAUSE_INTERRUPT_MASK;
+  uint32_t cause = (uint32_t)mcause & RISCV_IRQ_MASK;

Review comment:
       mcause is always 32 bit on rv32 and rv64, so it's safe to do this cast and the _aleart below use the PRIx32 to format is.




-- 
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