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:43:27 UTC

[GitHub] [incubator-nuttx] no1wudi opened a new pull request #5308: arch/risc-v: Merge mcause.h into irq.h

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


   ## Summary
   Some exception relative definitions is already in irq.h, let's delete the mcause.h and refine these references.
   ## Impact
   Rename only.
   ## Testing
   CI and qemu-rv.
   


-- 
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 pull request #5308: arch/risc-v: Merge mcause.h into irq.h

Posted by GitBox <gi...@apache.org>.
no1wudi commented on pull request #5308:
URL: https://github.com/apache/incubator-nuttx/pull/5308#issuecomment-1019058320


   > @no1wudi seems that some additional include changes are needed to replace deleted header file
   
   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] no1wudi commented on a change in pull request #5308: arch/risc-v: Merge mcause.h into irq.h

Posted by GitBox <gi...@apache.org>.
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



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

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



##########
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:
       Why this is changed?




-- 
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 #5308: arch/risc-v: Merge mcause.h into irq.h

Posted by GitBox <gi...@apache.org>.
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:
       Oh, I should correct the output format of _alert below, thanks.




-- 
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 #5308: arch/risc-v: Merge mcause.h into irq.h

Posted by GitBox <gi...@apache.org>.
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 it.




-- 
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 #5308: arch/risc-v: Merge mcause.h into irq.h

Posted by GitBox <gi...@apache.org>.
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:
       Oh, I should correct the outpt format of _alert below, thanks.




-- 
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] pkarashchenko commented on pull request #5308: arch/risc-v: Merge mcause.h into irq.h

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5308:
URL: https://github.com/apache/incubator-nuttx/pull/5308#issuecomment-1018713318


   @no1wudi seems that some additional include changes are needed to replace deleted header file


-- 
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 #5308: arch/risc-v: Merge mcause.h into irq.h

Posted by GitBox <gi...@apache.org>.
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:
       Oh, I should correct the outpt format of _alert below.




-- 
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 #5308: arch/risc-v: Merge mcause.h into irq.h

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


   


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